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.GluingTopology |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.Singular.RegularLimit.Spacetime.TerminalGeometry |
| 3 | |
| 4 | /-! |
| 5 | # Gluing with the actual terminal slice as source |
| 6 | |
| 7 | Composing the regular cylinder chart with the linked terminal slice |
| 8 | identification gives the exact gluing map required by the singular-limit |
| 9 | conclusion, including its literal old-time and terminal-time formulas. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | set_option backward.isDefEq.respectTransparency false |
| 14 | |
| 15 | open Set Function TopologicalSpace Topology |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | noncomputable section |
| 21 | |
| 22 | namespace PoincareMT.SingularTimeAssumptions |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 26 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 27 | [T2Space M] [T3Space M] [SecondCountableTopology M] |
| 28 | {F : GeneralizedRicciFlowData.{u}} {T : ℝ} |
| 29 | (H : SingularTimeAssumptions F T M) (P04 : RicciFlowCurvatureTheory.{u}) |
| 30 | |
| 31 | /-- The gluing cylinder is parameterized by the actual extended terminal slice. -/ |
| 32 | def terminalGluingMap : |
| 33 | Ioc H.reference.tMinus T × (H.extendedSliceGeometry P04 T).slice.carrier → |
| 34 | H.extendedPoint P04 := |
| 35 | H.regularSpacetimeForward P04 ∘ Prod.map id (H.terminalSliceHomeomorph P04) |
| 36 | |
| 37 | @[simp] theorem terminalGluingMap_time |
| 38 | (p : Ioc H.reference.tMinus T × (H.extendedSliceGeometry P04 T).slice.carrier) : |
| 39 | (H.terminalGluingMap P04 p).1 = (p.1 : ℝ) := |
| 40 | H.regularSpacetimeForward_time P04 _ |
| 41 | |
| 42 | theorem terminalGluingMap_old (t : ℝ) (ht : t ∈ Ioc H.reference.tMinus T) |
| 43 | (hlt : t < T) (x : (H.extendedSliceGeometry P04 T).slice.carrier) : |
| 44 | H.terminalGluingMap P04 (⟨t, ht⟩, x) = H.oldSpacetimeForward P04 |
| 45 | (⟨t, H.reference.forward t ⟨le_of_lt ht.1, hlt⟩ (H.terminalSource P04 x)⟩ : F.point) := |
| 46 | H.regularSpacetimeForward_old P04 t ht hlt (H.terminalSliceHomeomorph P04 x) |
| 47 | |
| 48 | @[simp] theorem terminalGluingMap_terminal |
| 49 | (x : (H.extendedSliceGeometry P04 T).slice.carrier) : |
| 50 | H.terminalGluingMap P04 (⟨T, ⟨H.reference.tMinus_lt, le_rfl⟩⟩, x) = |
| 51 | (⟨T, x⟩ : H.extendedPoint P04) := by |
| 52 | change H.regularSpacetimeForward P04 |
| 53 | (⟨T, ⟨H.reference.tMinus_lt, le_rfl⟩⟩, H.terminalSliceHomeomorph P04 x) = _ |
| 54 | rw [H.regularSpacetimeForward_terminal P04, Homeomorph.symm_apply_apply] |
| 55 | |
| 56 | theorem terminalGluingMap_openEmbedding : |
| 57 | @IsOpenEmbedding |
| 58 | (Ioc H.reference.tMinus T × (H.extendedSliceGeometry P04 T).slice.carrier) |
| 59 | (H.extendedPoint P04) _ (H.extendedSpacetimeTopology P04) (H.terminalGluingMap P04) := by |
| 60 | let _ := H.extendedSpacetimeTopology P04 |
| 61 | exact (H.regularSpacetimeForward_isOpenEmbedding P04).comp |
| 62 | (IsOpenEmbedding.id.prodMap (H.terminalSliceHomeomorph P04).isOpenEmbedding) |
| 63 | |
| 64 | theorem terminalGluingMap_range : |
| 65 | range (H.terminalGluingMap P04) = range (H.regularSpacetimeForward P04) := by |
| 66 | ext z |
| 67 | constructor |
| 68 | · rintro ⟨p, rfl⟩ |
| 69 | exact ⟨(p.1, H.terminalSliceHomeomorph P04 p.2), rfl⟩ |
| 70 | · rintro ⟨p, rfl⟩ |
| 71 | refine ⟨(p.1, (H.terminalSliceHomeomorph P04).symm p.2), ?_⟩ |
| 72 | change H.regularSpacetimeForward P04 |
| 73 | (p.1, H.terminalSliceHomeomorph P04 ((H.terminalSliceHomeomorph P04).symm p.2)) = _ |
| 74 | rw [Homeomorph.apply_symm_apply] |
| 75 | |
| 76 | /-- The unchanged old spacetime and the terminal gluing cylinder cover the extension. -/ |
| 77 | theorem terminalGluingMap_cover : |
| 78 | range (H.oldSpacetimeForward P04) ∪ range (H.terminalGluingMap P04) = univ := by |
| 79 | rw [H.terminalGluingMap_range P04] |
| 80 | exact H.old_regular_spacetime_range_union P04 |
| 81 | |
| 82 | end PoincareMT.SingularTimeAssumptions |