Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

LLL and L+df/dtL + df/dtL+df/dt have the same equations of motion

Proved
ClassicalDynamics.motion_invariant_under_total_time_derivative

by LG · Sep 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

classical-mechanicsmathematical-physics

Tong, eq. (2.45). The Lagrangian of a system is not unique: adding to it the total time derivative of any function f(t,q)f(t, q)f(t,q) of time and position leaves the equations of motion unchanged.

Precisely, let LLL be a smooth Lagrangian on Rn\mathbb{R}^nRn, let f(t,q)f(t, q)f(t,q) be smooth, and set

L′(t,q,v)=L(t,q,v)+dfdt,dfdt=∂f∂t+∑ivi∂f∂qi,L'(t, q, v) = L(t, q, v) + \frac{df}{dt}, \qquad \frac{df}{dt} = \frac{\partial f}{\partial t} + \sum_{i} v_i \frac{\partial f}{\partial q_i},L′(t,q,v)=L(t,q,v)+dtdf​,dtdf​=∂t∂f​+i∑​vi​∂qi​∂f​,

the chain-rule expression for the total time derivative of fff along a path with velocity vvv. Then a smooth path satisfies Lagrange's equations for LLL if and only if it satisfies them for L′L'L′.

Preamble
import Definitions.Def_ClassicalDynamics_core
Formal statement
namespace ClassicalDynamics

/-- Tong, eq. (2.45): adding a total time derivative `df/dt` to a Lagrangian
leaves the equations of motion unchanged. -/
theorem motion_invariant_under_total_time_derivative {n : ℕ} (L : Lagrangian n)
    (hL : IsSmoothLagrangian L) (f : ℝ → (Fin n → ℝ) → ℝ)
    (hf : ContDiff ℝ (⊤ : ℕ∞) (fun p : ℝ × (Fin n → ℝ) => f p.1 p.2))
    (q : ℝ → Fin n → ℝ) (hq : ContDiff ℝ (⊤ : ℕ∞) q) :
    IsMotion L q ↔
      IsMotion (fun t x v =>
        L t x v + (deriv (fun s : ℝ => f s x) t + ∑ i : Fin n, v i * dfdq f i t x)) q := by sorry
end ClassicalDynamics
Source
D. Tong, Classical Dynamics, University of Cambridge Part II Mathematical Tripos, Michaelmas 2004/2005, https://www.damtp.cam.ac.uk/user/tong/dynamics.html, Section 2 (pp. 10-25), p. 22, eq. (2.45)
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) — the drafting agent itself; see the notice above

Non-blind read-back — not independent testimony. This read-back was written by the same agent that drafted the Lean statements in this proposal, not by an independent blind auditor. Its author knew what the code was intended to say, so it cannot serve the usual purpose of catching a mismatch between intent and code. Treat it as an aid to reading the Lean, and obtain an independent blind read-back before relying on it during the audit.

Fix a natural number nnn. The data are: a Lagrangian L(t,q,v)L(t, q, v)L(t,q,v) on nnn-tuples of reals, a function f(t,q)f(t, q)f(t,q) of a real time and an nnn-tuple, and a path q:R→Rnq : \mathbb{R} \to \mathbb{R}^nq:R→Rn. The hypotheses are that LLL is C∞C^\inftyC∞ jointly in (t,q,v)(t, q, v)(t,q,v), that (t,q)↦f(t,q)(t, q) \mapsto f(t, q)(t,q)↦f(t,q) is C∞C^\inftyC∞ jointly, and that the path qqq is C∞C^\inftyC∞.

Define a second Lagrangian by

L′(t,x,v)  =  L(t,x,v)  +  ([ddsf(s,x)]s=t  +  ∑ivi ∂f∂qi(t,x)),L'(t, x, v) \;=\; L(t, x, v) \;+\; \left(\left[\frac{d}{ds} f(s, x)\right]_{s=t} \;+\; \sum_{i} v_i \,\frac{\partial f}{\partial q_i}(t, x)\right),L′(t,x,v)=L(t,x,v)+([dsd​f(s,x)]s=t​+i∑​vi​∂qi​∂f​(t,x)),

where the first bracket is the derivative of fff in its time argument with the position argument frozen at xxx, and ∂f/∂qi\partial f/\partial q_i∂f/∂qi​ is the one-variable derivative of fff in the iii-th position slot, evaluated at the iii-th entry of xxx, the other entries frozen. Both derivative operators are total, returning 000 where the derivative does not exist. The sum runs over all nnn indices and is empty when n=0n = 0n=0.

The assertion is the equivalence of the two statements:

  • for every index iii and every real ttt, the function s↦∂L∂q˙i(s,q(s),q˙(s))s \mapsto \frac{\partial L}{\partial \dot q_i}(s, q(s), \dot q(s))s↦∂q˙​i​∂L​(s,q(s),q˙​(s)) is differentiable at ttt with derivative ∂L∂qi(t,q(t),q˙(t))\frac{\partial L}{\partial q_i}(t, q(t), \dot q(t))∂qi​∂L​(t,q(t),q˙​(t));
  • the same statement with LLL replaced throughout by L′L'L′, i.e. for every iii and every ttt, s↦∂L′∂q˙i(s,q(s),q˙(s))s \mapsto \frac{\partial L'}{\partial \dot q_i}(s, q(s), \dot q(s))s↦∂q˙​i​∂L′​(s,q(s),q˙​(s)) is differentiable at ttt with derivative ∂L′∂qi(t,q(t),q˙(t))\frac{\partial L'}{\partial q_i}(t, q(t), \dot q(t))∂qi​∂L′​(t,q(t),q˙​(t)).

Here q˙\dot qq˙​ is the coordinatewise time derivative of the path, and each partial derivative is a one-variable derivative in a single coordinate slot. Both directions of the equivalence are claimed, for all times on the whole real line. Note that fff is not assumed to depend on the velocity, and that no smoothness is assumed of L′L'L′ beyond what follows from the hypotheses on LLL and fff. For n=0n = 0n=0 both sides hold vacuously, there being no indices.

Human review
  • Endorsed by Shuze Chen · Sep 23, 2026

  • Endorsed by LG · Sep 23, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me