Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Special-relativistic kinematics for mass–energy equivalence: Lorentz factor, relativistic energy, momentum and mass, rest and kinetic energy, invariant mass, boosts

Definition
MassEnergyEquivalence_Defs

by Lucas · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

mathematical-physicsspecial-relativity

Basic objects of special-relativistic kinematics with an explicit speed of light ccc, as used in the article Mass–energy equivalence.

Velocities and momenta are vectors in R3\mathbb R^3R3 with the Euclidean norm ∣⋅∣|\cdot|∣⋅∣; the coordinates are indexed 1,2,31,2,31,2,3 here (0,1,20,1,20,1,2 in Lean). For a speed of light ccc, a rest mass mmm and a velocity v∈R3\mathbf v\in\mathbb R^3v∈R3:

  1. Lorentz factor γ(v)=11−∣v∣2/c2\gamma(\mathbf v) = \dfrac{1}{\sqrt{1-|\mathbf v|^2/c^2}}γ(v)=1−∣v∣2/c2​1​.
  2. Relativistic energy Erel=γmc2E_{\mathrm{rel}} = \gamma m c^2Erel​=γmc2.
  3. Relativistic momentum p=γm v\mathbf p = \gamma m\,\mathbf vp=γmv.
  4. Rest energy E0=mc2E_0 = mc^2E0​=mc2.
  5. Kinetic energy Ek=Erel−mc2=mc2(γ−1)E_k = E_{\mathrm{rel}} - mc^2 = mc^2(\gamma-1)Ek​=Erel​−mc2=mc2(γ−1).
  6. Relativistic mass mrel=Erel/c2m_{\mathrm{rel}} = E_{\mathrm{rel}}/c^2mrel​=Erel​/c2.
  7. Invariant mass of a finite system of free particles i∈si\in si∈s with rest masses mim_imi​ and velocities vi\mathbf v_ivi​:
M=1c2(∑i∈sEi)2−c2∣∑i∈spi∣2,M = \frac{1}{c^2}\sqrt{\Big(\sum_{i\in s} E_i\Big)^2 - c^2\Big|\sum_{i\in s}\mathbf p_i\Big|^2},M=c21​(i∈s∑​Ei​)2−c2​i∈s∑​pi​​2​,

where EiE_iEi​, pi\mathbf p_ipi​ are the relativistic energy and momentum of particle iii; i.e. MMM is the total energy divided by c2c^2c2 in the centre-of-momentum frame. 8. Lorentz boost with speed uuu along the first axis, γu=1/1−u2/c2\gamma_u = 1/\sqrt{1-u^2/c^2}γu​=1/1−u2/c2​, acting on an energy–momentum pair (E,p)(E,\mathbf p)(E,p):

E′=γu (E−u p1),p′=(γu(p1−uEc2), p2, p3).E' = \gamma_u\,(E - u\,p_1),\qquad \mathbf p' = \Big(\gamma_u\big(p_1 - \tfrac{uE}{c^2}\big),\ p_2,\ p_3\Big).E′=γu​(E−up1​),p′=(γu​(p1​−c2uE​), p2​, p3​).

These are the objects in terms of which the article states E=mc2E=mc^2E=mc2, its extension Erel2−(pc)2=(m0c2)2E_{\mathrm{rel}}^2-(pc)^2=(m_0c^2)^2Erel2​−(pc)2=(m0​c2)2 to moving systems, the low-speed expansion, and the invariance of rest/invariant mass.

Formalization Note R3\mathbb R^3R3 is EuclideanSpace ℝ (Fin 3). All quantities are total functions: when 1−∣v∣2/c2≤01-|\mathbf v|^2/c^2\le 01−∣v∣2/c2≤0 (or 1−u2/c2≤01-u^2/c^2\le01−u2/c2≤0) the square root returns the junk value 000, hence γ=0\gamma=0γ=0; every theorem of the mission therefore assumes c>0c>0c>0 and ∣v∣<c|\mathbf v|<c∣v∣<c (resp. ∣u∣<c|u|<c∣u∣<c). For c=0c=0c=0 the divisions by c2c^2c2 return 000. Inside the invariant-mass square root a negative argument would give 000; for physical data (mi≥0m_i\ge0mi​≥0, ∣vi∣<c|\mathbf v_i|<c∣vi​∣<c) the argument is non-negative.

Definition code
import Mathlib

namespace MassEnergyEquivalence

/-- Three-dimensional Euclidean space `ℝ³`, the space of velocities and momenta. -/
abbrev Vec3 : Type := EuclideanSpace ℝ (Fin 3)

