Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

PhysLib Schwarzschild exterior and frame curvature

Definition
PhyslibSchwarzschildExteriorCoordinates

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

general-relativityphyslib-exact-spacetimes

The Schwarzschild coordinate metric, its specialization from Schwarzschild–de Sitter, and the orthonormal-frame Riemann tensor used to compute the curvature invariant.

Definition code
import Definitions.Def_PhyslibCoordinateCurvatureExtensions
import Definitions.Def_PhyslibCoordinateGeometry
import Definitions.Def_PhyslibSchwarzschildCoordinates
import Definitions.Def_PhyslibSchwarzschildDeSitterCoordinates
import Definitions.Def_PhyslibStaticSphericalCoordinates
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Algebra.Lie.Classical
import Mathlib.Analysis.Calculus.ContDiff.Deriv
import Mathlib.Analysis.Calculus.Deriv.Add
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.Deriv.Inv
import Mathlib.Analysis.Calculus.Deriv.Mul
import Mathlib.Analysis.Calculus.Deriv.Pow
import Mathlib.Analysis.Calculus.Deriv.Prod
import Mathlib.Analysis.Calculus.FDeriv.Symmetric
import Mathlib.Analysis.ODE.ExistUnique
import Mathlib.Analysis.SpecialFunctions.Sqrt
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.Real.Basic
import Mathlib.Data.Set.Basic
import Mathlib.LinearAlgebra.Matrix.Notation
import Mathlib.LinearAlgebra.Matrix.Symmetric
import Mathlib.Logic.Equiv.Fin.Basic
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.FinCases
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.LinearCombination
import Mathlib.Tactic.NoncommRing
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Positivity
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
-/


/-!

# Sum of squared orthonormal-frame curvature components

The sum `∑_{a,b,c,d} R_{abcd}²` of a four-dimensional Riemann tensor's orthonormal-frame
components, which reproduces the Kretschmann scalar under the stated conditions.

## i. Overview

The sum of squared orthonormal-frame components `∑_{a,b,c,d} R_{abcd}²` agrees with the Lorentzian
Kretschmann scalar when odd-time-index components vanish or in a Riemannian frame, so it is named
for what it sums rather than for that invariant.

## ii. Key results

- `RiemannTensor.frameSumOfSquares` : sum of squared orthonormal-frame curvature components.

## iii. Table of contents

- A. Sum of squared frame curvature components

## iv. References

