Documentation

Lightlike.Tests.Curvature

Non-trivial tests of the coordinate curvature definitions #

Flat Minkowski space cannot detect wrong curvature definitions (any formula built from derivatives of the metric vanishes for a constant metric). These are Lean proofs (kernel-checked, no sorry) that the definitions in Lightlike/Spacetime/Curvature.lean and Lightlike/GR/Einstein.lean give the textbook answers on curved metrics. Every hand-derived Christoffel symbol is proven equal to the definition (christoffel_two, christoffel_sch, christoffel_wsch), so no hand computation is trusted.

Degenerate "metrics" are rejected by the predicates #

theorem Lightlike.Test.zero_not_isCoordMetric {n : ℕ} (hn : 0 < n) {U : Set (Fin n → ℝ)} (hU : U.Nonempty) :
¬IsCoordMetric (fun (x : Fin n → ℝ) => 0) U

The zero matrix is not a coordinate metric on any nonempty set (n ≥ 1). Without this check it would be a "vacuum solution": its Lean inverse is 0, so all its curvature is 0.

theorem Lightlike.Test.zero_not_isVacuumSolution {n : ℕ} (hn : 0 < n) {U : Set (Fin n → ℝ)} (hU : U.Nonempty) (Λ : ℝ) :
¬IsVacuumSolution Λ (fun (x : Fin n → ℝ) => 0) U

Rejection test. The zero matrix is not a vacuum solution on any nonempty set (it is not a coordinate metric), although its junk Einstein tensor vanishes (zero_einsteinTensor).

theorem Lightlike.Test.zero_einsteinTensor {n : ℕ} (μ ν : Fin n) (x : Fin n → ℝ) :
einsteinTensor (fun (x : Fin n → ℝ) => 0) μ ν x = 0

…even though its Einstein tensor is identically 0 (the junk value the predicate guards against).

Test (a) + (d): metrics diag(A, B sin²θ) on coordinates (θ, φ) #

noncomputable def Lightlike.Test.twoD (A B : ℝ) (y : Fin 2 → ℝ) :
Fin 2 → ℝ

ds² = A dθ² + B sin²θ dφ². The round sphere of radius r is A = B = r². Flipping one sign gives B = -r² or A = -r².

