Action, admissible variations, stationary paths, Euler–Lagrange expression
DefinitionStationaryActionCoreThis file fixes the variational vocabulary used by the whole mission, in the one-dimensional setting of Chapter 3 of the source monograph.
An integrand is a function of three real arguments. For a path and endpoints , the action is
where is the derivative of . The two partial derivatives of the integrand, and , are the derivatives of in its first and second slot with the other two arguments held fixed.
Neighbouring paths are . A variation is admissible on when it is twice continuously differentiable and , which is the class of comparison paths used in the source. A path is a stationary path when, for every admissible , the function has derivative at .
Finally the Euler–Lagrange expression along is
so that the Euler–Lagrange equation of the source is the assertion . Taking , and turns these definitions into Hamilton's principle and the Lagrange equations of motion.
Formalization Note Derivatives are Lean's deriv, which returns at points of non-differentiability; the theorems of this mission therefore carry explicit hypotheses wherever a derivative is asserted to be a genuine derivative. Paths, variations and integrands are defined on all of , and only their behaviour on is constrained.
import Mathlib
namespace StationaryAction
/-- `partialY f y v x` is the partial derivative `∂f/∂y` of the integrand
`f = f (y, y', x)` with respect to its first slot, evaluated at `(y, v, x)`. -/
noncomputable def partialY (f : ℝ → ℝ → ℝ → ℝ) (y v x : ℝ) : ℝ :=
deriv (fun u => f u v x) y
/-- `partialV f y v x` is the partial derivative `∂f/∂y'` of the integrand
`f = f (y, y', x)` with respect to its second slot, evaluated at `(y, v, x)`. -/
noncomputable def partialV (f : ℝ → ℝ → ℝ → ℝ) (y v x : ℝ) : ℝ :=
deriv (fun w => f y w x) v
/-- The action (variational) integral `S = ∫_{x₁}^{x₂} f (y x, y' x, x) dx`. -/
noncomputable def action (f : ℝ → ℝ → ℝ → ℝ) (y : ℝ → ℝ) (x₁ x₂ : ℝ) : ℝ :=
∫ x in x₁..x₂, f (y x) (deriv y x) x
/-- The one-parameter family of neighbouring paths `y (x, a) = y x + a * η x`. -/
noncomputable def vary (y η : ℝ → ℝ) (a : ℝ) : ℝ → ℝ := fun x => y x + a * η x
/-- An admissible variation on `[x₁, x₂]`: twice continuously differentiable and
vanishing at both endpoints. -/
def IsAdmissibleVariation (η : ℝ → ℝ) (x₁ x₂ : ℝ) : Prop :=
ContDiff ℝ 2 η ∧ η x₁ = 0 ∧ η x₂ = 0
/-- `y` makes the action stationary on `[x₁, x₂]`: for every admissible variation `η`,
the derivative at `a = 0` of `a ↦ S (y + a η)` vanishes. -/
def IsStationaryPath (f : ℝ → ℝ → ℝ → ℝ) (y : ℝ → ℝ) (x₁ x₂ : ℝ) : Prop :=
∀ η : ℝ → ℝ, IsAdmissibleVariation η x₁ x₂ →
deriv (fun a : ℝ => action f (vary y η a) x₁ x₂) 0 = 0
/-- The Euler–Lagrange expression `∂f/∂y - d/dx (∂f/∂y')` evaluated along the path `y`. -/
noncomputable def eulerLagrangeExpr (f : ℝ → ℝ → ℝ → ℝ) (y : ℝ → ℝ) (x : ℝ) : ℝ :=
partialY f (y x) (deriv y x) x - deriv (fun t => partialV f (y t) (deriv y t) t) x
end StationaryAction
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.
This bundle introduces six declarations about real-valued functions on the real line.
-
For a function of three real arguments, is defined as the derivative at the point of the one-variable function ; the second and third arguments are frozen.
-
is defined as the derivative at the point of the one-variable function ; the first and third arguments are frozen.
-
For as above, a function and reals , is the oriented interval integral
where denotes the derivative function of . No integrability or differentiability is required in the definition: where fails to be differentiable the derivative is taken to be , and where the integrand is not integrable the integral is taken to be .
-
For functions and a real , is the function , defined on all of .
-
The predicate is the conjunction of three conditions: is twice continuously differentiable on all of (smoothness of order exactly , globally, not merely on ); ; and . Nothing prevents , and the zero function satisfies the predicate.
-
The predicate asserts: for every function satisfying the admissibility predicate of item 5, the derivative at of the map
equals . If that map is not differentiable at , its derivative is by convention and the condition is satisfied for that .
- is defined as the number
the second term being the derivative at of the displayed function of , again with the convention that a non-differentiable point contributes .
All declarations are unconditional definitions; none of them asserts anything.