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.Existence.Lifetime.CanonicalGeometry.CapPersistenceRecutOpen |
| 2 | import Mathlib.Topology.Separation.Regular |
| 3 | import Mathlib.Topology.Order.Compact |
| 4 | |
| 5 | /-! |
| 6 | # Compact closure of each strict inner recut |
| 7 | |
| 8 | A compact neighborhood of the core has frontier in the actual end. |
| 9 | The positive distance of its axial heights from the inner endpoint, |
| 10 | connectedness, and attachment capture the entire remaining inner tail. |
| 11 | Source: Morgan--Tian Proposition 9.79(3), p. 234; |
| 12 | cap-persistence-implementation.md, section 2. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | |
| 20 | namespace PoincareMT.CapCertificate |
| 21 | |
| 22 | variable {M : Type*} [TopologicalSpace M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 24 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 25 | {g : RiemannianMetric 3 M} (N : CapCertificate g) |
| 26 | |
| 27 | /-- The closure of every strict left-anchored recut is compact and |
| 28 | remains in the original cap. Completeness of the ambient metric is |
| 29 | unnecessary for this topological statement (Proposition 9.79(3)). -/ |
| 30 | theorem recutCarrier_compact_closure {b : ℝ} |
| 31 | (hb : -N.epsilon⁻¹ < b) (hb' : b < N.epsilon⁻¹) : |
| 32 | IsCompact (closure (N.recutCarrier b)) ∧ |
| 33 | closure (N.recutCarrier b) ⊆ N.carrier := by |
| 34 | let : LocallyCompactSpace M := ChartedSpace.locallyCompactSpace |
| 35 | (EuclideanSpace ℝ (Fin 3)) M |
| 36 | obtain ⟨W, hW, hYW, hWV, hWc⟩ := exists_open_between_and_isCompact_closure |
| 37 | N.closed_core_compact N.carrier_open N.closed_core_subset_carrier |
| 38 | have hfront : frontier W ⊆ N.end_neck.carrier := by |
| 39 | intro x hx |
| 40 | by_contra he |
| 41 | have hy : x ∈ N.closed_core := by |
| 42 | rw [N.closed_core_eq_complement_end] |
| 43 | exact ⟨hWV hx.1, he⟩ |
| 44 | exact hx.2 (hW.interior_eq.symm ▸ hYW hy) |
| 45 | have hfc : IsCompact (frontier W) := |
| 46 | hWc.of_isClosed_subset isClosed_frontier frontier_subset_closure |
| 47 | obtain ⟨d, hd, hdbound⟩ := hfc.exists_forall_le' |
| 48 | (N.end_neck.coordinate_inverse_smooth.continuousOn.snd.mono hfront) |
| 49 | (a := -N.epsilon⁻¹) (by |
| 50 | intro x hx |
| 51 | have ht := (N.end_neck.coordinate_inverse_mem x (hfront hx)).2.1 |
| 52 | simpa only [N.end_neck_epsilon] using ht) |
| 53 | let c := min ((-N.epsilon⁻¹ + b) / 2) ((-N.epsilon⁻¹ + d) / 2) |
| 54 | have hc : -N.epsilon⁻¹ < c := by |
| 55 | apply lt_min <;> linarith |
| 56 | have hcb : c < b := (min_le_left _ _).trans_lt (by linarith) |
| 57 | have hcd : c < d := (min_le_right _ _).trans_lt (by linarith) |
| 58 | have hSc : IsPreconnected (N.end_neck.region (-N.epsilon⁻¹) c) := by |
| 59 | apply N.end_neck.region_isPreconnected |
| 60 | · rw [N.end_neck_epsilon] |
| 61 | · rw [N.end_neck_epsilon] |
| 62 | exact (hcb.trans hb').le |
| 63 | have hcenter : N.boundary_neck.center ∈ N.boundary_sphere := |
| 64 | N.boundary_eq_neck_sphere.symm ▸ N.boundary_neck.center_on_central_sphere |
| 65 | obtain ⟨y, hyW, hyS⟩ := mem_closure_iff.mp |
| 66 | (N.boundary_subset_inner_end_closure hc hcenter) W hW |
| 67 | (hYW (N.boundary_subset_closed_core hcenter)) |
| 68 | have hSW : N.end_neck.region (-N.epsilon⁻¹) c ⊆ W := by |
| 69 | apply hSc.subset_of_closure_inter_subset hW ⟨y, hyS, hyW⟩ |
| 70 | intro x hx |
| 71 | by_contra hxW |
| 72 | have hxF : x ∈ frontier W := ⟨hx.1, by simpa only [hW.interior_eq] using hxW⟩ |
| 73 | exact (not_lt_of_ge (hdbound x hxF)) (hx.2.2.2.trans hcd) |
| 74 | let K := N.end_neck.coordinate_map '' (univ ×ˢ Icc c b) |
| 75 | have hK : IsCompact K := N.end_neck.isCompact_image_closed_axial_interval |
| 76 | (by simpa only [N.end_neck_epsilon] using hc) |
| 77 | (by simpa only [N.end_neck_epsilon] using hb') |
| 78 | have hKV : K ⊆ N.carrier := |
| 79 | (N.end_neck.image_closed_axial_interval_subset_carrier |
| 80 | (by simpa only [N.end_neck_epsilon] using hc) |
| 81 | (by simpa only [N.end_neck_epsilon] using hb')).trans N.end_neck_subset |
| 82 | have hsplit : N.recutCarrier b ⊆ W ∪ K := by |
| 83 | intro x hx |
| 84 | rcases hx with hxY | hxE |
| 85 | · exact Or.inl (hYW hxY) |
| 86 | · by_cases hxc : (N.end_neck.coordinate_inverse x).2 < c |
| 87 | · exact Or.inl (hSW ⟨hxE.1, hxE.2.1, hxc⟩) |
| 88 | · exact Or.inr ⟨N.end_neck.coordinate_inverse x, |
| 89 | ⟨mem_univ _, le_of_not_gt hxc, hxE.2.2.le⟩, |
| 90 | N.end_neck.coordinate_map_coordinate_inverse hxE.1⟩ |
| 91 | have hcl : closure (N.recutCarrier b) ⊆ closure W ∪ K := by |
| 92 | simpa only [closure_union, hK.isClosed.closure_eq] using closure_mono hsplit |
| 93 | exact ⟨(hWc.union hK).of_isClosed_subset isClosed_closure hcl, |
| 94 | hcl.trans (union_subset hWV hKV)⟩ |
| 95 | |
| 96 | end PoincareMT.CapCertificate |