Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Minkowski and Schwarzschild metrics in coordinates

Definition
efe_metrics

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

differential-geometrygeneral-relativitymathematical-physics

Two concrete metrics in the coordinate framework of efe_geometry.

The Minkowski metric of flat spacetime in inertial coordinates is the constant diagonal metric diag⁡(−1,1,1,1)\operatorname{diag}(-1, 1, 1, 1)diag(−1,1,1,1), of signature (−,+,+,+)(-,+,+,+)(−,+,+,+).

The Schwarzschild metric of mass MMM, in Schwarzschild coordinates x=(t,r,θ,φ)x = (t, r, \theta, \varphi)x=(t,r,θ,φ) and geometrized units G=c=1G = c = 1G=c=1, is the diagonal metric

g  =  diag⁡ ⁣(−(1−2Mr),  (1−2Mr)−1,  r2,  r2sin⁡2θ),g \;=\; \operatorname{diag}\!\left(-\left(1-\frac{2M}{r}\right),\; \left(1-\frac{2M}{r}\right)^{-1},\; r^{2},\; r^{2}\sin^{2}\theta\right),g=diag(−(1−r2M​),(1−r2M​)−1,r2,r2sin2θ),

where r=x1r = x^1r=x1 and θ=x2\theta = x^2θ=x2.

Its exterior region is the set of coordinate points with r>2Mr > 2Mr>2M and 0<θ<π0 < \theta < \pi0<θ<π: outside the horizon, and away from the coordinate poles where the angular part of the chart degenerates. On this region the four component functions are smooth and the metric matrix is invertible, which is what makes the curvature quantities of efe_geometry meaningful there.

Definition code
import Definitions.Def_efe_geometry

namespace EinsteinFieldEquations

/-- The Minkowski metric of flat spacetime in inertial coordinates, with signature
`(−, +, +, +)`. -/
noncomputable def minkowski : Tensor2Field := fun _ =>
  Matrix.diagonal ![-1, 1, 1, 1]

/-- The Schwarzschild metric of mass `M` in Schwarzschild coordinates
`x = (t, r, θ, φ)`, in geometrized units `G = c = 1` and signature `(−, +, +, +)`:
`diag(−(1 − 2M/r), (1 − 2M/r)⁻¹, r², r² sin²θ)`. -/
noncomputable def schwarzschild (M : ℝ) : Tensor2Field := fun x =>
  Matrix.diagonal ![-(1 - 2 * M / x 1), (1 - 2 * M / x 1)⁻¹, (x 1) ^ 2,
    (x 1) ^ 2 * Real.sin (x 2) ^ 2]

/-- The Schwarzschild exterior region in Schwarzschild coordinates: the radial coordinate is
outside the horizon, `r > 2M`, and the polar angle avoids the coordinate poles, `0 < θ < π`. -/
def SchwarzschildExterior (M : ℝ) (x : Coord) : Prop :=
  2 * M < x 1 ∧ 0 < x 2 ∧ x 2 < Real.pi

end EinsteinFieldEquations
Source
Wikipedia, "Einstein field equations", https://en.wikipedia.org/wiki/Einstein_field_equations (section "Vacuum field equations"); Wikipedia, "General relativity", https://en.wikipedia.org/wiki/General_relativity (section "Solutions — the Schwarzschild solution")
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Provenance note — this read-back is NOT independent testimony. It is non-blind: it was written by the same agent that drafted the Lean statements and the mission, at the explicit instruction of the proposal's owner, and not by an independent auditor kept blind to the intended meaning. The author knew the source material and the intended statement while writing it, so it cannot play the cross-checking role a blind read-back is meant to play, and no reviewer should treat it as independent confirmation that the formalization is faithful.

This file defines two tensor fields and one predicate, in the coordinate setting of the accompanying geometry file (a point is a quadruple of reals x=(x0,x1,x2,x3)x = (x_0,x_1,x_2,x_3)x=(x0​,x1​,x2​,x3​), and a tensor field assigns a real 4×44\times44×4 matrix to each point).

First field. The constant field whose value at every point is the diagonal matrix with diagonal entries (−1,1,1,1)(-1, 1, 1, 1)(−1,1,1,1) in index order 0,1,2,30,1,2,30,1,2,3, and zero off the diagonal. It does not depend on the point.

Second field. For a real parameter MMM — with no sign or positivity restriction — the field whose value at the point xxx is the diagonal matrix with diagonal entries, in index order 0,1,2,30,1,2,30,1,2,3,

−(1−2Mx1),(1−2Mx1)−1,x1 2,x1 2 sin⁡2(x2),-\left(1 - \frac{2M}{x_1}\right), \qquad \left(1 - \frac{2M}{x_1}\right)^{-1}, \qquad x_1^{\,2}, \qquad x_1^{\,2}\,\sin^{2}(x_2),−(1−x1​2M​),(1−x1​2M​)−1,x12​,x12​sin2(x2​),

and zero off the diagonal. Only the second and third coordinates of xxx occur; the value is independent of x0x_0x0​ and x3x_3x3​. Both occurrences of division are total: if x1=0x_1 = 0x1​=0 then 2M/x1=02M/x_1 = 02M/x1​=0, so the first entry is −1-1−1 and the second is 111; if 1−2M/x1=01 - 2M/x_1 = 01−2M/x1​=0 then its reciprocal is 000, so the matrix is singular there. Nothing in the definition excludes these degenerate points.

Predicate. For a real MMM and a point xxx, the stated condition is the conjunction of three strict inequalities:

2M<x1,0<x2,x2<π.2M < x_1, \qquad 0 < x_2, \qquad x_2 < \pi .2M<x1​,0<x2​,x2​<π.

It constrains only the second and third coordinates; x0x_0x0​ and x3x_3x3​ are unconstrained, and MMM itself is not required to be positive — for M≤0M \le 0M≤0 the condition 2M<x12M < x_12M<x1​ admits points with x1≤0x_1 \le 0x1​≤0, including x1=0x_1 = 0x1​=0 when M<0M < 0M<0. On points satisfying the three inequalities together with M>0M > 0M>0 one has x1>2M>0x_1 > 2M > 0x1​>2M>0 and 0<sin⁡(x2)0 < \sin(x_2)0<sin(x2​), so the four diagonal entries above are respectively negative, positive, positive and positive, and the matrix is invertible; the predicate alone, without M>0M > 0M>0, does not guarantee this.

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