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.Realization.Cylinder.Gluing.Topology |
| 2 | import PoincareLib.Geometry.Spacetime.Realization.Cylinder.Gluing.Differential |
| 3 | |
| 4 | /-! |
| 5 | # Compatible cylinders glued over relatively open time intervals |
| 6 | -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | set_option backward.isDefEq.respectTransparency false |
| 10 | |
| 11 | open scoped Manifold ContDiff Topology |
| 12 | |
| 13 | universe u v w |
| 14 | |
| 15 | open PoincareMT |
| 16 | |
| 17 | namespace Poincare.Spacetime.Realization.CylinderTimeCover |
| 18 | |
| 19 | variable {n : ℕ} {X : Type u} [TopologicalSpace X] {time : X → ℝ} |
| 20 | {I K : SpacetimeInterval} {F : GeneralizedFlowSpacetime n X time I} |
| 21 | {C : Type v} [TopologicalSpace C] [ChartedSpace (EuclideanSpace ℝ (Fin n)) C] |
| 22 | [IsManifold (𝓡 n) ∞ C] (D : CylinderTimeCover.{u, v, w} F K C) |
| 23 | |
| 24 | noncomputable def glued : CompatibleSpacetimeCylinder F (smoothInterval K) C where |
| 25 | interval_subset := by |
| 26 | intro t ht |
| 27 | obtain ⟨b, hb⟩ := D.covers ⟨t, ht⟩ |
| 28 | exact (D.cylinder b).interval_subset hb |
| 29 | toSpacetime := D.map |
| 30 | embedding := D.map_embedding |
| 31 | time_eq := D.map_time |
| 32 | worldline_smooth := D.map_worldline_smooth |
| 33 | worldline_derivative := D.map_worldline_derivative |
| 34 | smooth := D.map_smooth |
| 35 | differential_injective := D.map_differential_injective |
| 36 | |
| 37 | theorem glued_eq (b : D.index) (t : (smoothInterval (D.interval b)).Point) (x : C) : |
| 38 | D.glued.toSpacetime (spacetimeIntervalInclusion (smoothInterval (D.interval b)) |
| 39 | (smoothInterval K) (D.subset b) t, x) = (D.cylinder b).toSpacetime (t, x) := |
| 40 | D.map_eq b t x |
| 41 | |
| 42 | theorem glued_based (b : D.index) (t : (smoothInterval (D.interval b)).Point) |
| 43 | (source : C → F.Point) (h : (D.cylinder b).toCompatibleSpacetimeEmbedding.IsBasedAt t source) : |
| 44 | D.glued.toCompatibleSpacetimeEmbedding.IsBasedAt |
| 45 | (spacetimeIntervalInclusion (smoothInterval (D.interval b)) (smoothInterval K) (D.subset b) t) |
| 46 | source := |
| 47 | fun x ↦ (D.map_eq b t x).trans (h x) |
| 48 | |
| 49 | end Poincare.Spacetime.Realization.CylinderTimeCover |