Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Dirac matrices: the Clifford relation, the Dirac basis, and the pairing ψˉMχ\bar\psi M \chiψˉ​Mχ

Definition
QED_dirac_algebra

by LG · Sep 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

differential-equationselectrodynamicsmathematical-physicsquantum-field-theory

The algebraic layer. A family γ=(γ0,γ1,γ2,γ3)\gamma=(\gamma^0,\gamma^1,\gamma^2,\gamma^3)γ=(γ0,γ1,γ2,γ3) of complex 4×44\times44×4 matrices is a Dirac representation for the metric η=diag(1,−1,−1,−1)\eta=\mathrm{diag}(1,-1,-1,-1)η=diag(1,−1,−1,−1) when it satisfies the Clifford anticommutation relation

γμγν+γνγμ=2ημνI4\gamma^\mu\gamma^\nu+\gamma^\nu\gamma^\mu=2\eta^{\mu\nu}I_4γμγν+γνγμ=2ημνI4​

together with the hermiticity relation (γμ)†=γ0γμγ0(\gamma^\mu)^\dagger=\gamma^0\gamma^\mu\gamma^0(γμ)†=γ0γμγ0, which says that γ0\gamma^0γ0 is hermitian and γ1,γ2,γ3\gamma^1,\gamma^2,\gamma^3γ1,γ2,γ3 are anti-hermitian. These two properties are exactly what the Dirac theory uses: the first makes the Dirac operator a square root of the wave operator, the second makes the Dirac adjoint behave correctly under conjugation.

The Dirac basis is the standard concrete solution of these relations, given explicitly. Finally, for a matrix MMM the Dirac pairing of two spinors is

φˉMχ=∑i,jφi‾ (γ0M)ij χj,\bar\varphi M\chi=\sum_{i,j}\overline{\varphi_i}\,(\gamma^0M)_{ij}\,\chi_j,φˉ​Mχ=i,j∑​φi​​(γ0M)ij​χj​,

i.e. φ†γ0Mχ\varphi^\dagger\gamma^0M\chiφ†γ0Mχ, the sesquilinear form through which every bilinear quantity of the theory — the current, the mass term, the kinetic term — is expressed.

Definition code
import Definitions.Def_QED_minkowski_spacetime

namespace QED

/-- `IsDiracRepresentation γ` says that the four complex `4 × 4` matrices
`γ 0, γ 1, γ 2, γ 3` are Dirac matrices for the metric `η` with signature
`(+, -, -, -)`:

* the Clifford (anticommutation) relation `γ^μ γ^ν + γ^ν γ^μ = 2 η^{μν} I₄`;
* the hermiticity relation `(γ^μ)† = γ^0 γ^μ γ^0`,
  i.e. `γ^0` is hermitian and `γ^1, γ^2, γ^3` are anti-hermitian. -/
def IsDiracRepresentation (γ : Fin 4 → Matrix (Fin 4) (Fin 4) ℂ) : Prop :=
  (∀ μ ν : Fin 4,
      γ μ * γ ν + γ ν * γ μ = (2 * (minkowski μ ν : ℂ)) • (1 : Matrix (Fin 4) (Fin 4) ℂ)) ∧
  (∀ μ : Fin 4, (γ μ).conjTranspose = γ 0 * γ μ * γ 0)

/-- The gamma matrices in the standard Dirac basis. -/
def diracGamma : Fin 4 → Matrix (Fin 4) (Fin 4) ℂ
  | ⟨0, _⟩ => !![1, 0, 0, 0; 0, 1, 0, 0; 0, 0, -1, 0; 0, 0, 0, -1]
  | ⟨1, _⟩ => !![0, 0, 0, 1; 0, 0, 1, 0; 0, -1, 0, 0; -1, 0, 0, 0]
  | ⟨2, _⟩ => !![0, 0, 0, -Complex.I; 0, 0, Complex.I, 0;
                 0, Complex.I, 0, 0; -Complex.I, 0, 0, 0]
  | ⟨3, _⟩ => !![0, 0, 1, 0; 0, 0, 0, -1; -1, 0, 0, 0; 0, 1, 0, 0]

/-- The Dirac adjoint pairing `ψ̄ M χ = ψ† γ^0 M χ` of two spinors, for a
`4 × 4` matrix `M` inserted between them. -/
def diracPairing (γ : Fin 4 → Matrix (Fin 4) (Fin 4) ℂ) (M : Matrix (Fin 4) (Fin 4) ℂ)
    (φ χ : Fin 4 → ℂ) : ℂ :=
  ∑ i : Fin 4, ∑ j : Fin 4, (starRingEnd ℂ) (φ i) * ((γ 0 * M) i j) * χ j

end QED
Source
Wikipedia, "Quantum electrodynamics", section "Mathematical formulation", subsections "QED action" and "Equations of motion" (QED Lagrangian, Dirac matrices, covariant derivative, field tensor, conserved current, Euler-Lagrange equations for psi and A, Lorenz-gauge wave equation). https://en.wikipedia.org/wiki/Quantum_electrodynamics
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) — same agent that drafted the statements; not an independent auditor

