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.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.CapTopology.CompactNeighborhood |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.CapTopology.InnerAttachment |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Persistence.CapTopology.NeckCollar |
| 5 | import Mathlib.Topology.Order.Compact |
| 6 | |
| 7 | /-! |
| 8 | # Compact closure of the actual cap recut |
| 9 | |
| 10 | Morgan--Tian Proposition 9.79, pp. 232-234, and task record |
| 11 | `cap-topology/2026-09-22-recut-plan.md`. Compactness follows from the |
| 12 | actual inner attachment and compact end slabs. This proof neither uses |
| 13 | ambient completeness nor assumes that the recut is open. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open scoped Manifold ContDiff Bundle Topology |
| 19 | open Set |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.CapCertificate |
| 24 | |
| 25 | variable {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 27 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 28 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 29 | |
| 30 | /-- The actual core together with an inner end interval has compact closure |
| 31 | inside the original cap. No open-recut hypothesis is used (Proposition |
| 32 | 9.79, pp. 232-234). -/ |
| 33 | theorem compact_closure_recut (N : CapCertificate g) {b : ℝ} |
| 34 | (hb : -N.epsilon⁻¹ < b) (hb' : b < N.epsilon⁻¹) : |
| 35 | IsCompact (closure (N.closed_core ∪ N.end_neck.region (-N.epsilon⁻¹) b)) ∧ |
| 36 | closure (N.closed_core ∪ N.end_neck.region (-N.epsilon⁻¹) b) ⊆ N.carrier := by |
| 37 | have heps : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 38 | obtain ⟨W, hW, hYW, _, hWc, hWV⟩ := |
| 39 | N.exists_compact_collar_neighborhood (a := 0) (b := 0) (neg_neg_of_pos heps) heps |
| 40 | have hfront : frontier W ⊆ N.end_neck.carrier := by |
| 41 | intro x hx |
| 42 | have hxV := hWV (frontier_subset_closure hx) |
| 43 | have hxnotW : x ∉ W := (hW.frontier_eq ▸ hx).2 |
| 44 | by_contra hxE |
| 45 | have hxY : x ∈ N.closed_core := by |
| 46 | rw [N.closed_core_eq_complement_end] |
| 47 | exact ⟨hxV, hxE⟩ |
| 48 | exact hxnotW (hYW hxY) |
| 49 | have hfc : IsCompact (frontier W) := |
| 50 | hWc.of_isClosed_subset isClosed_frontier frontier_subset_closure |
| 51 | have hfcont : ContinuousOn (fun x => (N.end_neck.coordinate_inverse x).2) |
| 52 | (frontier W) := |
| 53 | (continuous_snd.comp_continuousOn |
| 54 | N.end_neck.coordinate_inverse_smooth.continuousOn).mono hfront |
| 55 | have hflow : ∀ x ∈ frontier W, -N.epsilon⁻¹ < |
| 56 | (N.end_neck.coordinate_inverse x).2 := by |
| 57 | intro x hx |
| 58 | simpa only [N.end_neck_epsilon] using |
| 59 | (N.end_neck.coordinate_inverse_mem x (hfront hx)).2.1 |
| 60 | obtain ⟨m, hm, hmin⟩ := hfc.exists_forall_le' hfcont hflow |
| 61 | obtain ⟨c, hc, hcm⟩ := exists_between (lt_min hm hb) |
| 62 | have hcm' : c < m := hcm.trans_le (min_le_left _ _) |
| 63 | have hcb : c < b := hcm.trans_le (min_le_right _ _) |
| 64 | have hconn : IsPreconnected (N.end_neck.region (-N.epsilon⁻¹) c) := |
| 65 | N.end_neck.isPreconnected_region (by simp only [N.end_neck_epsilon, le_refl]) |
| 66 | (by simpa only [N.end_neck_epsilon] using (hcb.trans hb').le) |
| 67 | have hS : N.boundary_neck.center ∈ N.boundary_sphere := |
| 68 | N.boundary_eq_neck_sphere.symm ▸ N.boundary_neck.center_on_central_sphere |
| 69 | obtain ⟨y, hyW, hyR⟩ := mem_closure_iff.mp |
| 70 | (N.boundary_subset_closure_inner_end hc hS) W hW |
| 71 | (hYW (N.boundary_subset_closed_core_m28 hS)) |
| 72 | have hinner : N.end_neck.region (-N.epsilon⁻¹) c ⊆ W := by |
| 73 | apply hconn.subset_of_closure_inter_subset hW ⟨y, hyR, hyW⟩ |
| 74 | intro x hx |
| 75 | by_contra hxW |
| 76 | have hxf : x ∈ frontier W := hW.frontier_eq.symm ▸ ⟨hx.1, hxW⟩ |
| 77 | exact (not_lt_of_ge (hmin x hxf)) (hx.2.2.2.trans hcm') |
| 78 | let T : Set M := N.end_neck.coordinate_map '' (univ ×ˢ Icc c b) |
| 79 | have hTc : IsCompact T := N.end_neck.isCompact_coordinate_slab_intrinsic |
| 80 | (by simpa only [N.end_neck_epsilon] using hc) |
| 81 | (by simpa only [N.end_neck_epsilon] using hb') |
| 82 | have hTV : T ⊆ N.carrier := |
| 83 | (N.end_neck.coordinate_slab_subset_carrier_m28 |
| 84 | (by simpa only [N.end_neck_epsilon] using hc) |
| 85 | (by simpa only [N.end_neck_epsilon] using hb')).trans N.end_neck_subset |
| 86 | have hcut : N.closed_core ∪ N.end_neck.region (-N.epsilon⁻¹) b ⊆ closure W ∪ T := by |
| 87 | intro x hx |
| 88 | rcases hx with hx | hx |
| 89 | · exact Or.inl (subset_closure (hYW hx)) |
| 90 | · by_cases hxc : (N.end_neck.coordinate_inverse x).2 < c |
| 91 | · exact Or.inl (subset_closure (hinner ⟨hx.1, hx.2.1, hxc⟩)) |
| 92 | · exact Or.inr ⟨N.end_neck.coordinate_inverse x, |
| 93 | ⟨mem_univ _, le_of_not_gt hxc, hx.2.2.le⟩, |
| 94 | N.end_neck.coordinate_map_coordinate_inverse hx.1⟩ |
| 95 | have hcl := closure_minimal hcut (hWc.union hTc).isClosed |
| 96 | exact ⟨(hWc.union hTc).of_isClosed_subset isClosed_closure hcl, |
| 97 | hcl.trans (union_subset hWV hTV)⟩ |
| 98 | |
| 99 | end PoincareMT.CapCertificate |