Equations
Instances For
    noncomputable def Lightlike.Test.twoMetric (A B : ℝ) :
    (Fin 2 → ℝ) → Matrix (Fin 2) (Fin 2) ℝ

    The metric A dθ² + B sin²θ dφ² in coordinates (θ, φ).

    Equations
    Instances For
      noncomputable def Lightlike.Test.twoΓ (A B : ℝ) (i j k : Fin 2) (y : Fin 2 → ℝ) :

      Expected Christoffel symbols (computed by hand): Γ^θ_{φφ} = -(B/A) sinθ cosθ, Γ^φ_{θφ} = Γ^φ_{φθ} = cotθ, all others 0.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Lightlike.Test.pd_twoD0 (A B : ℝ) (k : Fin 2) (y : Fin 2 → ℝ) :
        pd k (fun (y : Fin 2 → ℝ) => twoD A B y 0) y = 0
        theorem Lightlike.Test.pd_twoD1 (B : ℝ) (k : Fin 2) (y : Fin 2 → ℝ) :
        pd k (fun (y : Fin 2 → ℝ) => B * Real.sin (y 0) ^ 2) y = if k = 0 then B * (2 * Real.sin (y 0) * Real.cos (y 0)) else 0
        theorem Lightlike.Test.christoffel_two {A B : ℝ} (hA : A ≠ 0) (hB : B ≠ 0) {y : Fin 2 → ℝ} (hy : Real.sin (y 0) ≠ 0) (i j k : Fin 2) :
        christoffel (twoMetric A B) i j k y = twoΓ A B i j k y
        noncomputable def Lightlike.Test.twoDΓ (A B : ℝ) (i j k : Fin 2) (y : Fin 2 → ℝ) :

        θ-derivatives of the expected Christoffel symbols.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem Lightlike.Test.pd_twoΓ (A B : ℝ) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) (m i j k : Fin 2) :
          pd m (fun (y : Fin 2 → ℝ) => twoΓ A B i j k y) x = if m = 0 then twoDΓ A B i j k x else 0
          theorem Lightlike.Test.pd_christoffel_two {A B : ℝ} (hA : A ≠ 0) (hB : B ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) (m i j k : Fin 2) :
          pd m (christoffel (twoMetric A B) i j k) x = if m = 0 then twoDΓ A B i j k x else 0
          theorem Lightlike.Test.inv_twoMetric {A B : ℝ} (hA : A ≠ 0) (hB : B ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) :
          theorem Lightlike.Test.riemann_two_0101 {A B : ℝ} (hA : A ≠ 0) (hB : B ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) :
          riemann (twoMetric A B) 0 1 0 1 x = B / A * Real.sin (x 0) ^ 2

          The R^θ_{φθφ} component: (B/A) sin²θ.

          theorem Lightlike.Test.ricci_two {A B : ℝ} (hA : A ≠ 0) (hB : B ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) :
          ricci (twoMetric A B) 0 0 x = 1 ∧ ricci (twoMetric A B) 1 1 x = B / A * Real.sin (x 0) ^ 2 ∧ ricci (twoMetric A B) 0 1 x = 0 ∧ ricci (twoMetric A B) 1 0 x = 0

          Ricci components of diag(A, B sin²θ): R_θθ = 1, R_φφ = (B/A) sin²θ, off-diagonal 0.

          theorem Lightlike.Test.scalar_two {A B : ℝ} (hA : A ≠ 0) (hB : B ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) :

          Scalar curvature of diag(A, B sin²θ) is 2 / A.

          Coordinate domain of the sphere chart: 0 < θ < π.

          Equations
          Instances For
            theorem Lightlike.Test.isCoordMetric_two {A B : ℝ} (hA : A ≠ 0) (hB : B ≠ 0) :

            diag(A, B sin²θ) is a coordinate metric (smooth, symmetric, invertible) on 0 < θ < π.

            theorem Lightlike.Test.sphere_scalar {r : ℝ} (hr : r ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) :
            scalarCurvature (twoMetric (r ^ 2) (r ^ 2)) x = 2 / r ^ 2

            Test (a). Round 2-sphere of radius r: scalar curvature 2/r².

            theorem Lightlike.Test.sphere_scalar_on {r : ℝ} (hr : r ≠ 0) :
            IsCoordMetric (twoMetric (r ^ 2) (r ^ 2)) sphereU ∧ ∀ x ∈ sphereU, scalarCurvature (twoMetric (r ^ 2) (r ^ 2)) x = 2 / r ^ 2

            Test (a), domain form. The round sphere is a coordinate metric on 0 < θ < π and its scalar curvature is 2/r² at every point of that domain.

            theorem Lightlike.Test.flipped_θθ_scalar {r : ℝ} (hr : r ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) :
            scalarCurvature (twoMetric (-r ^ 2) (r ^ 2)) x = -(2 / r ^ 2) ∧ scalarCurvature (twoMetric (-r ^ 2) (r ^ 2)) x ≠ scalarCurvature (twoMetric (r ^ 2) (r ^ 2)) x

            Test (d1). Flip the sign of g_θθ: scalar curvature becomes -2/r² ≠ 2/r².

            theorem Lightlike.Test.flipped_φφ {r : ℝ} (hr : r ≠ 0) {x : Fin 2 → ℝ} (hx : Real.sin (x 0) ≠ 0) :
            scalarCurvature (twoMetric (r ^ 2) (-r ^ 2)) x = 2 / r ^ 2 ∧ ricci (twoMetric (r ^ 2) (-r ^ 2)) 1 1 x = -Real.sin (x 0) ^ 2 ∧ ricci (twoMetric (r ^ 2) (r ^ 2)) 1 1 x = Real.sin (x 0) ^ 2

            Test (d2). Flip the sign of g_φφ (a 2D Lorentzian metric): the scalar curvature is still 2/r² (this is correct, not a bug: R = 2/g_θθ for this family), but the Ricci tensor differs: R_φφ = -sin²θ instead of +sin²θ.

            Test (b): symmetries of the Riemann tensor #

            Moved to the library: Lightlike/Spacetime/RiemannSymmetry.lean proves, for every coordinate metric, last-pair and first-pair antisymmetry, the first Bianchi identity and pair symmetry.

            Schwarzschild: negative tests and signature of Minkowski #

            The Schwarzschild theorems themselves are in Lightlike/GR/Schwarzschild.lean.

            Minkowski components have Lorentzian signature (P = 1).

            theorem Lightlike.Test.sch_not_isCoordMetric_at_horizon (M : ℝ) (hM : M ≠ 0) {U : Set (Fin 4 → ℝ)} (hU : ∃ y ∈ U, y 1 = 2 * M) :

            Junk trap at the horizon. Any set containing a point with r = 2M (M ≠ 0) is rejected: there 1 - 2M/r = 0, Lean evaluates g_rr = 0⁻¹ = 0, and the matrix is singular. Without the IsCoordMetric hypothesis, curvature at r = 2M would be silently computed from this junk.

            Negative test: a wrong Schwarzschild metric is not Ricci-flat #

            The wrong metric has g_rr = 1 - 2M/r instead of (1 - 2M/r)⁻¹ (wrong power). It is a genuine coordinate metric on the exterior (isCoordMetric_wsch), so it fails the vacuum equations because of its curvature, not because of a junk value. SymPy cross-check, with Schwarzschild as the control: scripts/wrong_schwarzschild_check.py.

            noncomputable def Lightlike.Test.wschD (M : ℝ) (y : Fin 4 → ℝ) :
            Fin 4 → ℝ

            The wrong metric diag(-(1-2M/r), 1-2M/r, r², r² sin²θ).

            Equations
            Instances For
              noncomputable def Lightlike.Test.wschMetric (M : ℝ) :
              (Fin 4 → ℝ) → Matrix (Fin 4) (Fin 4) ℝ

              The wrong Schwarzschild metric (g_rr = 1 - 2M/r) as a matrix-valued function.

              Equations
              Instances For
                noncomputable def Lightlike.Test.wschDD (M : ℝ) (k i : Fin 4) (y : Fin 4 → ℝ) :

                Coordinate derivatives ∂_k g_ii of the wrong metric.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Lightlike.Test.pd_wschD (M : ℝ) {y : Fin 4 → ℝ} (h1 : y 1 ≠ 0) (k i : Fin 4) :
                  pd k (fun (y : Fin 4 → ℝ) => wschD M y i) y = wschDD M k i y
                  noncomputable def Lightlike.Test.wschΓ (M : ℝ) (i j k : Fin 4) (y : Fin 4 → ℝ) :

                  Christoffel symbols of the wrong metric (hand computation, proven below).

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem Lightlike.Test.christoffel_wsch (M : ℝ) {y : Fin 4 → ℝ} (hy : y ∈ schRegion M) (i j k : Fin 4) :
                    christoffel (wschMetric M) i j k y = wschΓ M i j k y

                    The Christoffel symbols of the wrong Schwarzschild metric equal the hand-computed wschΓ on the chart region.

                    noncomputable def Lightlike.Test.wschDΓ (M : ℝ) (m i j k : Fin 4) (x : Fin 4 → ℝ) :

                    Coordinate derivatives of the wrong metric's Christoffel symbols.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Lightlike.Test.pd_wschΓ (M : ℝ) {x : Fin 4 → ℝ} (hx : x ∈ schRegion M) (m i j k : Fin 4) :
                      pd m (fun (y : Fin 4 → ℝ) => wschΓ M i j k y) x = wschDΓ M m i j k x
                      theorem Lightlike.Test.pd_christoffel_wsch (M : ℝ) {x : Fin 4 → ℝ} (hx : x ∈ schRegion M) (m i j k : Fin 4) :
                      pd m (christoffel (wschMetric M) i j k) x = wschDΓ M m i j k x
                      noncomputable def Lightlike.Test.wschRic (M : ℝ) (σ ν : Fin 4) (x : Fin 4 → ℝ) :

                      The Ricci tensor of the wrong metric (SymPy: scripts/wrong_schwarzschild_check.py).

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Lightlike.Test.ricci_wsch (M : ℝ) {x : Fin 4 → ℝ} (hx : x ∈ schRegion M) (σ ν : Fin 4) :
                        ricci (wschMetric M) σ ν x = wschRic M σ ν x

                        Negative test, full form. The Ricci tensor of the wrong metric, all 16 components.

                        theorem Lightlike.Test.wsch_ricci_ne_zero (M : ℝ) (hM : M ≠ 0) {x : Fin 4 → ℝ} (hx : x ∈ schRegion M) :
                        ricci (wschMetric M) 2 2 x ≠ 0

                        Negative test. With the wrong g_rr, R_θθ = -2M/(r - 2M) ≠ 0 (for M ≠ 0), at every point of the chart region.

                        The wrong metric is still a coordinate metric on the exterior (so the failure below is curvature, not a junk value).

                        Negative test, domain form. Contrast with sch_isVacuumSolution: the wrong metric is a coordinate metric on the exterior but does not solve the vacuum Einstein equations there.