Documentation

Atlas.IntroductionToPartialDifferentialEquations.code.CM18.LagrangianMechanics

@[reducible, inline]
abbrev CM18.Spacetime (n : ) :

Spacetime $\mathbb{R}^{1+n}$ modeled as functions $\text{Fin}(n+1) \to \mathbb{R}$. The component indexed by $0$ is time and components $1, \ldots, n$ are spatial.

Instances For
    @[reducible, inline]
    abbrev CM18.ScalarField (n : ) :

    A real-valued scalar field on $(1+n)$-dimensional spacetime.

    Instances For

      A Lagrangian (Definition 1.0.1) is a function of the field value $\phi \in \mathbb{R}$, its spacetime gradient $\nabla\phi \in \mathbb{R}^{1+n}$, and the spacetime coordinate $x$. We write $\mathcal{L}(\phi, \nabla\phi, x)$.

      Instances For
        noncomputable def CM18.spacetimeGradient {n : } (φ : ScalarField n) (x : Spacetime n) :
        Fin (n + 1)

        The spacetime gradient $\nabla\phi$ of a scalar field $\phi$ at $x$, given by the components $(\nabla\phi)_\mu = \partial_\mu \phi(x) = (D\phi)_x(e_\mu)$ where $e_\mu$ is the $\mu$-th coordinate vector.

        Instances For
          noncomputable def CM18.action {n : } (L : Lagrangian n) (φ : ScalarField n) (K : Set (Spacetime n)) :

          The action (Definition 1.0.2) of a field $\phi$ over a compact set $\mathfrak{K} \subset \mathbb{R}^{1+n}$: $$\mathcal{A}[\phi; \mathfrak{K}] = \int_{\mathfrak{K}} \mathcal{L}(\phi(x), \nabla\phi(x), x)\, d^{1+n}x.$$

          Instances For
            def CM18.IsVariation {n : } (K : Set (Spacetime n)) (ψ : ScalarField n) :

            A variation (Definition 1.0.3) on a set $K$ is a smooth scalar field $\psi$ whose support is contained in $K$; equivalently $\psi \in C_c^\infty(K)$.

            Instances For
              def CM18.perturbedField {n : } (φ ψ : ScalarField n) (ε : ) :

              The perturbed field (Definition 1.0.4) $\phi_\varepsilon := \phi + \varepsilon\psi$.

              Instances For

                $\phi$ is a stationary point of the action (Definition 1.0.5) iff for every compact set $\mathfrak{K}$ and every variation $\psi \in C_c^\infty(\mathfrak{K})$, $$\left.\frac{d}{d\varepsilon}\right|_{\varepsilon=0} \mathcal{A}[\phi_\varepsilon; \mathfrak{K}] = 0.$$

                Instances For
                  noncomputable def CM18.dL_dφ {n : } (L : Lagrangian n) (φ : ScalarField n) (x : Spacetime n) :

                  The partial derivative $\partial\mathcal{L}/\partial\phi$ evaluated at $(\phi(x), \nabla\phi(x), x)$.

                  Instances For
                    noncomputable def CM18.dL_dgrad {n : } (L : Lagrangian n) (φ : ScalarField n) (x : Spacetime n) (α : Fin (n + 1)) :

                    The partial derivative $\partial\mathcal{L}/\partial(\nabla_\alpha\phi)$ evaluated at $(\phi(x), \nabla\phi(x), x)$, holding the other gradient components, $\phi$, and $x$ fixed.

                    Instances For
                      noncomputable def CM18.eulerLagrangeOperator {n : } (L : Lagrangian n) (φ : ScalarField n) (x : Spacetime n) :

                      The Euler-Lagrange operator $$E[\phi](x) = \frac{\partial\mathcal{L}}{\partial\phi} - \sum_\alpha \nabla_\alpha\left( \frac{\partial\mathcal{L}}{\partial(\nabla_\alpha\phi)}\right).$$ The Euler-Lagrange PDE (Theorem 1.1) is $E[\phi] = 0$.

                      Instances For
                        theorem CM18.ibp_fundamental_lemma {n : } (f : Spacetime n) (hcont : Continuous f) (hf : ∀ (K : Set (Spacetime n)), IsCompact K∀ (ψ : ScalarField n), IsVariation K ψ (x : Spacetime n) in K, f x * ψ x = 0) (x : Spacetime n) :
                        f x = 0

                        Fundamental lemma of the calculus of variations: if $f$ is continuous and $\int_K f\psi = 0$ for every compact $K$ and every variation $\psi \in C_c^\infty(K)$, then $f \equiv 0$.

                        theorem CM18.pointwise_chain_rule {n : } (L : Lagrangian n) (φ ψ : ScalarField n) (x : Spacetime n) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) ( : ContDiff (↑) ψ) :
                        HasDerivAt (fun (ε : ) => L (φ x + ε * ψ x) (spacetimeGradient (perturbedField φ ψ ε) x) x) (dL_dφ L φ x * ψ x + α : Fin (n + 1), dL_dgrad L φ x α * spacetimeGradient ψ x α) 0

                        Pointwise chain rule at $\varepsilon = 0$ for the integrand of the action: the derivative in $\varepsilon$ of $\mathcal{L}(\phi_\varepsilon(x), \nabla\phi_\varepsilon(x), x)$ at $\varepsilon=0$ equals $\frac{\partial\mathcal{L}}{\partial\phi}\psi + \sum_\alpha \frac{\partial\mathcal{L}}{\partial(\nabla_\alpha\phi)} \nabla_\alpha\psi$.

                        theorem CM18.general_chain_rule_all_eps {n : } (L : Lagrangian n) (φ ψ : ScalarField n) (x : Spacetime n) (ε₀ : ) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : DifferentiableAt φ x) ( : DifferentiableAt ψ x) :
                        HasDerivAt (fun (ε : ) => L (φ x + ε * ψ x) (spacetimeGradient (perturbedField φ ψ ε) x) x) ((fderiv (fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) (φ x + ε₀ * ψ x, fun (μ : Fin (n + 1)) => spacetimeGradient φ x μ + ε₀ * spacetimeGradient ψ x μ, x)) (ψ x, spacetimeGradient ψ x, 0)) ε₀

                        General pointwise chain rule at an arbitrary base point $\varepsilon_0$: gives a closed-form expression for $\frac{d}{d\varepsilon} \mathcal{L}(\phi_\varepsilon(x), \nabla\phi_\varepsilon(x), x)$ at any $\varepsilon = \varepsilon_0$ in terms of the full Fréchet derivative of $\mathcal{L}$. Used to dominate the difference quotient when differentiating under the integral sign.

                        theorem CM18.leibniz_chain_rule {n : } (L : Lagrangian n) (φ ψ : ScalarField n) (K : Set (Spacetime n)) (hK : IsCompact K) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) ( : ContDiff (↑) ψ) :
                        deriv (fun (ε : ) => action L (perturbedField φ ψ ε) K) 0 = (x : Spacetime n) in K, dL_dφ L φ x * ψ x + α : Fin (n + 1), dL_dgrad L φ x α * spacetimeGradient ψ x α

                        Differentiation under the integral sign (Leibniz rule) applied to the action: for smooth data, $$\left.\frac{d}{d\varepsilon}\right|_{\varepsilon=0} \mathcal{A}[\phi_\varepsilon; K] = \int_K \left(\frac{\partial\mathcal{L}}{\partial\phi}\,\psi + \sum_\alpha \frac{\partial\mathcal{L}}{\partial(\nabla_\alpha\phi)}\,\nabla_\alpha\psi\right) d^{1+n}x.$$

                        theorem CM18.ibp_single_coordinate {n : } (f : Spacetime n) (ψ : ScalarField n) (K : Set (Spacetime n)) (α : Fin (n + 1)) (hK : IsCompact K) ( : IsVariation K ψ) (hf : ContDiff 1 f) :
                        (x : Spacetime n) in K, f x * spacetimeGradient ψ x α = (x : Spacetime n) in K, -(fderiv f x) (Pi.single α 1) * ψ x

                        Integration by parts in one coordinate direction $\alpha$: since $\psi$ vanishes near $\partial K$, $\int_K f\,\partial_\alpha\psi\, d^{1+n}x = -\int_K (\partial_\alpha f)\,\psi\, d^{1+n}x$.

                        theorem CM18.el_terms_integrable {n : } (L : Lagrangian n) (φ ψ : ScalarField n) (K : Set (Spacetime n)) (hK : IsCompact K) ( : IsVariation K ψ) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) :
                        MeasureTheory.IntegrableOn (fun (x : Spacetime n) => dL_dφ L φ x * ψ x) K MeasureTheory.volume MeasureTheory.IntegrableOn (fun (x : Spacetime n) => α : Fin (n + 1), dL_dgrad L φ x α * spacetimeGradient ψ x α) K MeasureTheory.volume MeasureTheory.IntegrableOn (fun (x : Spacetime n) => α : Fin (n + 1), -(fderiv (fun (y : Spacetime n) => dL_dgrad L φ y α) x) (Pi.single α 1) * ψ x) K MeasureTheory.volume (∀ (α : Fin (n + 1)), MeasureTheory.IntegrableOn (fun (x : Spacetime n) => dL_dgrad L φ x α * spacetimeGradient ψ x α) K MeasureTheory.volume) ∀ (α : Fin (n + 1)), MeasureTheory.IntegrableOn (fun (x : Spacetime n) => -(fderiv (fun (y : Spacetime n) => dL_dgrad L φ y α) x) (Pi.single α 1) * ψ x) K MeasureTheory.volume

                        Integrability of the Euler-Lagrange-type terms over the compact set $K$: the field-derivative term, the gradient-derivative sum, the integrated-by-parts sum, and each summand of those sums are integrable on $K$.

                        theorem CM18.dL_dgrad_contDiff {n : } (L : Lagrangian n) (φ : ScalarField n) (α : Fin (n + 1)) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) :
                        ContDiff 1 fun (x : Spacetime n) => dL_dgrad L φ x α

                        If $\mathcal{L}$ is $C^2$ and $\phi$ is $C^2$, then $x \mapsto \partial\mathcal{L}/\partial(\nabla_\alpha\phi)$ evaluated at $(\phi(x), \nabla\phi(x), x)$ is $C^1$. This is the regularity required to integrate by parts.

                        theorem CM18.ibp_per_coordinate_sum {n : } (L : Lagrangian n) (φ ψ : ScalarField n) (K : Set (Spacetime n)) (hK : IsCompact K) ( : IsVariation K ψ) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) :
                        (x : Spacetime n) in K, α : Fin (n + 1), dL_dgrad L φ x α * spacetimeGradient ψ x α = (x : Spacetime n) in K, α : Fin (n + 1), -(fderiv (fun (y : Spacetime n) => dL_dgrad L φ y α) x) (Pi.single α 1) * ψ x MeasureTheory.IntegrableOn (fun (x : Spacetime n) => dL_dφ L φ x * ψ x) K MeasureTheory.volume MeasureTheory.IntegrableOn (fun (x : Spacetime n) => α : Fin (n + 1), dL_dgrad L φ x α * spacetimeGradient ψ x α) K MeasureTheory.volume MeasureTheory.IntegrableOn (fun (x : Spacetime n) => α : Fin (n + 1), -(fderiv (fun (y : Spacetime n) => dL_dgrad L φ y α) x) (Pi.single α 1) * ψ x) K MeasureTheory.volume

                        Coordinate-by-coordinate integration by parts applied to each term in the $\sum_\alpha \frac{\partial\mathcal{L}}{\partial(\nabla_\alpha\phi)} \nabla_\alpha\psi$ sum, giving $\sum_\alpha (-\nabla_\alpha \frac{\partial\mathcal{L}}{\partial(\nabla_\alpha\phi)})\psi$, together with the integrability conditions that justify swapping integral and sum.

                        theorem CM18.ibp_euler_lagrange {n : } (L : Lagrangian n) (φ ψ : ScalarField n) (K : Set (Spacetime n)) (hK : IsCompact K) ( : IsVariation K ψ) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) :
                        (x : Spacetime n) in K, dL_dφ L φ x * ψ x + α : Fin (n + 1), dL_dgrad L φ x α * spacetimeGradient ψ x α = (x : Spacetime n) in K, eulerLagrangeOperator L φ x * ψ x

                        Integration by parts reassembled: the full first-variation integrand equals the Euler-Lagrange operator times the variation, $$\int_K \left(\frac{\partial\mathcal{L}}{\partial\phi}\,\psi + \sum_\alpha \frac{\partial\mathcal{L}}{\partial(\nabla_\alpha\phi)}\,\nabla_\alpha\psi\right) = \int_K E[\phi](x)\,\psi(x)\, d^{1+n}x.$$

                        theorem CM18.first_variation_expansion {n : } (L : Lagrangian n) (φ : ScalarField n) (K : Set (Spacetime n)) (hK : IsCompact K) (ψ : ScalarField n) ( : IsVariation K ψ) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) :
                        deriv (fun (ε : ) => action L (perturbedField φ ψ ε) K) 0 = (x : Spacetime n) in K, eulerLagrangeOperator L φ x * ψ x

                        First-variation formula: combining the Leibniz chain rule with integration by parts, $$\left.\frac{d}{d\varepsilon}\right|_{\varepsilon=0} \mathcal{A}[\phi_\varepsilon; K] = \int_K E[\phi](x)\,\psi(x)\, d^{1+n}x.$$

                        theorem CM18.euler_lagrange_equation {n : } (L : Lagrangian n) (φ : ScalarField n) (hL : ContDiff 2 fun (p : × (Fin (n + 1)) × Spacetime n) => L p.1 p.2.1 p.2.2) ( : ContDiff 2 φ) :

                        Theorem 1.1 (Principle of Stationary Action / Euler-Lagrange equation): for a $C^2$ Lagrangian $\mathcal{L}$ and a $C^2$ field $\phi$, $\phi$ is a stationary point of the action if and only if the Euler-Lagrange PDE $$\nabla_\alpha\left(\frac{\partial\mathcal{L}}{\partial(\nabla_\alpha\phi)}\right) = \frac{\partial\mathcal{L}}{\partial\phi}$$ holds pointwise on spacetime.

                        theorem CM18.proposition_2_0_1_ode_flow {n : } (Y : Spacetime nSpacetime n) (hY_smooth : ContDiff Y) (C : ) (hC : 0 < C) (hY_bdd : ∀ (x : Spacetime n) (μ ν : Fin (n + 1)), |(fderiv (fun (y : Spacetime n) => Y y ν) x) (Pi.single μ 1)| C) :
                        ε₀ > 0, ∃ (F : Spacetime nSpacetime n), (∀ (x : Spacetime n), F 0 x = x) (∀ (x : Spacetime n) (ε : ), |ε| ε₀deriv (fun (s : ) => F s x) ε = Y (F ε x)) (∀ (x : Spacetime n), ContDiff fun (ε : ) => F ε x) (∀ (ε : ), ContDiff (F ε)) (∀ (ε : ), |ε| ε₀Function.Bijective (F ε) ∀ (x : Spacetime n), F (-ε) (F ε x) = x) (∀ (ε₁ ε₂ : ), |ε₁| + |ε₂| ε₀∀ (x : Spacetime n), F ε₁ (F ε₂ x) = F (ε₁ + ε₂) x) (∀ (x : Spacetime n), ∃ (R : Spacetime nSpacetime n), (∀ (x' : Spacetime n), ContDiff fun (ε : ) => R ε x') (∀ (ε : ), ContDiff (R ε)) ∀ (ε : ) (μ : Fin (n + 1)), F ε x μ = x μ + ε * Y x μ + ε ^ 2 * R ε x μ) (∀ (x : Spacetime n), ∃ (S : Spacetime nFin (n + 1)Fin (n + 1)), (∀ (x' : Spacetime n), ContDiff fun (ε : ) => S ε x') ∀ (ε : ) (μ ν : Fin (n + 1)), (fderiv (fun (y : Spacetime n) => F ε y μ) x) (Pi.single ν 1) = (if μ = ν then 1 else 0) + ε * (fderiv (fun (y : Spacetime n) => Y y μ) x) (Pi.single ν 1) + ε ^ 2 * S ε x μ ν) (∀ (x : Spacetime n), ∃ (S : Spacetime nFin (n + 1)Fin (n + 1)), (∀ (x' : Spacetime n), ContDiff fun (ε : ) => S ε x') ∀ (ε : ) (μ ν : Fin (n + 1)), (fderiv (fun (y : Spacetime n) => F (-ε) y μ) (F ε x)) (Pi.single ν 1) = (if μ = ν then 1 else 0) - ε * (fderiv (fun (y : Spacetime n) => Y y μ) x) (Pi.single ν 1) + ε ^ 2 * S ε x μ ν) ∀ (x : Spacetime n), ∃ (S : Spacetime n), (∀ (x' : Spacetime n), ContDiff fun (ε : ) => S ε x') ∀ (ε : ), (Matrix.of fun (μ ν : Fin (n + 1)) => (fderiv (fun (y : Spacetime n) => F (-ε) y μ) (F ε x)) (Pi.single ν 1)).det = 1 - ε * α : Fin (n + 1), (fderiv (fun (y : Spacetime n) => Y y α) x) (Pi.single α 1) + ε ^ 2 * S ε x

                        Proposition 2.0.1 (ODE flow generated by a smooth, bounded-gradient vector field): given a smooth vector field $Y$ on $\mathbb{R}^{1+n}$ whose first partial derivatives are uniformly bounded by $C$, the local flow $F_\varepsilon$ of $Y$ exists on a uniform $\varepsilon$-interval and enjoys identity at $\varepsilon=0$, the flow equation, joint smoothness, a one-parameter group law, local bijectivity with explicit inverse $F_{-\varepsilon}$, a Taylor expansion of $F_\varepsilon x$ to second order in $\varepsilon$, Taylor expansions of $D F_{\pm\varepsilon}$ to second order, and the Jacobian determinant expansion $\det DF_{-\varepsilon}|_{F_\varepsilon x} = 1 - \varepsilon\,\nabla_\alpha Y^\alpha(x) + O(\varepsilon^2)$.