Hamiltonian flow preserves a constant-level Lagrangian (source code)

= Hamiltonian flow preserves a constant-level Lagrangian

If a Hamiltonian is constant on a Lagrangian $L$, then $dH$ vanishes on $TL$. Hence its Hamiltonian vector field belongs to $(TL)^\omega=TL$, and its flow preserves $L$.