PhysLib coordinate metric and curvature operators
DefinitionPhyslibCoordinateGeometrygeneral-relativityphyslib-exact-spacetimes
The coordinate metric interface, the slice derivative, and the Christoffel, Riemann, and Ricci operators used by the PhysLib spacetime theorems.
Definition code
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.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.Linarith
import Mathlib.Tactic.NoncommRing
import Mathlib.Tactic.NormNum
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
-/
/-!
# Coordinate partial derivatives
Coordinate-axis partial derivatives `coordDeriv μ f x` on `Fin n → ℝ`, with algebraic and
regularity API and Schwarz mixed-derivative symmetry.
## i. Overview
On a coordinate chart `Fin n → ℝ`, `CoordinateCurvature.coordDeriv μ f x` differentiates the
single-variable slice `s ↦ f (Function.update x μ s)` at `x μ`. This module supplies linearity,
quotient rule, neighborhood congruence, `C²` differentiability, and Schwarz symmetry.
## ii. Key results
- `CoordinateCurvature.coordDeriv` : coordinate partial derivative `∂_μ f(x)`.
- `CoordinateCurvature.coordDeriv_eq_fderiv` : directional Fréchet-derivative form.
- `CoordinateCurvature.coordDeriv_comm` : Schwarz mixed-derivative symmetry.
- `CoordinateCurvature.contDiffAt_coordDeriv`, `CoordinateCurvature.coordDeriv_differentiableAt` :
regularity of coordinate derivatives.
## iii. Table of contents
- A. Coordinate partial derivatives and derivative API
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 3 (Sec. 3.1). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 8 & Ch. 13.
[ref: mtw_1973_gravitation]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 3 (Sec. 3.1)
(https://arxiv.org/pdf/gr-qc/9712019#page=57). [ref: Carroll1997]
-/
namespace GeneralRelativity
namespace CoordinateCurvature
/-!
## A. Coordinate partial derivatives and derivative API
Coordinate partial derivatives along basis axes `μ : Fin n` evaluate directional derivatives
`∂_μ f(x)` and preserve `C²` regularity and mixed-derivative symmetry.
-/
/-- The partial derivative of a scalar field along a coordinate axis: the derivative of the
single-variable slice `s ↦ f (Function.update x μ s)` at `x μ`. -/
noncomputable def coordDeriv {n : ℕ} (μ : Fin n) (f : (Fin n → ℝ) → ℝ) (x : Fin n → ℝ) : ℝ :=
deriv (fun s : ℝ => f (Function.update x μ s)) (x μ)
end CoordinateCurvature
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
-/
/-!
# Rank-2 component tensors and symmetry
Rank-2 covariant tensor components in a fixed frame or coordinate chart and symmetry predicates.
## i. Overview
A rank-2 covariant tensor in an `n`-dimensional coordinate chart or frame is represented as a real
`n × n` matrix of components (`Tensor2 n`). This module defines `Tensor2` and aliases `IsSymm` to
Mathlib's `Matrix.IsSymm` for use across `PhyslibAlpha.Relativity.Metrics` and
`PhyslibAlpha.Relativity.General`.
## ii. Key results
- `Tensor2` : rank-2 covariant tensor components in `n` dimensions.
- `IsSymm` : component symmetry of a rank-2 tensor (reusing `Matrix.IsSymm`).
## iii. Table of contents
- A. Rank-2 tensors and symmetry
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 2 (Sec. 2.3). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 3.
[ref: mtw_1973_gravitation]
* B. O'Neill, *Semi-Riemannian Geometry With Applications to Relativity* (1983), Ch. 2.
[ref: oneill_1983_semi_riemannian]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 1
(https://arxiv.org/pdf/gr-qc/9712019#page=21). [ref: Carroll1997]
-/
namespace GeneralRelativity
/-!
## A. Rank-2 tensors and symmetry
Symmetric rank-2 tensors include the spacetime metric, Ricci, Einstein, and stress-energy tensors.
-/
/-- A rank-2 covariant tensor in a fixed frame or coordinate basis: a real matrix of
components. -/
abbrev Tensor2 (n : ℕ) : Type := Matrix (Fin n) (Fin n) ℝ
/-- Symmetry of a rank-2 tensor: `Tᵀ = T` (equivalently `T j i = T i j` for all indices `i`
and `j`). -/
abbrev IsSymm {n : ℕ} (T : Tensor2 n) : Prop := Matrix.IsSymm T
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
-/
/-!
# Nondegenerate metric tensors with explicit inverses
Pseudo-Riemannian metric components paired with a certified two-sided inverse matrix.
## i. Overview
A nondegenerate metric (`MetricTensor n`) consists of covariant metric components `g : Tensor2 n`
together with an explicit two-sided inverse matrix `ginv : Tensor2 n` and component symmetry,
so contractions and trace operations use an inverse certified for that metric.
## ii. Key results
- `MetricTensor` : nondegenerate metric with its explicit two-sided inverse.
- `MetricTensor.ginv_symm` : the inverse of a symmetric metric is symmetric.
- `MetricTensor.sum_ginv_mul_g_left`, `MetricTensor.sum_ginv_mul_g_right`,
`MetricTensor.sum_ginv_mul_g_apply`, `MetricTensor.sum_mul_ginv_g_apply` :
componentwise inverse-metric contraction identities.
## iii. Table of contents
- A. Metric tensors with explicit inverses
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 2 (Sec. 2.3). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 13.
[ref: mtw_1973_gravitation]
* B. O'Neill, *Semi-Riemannian Geometry With Applications to Relativity* (1983), Ch. 2.
[ref: oneill_1983_semi_riemannian]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 2
(https://arxiv.org/pdf/gr-qc/9712019#page=48). [ref: Carroll1997]
-/
namespace GeneralRelativity
/-!
## A. Metric tensors with explicit inverses
Packaging the covariant metric and its two-sided inverse in `MetricTensor` supplies symmetric
index-contraction lemmas used throughout curvature calculations.
-/
/-- A left inverse of a symmetric square matrix is also a right inverse. -/
lemma mul_eq_one_of_isSymm_of_mul_eq_one {n : ℕ} {g ginv : Tensor2 n}
(hsymm : IsSymm g) (h : ginv * g = 1) : g * ginv = 1 := by
have htrans : g * Matrix.transpose ginv = 1 := by
have := congrArg Matrix.transpose h
rwa [Matrix.transpose_mul, Matrix.transpose_one, hsymm.eq] at this
have hginv : ginv = Matrix.transpose ginv := by
calc ginv = ginv * 1 := (Matrix.mul_one ginv).symm
_ = ginv * (g * Matrix.transpose ginv) := by rw [htrans]
_ = (ginv * g) * Matrix.transpose ginv := by rw [Matrix.mul_assoc]
_ = 1 * Matrix.transpose ginv := by rw [h]
_ = Matrix.transpose ginv := Matrix.one_mul _
rwa [← hginv] at htrans
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
-/
/-!
# Coordinate Christoffel symbols
Levi-Civita Christoffel symbols computed from a coordinate metric and its inverse.
## i. Overview
For a coordinate metric field `C : CoordinateMetric n`, the Levi-Civita connection
`Γ^k_{ij} = (1/2) g^{kl} (∂_i g_{jl} + ∂_j g_{il} - ∂_l g_{ij})` is evaluated from the metric
components and their coordinate partial derivatives. The component-level function
`CoordinateCurvature.christoffel` takes the metric and inverse as bare functions and is used by
coordinate-chart proofs; the chart-level wrapper `CoordinateMetric.christoffel` lives in
`Metrics/CoordinateMetric.lean`.
## ii. Key results
- `CoordinateCurvature.christoffel` : component-level Christoffel symbols.
- `CoordinateCurvature.christoffel_diag` : diagonal-inverse collapse of the contraction.
- `CoordinateCurvature.christoffel_const` : vanishing symbols for a constant metric.
## iii. Table of contents
- A. Christoffel symbols from a coordinate metric
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 3 (Sec. 3.1). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 8.
[ref: mtw_1973_gravitation]
* B. O'Neill, *Semi-Riemannian Geometry With Applications to Relativity* (1983), Ch. 3.
[ref: oneill_1983_semi_riemannian]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 3 (Sec. 3.3)
(https://arxiv.org/pdf/gr-qc/9712019#page=63). [ref: Carroll1997]
-/
namespace GeneralRelativity
namespace CoordinateCurvature
/-!
## A. Christoffel symbols from a coordinate metric
The coordinate partial derivatives `coordDeriv` and the inverse metric components contract to the
Levi-Civita connection of any nondegenerate coordinate metric field.
-/
/-- Christoffel symbols of the second kind,
`Γ^k_{ij} = (1/2) g^{kl} (∂_i g_{jl} + ∂_j g_{il} - ∂_l g_{ij})`. -/
noncomputable def christoffel {n : ℕ} (g ginv : (Fin n → ℝ) → Tensor2 n)
(x : Fin n → ℝ) (k i j : Fin n) : ℝ :=
(1 / 2) * ∑ l, ginv x k l *
(coordDeriv i (fun y => g y j l) x + coordDeriv j (fun y => g y i l) x
- coordDeriv l (fun y => g y i j) x)
end CoordinateCurvature
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
-/
/-!
# Riemann curvature from Christoffel data
The coordinate Riemann curvature tensor evaluated directly from supplied Christoffel symbols `G`
and coordinate derivative table `dG`.
## i. Overview
Given closed-form Levi-Civita connection coefficients `G` and their partial derivatives
`dG μ x ρ ν σ = ∂_μ Γ^ρ_{νσ}`, the function `CoordinateCurvature.riemannFromData G dG x ρ σ μ ν`
evaluates
`R^ρ_{σμν} = ∂_μ Γ^ρ_{νσ} - ∂_ν Γ^ρ_{μσ} + Γ^ρ_{μλ} Γ^λ_{νσ} - Γ^ρ_{νλ} Γ^λ_{μσ}`
directly without nested inverse-metric differentiation, and `riemannFromData_congr` records its
local dependence on the derivative components `(μ, ρ, ν, σ)` and `(ν, ρ, μ, σ)`.
## ii. Key results
- `CoordinateCurvature.riemannFromData` : data-parameterised Riemann curvature evaluator.
- `CoordinateCurvature.riemannFromData_congr` : local congruence in the derivative arguments.
## iii. Table of contents
- A. Curvature from Christoffel data
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 3 (Sec. 3.1-3.2). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 8 & Ch. 13.
[ref: mtw_1973_gravitation]
* B. O'Neill, *Semi-Riemannian Geometry With Applications to Relativity* (1983), Ch. 3.
[ref: oneill_1983_semi_riemannian]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 3
(https://arxiv.org/pdf/gr-qc/9712019#page=72). [ref: Carroll1997]
-/
namespace GeneralRelativity
namespace CoordinateCurvature
/-!
## A. Curvature from Christoffel data
Evaluating the Riemann curvature tensor directly from closed-form connection coefficients `Γ` and
their coordinate derivatives `∂Γ` reproduces the same curvature as differentiating the connection
symbol by symbol, while isolating the algebraic curvature contractions.
-/
-- Decoupled from the derivative-based `CoordinateCurvature.riemann` so closed-form Christoffel
-- tables avoid re-differentiation.
/-- The Riemann curvature tensor evaluated from supplied Christoffel symbols and their coordinate
partial derivatives:
`R^ρ_{σμν} = ∂_μ Γ^ρ_{νσ} - ∂_ν Γ^ρ_{μσ} + Γ^ρ_{μλ} Γ^λ_{νσ} - Γ^ρ_{νλ} Γ^λ_{μσ}`. -/
noncomputable def riemannFromData {n : ℕ}
(G : (Fin n → ℝ) → Fin n → Fin n → Fin n → ℝ)
(dG : Fin n → (Fin n → ℝ) → Fin n → Fin n → Fin n → ℝ)
(x : Fin n → ℝ) (ρ σ μ ν : Fin n) : ℝ :=
dG μ x ρ ν σ - dG ν x ρ μ σ
+ ∑ l, (G x ρ μ l * G x l ν σ - G x ρ ν l * G x l μ σ)
end CoordinateCurvature
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
-/
/-!
# Coordinate Riemann curvature
Riemann curvature computed from a coordinate metric, its Christoffel symbols, and their
derivatives.
## i. Overview
The coordinate Riemann tensor
`R^ρ_{σμν} = ∂_μ Γ^ρ_{νσ} - ∂_ν Γ^ρ_{μσ} + Γ^ρ_{μλ} Γ^λ_{νσ} - Γ^ρ_{νλ} Γ^λ_{μσ}`
is assembled from `christoffel` and `coordDeriv`. It agrees with `riemannFromData` when the
latter is fed the metric's actual Christoffel derivatives; the chart-level wrapper
`CoordinateMetric.riemann` lives in `Metrics/CoordinateMetric.lean`.
## ii. Key results
- `CoordinateCurvature.riemann` : component-level Riemann curvature.
- `CoordinateCurvature.riemann_eq_riemannFromData`,
`CoordinateCurvature.riemann_eq_riemannFromData_of_eventuallyEq` : identification with
`riemannFromData`.
- `CoordinateCurvature.riemann_const` : vanishing curvature for a constant metric.
## iii. Table of contents
- A. Riemann curvature from a coordinate metric
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 3 (Sec. 3.2). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 8 & Ch. 13.
[ref: mtw_1973_gravitation]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 3
(https://arxiv.org/pdf/gr-qc/9712019#page=72). [ref: Carroll1997]
-/
namespace GeneralRelativity
namespace CoordinateCurvature
/-!
## A. Riemann curvature from a coordinate metric
The antisymmetrized derivative of the Christoffel symbols plus the quadratic connection terms gives
the Riemann tensor of the coordinate metric.
-/
/-- The Riemann curvature tensor
`R^ρ_{σμν} = ∂_μ Γ^ρ_{νσ} - ∂_ν Γ^ρ_{μσ} + Γ^ρ_{μλ} Γ^λ_{νσ} - Γ^ρ_{νλ} Γ^λ_{μσ}`. -/
noncomputable def riemann {n : ℕ} (g ginv : (Fin n → ℝ) → Tensor2 n)
(x : Fin n → ℝ) (ρ σ μ ν : Fin n) : ℝ :=
coordDeriv μ (fun y => christoffel g ginv y ρ ν σ) x
- coordDeriv ν (fun y => christoffel g ginv y ρ μ σ) x
+ ∑ l, (christoffel g ginv x ρ μ l * christoffel g ginv x l ν σ
- christoffel g ginv x ρ ν l * christoffel g ginv x l μ σ)
end CoordinateCurvature
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
-/
/-!
# Coordinate Ricci curvature
Ricci tensor and scalar curvature obtained by contracting the coordinate Riemann tensor.
## i. Overview
The Ricci tensor `Ric_{σν} = ∑ ρ, R^ρ_{σρν}` contracts the coordinate Riemann tensor, and the
scalar curvature `R = ∑ σ ν, g^{σν} Ric_{σν}` contracts the Ricci tensor with the inverse metric.
The chart-level wrappers `CoordinateMetric.ricciTensor` and `CoordinateMetric.ricciScalar` live in
`Metrics/CoordinateMetric.lean`.
## ii. Key results
- `CoordinateCurvature.ricciTensor` : coordinate Ricci tensor.
- `CoordinateCurvature.ricciScalar` : coordinate scalar curvature.
- `CoordinateCurvature.ricciTensor_const`, `CoordinateCurvature.ricciScalar_const` : vanishing
Ricci curvature for a constant metric.
## iii. Table of contents
- A. Ricci tensor and scalar curvature
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 3 (Sec. 3.2). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 8 & Ch. 13.
[ref: mtw_1973_gravitation]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 3 (Sec. 3.7)
(https://arxiv.org/pdf/gr-qc/9712019#page=80). [ref: Carroll1997]
-/
namespace GeneralRelativity
namespace CoordinateCurvature
/-!
## A. Ricci tensor and scalar curvature
Contracting the Riemann tensor in its first and third indices gives the Ricci tensor, and a
further contraction with the inverse metric gives the scalar curvature.
-/
/-- The coordinate Ricci tensor `Ric_{σν} = ∑ ρ, R^ρ_{σρν}`. -/
noncomputable def ricciTensor {n : ℕ} (g ginv : (Fin n → ℝ) → Tensor2 n)
(x : Fin n → ℝ) (σ ν : Fin n) : ℝ :=
∑ ρ, riemann g ginv x ρ σ ρ ν
end CoordinateCurvature
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
-/
/-!
# Coordinate metrics
Coordinate-chart metric fields, their pointwise `MetricTensor` restrictions, and the chart-level
connection and curvature operators.
## i. Overview
A `CoordinateMetric n` collects a coordinate-dependent symmetric metric field `g_{ij}(x)`, its
inverse `g^{ij}(x)`, and the regular chart domain on which the two are two-sided inverses. At a
point of that domain `CoordinateMetric.metricTensor` restricts the field to a pointwise
`MetricTensor n`. On the chart, `CoordinateMetric.christoffel` assembles the Levi-Civita symbols
from the field and its inverse, `CoordinateMetric.geodesicAccel` gives the geodesic acceleration,
and `CoordinateMetric.riemann`, `CoordinateMetric.ricciTensor`, `CoordinateMetric.ricciScalar`,
and `CoordinateMetric.einsteinTensor` evaluate the curvature componentwise.
## ii. Key results
- `CoordinateMetric`, `CoordinateMetric.metricTensor` : coordinate metric field with its regular
domain and pointwise `MetricTensor` restriction.
- `CoordinateMetric.christoffel`, `CoordinateMetric.geodesicAccel`, `CoordinateMetric.IsGeodesic`,
`CoordinateMetric.isGeodesic_iff` : chart connection and geodesic motion.
- `CoordinateMetric.riemann`, `CoordinateMetric.ricciTensor`, `CoordinateMetric.ricciScalar`,
`CoordinateMetric.einsteinTensor` : Levi-Civita curvature of a coordinate metric.
## iii. Table of contents
- A. Coordinate metrics and pointwise restrictions
- B. Connection, geodesics, and curvature
## iv. References
* R. M. Wald, *General Relativity* (1984), Ch. 3 (Sec. 3.1). [ref: wald_1984_general_relativity]
* C. W. Misner, K. S. Thorne, and J. A. Wheeler, *Gravitation* (1973), Ch. 8 & Ch. 13.
[ref: mtw_1973_gravitation]
* B. O'Neill, *Semi-Riemannian Geometry With Applications to Relativity* (1983), Ch. 3.
[ref: oneill_1983_semi_riemannian]
* S. M. Carroll, *Lecture Notes on General Relativity* (1997), Ch. 3 (Sec. 3.1)
(https://arxiv.org/pdf/gr-qc/9712019#page=58). [ref: Carroll1997]
-/
namespace GeneralRelativity
/-!
## A. Coordinate metrics and pointwise restrictions
A coordinate metric field carries its own regularity domain, so pointwise `MetricTensor`s — and
with them the inverse-metric contractions — exist exactly at the chart points where `g` and
`ginv` are two-sided inverses.
-/
/-- A coordinate-chart metric field `g` paired with its inverse `ginv` and regularity domain. -/
structure CoordinateMetric (n : ℕ) where
/-- The covariant metric component field `g_{ij}(x)`. -/
g : (Fin n → ℝ) → Tensor2 n
/-- The contravariant inverse metric component field `g^{ij}(x)`. -/
ginv : (Fin n → ℝ) → Tensor2 n
/-- Regular coordinate domain where `g` is nondegenerate. -/
domain : Set (Fin n → ℝ)
/-- Symmetry of the covariant metric at every point. -/
symm : ∀ x, IsSymm (g x)
/-- Left-to-right inverse relation `g(x) * ginv(x) = 1` on `domain`. -/
inv_left : ∀ x ∈ domain, g x * ginv x = 1
/-- Right-to-left inverse relation `ginv(x) * g(x) = 1` on `domain`. -/
inv_right : ∀ x ∈ domain, ginv x * g x = 1
/-!
## B. Connection, geodesics, and curvature
The Levi-Civita connection is assembled from the metric field and its explicit inverse;
contracting the derivatives of the symbols gives the Riemann, Ricci, scalar, and Einstein tensors
componentwise, and the same symbols give the affine geodesic equation of the chart.
-/
/-- Christoffel symbols of a `CoordinateMetric`. -/
noncomputable def CoordinateMetric.christoffel {n : ℕ} (C : CoordinateMetric n)
(x : Fin n → ℝ) (k i j : Fin n) : ℝ :=
CoordinateCurvature.christoffel C.g C.ginv x k i j
/-- Riemann curvature tensor of a `CoordinateMetric`. -/
noncomputable def CoordinateMetric.riemann {n : ℕ} (C : CoordinateMetric n)
(x : Fin n → ℝ) (ρ σ μ ν : Fin n) : ℝ :=
CoordinateCurvature.riemann C.g C.ginv x ρ σ μ ν
/-- Ricci tensor of a `CoordinateMetric`. -/
noncomputable def CoordinateMetric.ricciTensor {n : ℕ} (C : CoordinateMetric n)
(x : Fin n → ℝ) (σ ν : Fin n) : ℝ :=
CoordinateCurvature.ricciTensor C.g C.ginv x σ ν
end GeneralRelativity
end
Source