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.Mathematics.VariationalCalculus.HasVarAdjDeriv public import Physlib.SpaceAndTime.SpaceTime.TimeSlice public import Physlib.Mathematics.Calculus.ParametricIntegration

The Electromagnetic Potential

i. Overview

The electromagnetic potential A^μ is the fundamental objects in electromagnetism. Mathematically it is related to a connection on a U(1)-bundle.

We define the electromagnetic potential as a function from spacetime to contravariant Lorentz vectors.

ii. Key results

    ElectromagneticPotential : is the type of electromagnetic potentials.

    ElectromagneticPotential.deriv : the derivative tensor ∂_μ A^ν.

iii. Table of contents

    A. The electromagnetic potential

      A.1. Basic instances on the type of electromagnetic potentials

      A.2. Basic constructors of the electromagnetic potential

      A.3. The group action on the ElectromagneticPotential

      A.4. Differentiability

      A.5. The action on the space-time derivatives

      A.6. Variational adjoint derivative of component

      A.7. Variational adjoint derivative of derivatives of the potential

    B. The derivative tensor of the electromagnetic potential

      B.1. Equivariance of the derivative tensor

      B.2. The elements of the derivative tensor in terms of the basis

iv. References

    https://quantummechanics.ucsd.edu/ph130a/130_notes/node452.html

    https://ph.qmul.ac.uk/sites/default/files/EMT10new.pdf

@[expose] public section

A. The electromagnetic potential

We define the electromagnetic potential as a function from spacetime to contravariant Lorentz vectors, and prove some simple results about it.

The electromagnetic potential is a tensor A^μ.

The underlying map from SpaceTime d to Lorentz.Vector d associated with an electromagnetic potential.

structure ElectromagneticPotential (d : := 3) where val : SpaceTime d Lorentz.Vector d
attribute [-simp] Fintype.sum_sum_typeattribute [-simp] Nat.succ_eq_add_one@[ext] lemma eq_of_val_eq (A B : ElectromagneticPotential d) (h : A.val = B.val) : A = B := congrArg ElectromagneticPotential.mk h

A.1. Basic instances on the type of electromagnetic potentials

instance {d} : CoeFun (ElectromagneticPotential d) (fun _ => SpaceTime d Lorentz.Vector d) where coe A := A.valinstance {d} : Zero (ElectromagneticPotential d) where zero := fun _ => 0@[simp] lemma zero_val {d} : (0 : ElectromagneticPotential d).val = 0 := rfl@[simp] lemma zero_apply {d} (x : SpaceTime d) : (0 : ElectromagneticPotential d) x = 0 := rflinstance {d} : Add (ElectromagneticPotential d) where add A B := fun x => A x + B x@[simp] lemma add_val {d} (A B : ElectromagneticPotential d) : (A + B).val = A.val + B.val := rfl@[simp] lemma add_apply {d} (A B : ElectromagneticPotential d) (x : SpaceTime d) : (A + B) x = A x + B x := d:A:ElectromagneticPotential dB:ElectromagneticPotential dx:SpaceTime d(A + B).val x = A.val x + B.val x All goals completed! 🐙instance {d} : Neg (ElectromagneticPotential d) where neg A := fun x => - A x@[simp] lemma neg_val {d} (A : ElectromagneticPotential d) : (- A).val = - A.val := rfl@[simp] lemma neg_apply {d} (A : ElectromagneticPotential d) (x : SpaceTime d) : (- A) x = - A x := rflinstance {d} : Sub (ElectromagneticPotential d) where sub A B := fun x => A x - B x@[simp] lemma sub_val {d} (A B : ElectromagneticPotential d) : (A - B).val = A.val - B.val := rfl@[simp] lemma sub_apply {d} (A B : ElectromagneticPotential d) (x : SpaceTime d) : (A - B) x = A x - B x := rflinstance {d} : AddCommGroup (ElectromagneticPotential d) where add_assoc A B C := d:A:ElectromagneticPotential dB:ElectromagneticPotential dC:ElectromagneticPotential dA + B + C = A + (B + C) d:A:ElectromagneticPotential dB:ElectromagneticPotential dC:ElectromagneticPotential dx:SpaceTime dμ:Fin 1 Fin d(A + B + C).val x μ = (A + (B + C)).val x μ All goals completed! 🐙 zero_add A := d:A:ElectromagneticPotential d0 + A = A d:A:ElectromagneticPotential dx:SpaceTime dμ:Fin 1 Fin d(0 + A).val x μ = A.val x μ All goals completed! 🐙 add_zero A := d:A:ElectromagneticPotential dA + 0 = A d:A:ElectromagneticPotential dx:SpaceTime dμ:Fin 1 Fin d(A + 0).val x μ = A.val x μ All goals completed! 🐙 neg_add_cancel A := d:A:ElectromagneticPotential d-A + A = 0 d:A:ElectromagneticPotential dx:SpaceTime dμ:Fin 1 Fin d(-A + A).val x μ = val 0 x μ All goals completed! 🐙 add_comm A B := d:A:ElectromagneticPotential dB:ElectromagneticPotential dA + B = B + A d:A:ElectromagneticPotential dB:ElectromagneticPotential dx:SpaceTime dμ:Fin 1 Fin d(A + B).val x μ = (B + A).val x μ All goals completed! 🐙 nsmul := nsmulRec zsmul := zsmulRec@[simp] lemma smul_val {d} (r : ) (A : ElectromagneticPotential d) : (r A).val = r A.val := rfl@[simp] lemma smul_apply {d} (r : ) (A : ElectromagneticPotential d) (x : SpaceTime d) : (r A) x = r A x := d:r:A:ElectromagneticPotential dx:SpaceTime d(r A).val x = r A.val x All goals completed! 🐙

