Solution (source code)

= Solution

A function $F$ is an <integral of motion> of $H$ when it is constant along every trajectory of the <Hamiltonian flow>. Infinitesimally,
$$
\boxed{X_HF=\{F,H\}=0.}
$$
The <antisymmetry of a Lie bracket> of the <Poisson bracket> gives $X_FH=\{H,F\}=0$. Hence \b[$H$ is also an <integral of motion> of $F$].

For the commuting assertion, $\mathcal L_{X_F}\omega=d(\iota_{X_F}\omega)=d^2F=0$, because $\omega$ is closed. The contraction identity for a <Lie bracket of vector fields> then gives
$$
\iota_{[X_F,X_H]}\omega
=\mathcal L_{X_F}(\iota_{X_H}\omega)-\iota_{X_H}(\mathcal L_{X_F}\omega)
=\mathcal L_{X_F}(dH)=d(X_FH)=d\{H,F\}=0.
$$
Since the <symplectic form> is a <nondegenerate bilinear form> at every point, \b[the <Hamiltonian vector fields> commute]:
$$
\boxed{[X_F,X_H]=0.}
$$
With the chosen convention the general identity is $[X_F,X_H]=X_{\{H,F\}}$. Equivalently, it follows by applying the <Jacobi identity for the Poisson bracket> to an arbitrary test function. Local flows commute whenever both compositions are defined; no global completeness assumption is needed.