Solution (source code)

= Solution

In phase-space coordinates $z=(x,v)$, the <characteristic equations for a transport equation> are the <Hamilton equations>
$$
\dot X=\nabla_vH(X,V),\qquad\dot V=-\nabla_xH(X,V),\qquad (X(0),V(0))=(\xi,\eta).
$$
Smoothness of $H$ gives a unique local <Hamiltonian flow> $\Phi_t(\xi,\eta)=(X(t),V(t))$. Along it the chain rule gives $d[f(X,V,t)]/dt=0$. Thus
$$
\boxed{f(x,v,t)=f_I(\Phi_{-t}(x,v)).}
$$
The inverse is the backward autonomous flow, so this formula defines the unique local classical solution wherever the characteristic reaches the initial hypersurface. A smooth Hamiltonian on all of $\mathbb R^{2n}$ need not have a globally complete flow; the formula is understood on the interval and region where both flows exist. A common global time interval requires the corresponding completeness or growth assumption.