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.RicciFlow.Surgery.Singular.RegularLimit.Spacetime.Assembly |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.RegularLimit.Spacetime.GluingMap |
| 3 | |
| 4 | /-! # The terminal gluing map follows the constructed generalized flow -/ |
| 5 | |
| 6 | set_option autoImplicit false |
| 7 | |
| 8 | open Set |
| 9 | open scoped Manifold ContDiff Bundle Topology |
| 10 | |
| 11 | universe u |
| 12 | |
| 13 | namespace PoincareMT.SingularTimeAssumptions |
| 14 | |
| 15 | variable {M : Type u} [TopologicalSpace M] |
| 16 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 17 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 18 | [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 19 | {F : GeneralizedRicciFlowData.{u}} {T : ℝ} |
| 20 | |
| 21 | theorem terminalGluingMap_vertical_compatibility |
| 22 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 23 | (hΩ : H.reference.regularLimitSet.Nonempty) |
| 24 | (t : ℝ) (_ht : t ∈ Ioc H.reference.tMinus T) |
| 25 | (x : ((H.nonemptyExtension P04 hΩ).extended.slice T).carrier) : |
| 26 | ∃ b, ∃ y : ((H.nonemptyExtension P04 hΩ).extended.box b).carrier.carrier, |
| 27 | ∃ δ : ℝ, 0 < δ ∧ |
| 28 | ∀ s hs, |s - t| < δ → |
| 29 | ∃ hb : s ∈ ((H.nonemptyExtension P04 hΩ).extended.box b).interval, |
| 30 | H.terminalGluingMap P04 (⟨s, hs⟩, x) = |
| 31 | (⟨s, ((H.nonemptyExtension P04 hΩ).extended.box b).forward s hb y⟩ : |
| 32 | (H.nonemptyExtension P04 hΩ).extended.point) := by |
| 33 | refine ⟨.inr PUnit.unit, H.terminalSliceHomeomorph P04 x, 1, by norm_num, ?_⟩ |
| 34 | intro s hs _ |
| 35 | exact ⟨hs, (H.regularBox_spacetime_forward P04 hΩ |
| 36 | (⟨s, hs⟩, H.terminalSliceHomeomorph P04 x)).symm⟩ |
| 37 | |
| 38 | end PoincareMT.SingularTimeAssumptions |