Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Euler–Lagrange equation from a computed first variation

Proved
VectorSpaceOpt.euler_lagrange_equation

by wenxinzhang · Aug 25, 2026 · Mathlib c5ea003 (Lean v4.30.0)

calculus-of-variationseuler-lagrangeinterval-integraloptimization

Let a<ba<ba<b, let L(y,v,t)L(y,v,t)L(y,v,t) be a real Lagrangian, and let (x,x˙)(x,\dot x)(x,x˙) be a C1C^1C1 path. Let Lx(t)L_x(t)Lx​(t) and Lv(t)L_v(t)Lv​(t) be continuous along the path and equal the indicated partial derivatives of LLL. Assume the already computed first variation vanishes for every fixed-endpoint C1C^1C1 variation:

∫ab(Lx(t)h(t)+Lv(t)h˙(t)) dt=0.\int_a^b\bigl(L_x(t)h(t)+L_v(t)\dot h(t)\bigr)\,dt=0.∫ab​(Lx​(t)h(t)+Lv​(t)h˙(t))dt=0.

Then, for every interior time,

ddtLv(t)=Lx(t).\frac{d}{dt}L_v(t)=L_x(t).dtd​Lv​(t)=Lx​(t).

The Lean conclusion uses HasDerivAt, so it establishes differentiability as well as equality. This is the mission capstone and deliberately starts at the first-variation identity displayed by Luenberger. It is ready for concrete Lagrangians without changing the shared variation infrastructure.

Preamble
import Definitions.Def_VectorSpaceOpt_isC1OnSegment

open Set intervalIntegral
Formal statement
namespace VectorSpaceOpt

/-- Luenberger, Chapter 7, §7.5, equation (2) and its conclusion. -/
theorem euler_lagrange_equation
    (a b : ℝ) (hab : a < b)
    (L : ℝ → ℝ → ℝ → ℝ) (x dx Lx Lv : ℝ → ℝ)
    (hx : IsC1OnSegment a b x dx)
    (hLx_cont : ContinuousOn Lx (Icc a b))
    (hLv_cont : ContinuousOn Lv (Icc a b))
    (hLx : ∀ t ∈ Icc a b,
      HasDerivAt (fun y : ℝ ↦ L y (dx t) t) (Lx t) (x t))
    (hLv : ∀ t ∈ Icc a b,
      HasDerivAt (fun v : ℝ ↦ L (x t) v t) (Lv t) (dx t))
    (hstationary : ∀ (h dh : ℝ → ℝ),
      IsC1OnSegment a b h dh → h a = 0 → h b = 0 →
      (∫ t in a..b, (Lx t * h t + Lv t * dh t)) = 0) :
    ∀ t ∈ Ioo a b, HasDerivAt Lv (Lx t) t := by sorry

end VectorSpaceOpt
Source
David G. Luenberger, Optimization by Vector Space Methods, Wiley, 1969, public scan https://sites.science.oregonstate.edu/~show/old/142_Luenberger.pdf, Chapter 7, §7.5, first-variation equation (1), printed p. 179, and Euler–Lagrange equation (2) with conclusion, printed pp. 180–181; physical PDF pp. 199–201.
Read-back

What the Lean code literally says, in plain math · gpt-5

Let a<ba<ba<b be real, let L:R×R×R→RL : ℝ×ℝ×ℝ → ℝL:R×R×R→R be an arbitrary three-argument function, and let x,dx,Lx,Lv:R→Rx,dx,L_x,L_v : ℝ → ℝx,dx,Lx​,Lv​:R→R. Assume xxx and dxdxdx are continuous on [a,b][a,b][a,b] and xxx has derivative dx(t)dx(t)dx(t) at every t∈(a,b)t∈(a,b)t∈(a,b); assume LxL_xLx​ and LvL_vLv​ are continuous on [a,b][a,b][a,b]; assume that for every t∈[a,b]t∈[a,b]t∈[a,b], the one-variable map y↦L(y,dx(t),t)y↦L(y,dx(t),t)y↦L(y,dx(t),t) has derivative Lx(t)L_x(t)Lx​(t) at y=x(t)y=x(t)y=x(t) and the one-variable map v↦L(x(t),v,t)v↦L(x(t),v,t)v↦L(x(t),v,t) has derivative Lv(t)L_v(t)Lv​(t) at v=dx(t)v=dx(t)v=dx(t). Finally, assume that for every h,dh:R→Rh,dh : ℝ → ℝh,dh:R→R such that h,dhh,dhh,dh are continuous on [a,b][a,b][a,b], hhh has derivative dh(t)dh(t)dh(t) throughout (a,b)(a,b)(a,b), and h(a)=h(b)=0h(a)=h(b)=0h(a)=h(b)=0, the oriented interval integral from aaa to bbb of Lx(t)h(t)+Lv(t)dh(t)L_x(t)h(t)+L_v(t)dh(t)Lx​(t)h(t)+Lv​(t)dh(t) is zero. Then LvL_vLv​ has derivative Lx(t)L_x(t)Lx​(t) at every t∈(a,b)t∈(a,b)t∈(a,b). No derivative of xxx at the endpoints, no derivative of LvL_vLv​ at the endpoints, and no regularity of LLL beyond the two displayed one-variable derivative hypotheses is asserted.

Human review
  • Endorsed by Shuze Chen · Aug 25, 2026

  • Endorsed by wenxinzhang · Aug 25, 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