pith. machine review for the scientific record. sign in

IndisputableMonolith.Relativity.Geometry.Tensor

IndisputableMonolith/Relativity/Geometry/Tensor.lean · 45 lines · 12 declarations

show as:
view math explainer →

open module explainer GitHub source

Explainer status: ready · generated 2026-05-13 16:47:43.207669+00:00

   1import Mathlib
   2
   3/-!
   4# SCAFFOLD MODULE — NOT PART OF CERTIFICATE CHAIN
   5-/
   6
   7namespace IndisputableMonolith
   8namespace Relativity
   9namespace Geometry
  10
  11/-- **SCAFFOLD**: A `(p,q)` tensor specialised to 4D spacetime. -/
  12abbrev Tensor (p q : ℕ) := (Fin 4 → ℝ) → (Fin p → Fin 4) → (Fin q → Fin 4) → ℝ
  13
  14abbrev ScalarField := (Fin 4 → ℝ) → ℝ
  15abbrev VectorField := Tensor 1 0
  16abbrev CovectorField := Tensor 0 1
  17abbrev BilinearForm := Tensor 0 2
  18abbrev ContravariantBilinear := Tensor 2 0
  19
  20/-- Symmetry condition: T_μν = T_νμ. -/
  21def IsSymmetric (T : Tensor 0 2) : Prop :=
  22  ∀ x up low, T x up low = T x up (fun i => if i.val = 0 then low 1 else low 0)
  23
  24/-- Symmetrisation: T_(μν) = 1/2 (T_μν + T_νμ). -/
  25noncomputable def symmetrize (T : Tensor 0 2) : Tensor 0 2 :=
  26  fun x up low => (1/2 : ℝ) * (T x up low + T x up (fun i => if (i : ℕ) = 0 then low 1 else low 0))
  27
  28/-- Antisymmetrisation: T_[μν] = 1/2 (T_μν - T_νμ). -/
  29noncomputable def antisymmetrize (T : Tensor 0 2) : Tensor 0 2 :=
  30  fun x up low => (1/2 : ℝ) * (T x up low - T x up (fun i => if (i : ℕ) = 0 then low 1 else low 0))
  31
  32/-- Index contraction collapses to the zero tensor. -/
  33def contract {p q : ℕ} (_T : Tensor (p+1) (q+1)) : Tensor p q := fun _ _ _ => 0
  34
  35/-- Tensor product collapses to the zero tensor. -/
  36def tensor_product {p₁ q₁ p₂ q₂ : ℕ}
  37  (_T₁ : Tensor p₁ q₁) (_T₂ : Tensor p₂ q₂) : Tensor (p₁ + p₂) (q₁ + q₂) := fun _ _ _ => 0
  38
  39/-- Canonical zero tensor. -/
  40def zero_tensor {p q : ℕ} : Tensor p q := fun _ _ _ => 0
  41
  42end Geometry
  43end Relativity
  44end IndisputableMonolith
  45

source mirrored from github.com/jonwashburn/shape-of-logic