A.2. Basic constructors of the electromagnetic potential

lemma ofPotentials_eq_add {d} (c : SpeedOfLight) (ϕ : Time Space d ) (A : Time Space d EuclideanSpace (Fin d)) : ofPotentials c ϕ A = ofScalarPotential c ϕ + ofVectorPotential c A := d:c:SpeedOfLightϕ:Time Space d A:Time Space d EuclideanSpace (Fin d)ofPotentials c ϕ A = ofScalarPotential c ϕ + ofVectorPotential c A d:c:SpeedOfLightϕ:Time Space d A:Time Space d EuclideanSpace (Fin d)(ofPotentials c ϕ A).val = (ofScalarPotential c ϕ + ofVectorPotential c A).val d:c:SpeedOfLightϕ:Time Space d A:Time Space d EuclideanSpace (Fin d)x:SpaceTime d(ofPotentials c ϕ A).val x = (ofScalarPotential c ϕ + ofVectorPotential c A).val x d:c:SpeedOfLightϕ:Time Space d A:Time Space d EuclideanSpace (Fin d)x:SpaceTime di:Fin 1 Fin d(ofPotentials c ϕ A).val x i = (ofScalarPotential c ϕ + ofVectorPotential c A).val x i match i with d:c:SpeedOfLightϕ:Time Space d A:Time Space d EuclideanSpace (Fin d)x:SpaceTime di:Fin 1 Fin dval✝:Fin d(ofPotentials c ϕ A).val x (Sum.inr val✝) = (ofScalarPotential c ϕ + ofVectorPotential c A).val x (Sum.inr val✝)d:c:SpeedOfLightϕ:Time Space d A:Time Space d EuclideanSpace (Fin d)x:SpaceTime di:Fin 1 Fin d(ofPotentials c ϕ A).val x (Sum.inl 0) = (ofScalarPotential c ϕ + ofVectorPotential c A).val x (Sum.inl 0) All goals completed! 🐙lemma ofStaticPotentials_eq_ofPotentials {d} (c : SpeedOfLight) (ϕ : Space d ) (A : Space d EuclideanSpace (Fin d)) : ofStaticPotentials c ϕ A = ofPotentials c (fun _ => ϕ) (fun _ => A) := d:c:SpeedOfLightϕ:Space d A:Space d EuclideanSpace (Fin d)ofStaticPotentials c ϕ A = ofPotentials c (fun x => ϕ) fun x => A All goals completed! 🐙TODO "Write lemmas for the various properties (e.g. the electric field) of the electromagnetic potential from the various constructors."