* R. M. Wald, *General Relativity* (1984), Ch. 3 (Sec. 3.2). [ref: wald_1984_general_relativity]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 3 (Sec. 3.6)
  (https://arxiv.org/pdf/gr-qc/9712019#page=79). [ref: Carroll1997]
-/


namespace GeneralRelativity

namespace RiemannTensor

/-!

## A. Sum of squared frame curvature components

The frame sum squares each covariant component without raising indices, so it reproduces the
Lorentzian Kretschmann scalar only when the gravitomagnetic components vanish.

-/

/-- Sum of squared orthonormal-frame curvature components `∑_{a,b,c,d} R_{abcd}²`. In a Lorentzian
orthonormal frame of signature `(-, +, +, +)`, `R_{abcd} R^{abcd}` weights components with an odd
number of temporal indices by `-1`, so this expression coincides with the Lorentzian Kretschmann
scalar whenever odd-time-index (gravitomagnetic) components vanish (such as purely electric static
curvature), as well as in any Riemannian orthonormal frame. -/
noncomputable def frameSumOfSquares (R : RiemannTensor 4) : ℝ :=
  ∑ i, ∑ j, ∑ l, ∑ m, R.comp i j l m * R.comp i j l m

end RiemannTensor

end GeneralRelativity

end

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
-/


/-!

# Schwarzschild black hole spacetime

Exterior Schwarzschild black hole structure `SchwarzschildSpacetime`, its radial metric function
`f(r) = 1 - 2M/r`, radial Christoffel symbols, direct coordinate-level Riemann components, and
matching to the exterior of `IncompressibleSphere`.

## i. Overview

Starting from the line element `g = diag(-f, f⁻¹, r², r² sin²θ)` with radial metric function
`f = 1 - 2M/r`, where `M` is the mass of `S : SchwarzschildSpacetime`, this module views the metric
as a `StaticSpherical.StaticSphericalMetric`, computes radial derivatives of the metric and its static Newtonian
potential `Φ = -M/r`, and evaluates the radial Christoffel symbols `Γ^t_{tr}` and `Γ^r_{rr}`
from the metric components.

Note that this module uses the `(-, +, +, +)` signature (`g_tt = -f`), whereas
`IncompressibleSphere.gttOut` stores the positive factor `f = 1 - r_s / r` directly.

## ii. Key results

- `SchwarzschildSpacetime`, `SchwarzschildSpacetime.metricFn`,
  `SchwarzschildSpacetime.toStaticSpherical`, `SchwarzschildSpacetime.toCoordinateMetric`,
  `SchwarzschildSpacetime.metric`, `SchwarzschildSpacetime.metricInv` : Schwarzschild spacetime
  structure, metric function `1 - 2M / r`, and coordinate metric.
- `SchwarzschildSpacetime.ofIncompressibleSphere`,
  `SchwarzschildSpacetime.metricFn_ofIncompressibleSphere`,
  `SchwarzschildSpacetime.metric_tt_ofIncompressibleSphere`,
  `SchwarzschildSpacetime.metric_rr_ofIncompressibleSphere` : exterior matching with
  `IncompressibleSphere`.
- `SchwarzschildSpacetime.christoffelTtr_from_metric`,
  `SchwarzschildSpacetime.christoffelRrr_from_metric` : radial Christoffel symbols derived from
  the metric.

The coordinate Riemann, Ricci, scalar, and Einstein tensors are proved in
`Schwarzschild/CoordinateCurvature.lean` from `SchwarzschildSpacetime.toCoordinateMetric`.

## iii. Table of contents

- A. Metric function and radial Christoffel symbols
- B. Exterior matching with the incompressible sphere

## iv. References

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


namespace GeneralRelativity

namespace Schwarzschild

/-!

## A. Metric function and radial Christoffel symbols

From the Schwarzschild metric function `f = 1 - 2M/r` and diagonal inverse metric
`diag(-f⁻¹, f, r⁻², r⁻² sin⁻²θ)`, differentiating the radial metric components determines the mixed
Christoffel symbols `Γ^t_{tr}` and `Γ^r_{rr}`.

-/



namespace SchwarzschildSpacetime



/-- View a Schwarzschild spacetime as a `StaticSpherical.StaticSphericalMetric` with profile `S.metricFn`. -/
noncomputable def toStaticSpherical (S : SchwarzschildSpacetime) :
    StaticSpherical.StaticSphericalMetric :=
  ⟨S.metricFn⟩



/-- The Schwarzschild metric as a `CoordinateMetric 4` on the regular chart
`r ≠ 0`, `1 - 2M/r ≠ 0`, `sin θ ≠ 0`. -/
noncomputable def toCoordinateMetric (S : SchwarzschildSpacetime) : CoordinateMetric 4 :=
  S.toStaticSpherical.toCoordinateMetric

/-- The Schwarzschild metric in `(t, r, θ, φ)` coordinates with signature `(-, +, +, +)`. -/
noncomputable def metric (S : SchwarzschildSpacetime) (x : Fin 4 → ℝ) : Tensor2 4 :=
  S.toStaticSpherical.metric x

/-- The inverse of the Schwarzschild metric in `(t, r, θ, φ)` coordinates. -/
noncomputable def metricInv (S : SchwarzschildSpacetime) (x : Fin 4 → ℝ) : Tensor2 4 :=
  S.toStaticSpherical.metricInv x































/-!

## B. Exterior matching with the incompressible sphere

Matching the exterior mass `M = r_s / 2` to the constant-density sphere connects the point-mass
Schwarzschild geometry to the uniform-density stellar interior. The Riemann, Ricci, scalar, and
Einstein tensors are computed from the coordinate metric in `Schwarzschild/CoordinateCurvature.lean`.

-/









end SchwarzschildSpacetime

end Schwarzschild

end GeneralRelativity

end

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
-/


/-!

# Schwarzschild curvature in the orthonormal frame

The Schwarzschild Weyl tensor, Ricci flatness, Kretschmann scalar, and Newtonian tidal potential
in the orthonormal frame `(t, r, θ, φ)`.

## i. Overview

In the orthonormal frame `(t, r, θ, φ)`, the Schwarzschild curvature is a purely electric Weyl
tensor determined by `E = diag(0, -2k, k, k)` with `k = M / r³`:

`R_{ijlm} = δ_{il} E_{jm} - δ_{im} E_{jl} - δ_{jl} E_{im} + δ_{jm} E_{il}`.

This module builds that tensor as a `RiemannTensor 4`, proves its Ricci flatness against
`minkowski` (via the general Ricci contraction), computes its sum of squares `48 k²` (yielding
the Kretschmann scalar `48 M² / r⁶` for any `SchwarzschildSpacetime`), and proves it is purely
electric. The final Section C works the opposite way round: rather than deriving the tidal
eigenvalues from the curvature tensor, it postulates the coordinate-frame entries
`∓g_{tt} (2M/r³)` and `g^{rr} (M/r³)` and shows that frame rescaling of `SchwarzschildSpacetime`
metric components reproduces the eigenvalues of the Hessian of `Φ = -M / r`, thereby certifying
that the postulated eigenvalues agree with the metric. (Here `tidalPart (-2M/r³) (M/r³)` is the
Hessian of `Φ`, not the frame Riemann tensor.)

## ii. Key results

- `electricPart`, `electricPart_symm`, `electricPart_trace` : trace-free static Weyl electric
  matrix `diag(0, -2k, k, k)`.
- `electricWeylRiemann`, `ricci_eq_zero`, `electricWeyl_frameSumOfSquares_eq` : Schwarzschild
  frame curvature `RiemannTensor 4`, Ricci flatness, and frame sum of squares `48 k²`.
- `weyl_purely_electric` : every component with one temporal index vanishes.
- `SchwarzschildSpacetime.frameRiemann`, `SchwarzschildSpacetime.kretschmann_scalar`,
  `SchwarzschildSpacetime.tidalPart_eq_electricPart`,
  `SchwarzschildSpacetime.electricPart_from_metric` : Schwarzschild spacetime frame curvature,
  Kretschmann invariant `48 M² / r⁶`, tidal Hessian match, and metric electric eigenvalues.

## iii. Table of contents

- A. The electric Weyl tensor and frame curvature
- B. Ricci flatness, Kretschmann scalar, and purely electric property
- C. Tidal Hessian and electric eigenvalues for SchwarzschildSpacetime

## iv. References

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


namespace GeneralRelativity

namespace Schwarzschild

/-!

## A. The electric Weyl tensor and frame curvature

In a static orthonormal frame `(t, r, θ, φ)` outside a spherical mass, tidal gravity is captured by
the trace-free electric part `E = diag(0, -2k, k, k)` of the Weyl tensor, with `k = M / r³`.

-/

/-- The electric part of a static Weyl tensor in the orthonormal frame `(t, r, θ, φ)`:
`diag(0, -2k, k, k)`, symmetric and trace free. -/
noncomputable def electricPart (k : ℝ) (i j : Fin 4) : ℝ :=
  if i = j then (if i = 0 then 0 else if i = 1 then -2 * k else k) else 0

/-- Symmetry of the electric Weyl matrix `diag(0, -2k, k, k)` for any tidal scale `k`. -/
lemma electricPart_symm (k : ℝ) (i j : Fin 4) :
    electricPart k i j = electricPart k j i := by
  fin_cases i <;> fin_cases j <;> simp [electricPart]



/-- The Schwarzschild curvature in the orthonormal frame, with `k = M / r³` at a point: the
static Weyl tensor of electric part `E = diag(0, -2k, k, k)`. -/
noncomputable def electricWeylRiemann (k : ℝ) : RiemannTensor 4 where
  comp := fun i j l m =>
    (if i = l then electricPart k j m else 0)
      - (if i = m then electricPart k j l else 0)
      - (if j = l then electricPart k i m else 0)
      + (if j = m then electricPart k i l else 0)
  skew_last := by
    intro i j l m
    ring
  pair_symm := by
    intro i j l m
    rw [electricPart_symm k m j, electricPart_symm k m i,
      electricPart_symm k l j, electricPart_symm k l i]
    simp only [eq_comm (a := l) (b := i), eq_comm (a := l) (b := j),
      eq_comm (a := m) (b := i), eq_comm (a := m) (b := j)]
    ring
  bianchi := by
    intro i j l m
    rw [electricPart_symm k l j, electricPart_symm k l m,
      electricPart_symm k m j]
    simp only [eq_comm (a := l) (b := j), eq_comm (a := m) (b := j),
      eq_comm (a := m) (b := l)]
    ring

/-!

## B. Ricci flatness, Kretschmann scalar, and purely electric property

Contracting `electricWeylRiemann k` with the Minkowski frame metric yields zero Ricci tensor, while
squaring all 256 frame components yields `48 k²`.

-/







/-!

## C. Tidal Hessian and electric eigenvalues for SchwarzschildSpacetime

In the weak-field exterior region, the radial tidal eigenvalues `diag(0, -2M/r³, M/r³, M/r³)` of
a `SchwarzschildSpacetime` match both the Newtonian potential Hessian and the orthonormal-frame
components rescaled from the Schwarzschild coordinate metric.

-/



namespace SchwarzschildSpacetime

/-- Orthonormal-frame Schwarzschild Weyl curvature tensor at radius `r`. -/
noncomputable def frameRiemann (S : SchwarzschildSpacetime) (r : ℝ) : RiemannTensor 4 :=
  electricWeylRiemann (S.M / r ^ 3)















end SchwarzschildSpacetime

end Schwarzschild

end GeneralRelativity

end

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
-/


/-!

# Schwarzschild curvature from the coordinate metric

Vacuum Schwarzschild Riemann, Ricci, scalar, and Einstein tensors obtained from the coordinate
metric by specializing `SchwarzschildDeSitterSpacetime` to `Λ = 0`.

## i. Overview

Specializing `S.toDeSitter` (`⟨S.M, 0⟩ : SchwarzschildDeSitterSpacetime`) to `Λ = 0` matches
`S.metric` and `S.metricInv`, recovering all six independent Riemann components, Ricci flatness
`Ric = 0`, vanishing scalar curvature `R = 0`, and vacuum Einstein equations `G = 0`.

## ii. Key results

- `SchwarzschildSpacetime.toDeSitter` : Schwarzschild–de Sitter embedding at `Λ = 0`.
- `SchwarzschildSpacetime.toDeSitter_M`, `SchwarzschildSpacetime.toDeSitter_Λ`,
  `SchwarzschildSpacetime.toDeSitter_metricFn`, `SchwarzschildSpacetime.toDeSitter_metric`,
  `SchwarzschildSpacetime.toDeSitter_metricInv` : reduction from `toDeSitter` at `Λ = 0`.
- `SchwarzschildSpacetime.riemann_components_from_coordinateMetric` : all six independent
  Schwarzschild Riemann components computed from the coordinate metric.
- `SchwarzschildSpacetime.ricciTensor_eq_zero`, `SchwarzschildSpacetime.ricciScalar_eq_zero`,
  `SchwarzschildSpacetime.einsteinTensor_eq_zero` : vacuum Einstein solution theorems.

## iii. Table of contents

- A. Schwarzschild specialization at `Λ = 0`

## iv. References

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


namespace GeneralRelativity

namespace Schwarzschild

open GeneralRelativity.CoordinateCurvature GeneralRelativity.SchwarzschildDeSitter

namespace SchwarzschildSpacetime

/-!

## A. Schwarzschild specialization at `Λ = 0`

Because a Schwarzschild black hole is the zero-cosmological-constant limit of Schwarzschild–de
Sitter spacetime, its coordinate Riemann, Ricci, scalar, and Einstein tensors follow by evaluating
at `Λ = 0`.

-/

/-- Embed a Schwarzschild spacetime into `SchwarzschildDeSitterSpacetime` at `Λ = 0`. -/
def toDeSitter (S : SchwarzschildSpacetime) : SchwarzschildDeSitterSpacetime :=
  ⟨S.M, 0⟩



















end SchwarzschildSpacetime

end Schwarzschild

end GeneralRelativity

end
Source
https://github.com/BishopWolf/physlib/blob/8046e2b0cb30f5fa25306a69ff29e91ab5711f6b/PhyslibAlpha/Relativity/General/FrameKretschmann.lean https://github.com/BishopWolf/physlib/blob/8046e2b0cb30f5fa25306a69ff29e91ab5711f6b/PhyslibAlpha/Relativity/General/Schwarzschild/Basic.lean https://github.com/BishopWolf/physlib/blob/8046e2b0cb30f5fa25306a69ff29e91ab5711f6b/PhyslibAlpha/Relativity/General/Schwarzschild/CoordinateCurvature.lean https://github.com/BishopWolf/physlib/blob/8046e2b0cb30f5fa25306a69ff29e91ab5711f6b/PhyslibAlpha/Relativity/General/Schwarzschild/ElectricWeyl.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