/-- The Lorentz factor `γ = 1 / √(1 - ‖v‖² / c²)` of a velocity `v ∈ ℝ³`, where `c` is the
speed of light.  For `‖v‖ ≥ c` the square root is the junk value `0` and so is `γ`. -/
noncomputable def lorentzFactor (c : ℝ) (v : Vec3) : ℝ :=
  1 / Real.sqrt (1 - ‖v‖ ^ 2 / c ^ 2)

/-- The relativistic energy `E_rel = γ m c²` of a body of rest mass `m` moving with
velocity `v`. -/
noncomputable def relEnergy (c m : ℝ) (v : Vec3) : ℝ :=
  lorentzFactor c v * m * c ^ 2

/-- The relativistic momentum `p = γ m v` of a body of rest mass `m` moving with velocity `v`. -/
noncomputable def relMomentum (c m : ℝ) (v : Vec3) : Vec3 :=
  (lorentzFactor c v * m) • v

/-- The rest energy `E₀ = m c²` of a body of rest mass `m`. -/
noncomputable def restEnergy (c m : ℝ) : ℝ :=
  m * c ^ 2

/-- The relativistic kinetic energy `E_k = E_rel - m c² = m c² (γ - 1)`. -/
noncomputable def kineticEnergy (c m : ℝ) (v : Vec3) : ℝ :=
  relEnergy c m v - restEnergy c m

/-- The relativistic mass `m_rel = E_rel / c²`. -/
noncomputable def relMass (c m : ℝ) (v : Vec3) : ℝ :=
  relEnergy c m v / c ^ 2

/-- The invariant mass `M` of a finite system of free particles indexed by `s`, particle `i`
having rest mass `m i` and velocity `v i`:
`M = √((Σ E_i)² - c² ‖Σ p_i‖²) / c²`. -/
noncomputable def invariantMass {ι : Type*} (s : Finset ι) (c : ℝ) (m : ι → ℝ)
    (v : ι → Vec3) : ℝ :=
  Real.sqrt ((∑ i ∈ s, relEnergy c (m i) (v i)) ^ 2
      - c ^ 2 * ‖∑ i ∈ s, relMomentum c (m i) (v i)‖ ^ 2) / c ^ 2

/-- The Lorentz factor `γ_u = 1 / √(1 - u² / c²)` of a boost with speed `u` along the
first coordinate axis. -/
noncomputable def boostFactor (c u : ℝ) : ℝ :=
  1 / Real.sqrt (1 - u ^ 2 / c ^ 2)

/-- Energy measured in a frame moving with speed `u` along the first coordinate axis:
`E' = γ_u (E - u p₁)`. -/
noncomputable def boostEnergy (c u E : ℝ) (p : Vec3) : ℝ :=
  boostFactor c u * (E - u * p 0)

/-- Momentum measured in a frame moving with speed `u` along the first coordinate axis:
`p' = (γ_u (p₁ - u E / c²), p₂, p₃)`. -/
noncomputable def boostMomentum (c u E : ℝ) (p : Vec3) : Vec3 :=
  !₂[boostFactor c u * (p 0 - u * E / c ^ 2), p 1, p 2]

end MassEnergyEquivalence
Source
Wikipedia, *Mass–energy equivalence*, https://en.wikipedia.org/wiki/Mass%E2%80%93energy_equivalence (PDF snapshot supplied by the proposer, 25 pp.): lead section and §The formula (E=mc2E=mc^2E=mc2, rest frame); §Mass in special relativity and §Relativistic mass (p. 2) (mrel=E/c2m_{\mathrm{rel}}=E/c^2mrel​=E/c2, rest/invariant mass); §Composite systems (p. 3) (invariant mass, centre-of-momentum frame); §Extension for systems in motion (pp. 5–6) (ErelE_{\mathrm{rel}}Erel​, p\mathbf pp); §Low-speed approximation (p. 6) (Lorentz factor γ\gammaγ, E=γmc2E=\gamma mc^2E=γmc2); §History → Mass–velocity relationship (pp. 10–11) (Ek=m0c2(γ−1)E_k = m_0c^2(\gamma-1)Ek​=m0​c2(γ−1)).
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic) — same agent as the drafter; non-blind

Disclosure — this is NOT a blind read-back. It was written by the same agent (Aristotle, by Harmonic) that drafted this Lean statement, with full knowledge of the source material and of the intended meaning. It is not independent testimony and must not be mistaken for an independent audit; it was produced and uploaded at the proposer's explicit request. An independent, blind read-back is still recommended before the proposal is submitted.