A.3. The group action on the ElectromagneticPotential

lemma action_val {d} (Λ : LorentzGroup d) (A : ElectromagneticPotential d) : (Λ A).val = fun x => Λ A (Λ⁻¹ x) := rfl@[simp] lemma action_apply {d} (Λ : LorentzGroup d) (A : ElectromagneticPotential d) (x : SpaceTime d) : (Λ A) x = Λ A (Λ⁻¹ x) := rfl

A.4. Differentiability

We show that the components of field strength tensor are differentiable if the potential is.

@[fun_prop] lemma differentiable_component {d : } (A : ElectromagneticPotential d) (hA : Differentiable A) (μ : Fin 1 Fin d) : Differentiable (fun x => A x μ) := d:A:ElectromagneticPotential dhA:Differentiable A.valμ:Fin 1 Fin dDifferentiable fun x => A.val x μ All goals completed! 🐙@[fun_prop] lemma differentiable_action {d} (Λ : LorentzGroup d) (A : ElectromagneticPotential d) (hA : Differentiable A) : Differentiable (fun x => Λ A (Λ⁻¹ x)) := d:Λ:(LorentzGroup d)A:ElectromagneticPotential dhA:Differentiable A.valDifferentiable fun x => Λ A.val (Λ⁻¹ x) All goals completed! 🐙@[fun_prop] lemma contDiff_action {d} (Λ : LorentzGroup d) (A : ElectromagneticPotential d) (hA : ContDiff n A) : ContDiff n (fun x => Λ A (Λ⁻¹ x)) := n:ℕ∞ωd:Λ:(LorentzGroup d)A:ElectromagneticPotential dhA:ContDiff n A.valContDiff n fun x => Λ A.val (Λ⁻¹ x) All goals completed! 🐙d:A:ElectromagneticPotential dhA:ContDiff 2 A.valμ:Fin 1 Fin dν:Fin 1 Fin dh: (ν : Fin 1 Fin d), Differentiable fun x => (fderiv A.val x) (Lorentz.Vector.basis μ) νDifferentiable fun x => ∂_ μ A.val x ν All goals completed! 🐙@[fun_prop] lemma differentiable_deriv_of_smooth {d} {A : ElectromagneticPotential d} (hA : ContDiff A) (μ ν : Fin 1 Fin d) : Differentiable (fun x => ∂_ μ A x ν) := d:A:ElectromagneticPotential dhA:ContDiff A.valμ:Fin 1 Fin dν:Fin 1 Fin dDifferentiable fun x => ∂_ μ A.val x ν All goals completed! 🐙n:ℕ∞ωd:A:ElectromagneticPotential dhA:ContDiff (n + 1) A.valμ:Fin 1 Fin dν:Fin 1 Fin dh: (ν : Fin 1 Fin d), ContDiff n fun x => (fderiv A.val x) (Lorentz.Vector.basis μ) νContDiff n fun x => ∂_ μ A.val x ν All goals completed! 🐙TODO "Add results related to the differentiability of the derivative of the Electromagnetic potential."

A.5. Differentiablity in terms of constructors

