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.NeckRegions |
| 3 | |
| 4 | /-! |
| 5 | # Every inner end interval attaches to the cap boundary |
| 6 | |
| 7 | Morgan--Tian Definition 9.72, pp. 230-231, and Proposition 9.79, |
| 8 | pp. 232-234. Compact slabs let us shorten the frozen negative-end |
| 9 | attachment to any inner axial cutoff strictly inside the actual strip. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open scoped Manifold ContDiff Bundle Topology |
| 15 | open Set |
| 16 | |
| 17 | universe u |
| 18 | |
| 19 | namespace PoincareMT.CapCertificate |
| 20 | |
| 21 | variable {M : Type u} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 23 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 24 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 25 | |
| 26 | omit [T2Space M] in |
| 27 | /-- The actual cap boundary is disjoint from its open end neck |
| 28 | (Definition 9.72, pp. 230-231). -/ |
| 29 | theorem boundary_disjoint_end (N : CapCertificate g) : |
| 30 | Disjoint N.boundary_sphere N.end_neck.carrier := by |
| 31 | apply disjoint_left.mpr |
| 32 | intro x hxS hxE |
| 33 | have hxf : x ∈ frontier N.end_neck.carrier := |
| 34 | (N.boundary_eq_end_frontier ▸ hxS).2 |
| 35 | exact hxf.2 (N.end_neck.carrier_open.interior_eq.symm ▸ hxE) |
| 36 | |
| 37 | omit [T2Space M] in |
| 38 | /-- The recorded boundary is in the actual compact closed core |
| 39 | (Definition 9.72, pp. 230-231). -/ |
| 40 | theorem boundary_subset_closed_core_m28 (N : CapCertificate g) : |
| 41 | N.boundary_sphere ⊆ N.closed_core := by |
| 42 | intro x hx |
| 43 | rw [N.closed_core_eq_complement_end] |
| 44 | exact ⟨N.boundary_subset hx, fun he => disjoint_left.mp N.boundary_disjoint_end hx he⟩ |
| 45 | |
| 46 | /-- The boundary of the cap is approached through every inner end interval, |
| 47 | not just the negative half retained by the certificate (Proposition 9.79, |
| 48 | pp. 232-234; task derivation 10, section 6). -/ |
| 49 | theorem boundary_subset_closure_inner_end (N : CapCertificate g) {c : ℝ} |
| 50 | (hc : -N.epsilon⁻¹ < c) : |
| 51 | N.boundary_sphere ⊆ closure (N.end_neck.region (-N.epsilon⁻¹) c) := by |
| 52 | have heps : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 53 | have hdhi : -N.epsilon⁻¹ / 2 < N.end_neck.epsilon⁻¹ := by |
| 54 | rw [N.end_neck_epsilon] |
| 55 | linarith |
| 56 | by_cases hdc : -N.epsilon⁻¹ / 2 ≤ c |
| 57 | · apply N.boundary_subset_negative_end_closure.trans (closure_mono ?_) |
| 58 | intro x hx |
| 59 | exact ⟨hx.1, hx.2.1, hx.2.2.trans_le hdc⟩ |
| 60 | · let T : Set M := N.end_neck.coordinate_map '' |
| 61 | (univ ×ˢ Icc c (-N.epsilon⁻¹ / 2)) |
| 62 | have hTcompact : IsCompact T := |
| 63 | N.end_neck.isCompact_coordinate_slab_intrinsic |
| 64 | (by simpa only [N.end_neck_epsilon] using hc) hdhi |
| 65 | have hTend : T ⊆ N.end_neck.carrier := |
| 66 | N.end_neck.coordinate_slab_subset_carrier_m28 |
| 67 | (by simpa only [N.end_neck_epsilon] using hc) hdhi |
| 68 | have hsplit : N.end_neck.region (-N.epsilon⁻¹) (-N.epsilon⁻¹ / 2) ⊆ |
| 69 | N.end_neck.region (-N.epsilon⁻¹) c ∪ T := by |
| 70 | intro x hx |
| 71 | by_cases hxc : (N.end_neck.coordinate_inverse x).2 < c |
| 72 | · exact Or.inl ⟨hx.1, hx.2.1, hxc⟩ |
| 73 | · exact Or.inr ⟨N.end_neck.coordinate_inverse x, |
| 74 | ⟨mem_univ _, le_of_not_gt hxc, hx.2.2.le⟩, |
| 75 | N.end_neck.coordinate_map_coordinate_inverse hx.1⟩ |
| 76 | intro x hxS |
| 77 | have hx := closure_mono hsplit (N.boundary_subset_negative_end_closure hxS) |
| 78 | rw [closure_union, hTcompact.isClosed.closure_eq] at hx |
| 79 | rcases hx with hx | hx |
| 80 | · exact hx |
| 81 | · exact False.elim (disjoint_left.mp N.boundary_disjoint_end hxS (hTend hx)) |
| 82 | |
| 83 | end PoincareMT.CapCertificate |