The file introduces, in a namespace MassEnergyEquivalence, the following objects. Throughout, R3\mathbb R^3R3 denotes three-dimensional Euclidean space with norm ∣⋅∣|\cdot|∣⋅∣ and coordinates x1,x2,x3x_1,x_2,x_3x1​,x2​,x3​ (Lean indices 0,1,20,1,20,1,2); ccc, mmm, uuu, EEE are arbitrary real numbers (the definitions impose no sign conditions). ⋅\sqrt{\cdot}⋅​ is the real square root, which returns 000 on negative inputs, and division by 000 returns 000.

  1. γc(v)=1/1−∣v∣2/c2\gamma_c(\mathbf v) = 1/\sqrt{1-|\mathbf v|^2/c^2}γc​(v)=1/1−∣v∣2/c2​ for v∈R3\mathbf v\in\mathbb R^3v∈R3. It equals 000 whenever 1−∣v∣2/c2≤01-|\mathbf v|^2/c^2\le 01−∣v∣2/c2≤0 (e.g. c≠0c\ne0c=0 and ∣v∣≥∣c∣|\mathbf v|\ge|c|∣v∣≥∣c∣); if c=0c=0c=0 then ∣v∣2/c2=0|\mathbf v|^2/c^2 = 0∣v∣2/c2=0 and γ0(v)=1\gamma_0(\mathbf v)=1γ0​(v)=1.
  2. Erel(c,m,v)=γc(v) m c2E_{\mathrm{rel}}(c,m,\mathbf v) = \gamma_c(\mathbf v)\, m\, c^2Erel​(c,m,v)=γc​(v)mc2.
  3. p(c,m,v)=(γc(v) m) v∈R3\mathbf p(c,m,\mathbf v) = \big(\gamma_c(\mathbf v)\, m\big)\,\mathbf v\in\mathbb R^3p(c,m,v)=(γc​(v)m)v∈R3.
  4. E0(c,m)=mc2E_0(c,m) = m c^2E0​(c,m)=mc2.
  5. Ek(c,m,v)=Erel(c,m,v)−mc2E_k(c,m,\mathbf v) = E_{\mathrm{rel}}(c,m,\mathbf v) - m c^2Ek​(c,m,v)=Erel​(c,m,v)−mc2.
  6. mrel(c,m,v)=Erel(c,m,v)/c2m_{\mathrm{rel}}(c,m,\mathbf v) = E_{\mathrm{rel}}(c,m,\mathbf v)/c^2mrel​(c,m,v)=Erel​(c,m,v)/c2 (equal to 000 when c=0c=0c=0).
  7. For a type ι\iotaι, a finite set s⊆ιs\subseteq\iotas⊆ι, masses m:ι→Rm:\iota\to\mathbb Rm:ι→R and velocities v:ι→R3\mathbf v:\iota\to\mathbb R^3v:ι→R3:
M(s,c,m,v)=1c2(∑i∈sErel(c,mi,vi))2−c2∣∑i∈sp(c,mi,vi)∣2,M(s,c,m,\mathbf v) = \frac{1}{c^2}\sqrt{\Big(\sum_{i\in s}E_{\mathrm{rel}}(c,m_i,\mathbf v_i)\Big)^2 - c^2\Big|\sum_{i\in s}\mathbf p(c,m_i,\mathbf v_i)\Big|^2},M(s,c,m,v)=c21​(i∈s∑​Erel​(c,mi​,vi​))2−c2​i∈s∑​p(c,mi​,vi​)​2​,

with the same truncated square root (a negative radicand gives M=0M=0M=0). For s=∅s=\emptysets=∅ the sums are 000 and M=0M=0M=0. 8. γu=1/1−u2/c2\gamma_u = 1/\sqrt{1-u^2/c^2}γu​=1/1−u2/c2​ (same conventions), and for E∈RE\in\mathbb RE∈R, p=(p1,p2,p3)∈R3\mathbf p=(p_1,p_2,p_3)\in\mathbb R^3p=(p1​,p2​,p3​)∈R3:

E′(c,u,E,p)=γu (E−up1),p′(c,u,E,p)=(γu (p1−uE/c2), p2, p3)∈R3.E'(c,u,E,\mathbf p) = \gamma_u\,(E - u p_1),\qquad \mathbf p'(c,u,E,\mathbf p) = \big(\gamma_u\,(p_1 - uE/c^2),\ p_2,\ p_3\big)\in\mathbb R^3.E′(c,u,E,p)=γu​(E−up1​),p′(c,u,E,p)=(γu​(p1​−uE/c2), p2​, p3​)∈R3.

The file contains no hypotheses, axioms or theorems; all objects are plain (noncomputable) definitions.

Human review
  • Endorsed by Shuze Chen · Oct 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 10, 2026

    Confirmed by the mission captain (proposal self-audit).

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