Imports
/- Copyright (c) 2025 Tomas Skrivan. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Tomas Skrivan, Joseph Tooby-Smith -/ module public import Physlib.Mathematics.VariationalCalculus.HasVarGradient public import Physlib.SpaceAndTime.Time.Derivatives

A. Euler–Lagrange equations

The Euler–Lagrange equations characterize stationary trajectories of an action functional. For a Lagrangian L t q v, they compare the gradient with respect to position to the time derivative of the gradient with respect to velocity.

A.1. Mathematical setting

Trajectories take values in a complete real inner-product space X. The Lagrangian has type Time → X → X → ℝ, and the corresponding action is the time integral of L t (q t) (∂ₜ q t).

A.2. Main definitions and results

    eulerLagrangeOp defines the Euler–Lagrange operator ∂L/∂q - ∂ₜ (∂L/∂v) along a trajectory.

    eulerLagrangeOp_eq exposes its pointwise formula.

    eulerLagrangeOp_zero evaluates the operator for the zero Lagrangian.

    euler_lagrange_varGradient proves that the variational gradient of the action equals the Euler–Lagrange operator for smooth trajectories and Lagrangians.

A.3. Current scope

The result is formulated for smooth data and Hilbert-space-valued trajectories. Applications to specific mechanical systems are developed in their corresponding modules, where vanishing of the operator becomes the system's equation of motion.

@[expose] public sectionlemma eulerLagrangeOp_eq (L : Time X X ) (q : Time X) : eulerLagrangeOp L q = fun t => gradient (L t · (∂ₜ q t)) (q t) - ∂ₜ (fun t' => gradient (L t' (q t') ·) (∂ₜ q t')) t := X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace XL:Time X X q:Time XeulerLagrangeOp L q = fun t => gradient (fun x => L t x (∂ₜ q t)) (q t) - ∂ₜ (fun t' => gradient (fun x => L t' (q t') x) (∂ₜ q t')) t All goals completed! 🐙lemma eulerLagrangeOp_zero (q : Time X) : eulerLagrangeOp (fun _ _ _ => 0) q = fun _ => 0 := X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace Xq:Time XeulerLagrangeOp (fun x x_1 x_2 => 0) q = fun x => 0 All goals completed! 🐙X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace XL:Time X X q:Time Xhq:ContDiff qhL:ContDiff Lt✝:Timet:TimeDifferentiableAt (L t) (q t, (fderiv q t) 1)X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace XL:Time X X q:Time Xhq:ContDiff qhL:ContDiff Lt✝:Timet:TimeDifferentiableAt (fun x => L t (q t) x) ((fderiv q t) 1) X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace XL:Time X X q:Time Xhq:ContDiff qhL:ContDiff Lt✝:Timet:TimeDifferentiableAt (L t) (q t, (fderiv q t) 1)X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace XL:Time X X q:Time Xhq:ContDiff qhL:ContDiff Lt✝:Timet:TimeDifferentiableAt (fun x => L t (q t) x) ((fderiv q t) 1) apply ContDiff.differentiable (n := ) (X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace XL:Time X X q:Time Xhq:ContDiff qhL:ContDiff Lt✝:Timet:TimeContDiff fun x => L t (q t) x All goals completed! 🐙) (X:Typeinst✝²:NormedAddCommGroup Xinst✝¹:InnerProductSpace Xinst✝:CompleteSpace XL:Time X X q:Time Xhq:ContDiff qhL:ContDiff Lt✝:Timet:Time 0 All goals completed! 🐙)