Imports
/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ module public import Physlib.Electromagnetism.Distributional.Dynamics.Lagrangian

Extrema of the Lagrangian density

i. Overview

In this module we define what it means for an electromagnetic potential to be an extremum of the Lagrangian density in presence of a Lorentz current density.

This is equivalent to the electromagnetic potential satisfying Maxwell's equations with sources, i.e. Gauss's law and Ampère's law.

ii. Key results

    IsExtrema : The condition on an electromagnetic potential to be an extrema of the lagrangian.

iii. Table of contents

    A. Is Extema condition in the distributional case

      A.1. IsExtrema and Gauss's law and Ampère's law

      A.2. IsExtrema in terms of Vector Potentials

      A.3. The exterma condition in terms of tensors

      A.4. The invariance of the exterma condition under Lorentz transformations

iv. References

@[expose] public section

A. Is Extema condition in the distributional case

The above results looked at the extrema condition for electromagnetic potentials that are functions. We now look at the case where the electromagnetic potential is a distribution.

The proposition on an electromagnetic potential, corresponding to the statement that it is an extrema of the lagrangian.

def IsExtrema {d} (𝓕 : FreeSpace) (A : DistElectromagneticPotential d) (J : DistLorentzCurrentDensity d) : Prop := A.gradLagrangian 𝓕 J = 0
lemma isExtrema_iff_gradLagrangian {𝓕 : FreeSpace} (A : DistElectromagneticPotential d) (J : DistLorentzCurrentDensity d) : IsExtrema 𝓕 A J A.gradLagrangian 𝓕 J = 0 := d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dIsExtrema 𝓕 A J gradLagrangian 𝓕 A J = 0 All goals completed! 🐙d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dgradLagrangian 𝓕 A J = 0 (∀ (ε : SchwartzMap (SpaceTime d) ), (gradLagrangian 𝓕 A J) ε (Sum.inl 0) = 0) (ε : SchwartzMap (SpaceTime d) ) (i : Fin d), (gradLagrangian 𝓕 A J) ε (Sum.inr i) = 0 refine fun h => d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dh:gradLagrangian 𝓕 A J = 0(∀ (ε : SchwartzMap (SpaceTime d) ), (gradLagrangian 𝓕 A J) ε (Sum.inl 0) = 0) (ε : SchwartzMap (SpaceTime d) ) (i : Fin d), (gradLagrangian 𝓕 A J) ε (Sum.inr i) = 0 All goals completed! 🐙, fun h => ?_ d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dh:(∀ (ε : SchwartzMap (SpaceTime d) ), (gradLagrangian 𝓕 A J) ε (Sum.inl 0) = 0) (ε : SchwartzMap (SpaceTime d) ) (i : Fin d), (gradLagrangian 𝓕 A J) ε (Sum.inr i) = 0ε:SchwartzMap (SpaceTime d) (gradLagrangian 𝓕 A J) ε = 0 ε d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dh:(∀ (ε : SchwartzMap (SpaceTime d) ), (gradLagrangian 𝓕 A J) ε (Sum.inl 0) = 0) (ε : SchwartzMap (SpaceTime d) ) (i : Fin d), (gradLagrangian 𝓕 A J) ε (Sum.inr i) = 0ε:SchwartzMap (SpaceTime d) i:Fin 1 Fin d(gradLagrangian 𝓕 A J) ε i = 0 ε i match i with d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dh:(∀ (ε : SchwartzMap (SpaceTime d) ), (gradLagrangian 𝓕 A J) ε (Sum.inl 0) = 0) (ε : SchwartzMap (SpaceTime d) ) (i : Fin d), (gradLagrangian 𝓕 A J) ε (Sum.inr i) = 0ε:SchwartzMap (SpaceTime d) i:Fin 1 Fin d(gradLagrangian 𝓕 A J) ε (Sum.inl 0) = 0 ε (Sum.inl 0) All goals completed! 🐙 d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dh:(∀ (ε : SchwartzMap (SpaceTime d) ), (gradLagrangian 𝓕 A J) ε (Sum.inl 0) = 0) (ε : SchwartzMap (SpaceTime d) ) (i : Fin d), (gradLagrangian 𝓕 A J) ε (Sum.inr i) = 0ε:SchwartzMap (SpaceTime d) i:Fin 1 Fin dj:Fin d(gradLagrangian 𝓕 A J) ε (Sum.inr j) = 0 ε (Sum.inr j) All goals completed! 🐙

A.1. IsExtrema and Gauss's law and Ampère's law

We show that A is an extrema of the lagrangian if and only if Gauss's law and Ampère's law hold. In other words,

$$\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}$$ and $$\mu_0 \varepsilon_0 \frac{\partial \mathbf{E}i}{\partial t} - \sum_j \partial_j \mathbf{B}{j i} + \mu_0 \mathbf{J}_i = 0.$$ Here $\mathbf{B}$ is the magnetic field matrix.

