Let $(M,g)$ be a riemannian manifold and $G$ a Lie group acting on $M$ by isometries. Taking a $G$-invariant function $f\colon M \to \mathbb{R}$, we have the riemannian gradient $\operatorname{grad} f$ defined by $$d_xf(Y) = g_x(\operatorname{grad} f (x), Y)$$ Next, we take the flow $\phi_t$ induced by $\operatorname{grad} f$. Using the canonical lift, we get a flow $T^*\phi_t \colon T^*M \to T^*M$ on the cotangent bundle with the corresponding vector field $Z \in \mathfrak{X}(T^*M)$. $T^*M$ is a symplectic manifold with the canonical symplectic 2-form $\omega_0$. Now it is possible to show, that $$d(i_Z\omega_0) = L_Z\omega_0 =0.$$

Fixing $v \in T^*M$ and using the Poincaré lemma, we have a neighborhood $U$ of $v$, and a function $H \colon T^*M \to \mathbb{R}$ with $i_Z\omega_0|_U = dH|_U$.

After all this constructions, is the function $H$ locally invariant under the lifted action of $G$?