Analytical mechanics · PhysLib theorem
Hamilton's Equations from a Variational Gradient
For smooth phase-space paths, PhysLib identifies the variational gradient of the phase-space action integrand with the Hamilton-equation residual.
What it says
What the theorem says
For smooth data on a complete real inner-product space, PhysLib computes the variational gradient of its phase-space action integrand. The result is an identity for the gradient; it is not on its own an existence theorem or a proof that a path is stationary.
Context
Why it matters
This theorem exposes the mechanism behind Hamilton's equations: the phase-space action gradient is exactly the pair of equation residuals, rather than merely quoting the final dynamics.
Inside the proof
Proof architecture
The proof defines the Hamilton residual, relates its vanishing to the two familiar first-order equations, and computes the gradient of the phase-space action term by term.
Step 1
Package the two residuals
The Hamilton operator stores the velocity-minus-momentum-gradient and negative momentum-rate-minus-position-gradient components.
(q̇ − ∇ₚH, −ṗ − ∇qH)
Show the Lean ingredients
def hamiltonEqOphamiltonEqOp_eq_zero_iff_hamiltons_equationsStep 2
Differentiate the symplectic term
The gradient of the momentum–velocity pairing contributes the time-derivative pieces, including the integration-by-parts sign.
δ⟨p,q̇⟩
Show the Lean ingredients
HasVarAdjDerivAt.fderiv'adjFDeriv_innerStep 3
Subtract the Hamiltonian gradient
Combining the position and momentum gradients of H with the symplectic contribution gives the Hamilton residual exactly.
∇S = Hamilton residual
Show the Lean ingredients
hamiltons_equations_varGradientgradient_eq_adjFDerivAuthoritative formal type
Exact PhysLib statement
ClassicalMechanics.hamiltons_equations_varGradient (H : Time → X → X → ℝ) (pq : Time → X × X) (hpq : ContDiff ℝ ∞ pq) (hH : ContDiff ℝ ∞ ↿H) : varGradient (fun pq' t => ⟪(pq' t).1, Time.deriv (Prod.snd ∘ pq') t⟫_ℝ - H t (pq' t).1 (pq' t).2) pq = fun t => hamiltonEqOp H (fun t => (pq t).1) (fun t => (pq t).2) tThis is the theorem's exact Lean type. The diagrams and commentary are explanatory; the pinned statement and source are authoritative.
Provenance and verification
Sources and technical checks
Show declaration provenance and Lean checks
ClassicalMechanics.hamiltons_equations_varGradientPhyslib.ClassicalMechanics.HamiltonsEquations6bd0b4b99d3dsorryAx reportedThe declaration footprint describes source layout, not proof difficulty or the size of its dependencies. The pinned checks verify the cited Lean theorem; semantic review remains a separate PhysAtlas judgment.



