Poincaré conjecture: the Lean proof, cleaned up together
The 2026 Lean proof of the Poincaré conjecture after Morgan and Tian, 3 million lines, cleaned up together: smaller, faster to build, more readable, the theorems unchanged

| 1 | import PoincareLib.Geometry.Spacetime.Slice |
| 2 | import PoincareLib.Geometry.Riemannian.Curvature.Basic |
| 3 | import Mathlib.LinearAlgebra.Multilinear.Basic |
| 4 | |
| 5 | /-! Ported from Mapher06/Poincare-MorganTian, `PoincareMT/Definitions/M12HorizontalCalculus.lean`, |
| 6 | revision `b2c3c64781fee22edfd683a224d4f8d280e2e9ce`. Declaration bodies are unchanged; |
| 7 | only imports and module placement differ. See |
| 8 | `references/ricci-flow/mapher/spacetime-port.json`. -/ |
| 9 | |
| 10 | /-! |
| 11 | # Raw horizontal calculus on the selected spacetime |
| 12 | |
| 13 | Morgan-Tian Definition 3.36 and Remark 3.37, pp. 60-61, with the connection |
| 14 | and curvature conventions of pp. 3-7. The horizontal Lie expression uses |
| 15 | fixed bundle extensions and the actual manifold Lie bracket. Curvature is |
| 16 | transported from retained slice connections through the actual differential |
| 17 | of slice inclusion. Tensoriality, regularity, and connection laws are M12 |
| 18 | theorem conclusions, not proof fields in these definitions. |
| 19 | -/ |
| 20 | |
| 21 | set_option autoImplicit false |
| 22 | |
| 23 | open scoped Manifold ContDiff Bundle |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT |
| 28 | |
| 29 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 30 | {I : SpacetimeInterval} |
| 31 | |
| 32 | /-- A section of the literal horizontal kernel for this spacetime witness. -/ |
| 33 | abbrev HorizontalSection (F : GeneralizedFlowSpacetime n X time I) := |
| 34 | (p : F.Point) → F.Horizontal p |
| 35 | |
| 36 | /-- The actual tangent vector field underlying a horizontal section. -/ |
| 37 | def horizontalSectionVectorField (F : GeneralizedFlowSpacetime n X time I) |
| 38 | (V : HorizontalSection F) (p : F.Point) : TangentSpace (spacetimeModel n) p := |
| 39 | (V p).val |
| 40 | |
| 41 | /-- Smoothness of a horizontal section on its specified domain. -/ |
| 42 | def IsSmoothHorizontalSectionOn (F : GeneralizedFlowSpacetime n X time I) |
| 43 | (V : HorizontalSection F) (U : Set F.Point) : Prop := |
| 44 | ContMDiffOn (spacetimeModel n) |
| 45 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 46 | (fun p : F.Point ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 47 | (E := F.Horizontal) p (V p)) U |
| 48 | |
| 49 | /-- Raw covariant tensor evaluations on the actual horizontal fibers. -/ |
| 50 | abbrev HorizontalCovariantTensorEvaluation (F : GeneralizedFlowSpacetime n X time I) |
| 51 | (k : ℕ) := |
| 52 | (p : F.Point) → (Fin k → F.Horizontal p) → ℝ |
| 53 | |
| 54 | /-- Pointwise multilinearity and smooth evaluation on arbitrary local smooth sections. -/ |
| 55 | def IsSmoothHorizontalCovariantTensor (F : GeneralizedFlowSpacetime n X time I) |
| 56 | {k : ℕ} (T : HorizontalCovariantTensorEvaluation F k) : Prop := |
| 57 | (∀ p : F.Point, ∃ A : MultilinearMap ℝ (fun _ : Fin k ↦ F.Horizontal p) ℝ, |
| 58 | ∀ v, T p v = A v) ∧ |
| 59 | ∀ U : Set F.Point, IsOpen U → |
| 60 | ∀ V : Fin k → HorizontalSection F, |
| 61 | (∀ i, IsSmoothHorizontalSectionOn F (V i) U) → |
| 62 | ContMDiffOn (spacetimeModel n) 𝓘(ℝ) ∞ (fun p ↦ T p (fun i ↦ V i p)) U |
| 63 | |
| 64 | /-- The projected actual bracket with the normalized time vector. -/ |
| 65 | noncomputable def horizontalTimeBracket (F : GeneralizedFlowSpacetime n X time I) |
| 66 | (V : HorizontalSection F) (p : F.Point) : F.Horizontal p := |
| 67 | F.horizontalProjection p |
| 68 | (VectorField.mlieBracket (spacetimeModel n) |
| 69 | (show (q : F.Point) → TangentSpace (spacetimeModel n) q from F.timeVector) |
| 70 | (horizontalSectionVectorField F V) p) |
| 71 | |
| 72 | /-- The horizontal metric Lie expression on supplied sections. Its geometric |
| 73 | interpretation requires regularity near the evaluation point. -/ |
| 74 | noncomputable def horizontalMetricLieDerivativeOnFields |
| 75 | (F : GeneralizedFlowSpacetime n X time I) |
| 76 | (U V : HorizontalSection F) (p : F.Point) : ℝ := |
| 77 | mvfderiv (spacetimeModel n) |
| 78 | (fun q : F.Point ↦ F.horizontalMetric.inner q (U q) (V q)) p (F.timeVector p) - |
| 79 | F.horizontalMetric.inner p (horizontalTimeBracket F U p) (V p) - |
| 80 | F.horizontalMetric.inner p (U p) (horizontalTimeBracket F V p) |
| 81 | |
| 82 | /-- The pointwise Lie expression, using the fixed local bundle extensions. -/ |
| 83 | noncomputable def horizontalMetricLieDerivative |
| 84 | (F : GeneralizedFlowSpacetime n X time I) |
| 85 | (p : F.Point) (u v : F.Horizontal p) : ℝ := |
| 86 | let U : HorizontalSection F := FiberBundle.extend (EuclideanSpace ℝ (Fin n)) u |
| 87 | let V : HorizontalSection F := FiberBundle.extend (EuclideanSpace ℝ (Fin n)) v |
| 88 | horizontalMetricLieDerivativeOnFields F U V p |
| 89 | |
| 90 | /-- Retained actual Levi-Civita connections for the selected actual slice metrics. |
| 91 | Their existence and joint leafwise regularity are separate theorem conclusions. -/ |
| 92 | structure LeafwiseLeviCivitaFamily (F : GeneralizedFlowSpacetime n X time I) |
| 93 | (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) where |
| 94 | sliceConnection : ∀ t : ℝ, LeviCivitaData (S t).metricOnPoints |
| 95 | |
| 96 | variable {F : GeneralizedFlowSpacetime n X time I} |
| 97 | {S : ∀ t : ℝ, SpacetimeSliceGeometry F t} |
| 98 | |
| 99 | /-- A spacetime point regarded as a point of its exact selected time slice. -/ |
| 100 | def spacetimeSlicePoint (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) (p : F.Point) : |
| 101 | (S (F.timeFunction p)).Point := |
| 102 | ⟨p, rfl⟩ |
| 103 | |
| 104 | /-- Restrict a horizontal section through the inverse actual slice differential. -/ |
| 105 | noncomputable def restrictHorizontalSection |
| 106 | (S : ∀ t : ℝ, SpacetimeSliceGeometry F t) (t : ℝ) (V : HorizontalSection F) : |
| 107 | (x : (S t).Point) → TangentSpace (𝓡 n) x := |
| 108 | fun x ↦ ((S t).tangentEquiv x).symm (V x.val) |
| 109 | |
| 110 | /-- Four-covariant horizontal curvature, with last-slot convention `g(R(u,v)z,w)`. -/ |
| 111 | noncomputable def horizontalRiemann (D : LeafwiseLeviCivitaFamily F S) |
| 112 | (p : F.Point) (u v w z : F.Horizontal p) : ℝ := |
| 113 | let t := F.timeFunction p |
| 114 | let x : (S t).Point := spacetimeSlicePoint S p |
| 115 | let j := (S t).tangentEquiv x |
| 116 | (D.sliceConnection t).curvatureTensor x (j.symm u) (j.symm v) (j.symm w) (j.symm z) |
| 117 | |
| 118 | /-- Actual Ricci curvature of the selected slice, transported to its horizontal fiber. -/ |
| 119 | noncomputable def horizontalRicci (D : LeafwiseLeviCivitaFamily F S) |
| 120 | (p : F.Point) (u v : F.Horizontal p) : ℝ := |
| 121 | let t := F.timeFunction p |
| 122 | let x : (S t).Point := spacetimeSlicePoint S p |
| 123 | let j := (S t).tangentEquiv x |
| 124 | (D.sliceConnection t).ricci x (j.symm u) (j.symm v) |
| 125 | |
| 126 | /-- The scalar curvature of the selected actual time slice. -/ |
| 127 | noncomputable def horizontalScalarCurvature (D : LeafwiseLeviCivitaFamily F S) |
| 128 | (p : F.Point) : ℝ := |
| 129 | (D.sliceConnection (F.timeFunction p)).scalarCurvature (spacetimeSlicePoint S p) |
| 130 | |
| 131 | /-- The full four-tensor norm of the selected actual time slice. -/ |
| 132 | noncomputable def horizontalCurvatureNorm (D : LeafwiseLeviCivitaFamily F S) |
| 133 | (p : F.Point) : ℝ := |
| 134 | (D.sliceConnection (F.timeFunction p)).curvatureTensorNorm (spacetimeSlicePoint S p) |
| 135 | |
| 136 | /-- The squared full curvature norm; smoothness at curvature zero concerns this square. -/ |
| 137 | noncomputable def horizontalCurvatureNormSq (D : LeafwiseLeviCivitaFamily F S) |
| 138 | (p : F.Point) : ℝ := |
| 139 | horizontalCurvatureNorm D p ^ 2 |
| 140 | |
| 141 | /-- The intrinsic generalized Ricci equation on the actual horizontal bundle. -/ |
| 142 | def IntrinsicGeneralizedRicciEquation (D : LeafwiseLeviCivitaFamily F S) : Prop := |
| 143 | ∀ p : F.Point, ∀ u v : F.Horizontal p, |
| 144 | horizontalMetricLieDerivative F p u v = -2 * horizontalRicci D p u v |
| 145 | |
| 146 | /-- The slice covariant derivative transported as a continuous linear map on H. -/ |
| 147 | noncomputable def rawLeafwiseCovariantDerivative (D : LeafwiseLeviCivitaFamily F S) |
| 148 | (V : HorizontalSection F) (p : F.Point) : F.Horizontal p →L[ℝ] F.Horizontal p := |
| 149 | let t := F.timeFunction p |
| 150 | let x : (S t).Point := spacetimeSlicePoint S p |
| 151 | let j := (S t).tangentEquiv x |
| 152 | j.toContinuousLinearMap.comp |
| 153 | (((D.sliceConnection t).connection (restrictHorizontalSection S t V) x).comp |
| 154 | j.symm.toContinuousLinearMap) |
| 155 | |
| 156 | /-- The canonical raw derivative: spatial Levi-Civita derivative plus the time bracket. |
| 157 | Its metric defect on regular sections is dt(Z) times the metric Lie derivative. -/ |
| 158 | noncomputable def rawHorizontalCovariantDerivative (D : LeafwiseLeviCivitaFamily F S) |
| 159 | (V : HorizontalSection F) (p : F.Point) : |
| 160 | TangentSpace (spacetimeModel n) p →L[ℝ] F.Horizontal p := |
| 161 | (rawLeafwiseCovariantDerivative D V p).comp (F.horizontalProjection p) + |
| 162 | (show TangentSpace (spacetimeModel n) p →L[ℝ] ℝ from |
| 163 | mfderiv (spacetimeModel n) 𝓘(ℝ) F.timeFunction p).smulRight |
| 164 | (horizontalTimeBracket F V p) |
| 165 | |
| 166 | end PoincareMT |