d:c:SpeedOfLightφ:Time Space d :Differentiable φ (ν : Fin 1 Fin d), Differentiable fun x => match ν with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0 d:c:SpeedOfLightφ:Time Space d :Differentiable φμ:Fin 1 Fin dDifferentiable fun x => match μ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0 match μ with d:c:SpeedOfLightφ:Time Space d :Differentiable φμ:Fin 1 Fin dval✝:Fin dDifferentiable fun x => match Sum.inr val✝ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0d:c:SpeedOfLightφ:Time Space d :Differentiable φμ:Fin 1 Fin dDifferentiable fun x => match Sum.inl 0 with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0 All goals completed! 🐙n:ℕ∞ωd:c:SpeedOfLightφ:Time Space d :ContDiff n φ (ν : Fin 1 Fin d), ContDiff n fun x => match ν with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0 n:ℕ∞ωd:c:SpeedOfLightφ:Time Space d :ContDiff n φμ:Fin 1 Fin dContDiff n fun x => match μ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0 match μ with n:ℕ∞ωd:c:SpeedOfLightφ:Time Space d :ContDiff n φμ:Fin 1 Fin dval✝:Fin dContDiff n fun x => match Sum.inr val✝ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0n:ℕ∞ωd:c:SpeedOfLightφ:Time Space d :ContDiff n φμ:Fin 1 Fin dContDiff n fun x => match Sum.inl 0 with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr val => 0 All goals completed! 🐙d:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:Differentiable A (ν : Fin 1 Fin d), Differentiable fun x => match ν with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp i d:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:Differentiable Aμ:Fin 1 Fin dDifferentiable fun x => match μ with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp i match μ with d:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:Differentiable Aμ:Fin 1 Fin dval✝:Fin dDifferentiable fun x => match Sum.inr val✝ with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp id:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:Differentiable Aμ:Fin 1 Fin dDifferentiable fun x => match Sum.inl 0 with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp i All goals completed! 🐙n:ℕ∞ωd:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:ContDiff n A (ν : Fin 1 Fin d), ContDiff n fun x => match ν with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp i n:ℕ∞ωd:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:ContDiff n Aμ:Fin 1 Fin dContDiff n fun x => match μ with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp i match μ with n:ℕ∞ωd:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:ContDiff n Aμ:Fin 1 Fin dval✝:Fin dContDiff n fun x => match Sum.inr val✝ with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp in:ℕ∞ωd:c:SpeedOfLightA:Time Space d EuclideanSpace (Fin d)hA:ContDiff n Aμ:Fin 1 Fin dContDiff n fun x => match Sum.inl 0 with | Sum.inl 0 => 0 | Sum.inr i => ((timeSlice c).symm A x).ofLp i All goals completed! 🐙d:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):Differentiable φhA:Differentiable A (ν : Fin 1 Fin d), Differentiable fun x => match ν with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp i d:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):Differentiable φhA:Differentiable Aμ:Fin 1 Fin dDifferentiable fun x => match μ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp i match μ with d:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):Differentiable φhA:Differentiable Aμ:Fin 1 Fin dval✝:Fin dDifferentiable fun x => match Sum.inr val✝ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp id:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):Differentiable φhA:Differentiable Aμ:Fin 1 Fin dDifferentiable fun x => match Sum.inl 0 with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp i All goals completed! 🐙n:ℕ∞ωd:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):ContDiff n φhA:ContDiff n A (ν : Fin 1 Fin d), ContDiff n fun x => match ν with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp i n:ℕ∞ωd:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):ContDiff n φhA:ContDiff n Aμ:Fin 1 Fin dContDiff n fun x => match μ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp i match μ with n:ℕ∞ωd:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):ContDiff n φhA:ContDiff n Aμ:Fin 1 Fin dval✝:Fin dContDiff n fun x => match Sum.inr val✝ with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp in:ℕ∞ωd:c:SpeedOfLightφ:Time Space d A:Time Space d EuclideanSpace (Fin d):ContDiff n φhA:ContDiff n Aμ:Fin 1 Fin dContDiff n fun x => match Sum.inl 0 with | Sum.inl 0 => (timeSlice c).symm φ x / c.val | Sum.inr i => ((timeSlice c).symm A x).ofLp i All goals completed! 🐙

A.5. The action on the space-time derivatives

Given a ElectromagneticPotential A^μ, we can consider its derivative ∂_μ A^ν. Under a Lorentz transformation Λ, this transforms as ∂_ μ (Λ • A), we write an expression for this in terms of the tensor. ∂_ ρ A (Λ⁻¹ • x) κ.

