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.StandardCap.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Uniqueness.Blowup.Neck.Geometry.NeckExitTime |
| 3 | |
| 4 | /-! |
| 5 | # First exit from any point of an inner cylinder slab |
| 6 | |
| 7 | Morgan-Tian Theorem 12.32, pp. 326-327, initial-neck alternative. |
| 8 | The initial point can lie anywhere in the smaller open axial slab. |
| 9 | The first exit remains in its compact closure, with the full preceding |
| 10 | path retained in the original actual neck. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Bundle Topology |
| 17 | |
| 18 | namespace PoincareMT.StandardCylinderPatch |
| 19 | |
| 20 | /-- The actual first-exit argument with an arbitrary starting |
| 21 | point in the open inner slab. -/ |
| 22 | theorem exists_first_axial_exit_of_mem {length : ℝ} {center : StandardCapSpace} |
| 23 | (N : StandardCylinderPatch length center) {a : ℝ} (hal : a < length) |
| 24 | (gamma : ℝ → StandardCapSpace) (hgamma : ContinuousOn gamma (Icc 0 1)) |
| 25 | (hstart : gamma 0 ∈ N.coordinate '' (univ ×ˢ Ioo (-a) a)) |
| 26 | (hend : gamma 1 ∉ N.carrier) : |
| 27 | ∃ t ∈ Ioc (0 : ℝ) 1, |
| 28 | (∀ s ∈ Icc 0 t, gamma s ∈ N.coordinate '' (univ ×ˢ Icc (-a) a)) ∧ |
| 29 | |(N.inverse (gamma t)).2| = a := by |
| 30 | let U := N.coordinate '' (univ ×ˢ Ioo (-a) a) |
| 31 | let K := N.coordinate '' (univ ×ˢ Icc (-a) a) |
| 32 | have hU : IsOpen U := N.open_axial_slab hal.le |
| 33 | have hK : IsClosed K := (N.compact_axial_slab hal).isClosed |
| 34 | have hUK : U ⊆ K := image_mono (prod_mono Subset.rfl Ioo_subset_Icc_self) |
| 35 | have hKC : K ⊆ N.carrier := N.closed_axial_slab_subset_carrier hal |
| 36 | have hzero : gamma 0 ∈ U := hstart |
| 37 | let T := Icc (0 : ℝ) 1 ∩ gamma ⁻¹' Uᶜ |
| 38 | have hT : IsCompact T := isCompact_Icc.of_isClosed_subset |
| 39 | (hgamma.preimage_isClosed_of_isClosed isClosed_Icc hU.isClosed_compl) inter_subset_left |
| 40 | have hone : (1 : ℝ) ∈ T := ⟨⟨by norm_num, le_rfl⟩, |
| 41 | fun h => hend (hKC (hUK h))⟩ |
| 42 | obtain ⟨t, ht, hmin⟩ := hT.exists_isMinOn ⟨1, hone⟩ continuousOn_id |
| 43 | have htpos : 0 < t := by |
| 44 | by_contra h |
| 45 | have heq : t = 0 := le_antisymm (le_of_not_gt h) ht.1.1 |
| 46 | exact ht.2 (heq ▸ hzero) |
| 47 | have hbefore : ∀ s ∈ Ico 0 t, gamma s ∈ U := by |
| 48 | intro s hs |
| 49 | by_contra h |
| 50 | have hsmall : t ≤ s := hmin ⟨⟨hs.1, hs.2.le.trans ht.1.2⟩, h⟩ |
| 51 | exact (not_lt_of_ge hsmall) hs.2 |
| 52 | have hendK : gamma t ∈ K := by |
| 53 | have hc : ContinuousWithinAt gamma (Ico 0 t) t := |
| 54 | (hgamma t ht.1).mono (fun s hs => ⟨hs.1, hs.2.le.trans ht.1.2⟩) |
| 55 | have hcl : t ∈ closure (Ico 0 t) := by |
| 56 | rw [closure_Ico htpos.ne] |
| 57 | exact ⟨htpos.le, le_rfl⟩ |
| 58 | exact hK.closure_eq ▸ hc.mem_closure hcl (fun s hs => hUK (hbefore s hs)) |
| 59 | refine ⟨t, ⟨htpos, ht.1.2⟩, ?_, N.axial_abs_eq_at_slab_exit hal hendK ht.2⟩ |
| 60 | intro s hs |
| 61 | rcases hs.2.eq_or_lt with rfl | hst |
| 62 | · exact hendK |
| 63 | · exact hUK (hbefore s ⟨hs.1, hst⟩) |
| 64 | |
| 65 | end PoincareMT.StandardCylinderPatch |