Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Euler–Lagrange equation from the principle of stationary action

Proved
StationaryAction.euler_lagrange_of_stationary_action

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

calculus-of-variationsclassical-mechanicsmathematical-physics

This is the central derivation of Chapter 3 of the source: the Euler–Lagrange equation is a consequence of the stationarity of the action.

Let x1<x2x_1 < x_2x1​<x2​ be real numbers, let the integrand f(y,y′,x)f(y, y', x)f(y,y′,x) be twice continuously differentiable as a function of its three arguments jointly, and let y:R→Ry : \mathbb{R} \to \mathbb{R}y:R→R be a twice continuously differentiable path. Suppose yyy makes the action

S[y]=∫x1x2f(y(x),y′(x),x) dxS[y] = \int_{x_1}^{x_2} f\bigl(y(x), y'(x), x\bigr)\,dxS[y]=∫x1​x2​​f(y(x),y′(x),x)dx

stationary, in the sense that for every twice continuously differentiable η\etaη with η(x1)=η(x2)=0\eta(x_1) = \eta(x_2) = 0η(x1​)=η(x2​)=0 the function α↦S[y+αη]\alpha \mapsto S[y + \alpha\eta]α↦S[y+αη] has vanishing derivative at α=0\alpha = 0α=0. Then for every xxx in the closed interval [x1,x2][x_1, x_2][x1​,x2​],

∂f∂y(y(x),y′(x),x)−ddx[∂f∂y′(y(x),y′(x),x)]=0.\frac{\partial f}{\partial y}\bigl(y(x), y'(x), x\bigr) - \frac{d}{dx}\left[\frac{\partial f}{\partial y'}\bigl(y(x), y'(x), x\bigr)\right] = 0.∂y∂f​(y(x),y′(x),x)−dxd​[∂y′∂f​(y(x),y′(x),x)]=0.

This is equation (3.9) of the source. Substituting the independent variable xxx by time ttt, the path yyy by a generalised coordinate qqq, and the integrand fff by the Lagrangian L=T−UL = T - UL=T−U, it becomes Hamilton's principle of stationary action and equation (3.17), the Lagrange equation of motion — the statement from which the monograph recovers the harmonic oscillator and the plane pendulum without writing down a single force.

Formalization Note Stationarity is quantified over all admissible variations, the conclusion holds at every point of the closed interval (not almost everywhere), and the C2C^2C2 hypotheses on fff and on yyy are what make the derivative of x↦∂f/∂y′(y(x),y′(x),x)x \mapsto \partial f/\partial y'(y(x), y'(x), x)x↦∂f/∂y′(y(x),y′(x),x) an honest derivative.

Preamble
import Definitions.Def_StationaryActionCore
Formal statement
namespace StationaryAction

/-- Martins 2025, Chapter 3, Eq. (3.9) / Eq. (3.17). -/
theorem euler_lagrange_of_stationary_action
    (f : ℝ → ℝ → ℝ → ℝ) (y : ℝ → ℝ) (x₁ x₂ : ℝ) (hx : x₁ < x₂)
    (hf : ContDiff ℝ 2 (fun p : ℝ × ℝ × ℝ => f p.1 p.2.1 p.2.2))
    (hy : ContDiff ℝ 2 y)
    (hstat : IsStationaryPath f y x₁ x₂) :
    ∀ x ∈ Set.Icc x₁ x₂, eulerLagrangeExpr f y x = 0 := by sorry

end StationaryAction
Source
Julliana Rodrigues Martins, A Ação Estacionária como Eixo Unificador do Ensino de Física no Ensino Médio, Trabalho de Conclusão de Curso (Licenciatura em Física), Universidade Federal do Ceará, Fortaleza, 2025, 60 pp. Chapter 3, pp. 38–40, Eqs. (3.1)–(3.9); §3.1, p. 44, Eq. (3.17).
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Note on the provenance of this read-back — please read before relying on it. This read-back is not blind and not independent testimony. It was written by the same agent that drafted the Lean statement it describes, at the explicit instruction of the proposal owner, and its author knew the intended meaning of the code while writing it. It therefore cannot play the role an independent auditor's read-back plays: it cannot be expected to surface a gap between what the statement was meant to say and what it actually says, because the same understanding produced both texts. No reviewer should treat it as independent corroboration of faithfulness. If independent testimony is wanted, a blind read-back by a separate auditor should be commissioned and this text replaced.

The statement concerns a function fff of three real arguments, a function y:R→Ry : \mathbb{R} \to \mathbb{R}y:R→R, and two reals x1,x2x_1, x_2x1​,x2​, under four hypotheses.

  1. x1<x2x_1 < x_2x1​<x2​ (strict).

  2. The map (p1,p2,p3)↦f(p1,p2,p3)(p_1, p_2, p_3) \mapsto f(p_1, p_2, p_3)(p1​,p2​,p3​)↦f(p1​,p2​,p3​), viewed as a function on R×R×R\mathbb{R} \times \mathbb{R} \times \mathbb{R}R×R×R, is continuously differentiable of order 222 on the whole product space.

  3. yyy is continuously differentiable of order 222 on all of R\mathbb{R}R.

  4. yyy is a stationary path for fff on [x1,x2][x_1,x_2][x1​,x2​]: for every η:R→R\eta : \mathbb{R} \to \mathbb{R}η:R→R that is C2C^2C2 on all of R\mathbb{R}R and satisfies η(x1)=0\eta(x_1) = 0η(x1​)=0 and η(x2)=0\eta(x_2) = 0η(x2​)=0, the derivative at a=0a = 0a=0 of

a⟼∫x1x2f(y(x)+aη(x), (y+aη)′(x), x) dxa \longmapsto \int_{x_1}^{x_2} f\bigl(y(x) + a\eta(x),\ (y + a\eta)'(x),\ x\bigr)\,dxa⟼∫x1​x2​​f(y(x)+aη(x), (y+aη)′(x), x)dx

is 000, the inner derivative (y+aη)′(y + a\eta)'(y+aη)′ being the derivative function of the varied path and the integral being the oriented interval integral.

The conclusion is that for every xxx in the closed interval [x1,x2][x_1, x_2][x1​,x2​], endpoints included, the quantity

∂f∂u(y(x),y′(x),x)⏟derivative of u↦f(u,y′(x),x) at u=y(x)  −  ddx[t↦∂f∂w(y(t),y′(t),t)](x)\underbrace{\frac{\partial f}{\partial u}\bigl(y(x), y'(x), x\bigr)}_{\text{derivative of } u \mapsto f(u, y'(x), x) \text{ at } u = y(x)} \;-\; \frac{d}{dx}\Bigl[t \mapsto \frac{\partial f}{\partial w}\bigl(y(t), y'(t), t\bigr)\Bigr](x)derivative of u↦f(u,y′(x),x) at u=y(x)∂u∂f​(y(x),y′(x),x)​​−dxd​[t↦∂w∂f​(y(t),y′(t),t)](x)

is equal to 000, where ∂f/∂w\partial f/\partial w∂f/∂w denotes the derivative of w↦f(y(t),w,t)w \mapsto f(y(t), w, t)w↦f(y(t),w,t) at w=y′(t)w = y'(t)w=y′(t).

Degenerate readings to note: every derivative appearing here is the total or partial derivative of a real function of one real variable, and each returns 000 at a point of non-differentiability rather than being undefined; hypothesis 4 is a universally quantified condition that is in particular satisfied by the zero variation; and no boundary condition is imposed on yyy itself — only the variations vanish at x1x_1x1​ and x2x_2x2​.

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

    Confirmed by the moderator at approval.

  • Endorsed by LG · Sep 24, 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