d:μ:Fin 1 Fin dν:Fin 1 Fin dx:SpaceTime dΛ:(LorentzGroup d)A:ElectromagneticPotential dhA:Differentiable A.valρ:Fin 1 Fin dx✝:ρ Finset.univ i, Λ⁻¹ ρ μ * (Λ ν i * ∂_ ρ A.val (Λ⁻¹ x) i) = x_1, Λ ν x_1 * Λ⁻¹ ρ μ * ∂_ ρ A.val (Λ⁻¹ x) x_1 d:μ:Fin 1 Fin dν:Fin 1 Fin dx:SpaceTime dΛ:(LorentzGroup d)A:ElectromagneticPotential dhA:Differentiable A.valρ:Fin 1 Fin dx✝¹:ρ Finset.univκ:Fin 1 Fin dx✝:κ Finset.univΛ⁻¹ ρ μ * (Λ ν κ * ∂_ ρ A.val (Λ⁻¹ x) κ) = Λ ν κ * Λ⁻¹ ρ μ * ∂_ ρ A.val (Λ⁻¹ x) κ All goals completed! 🐙

A.6. Variational adjoint derivative of component

We find the variational adjoint derivative of the components of the potential. This will be used to find e.g. the variational derivative of the kinetic term, and derive the equations of motion.

lemma hasVarAdjDerivAt_component {d : } (μ : Fin 1 Fin d) (A : SpaceTime d Lorentz.Vector d) (hA : ContDiff A) : HasVarAdjDerivAt (fun (A' : SpaceTime d Lorentz.Vector d) x => A' x μ) (fun (A' : SpaceTime d ) x => A' x Lorentz.Vector.basis μ) A := d:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff AHasVarAdjDerivAt (fun A' x => A' x μ) (fun A' x => A' x Lorentz.Vector.basis μ) A d:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μHasVarAdjDerivAt (fun A' x => A' x μ) (fun A' x => A' x Lorentz.Vector.basis μ) A d:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μHasVarAdjDerivAt (fun A' x => A' x μ) (fun A' x => A' x Lorentz.Vector.basis μ) A d:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μHasVarAdjDerivAt (fun A' x => f x (A' x)) (fun ψ x => f' x (A x) (ψ x)) A d:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μContDiff Ad:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μContDiff fd:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μ (x : SpaceTime d) (u : Lorentz.Vector d), HasAdjFDerivAt (f x) (f' x u) u d:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μContDiff A All goals completed! 🐙 d:μ:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μContDiff f All goals completed! 🐙 d:μ:Fin 1 Fin dA✝:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μx:SpaceTime dA:Lorentz.Vector dHasAdjFDerivAt (f x) (f' x A) A d:μ:Fin 1 Fin dA✝:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μx:SpaceTime dA:Lorentz.Vector dDifferentiableAt (f x) Ad:μ:Fin 1 Fin dA✝:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μx:SpaceTime dA:Lorentz.Vector dHasAdjoint (⇑(fderiv (f x) A)) (f' x A) d:μ:Fin 1 Fin dA✝:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μx:SpaceTime dA:Lorentz.Vector dDifferentiableAt (f x) A All goals completed! 🐙 d:μ:Fin 1 Fin dA✝:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μx:SpaceTime dA:Lorentz.Vector d (x_1 : Lorentz.Vector d) (y : ), Inner.inner (f' x A y) x_1 = Inner.inner y ((fderiv (f x) A) x_1) d:μ:Fin 1 Fin dA✝:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μx:SpaceTime dA:Lorentz.Vector du:Lorentz.Vector dv:Inner.inner (f' x A v) u = Inner.inner v ((fderiv (f x) A) u) d:μ:Fin 1 Fin dA✝:SpaceTime d Lorentz.Vector dhA:ContDiff Af:SpaceTime d Lorentz.Vector d := fun x v => v μf':SpaceTime d Lorentz.Vector d Lorentz.Vector d := fun x x_1 c => c Lorentz.Vector.basis μx:SpaceTime dA:Lorentz.Vector du:Lorentz.Vector dv:v * u μ = u μ * v All goals completed! 🐙

A.7. Variational adjoint derivative of derivatives of the potential

We find the variational adjoint derivative of the derivatives of the components of the potential. This will again be used to find the variational derivative of the kinetic term, and derive the equations of motion (Maxwell's equations).

d:μ:Fin 1 Fin dν:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Ah0':HasVarAdjDerivAt (fun φ x => (fderiv (fun x => φ x ν) x) (Lorentz.Vector.basis μ)) (fun ψ x => (fun x' => -(fderiv ψ x') (Lorentz.Vector.basis μ)) x Lorentz.Vector.basis ν) Aφ:SpaceTime d Lorentz.Vector d:ContDiff φx:SpaceTime dDifferentiable φ exact .differentiable (d:μ:Fin 1 Fin dν:Fin 1 Fin dA:SpaceTime d Lorentz.Vector dhA:ContDiff Ah0':HasVarAdjDerivAt (fun φ x => (fderiv (fun x => φ x ν) x) (Lorentz.Vector.basis μ)) (fun ψ x => (fun x' => -(fderiv ψ x') (Lorentz.Vector.basis μ)) x Lorentz.Vector.basis ν) Aφ:SpaceTime d Lorentz.Vector d:ContDiff φx:SpaceTime d 0 All goals completed! 🐙)

B. The derivative tensor of the electromagnetic potential

We define the derivative as a tensor in Lorentz.CoVector ⊗[ℝ] Lorentz.Vector for the electromagnetic potential A^μ. We then prove that this tensor transforms correctly under Lorentz transformations.

d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime de:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)μ:Fin 1 Fin dx✝¹:μ Finset.univν:Fin 1 Fin dx✝:ν Finset.univTensorial.toTensor.symm ((basis ![Color.down]) (Lorentz.CoVector.indexEquiv.symm μ)) ⊗ₜ[] Tensorial.toTensor.symm ((basis ![Color.up]) (Lorentz.Vector.indexEquiv.symm ν)) = ((((basis ![Color.down]).map Tensorial.toTensor.symm).tensorProduct ((basis ![Color.up]).map Tensorial.toTensor.symm)).reindex ComponentIdx.prod.symm) (e.symm (μ, ν)) All goals completed! 🐙