Provenance note — this read-back is NOT blind and NOT independent. It was written by the same agent that drafted the Lean statement it describes, not by a separate auditor working from the code alone. It is therefore self-testimony rather than independent testimony: any misreading made while drafting is likely to be repeated here, and this text cannot corroborate the faithfulness of the formalization. A reviewer who needs independent confirmation should commission a blind read-back from an auditor who has seen only the Lean code and none of the source material or drafting intent.

This bundle introduces one predicate, one explicit family of matrices, and one pairing. It asserts nothing: in particular it does not claim that the explicit family satisfies the predicate.

The predicate. For a family γ\gammaγ assigning to each index μ∈{0,1,2,3}\mu\in\{0,1,2,3\}μ∈{0,1,2,3} a complex 4×44\times44×4 matrix, IsDiracRepresentation(γ)\mathrm{IsDiracRepresentation}(\gamma)IsDiracRepresentation(γ) is the conjunction of two conditions:

(i)∀ μ,ν:γμγν+γνγμ  =  (2ημν) I4,(ii)∀ μ:(γμ)†  =  γ0γμγ0,\text{(i)}\quad \forall\,\mu,\nu:\quad \gamma^\mu\gamma^\nu+\gamma^\nu\gamma^\mu \;=\; \big(2\eta_{\mu\nu}\big)\, I_4, \qquad\qquad \text{(ii)}\quad \forall\,\mu:\quad (\gamma^\mu)^{\dagger} \;=\; \gamma^{0}\gamma^{\mu}\gamma^{0},(i)∀μ,ν:γμγν+γνγμ=(2ημν​)I4​,(ii)∀μ:(γμ)†=γ0γμγ0,

where juxtaposition is matrix multiplication, I4I_4I4​ is the identity matrix, ημν\eta_{\mu\nu}ημν​ is the real array diag(1,−1,−1,−1)\mathrm{diag}(1,-1,-1,-1)diag(1,−1,−1,−1) regarded as a complex scalar, (⋅)†(\cdot)^\dagger(⋅)† is the conjugate transpose, and γ0\gamma^0γ0 means the member of the family at index 000. Both conditions range over all index values, including μ=ν\mu=\nuμ=ν; at μ=ν=0\mu=\nu=0μ=ν=0 condition (i) reads 2(γ0)2=2I42(\gamma^0)^2=2I_42(γ0)2=2I4​ and at μ=ν=k∈{1,2,3}\mu=\nu=k\in\{1,2,3\}μ=ν=k∈{1,2,3} it reads 2(γk)2=−2I42(\gamma^k)^2=-2I_42(γk)2=−2I4​. Condition (ii) at μ=0\mu=0μ=0 reads (γ0)†=(γ0)3(\gamma^0)^\dagger=(\gamma^0)^3(γ0)†=(γ0)3. Nothing requires the matrices to be invertible, traceless, or linearly independent beyond what (i) and (ii) force, and nothing asserts that such a family exists.

The explicit family. diracGamma\mathrm{diracGamma}diracGamma assigns to the four index values the four matrices

γ0=(1000010000−10000−1),γ1=(000100100−100−1000),γ2=(000−i00i00i00−i000),γ3=(0010000−1−10000100),\gamma^0=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&-1&0\\0&0&0&-1\end{pmatrix},\quad \gamma^1=\begin{pmatrix}0&0&0&1\\0&0&1&0\\0&-1&0&0\\-1&0&0&0\end{pmatrix},\quad \gamma^2=\begin{pmatrix}0&0&0&-i\\0&0&i&0\\0&i&0&0\\-i&0&0&0\end{pmatrix},\quad \gamma^3=\begin{pmatrix}0&0&1&0\\0&0&0&-1\\-1&0&0&0\\0&1&0&0\end{pmatrix},γ0=​1000​0100​00−10​000−1​​,γ1=​000−1​00−10​0100​1000​​,γ2=​000−i​00i0​0i00​−i000​​,γ3=​00−10​0001​1000​0−100​​,

with entries in C\mathbb{C}C and iii the imaginary unit. The assignment is by case analysis on the numerical value of the index, and it is total: the four cases exhaust the index type.

The pairing. For a family γ\gammaγ, a complex 4×44\times44×4 matrix MMM and two vectors φ,χ∈C4\varphi,\chi\in\mathbb{C}^4φ,χ∈C4,

diracPairing(γ,M,φ,χ)  =  ∑i=03∑j=03φi‾ (γ0M)ij χj  ∈  C,\mathrm{diracPairing}(\gamma,M,\varphi,\chi) \;=\; \sum_{i=0}^{3}\sum_{j=0}^{3}\overline{\varphi_i}\,\big(\gamma^0 M\big)_{ij}\,\chi_j \;\in\;\mathbb{C},diracPairing(γ,M,φ,χ)=i=0∑3​j=0∑3​φi​​(γ0M)ij​χj​∈C,

the bar being complex conjugation and (γ0M)ij(\gamma^0M)_{ij}(γ0M)ij​ the (i,j)(i,j)(i,j) entry of the product of the family's zeroth member with MMM. The definition is conjugate-linear in φ\varphiφ and linear in χ\chiχ. No hypothesis is placed on γ\gammaγ here: the zeroth member is used whatever it is, so the pairing is defined even for families that are not Dirac representations.

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