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.Interval |
| 2 | import PoincareLib.Geometry.Riemannian.Connection |
| 3 | import Mathlib.Geometry.Manifold.VectorField.LieBracket |
| 4 | import Mathlib.Geometry.Manifold.LocalDiffeomorph |
| 5 | |
| 6 | /-! Ported from Mapher06/Poincare-MorganTian, `PoincareMT/Definitions/M11GeneralizedFlow.lean`, |
| 7 | revision `b2c3c64781fee22edfd683a224d4f8d280e2e9ce`. Declaration bodies are unchanged; |
| 8 | only imports and module placement differ. See |
| 9 | `references/ricci-flow/mapher/spacetime-port.json`. -/ |
| 10 | |
| 11 | /-! |
| 12 | # Actual generalized spacetime geometry |
| 13 | |
| 14 | Morgan-Tian Definitions 3.34-3.35, pp. 59-60. The horizontal fibers are |
| 15 | literally the kernels of the differential of time in the actual tangent |
| 16 | bundle. A selected smooth positive metric lives on that bundle. This file |
| 17 | contains geometric data only; M12 owns the intrinsic Ricci equation. |
| 18 | -/ |
| 19 | |
| 20 | set_option autoImplicit false |
| 21 | |
| 22 | open scoped Manifold ContDiff Bundle Topology |
| 23 | |
| 24 | universe u |
| 25 | |
| 26 | namespace PoincareMT |
| 27 | |
| 28 | /-- The half-space time model times the boundaryless spatial model. -/ |
| 29 | noncomputable abbrev spacetimeModel (n : ℕ) := (𝓡∂ 1).prod (𝓡 n) |
| 30 | |
| 31 | /-- Vector model of the genuine (n+1)-dimensional tangent bundle. -/ |
| 32 | abbrev SpacetimeModelVector (n : ℕ) := |
| 33 | EuclideanSpace ℝ (Fin 1) × EuclideanSpace ℝ (Fin n) |
| 34 | |
| 35 | /-- Literal horizontal kernel, using the given charts and actual time map. -/ |
| 36 | noncomputable def spacetimeHorizontal {n : ℕ} {X : Type u} [TopologicalSpace X] |
| 37 | [ChartedSpace (ModelProd (EuclideanHalfSpace 1) (EuclideanSpace ℝ (Fin n))) X] |
| 38 | (time : X → ℝ) (p : X) : Submodule ℝ (TangentSpace (spacetimeModel n) p) := |
| 39 | (mfderiv (spacetimeModel n) 𝓘(ℝ) time p).toLinearMap.ker |
| 40 | |
| 41 | /-- The actual level set, with its inherited topology. -/ |
| 42 | abbrev spacetimeSlice {X : Type u} (time : X → ℝ) (t : ℝ) := |
| 43 | {p : X // time p = t} |
| 44 | |
| 45 | /-- Smooth spacetime, normalized time vector, and a smooth horizontal metric |
| 46 | on the exact carrier/topology/time supplied by the atlas. Existence of these |
| 47 | data is a conclusion of M11, never a premise of its raw atlas. -/ |
| 48 | structure GeneralizedFlowSpacetime (n : ℕ) (X : Type u) [TopologicalSpace X] |
| 49 | (time : X → ℝ) (I : SpacetimeInterval) where |
| 50 | chartedSpace : ChartedSpace |
| 51 | (ModelProd (EuclideanHalfSpace 1) (EuclideanSpace ℝ (Fin n))) X |
| 52 | isManifold : IsManifold (spacetimeModel n) ∞ X |
| 53 | t2Space : T2Space X |
| 54 | t3Space : T3Space X |
| 55 | secondCountable : SecondCountableTopology X |
| 56 | time_smooth : ContMDiff (spacetimeModel n) 𝓘(ℝ) ∞ time |
| 57 | time_range : Set.range time = I.domain |
| 58 | boundary_eq : (spacetimeModel n).boundary X = {p | time p ∈ frontier I.domain} |
| 59 | timeVector : ∀ p : X, TangentSpace (spacetimeModel n) p |
| 60 | timeVector_smooth : ContMDiff (spacetimeModel n) |
| 61 | ((spacetimeModel n).prod 𝓘(ℝ, SpacetimeModelVector n)) ∞ |
| 62 | (fun p : X ↦ Bundle.TotalSpace.mk' (SpacetimeModelVector n) |
| 63 | (E := (TangentSpace (spacetimeModel n) : X → Type _)) p (timeVector p)) |
| 64 | timeVector_normalized : ∀ p, |
| 65 | mfderiv (spacetimeModel n) 𝓘(ℝ) time p (timeVector p) = 1 |
| 66 | horizontalTopology : TopologicalSpace |
| 67 | (Bundle.TotalSpace (EuclideanSpace ℝ (Fin n)) (fun p ↦ spacetimeHorizontal (n := n) time p)) |
| 68 | horizontalFiberBundle : FiberBundle (EuclideanSpace ℝ (Fin n)) |
| 69 | (fun p ↦ spacetimeHorizontal (n := n) time p) |
| 70 | horizontalVectorBundle : VectorBundle ℝ (EuclideanSpace ℝ (Fin n)) |
| 71 | (fun p ↦ spacetimeHorizontal (n := n) time p) |
| 72 | horizontalSmoothBundle : ContMDiffVectorBundle ∞ (EuclideanSpace ℝ (Fin n)) |
| 73 | (fun p ↦ spacetimeHorizontal (n := n) time p) (spacetimeModel n) |
| 74 | horizontal_inclusion_smooth : |
| 75 | ContMDiff ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) |
| 76 | ((spacetimeModel n).prod 𝓘(ℝ, SpacetimeModelVector n)) ∞ |
| 77 | (fun v : Bundle.TotalSpace (EuclideanSpace ℝ (Fin n)) |
| 78 | (fun p ↦ spacetimeHorizontal (n := n) time p) ↦ |
| 79 | Bundle.TotalSpace.mk' (SpacetimeModelVector n) |
| 80 | (E := (TangentSpace (spacetimeModel n) : X → Type _)) v.proj v.2.val) |
| 81 | horizontalProjection : ∀ p, TangentSpace (spacetimeModel n) p →L[ℝ] |
| 82 | spacetimeHorizontal (n := n) time p |
| 83 | horizontalProjection_eq : ∀ p v, |
| 84 | (horizontalProjection p v).val = |
| 85 | v - (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) time p v) • timeVector p |
| 86 | horizontalProjection_identity : ∀ p (v : spacetimeHorizontal (n := n) time p), |
| 87 | horizontalProjection p v.val = v |
| 88 | tangent_decomposition : ∀ p v, |
| 89 | v = (show ℝ from mfderiv (spacetimeModel n) 𝓘(ℝ) time p v) • timeVector p + |
| 90 | (horizontalProjection p v).val |
| 91 | horizontalProjection_smooth : |
| 92 | ContMDiff ((spacetimeModel n).prod 𝓘(ℝ, SpacetimeModelVector n)) |
| 93 | ((spacetimeModel n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ |
| 94 | (fun v : TangentBundle (spacetimeModel n) X ↦ |
| 95 | Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) |
| 96 | (E := fun p ↦ spacetimeHorizontal (n := n) time p) v.proj |
| 97 | (horizontalProjection v.proj v.2)) |
| 98 | metric : Bundle.ContMDiffRiemannianMetric (spacetimeModel n) ∞ |
| 99 | (EuclideanSpace ℝ (Fin n)) (fun p ↦ spacetimeHorizontal (n := n) time p) |
| 100 | |
| 101 | namespace GeneralizedFlowSpacetime |
| 102 | |
| 103 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 104 | {I : SpacetimeInterval} |
| 105 | |
| 106 | /-- The original carrier, indexed to retain this witness's chart instances. -/ |
| 107 | abbrev Point (_F : GeneralizedFlowSpacetime n X time I) := X |
| 108 | |
| 109 | instance (F : GeneralizedFlowSpacetime n X time I) : |
| 110 | ChartedSpace (ModelProd (EuclideanHalfSpace 1) (EuclideanSpace ℝ (Fin n))) F.Point := |
| 111 | F.chartedSpace |
| 112 | |
| 113 | instance (F : GeneralizedFlowSpacetime n X time I) : |
| 114 | IsManifold (spacetimeModel n) ∞ F.Point := F.isManifold |
| 115 | |
| 116 | instance (F : GeneralizedFlowSpacetime n X time I) : T2Space F.Point := F.t2Space |
| 117 | |
| 118 | instance (F : GeneralizedFlowSpacetime n X time I) : T3Space F.Point := F.t3Space |
| 119 | |
| 120 | instance (F : GeneralizedFlowSpacetime n X time I) : |
| 121 | SecondCountableTopology F.Point := F.secondCountable |
| 122 | |
| 123 | /-- The unchanged, specified time map. -/ |
| 124 | def timeFunction (F : GeneralizedFlowSpacetime n X time I) : F.Point → ℝ := time |
| 125 | |
| 126 | /-- The kernel fiber in this particular tangent-bundle realization. -/ |
| 127 | noncomputable abbrev Horizontal (F : GeneralizedFlowSpacetime n X time I) |
| 128 | (p : F.Point) : Type := spacetimeHorizontal (n := n) F.timeFunction p |
| 129 | |
| 130 | instance (F : GeneralizedFlowSpacetime n X time I) : TopologicalSpace |
| 131 | (Bundle.TotalSpace (EuclideanSpace ℝ (Fin n)) F.Horizontal) := F.horizontalTopology |
| 132 | |
| 133 | instance (F : GeneralizedFlowSpacetime n X time I) : |
| 134 | FiberBundle (EuclideanSpace ℝ (Fin n)) F.Horizontal := F.horizontalFiberBundle |
| 135 | |
| 136 | instance (F : GeneralizedFlowSpacetime n X time I) : |
| 137 | VectorBundle ℝ (EuclideanSpace ℝ (Fin n)) F.Horizontal := F.horizontalVectorBundle |
| 138 | |
| 139 | instance (F : GeneralizedFlowSpacetime n X time I) : |
| 140 | ContMDiffVectorBundle ∞ (EuclideanSpace ℝ (Fin n)) F.Horizontal (spacetimeModel n) := |
| 141 | F.horizontalSmoothBundle |
| 142 | |
| 143 | /-- The selected metric with this witness's base and bundle instances explicit. -/ |
| 144 | noncomputable abbrev horizontalMetric (F : GeneralizedFlowSpacetime n X time I) : |
| 145 | Bundle.ContMDiffRiemannianMetric (B := F.Point) (spacetimeModel n) ∞ |
| 146 | (EuclideanSpace ℝ (Fin n)) F.Horizontal := F.metric |
| 147 | |
| 148 | /-- The actual time slice; its charts and metric are separate construction outputs. -/ |
| 149 | abbrev Slice (F : GeneralizedFlowSpacetime n X time I) (t : ℝ) := |
| 150 | spacetimeSlice F.timeFunction t |
| 151 | |
| 152 | end GeneralizedFlowSpacetime |
| 153 | |
| 154 | end PoincareMT |