B.1. Equivariance of the derivative tensor

We show that the derivative tensor is equivariant under the action of the Lorentz group. That is, ∂_μ (fun x => Λ • A (Λ⁻¹ • x)) = Λ • (∂_μ A (Λ⁻¹ • x)), or in words: applying the Lorentz transformation to the potential and then taking the derivative is the same as taking the derivative and then applying the Lorentz transformation to the resulting tensor.

d:x:SpaceTime dA:ElectromagneticPotential dΛ:(LorentzGroup d)hf:Differentiable A.valDifferentiable A.vald:x:SpaceTime dA:ElectromagneticPotential dΛ:(LorentzGroup d)hf:Differentiable A.valDifferentiable A.vald:x:SpaceTime dA:ElectromagneticPotential dΛ:(LorentzGroup d)hf:Differentiable A.valDifferentiable (Λ A).val all_goals All goals completed! 🐙

B.2. The elements of the derivative tensor in terms of the basis

We show that in the standard basis, the elements of the derivative tensor are just equal to ∂_ μ A x ν.

Evaluation of the tensor components of ∂_ μ A x ν.

d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e((match Fin.append ![Color.down] ![Color.up] 0 with | Color.up => Lorentz.contrBasis d | Color.down => Lorentz.coBasis d).repr (Pure.basisVector (Fin.append ![Color.down] ![Color.up]) b 0)) μ * ((Lorentz.contrBasis d).repr ((Lorentz.contrBasis d) (b 1))) ν = ((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (toTensor.symm (Pure.basisVector (Fin.append ![Color.down] ![Color.up]) b).toTensor)) (μ, ν) d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0 d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:b 0 = μ(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:¬b 0 = μ(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0 d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:b 0 = μ(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:¬b 0 = μ(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0 d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:¬b 0 = μ:b 1 = ν(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:¬b 0 = μ:¬b 1 = ν(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0 d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:b 0 = μ:b 1 = ν(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:b 0 = μ:¬b 1 = ν(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:¬b 0 = μ:b 1 = ν(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin db:ComponentIdx (Fin.append ![Color.down] ![Color.up])e:ComponentIdx (Fin.append ![Color.down] ![Color.up]) (Fin 1 Fin d) × (Fin 1 Fin d) := ComponentIdx.prod.trans (Lorentz.CoVector.indexEquiv.prodCongr Lorentz.Vector.indexEquiv)h1:Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis = ((basis (Fin.append ![Color.down] ![Color.up])).map toTensor.symm).reindex e:¬b 0 = μ:¬b 1 = ν(if b 1 = ν then if b 0 = μ then 1 else 0 else 0) = if b = e.symm (μ, ν) then 1 else 0 All goals completed! 🐙 d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin dtoField ((evalT 0 ν) ((evalT 0 μ) (toTensor (toTensor.symm 0)))) = ((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (toTensor.symm 0)) (μ, ν) All goals completed! 🐙 d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin da:t:(realLorentzTensor d).Tensor (Fin.append ![Color.down] ![Color.up])h:toField ((evalT 0 ν) ((evalT 0 μ) (toTensor (toTensor.symm t)))) = ((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (toTensor.symm t)) (μ, ν)toField ((evalT 0 ν) ((evalT 0 μ) (toTensor (toTensor.symm (a t))))) = ((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (toTensor.symm (a t))) (μ, ν) All goals completed! 🐙 d:A:ElectromagneticPotential dhA:Differentiable A.valx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin dt1:(realLorentzTensor d).Tensor (Fin.append ![Color.down] ![Color.up])t2:(realLorentzTensor d).Tensor (Fin.append ![Color.down] ![Color.up])h1:toField ((evalT 0 ν) ((evalT 0 μ) (toTensor (toTensor.symm t1)))) = ((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (toTensor.symm t1)) (μ, ν)h2:toField ((evalT 0 ν) ((evalT 0 μ) (toTensor (toTensor.symm t2)))) = ((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (toTensor.symm t2)) (μ, ν)toField ((evalT 0 ν) ((evalT 0 μ) (toTensor (toTensor.symm (t1 + t2))))) = ((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (toTensor.symm (t1 + t2))) (μ, ν) All goals completed! 🐙
@[simp] lemma deriv_basis_repr_apply {d} {μν : (Fin 1 Fin d) × (Fin 1 Fin d)} (A : ElectromagneticPotential d) (x : SpaceTime d) : (Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (deriv A x) μν = ∂_ μν.1 A x μν.2 := d:μν:(Fin 1 Fin d) × (Fin 1 Fin d)A:ElectromagneticPotential dx:SpaceTime d((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (A.deriv x)) μν = ∂_ μν.1 A.val x μν.2 d:A:ElectromagneticPotential dx:SpaceTime dμ:Fin 1 Fin dν:Fin 1 Fin d((Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).repr (A.deriv x)) (μ, ν) = ∂_ (μ, ν).1 A.val x (μ, ν).2 All goals completed! 🐙d:A:ElectromagneticPotential dx:SpaceTime db:ComponentIdx (Fin.append ![Color.down] ![Color.up])hb:(Lorentz.CoVector.basis.reindex Lorentz.CoVector.indexEquiv.symm).tensorProduct (Lorentz.Vector.basis.reindex Lorentz.Vector.indexEquiv.symm) = (Lorentz.CoVector.basis.tensorProduct Lorentz.Vector.basis).reindex (Lorentz.CoVector.indexEquiv.symm.prodCongr Lorentz.Vector.indexEquiv.symm)∂_ ((Lorentz.CoVector.indexEquiv.symm.prodCongr Lorentz.Vector.indexEquiv.symm).symm (ComponentIdx.prod b)).1 A.val x ((Lorentz.CoVector.indexEquiv.symm.prodCongr Lorentz.Vector.indexEquiv.symm).symm (ComponentIdx.prod b)).2 = ∂_ (b 0) A.val x (b 1) All goals completed! 🐙