Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

PhysLib coordinate Maxwell stress-energy

Definition
PhyslibCoordinateMaxwellStressEnergy

by scuba8684 · Nov 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

general-relativityphyslib-exact-spacetimes

The electromagnetic stress-energy tensor formed from a coordinate metric and a field-strength tensor, including its Gaussian-unit normalization by 1/(4π)1/(4\pi)1/(4π).

Definition code
import Definitions.Def_PhyslibCoordinateCurvatureExtensions
import Definitions.Def_PhyslibCoordinateGeometry
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.Real.Basic
import Mathlib.Data.Set.Basic
import Mathlib.LinearAlgebra.Matrix.Symmetric
import Mathlib.Tactic.Ring

section

/-
Copyright (c) 2026 Alex Vergara Gil. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Alex Vergara Gil
-/


/-!

# Electromagnetic field-strength invariant and Maxwell stress-energy

Shared 4D electromagnetic stress-energy tensor `T^{EM}_{ab}`, its quadratic field invariant
`F_{ab} F^{ab}`, and a single proof of conformal tracelessness `g^{ab} T^{EM}_{ab} = 0`.

## i. Overview

In four spacetime dimensions, classical electromagnetism has stress-energy tensor
`T^{EM}_{ab} = g^{cd} F_{ac} F_{bd} - ¼ g_{ab} F_{cd} F^{cd}` in Heaviside–Lorentz units
(Gaussian units include an overall `1 / (4 π)` prefactor). Contraction with the inverse metric
`g^{ab}` yields the conformal trace identity `g^{ab} T^{EM}_{ab} = 0`, a hallmark of classical
scale invariance in four dimensions that underlies vanishing scalar curvature `R = 0` for
electrovacuum solutions such as Reissner–Nordström spacetime and the Einstein–Maxwell sector of
Kaluza–Klein reduction.

## ii. Key results

- `maxwellFieldInvariant`, `metricTrace_maxwellQuad` : quadratic field-strength invariant
  `F_{ab} F^{ab}` and contraction of the quadratic term `g^{cd} F_{ac} F_{bd}`.
- `maxwellStressEnergy`, `maxwellStressEnergy_trace_zero` : Heaviside–Lorentz Maxwell stress-energy
  tensor in 4D and its conformal tracelessness `g^{ab} T^{EM}_{ab} = 0`.
- `maxwellStressEnergyGaussian` : the same tensor in Gaussian-cgs units, `1 / (4 π)` times the
  Heaviside–Lorentz one.

## iii. Table of contents

- A. Maxwell stress-energy and conformal tracelessness
- B. Gaussian-unit stress-energy

## iv. References

* R. M. Wald, *General Relativity* (1984), Ch. 4 (Sec. 4.3). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 3 & Ch. 5.
  [ref: mtw_1973_gravitation]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 4
  (https://arxiv.org/pdf/gr-qc/9712019#page=109). [ref: Carroll1997]
-/


namespace GeneralRelativity

/-!

## A. Maxwell stress-energy and conformal tracelessness

The electromagnetic field strength contracts with the inverse metric to form the Lorentz-invariant
scalar `F_{ab} F^{ab}` and the symmetric, trace-free 4D Maxwell stress-energy tensor.

-/

/-- Electromagnetic field-strength quadratic invariant `F_{ab} F^{ab} = g^{ac} g^{bd}
F_{ab} F_{cd}`. -/
def maxwellFieldInvariant {n : ℕ} (M : MetricTensor n) (F : Tensor2 n) : ℝ :=
  ∑ a, ∑ b, ∑ c, ∑ d, M.ginv a c * M.ginv b d * F a b * F c d



/-- Four-dimensional electromagnetic stress-energy tensor in Heaviside–Lorentz units:
`T^{EM}_{ab} = g^{cd} F_{ac} F_{bd} - ¼ g_{ab} F_{cd} F^{cd}` (multiply by `1 / (4 π)` for
Gaussian units). -/
noncomputable def maxwellStressEnergy (M : MetricTensor 4) (F : Tensor2 4) : Tensor2 4 :=
  fun a b =>
    (∑ c : Fin 4, ∑ d : Fin 4, M.ginv c d * F a c * F b d) -
      (1 / 4) * M.g a b * maxwellFieldInvariant M F



/-!

## B. Gaussian-unit stress-energy

Gaussian-cgs (and geometrized) unit conventions carry an overall `1 / (4 π)` relative to the
Heaviside–Lorentz tensor used above.

-/

/-- Electromagnetic stress-energy tensor `T^{EM}_{ij} = (1 / (4π)) (F_{ik} F_j{}^k - (1/4) g_{ij}
F_{ab} F^{ab})` in Gaussian-cgs/geometrized units (`G = c = 1`). -/
noncomputable def maxwellStressEnergyGaussian (M : MetricTensor 4) (F : Tensor2 4) :
    Tensor2 4 :=
  fun i j => (1 / (4 * Real.pi)) * maxwellStressEnergy M F i j



end GeneralRelativity

end
Source
https://github.com/BishopWolf/physlib/blob/8046e2b0cb30f5fa25306a69ff29e91ab5711f6b/PhyslibAlpha/Relativity/Tensors/MaxwellStressEnergy.lean

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me