d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dhsurj:Function.Surjective (SchwartzMap.compCLMOfContinuousLinearEquiv (SpaceTime.toTimeAndSpace 𝓕.c).symm)hgauss: (a b : ), 1 / (𝓕.μ₀ * 𝓕.c.val) * a - 𝓕.c.val * b = 0 a = 1 / 𝓕.ε₀ * bhampere: (T S C : ), 𝓕.μ₀⁻¹ * (1 / 𝓕.c.val ^ 2 * T - S) + C = 0 𝓕.μ₀ * 𝓕.ε₀ * T - S + 𝓕.μ₀ * C = 0(∀ (ε : SchwartzMap (SpaceTime d) ) (i : Fin d), 𝓕.μ₀⁻¹ * (1 / 𝓕.c.val ^ 2 * ((distTimeDeriv ((electricField 𝓕.c) A)) ((SchwartzMap.compCLMOfContinuousLinearEquiv (SpaceTime.toTimeAndSpace 𝓕.c).symm) ε)).ofLp i - x, (((PiLp.basisFun 2 (Fin d)).tensorProduct (PiLp.basisFun 2 (Fin d))).repr (((distSpaceDeriv x) ((magneticFieldMatrix 𝓕.c) A)) ((SchwartzMap.compCLMOfContinuousLinearEquiv (SpaceTime.toTimeAndSpace 𝓕.c).symm) ε))) (x, i)) + (((DistLorentzCurrentDensity.currentDensity 𝓕.c) J) ((SchwartzMap.compCLMOfContinuousLinearEquiv (SpaceTime.toTimeAndSpace 𝓕.c).symm) ε)).ofLp i = 0) (x : SchwartzMap (SpaceTime d) ) (i : Fin d), 𝓕.μ₀ * 𝓕.ε₀ * ((distTimeDeriv ((electricField 𝓕.c) A)) ((SchwartzMap.compCLMOfContinuousLinearEquiv (SpaceTime.toTimeAndSpace 𝓕.c).symm) x)).ofLp i - j, (((PiLp.basisFun 2 (Fin d)).tensorProduct (PiLp.basisFun 2 (Fin d))).repr (((distSpaceDeriv j) ((magneticFieldMatrix 𝓕.c) A)) ((SchwartzMap.compCLMOfContinuousLinearEquiv (SpaceTime.toTimeAndSpace 𝓕.c).symm) x))) (j, i) + 𝓕.μ₀ * (((DistLorentzCurrentDensity.currentDensity 𝓕.c) J) ((SchwartzMap.compCLMOfContinuousLinearEquiv (SpaceTime.toTimeAndSpace 𝓕.c).symm) x)).ofLp i = 0 All goals completed! 🐙

A.2. IsExtrema in terms of Vector Potentials

We show that A is an extrema of the lagrangian if and only if Gauss's law and Ampère's law hold. In other words,

$$\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}$$ and $$\mu_0 \varepsilon_0 \frac{\partial \mathbf{E}_i}{\partial t} - \sum_j -(\partial_j \partial_j \vec A_i - \partial_j \partial_i \vec A_j) + \mu_0 \mathbf{J}_i = 0.$$

d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dε:SchwartzMap (Time × Space d) i:Fin dj:Fin d-((((distSpaceDeriv j) ((distSpaceDeriv j) ((vectorPotential 𝓕.c) A))) ε).ofLp i - (((distSpaceDeriv j) ((distSpaceDeriv i) ((vectorPotential 𝓕.c) A))) ε).ofLp j) = (((distSpaceDeriv j) ((distSpaceDeriv i) ((vectorPotential 𝓕.c) A))) ε).ofLp j - (((distSpaceDeriv j) ((distSpaceDeriv j) ((vectorPotential 𝓕.c) A))) ε).ofLp i All goals completed! 🐙

A.3. The exterma condition in terms of tensors

We show that A is an extrema of the lagrangian if and only if the equation $$\frac{1}{\mu_0} \partial_\kappa F^{\kappa \nu'} - J^{\nu'} = 0,$$ holds.

d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dh: (ε : SchwartzMap (SpaceTime d) ), (contrT 1 0 1 ) (Tensorial.toTensor ((1 / 𝓕.μ₀) (distTensorDeriv (fieldStrength A)) ε)) + (permT ![0] ) (-Tensorial.toTensor (J ε)) = 0x:SchwartzMap (SpaceTime d) ν:Fin 1 Fin dη ν ν * Tensorial.toTensor.symm ((permT id ) 0) ν = 0 x ν All goals completed! 🐙

A.4. The invariance of the exterma condition under Lorentz transformations

We show that the Exterma condition is invariant under Lorentz transformations. This implies that if an electromagnetic potential is an extrema in one inertial frame, it is also an extrema in any other inertial frame. In otherwords that the Maxwell's equations are Lorentz invariant. A natural consequence of this is that the speed of light is the same in all inertial frames.

d:𝓕:FreeSpaceA:DistElectromagneticPotential dJ:DistLorentzCurrentDensity dΛ:(LorentzGroup d)x:SchwartzMap (SpaceTime d) h:𝓕.μ₀⁻¹ (contrT 1 0 1 ) (Tensorial.toTensor ((distTensorDeriv (fieldStrength A)) ((schwartzAction Λ⁻¹) x))) + -(permT ![0] ) (Tensorial.toTensor (J ((schwartzAction Λ⁻¹) x))) = 0Λ 0 = 0 All goals completed! 🐙