[proofplan]
The proof is local on $T^*X \setminus 0$, so we compute in canonical cotangent coordinates $(x,\xi)$. In those coordinates the Hamilton vector field differentiates a function by pairing the $\xi$-derivatives of $p$ with the $x$-derivatives of that function and subtracting the opposite pairing. Applying this formula to the function $p$ itself gives two identical scalar sums with opposite signs, hence $H_p p=0$. Along an integral curve $\gamma$ of $H_p$, the derivative of $p \circ \gamma$ is exactly $(H_p p)\circ \gamma$, so $p$ is constant and the zero level set is invariant.
[/proofplan]
[step:Compute the Hamilton vector field applied to its own Hamiltonian in canonical coordinates]
Let $\rho \in T^*X \setminus 0$ be arbitrary. Choose a coordinate chart $(U,\varphi)$ on $X$ with $\pi(\rho) \in U$, where $\pi: T^*X \to X$ is the cotangent projection. The induced canonical coordinates on $T^*U$ are denoted by $(x,\xi) = (x_1,\dots,x_n,\xi_1,\dots,\xi_n)$, where $x_i$ are base coordinates and $\xi_i$ are the corresponding fiber coordinates.
In these coordinates, the Hamilton vector field of $p$ is the smooth vector field
\begin{align*}
H_p = \sum_{j=1}^n \frac{\partial p}{\partial \xi_j}\frac{\partial}{\partial x_j} - \frac{\partial p}{\partial x_j}\frac{\partial}{\partial \xi_j}.
\end{align*}
Applying this first-order differential operator to the function $p: T^*X \setminus 0 \to \mathbb{R}$ gives, at every point of $T^*U \cap (T^*X \setminus 0)$,
\begin{align*}
(H_p p)(x,\xi)=\sum_{j=1}^n \left(\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)-\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi)\right).
\end{align*}
For each index $j \in \{1,\dots,n\}$, the two factors are [real numbers](/page/Real%20Numbers) and commute under multiplication, so
\begin{align*}
\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)-\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi)=0.
\end{align*}
Therefore $(H_p p)(x,\xi)=0$ in this coordinate neighbourhood. Since $\rho$ was arbitrary, $H_p p=0$ on all of $T^*X \setminus 0$.
[guided]
We prove the identity pointwise, because both $H_p p$ and the zero function are smooth real-valued functions on $T^*X \setminus 0$. Fix a point $\rho \in T^*X \setminus 0$. Choose a coordinate chart $(U,\varphi)$ on $X$ containing the base point $\pi(\rho)$, where $\pi: T^*X \to X$ is the cotangent projection. This chart induces canonical coordinates $(x,\xi) = (x_1,\dots,x_n,\xi_1,\dots,\xi_n)$ on $T^*U$: the $x_i$ record the base point and the $\xi_i$ record the covector components in the dual coordinate basis.
In these canonical coordinates, the Hamilton vector field associated to the smooth real-valued function $p: T^*X \setminus 0 \to \mathbb{R}$ is
\begin{align*}
H_p = \sum_{j=1}^n \frac{\partial p}{\partial \xi_j}\frac{\partial}{\partial x_j} - \frac{\partial p}{\partial x_j}\frac{\partial}{\partial \xi_j}.
\end{align*}
This formula says that $H_p$ is a first-order differential operator acting on smooth functions. We now apply it to the same function $p$. At a point $(x,\xi) \in T^*U \cap (T^*X \setminus 0)$, this gives
\begin{align*}
(H_p p)(x,\xi)=\sum_{j=1}^n \left(\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)-\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi)\right).
\end{align*}
The reason this expression vanishes is not an estimate or a limiting argument; it is exact cancellation. For each fixed $j$, the two quantities $\frac{\partial p}{\partial \xi_j}(x,\xi)$ and $\frac{\partial p}{\partial x_j}(x,\xi)$ are real numbers. Real multiplication is commutative, hence
\begin{align*}
\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)=\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi).
\end{align*}
Subtracting equal quantities gives
\begin{align*}
\frac{\partial p}{\partial \xi_j}(x,\xi)\frac{\partial p}{\partial x_j}(x,\xi)-\frac{\partial p}{\partial x_j}(x,\xi)\frac{\partial p}{\partial \xi_j}(x,\xi)=0.
\end{align*}
Every summand is zero, so the whole finite sum is zero:
\begin{align*}
(H_p p)(x,\xi)=0.
\end{align*}
Because the original point $\rho$ was arbitrary and the computation is valid in a canonical coordinate neighbourhood of any point of $T^*X \setminus 0$, the identity holds globally:
\begin{align*}
H_p p=0.
\end{align*}
[/guided]
[/step]
[step:Differentiate the Hamiltonian along an integral curve]
Let $I \subset \mathbb{R}$ be an interval, and let $\gamma: I \to T^*X \setminus 0$ be an integral curve of $H_p$. By definition of integral curve, for every $s \in I$,
\begin{align*}
\gamma'(s)=H_p(\gamma(s)).
\end{align*}
The composition $p \circ \gamma: I \to \mathbb{R}$ is smooth. Differentiating this composition along the curve gives
\begin{align*}
\frac{d}{ds}p(\gamma(s))=(H_p p)(\gamma(s)).
\end{align*}
By the identity already proved, $(H_p p)(\gamma(s))=0$ for every $s \in I$. Therefore
\begin{align*}
\frac{d}{ds}p(\gamma(s))=0
\end{align*}
for every $s \in I$. Hence $p \circ \gamma$ is constant on $I$.
[/step]
[step:Conclude that the characteristic set is invariant]
Let $s_0 \in I$ and suppose $\gamma(s_0) \in \{p=0\}$. Since $p \circ \gamma$ is constant on $I$, for every $s \in I$ we have
\begin{align*}
p(\gamma(s))=p(\gamma(s_0))=0.
\end{align*}
Thus $\gamma(s) \in \{p=0\}$ for every $s \in I$. This proves that every integral curve of $H_p$ beginning in the characteristic set remains in the characteristic set for as long as it is defined.
[/step]