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.StrongNeckRestriction |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Lifetime.CanonicalGeometry.CapPersistenceNormalization |
| 3 | import Mathlib.Analysis.Normed.Module.Connected |
| 4 | |
| 5 | /-! |
| 6 | # Compact neck sections and actual inner attachment |
| 7 | |
| 8 | Compact middle sections cannot contain an accumulation point of the cap |
| 9 | boundary. The given negative-half attachment therefore holds for every |
| 10 | shorter inner interval. Source: Morgan-Tian Proposition 9.79(3), p. 234, |
| 11 | and Theorem 12.28, pp. 323-324; cap-persistence-implementation.md, section 2. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle Topology |
| 18 | |
| 19 | namespace PoincareMT.EpsilonNeck |
| 20 | |
| 21 | variable {M : Type*} [TopologicalSpace M] |
| 22 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 23 | {g : RiemannianMetric 3 M} (N : EpsilonNeck g) |
| 24 | |
| 25 | namespace StandardCapImport |
| 26 | |
| 27 | /-- The total displayed neck coordinate is a right inverse on the |
| 28 | actual carrier (cap recutting, Proposition 9.79(3)). -/ |
| 29 | theorem coordinate_map_coordinate_inverse {x : M} (hx : x ∈ N.carrier) : |
| 30 | N.coordinate_map (N.coordinate_inverse x) = x := by |
| 31 | have h := congrArg Subtype.val (N.coordinate_inverse_right x hx) |
| 32 | rw [N.coordinate_map_eq] at h |
| 33 | exact h |
| 34 | |
| 35 | end StandardCapImport |
| 36 | |
| 37 | export StandardCapImport (coordinate_map_coordinate_inverse) |
| 38 | |
| 39 | /-- The axial inverse describes open regions without any regularity |
| 40 | claim for its arbitrary values outside the actual carrier. -/ |
| 41 | theorem region_isOpen (a b : ℝ) : IsOpen (N.region a b) := |
| 42 | N.coordinate_inverse_smooth.continuousOn.snd.isOpen_inter_preimage |
| 43 | N.carrier_open isOpen_Ioo |
| 44 | |
| 45 | /-- Every interval inside the displayed axial domain has exactly its |
| 46 | literal coordinate image as its actual region. -/ |
| 47 | theorem region_eq_image {a b : ℝ} (ha : -N.epsilon⁻¹ ≤ a) (hb : b ≤ N.epsilon⁻¹) : |
| 48 | N.region a b = N.coordinate_map '' (univ ×ˢ Ioo a b) := by |
| 49 | ext x |
| 50 | constructor |
| 51 | · intro hx |
| 52 | exact ⟨N.coordinate_inverse x, ⟨mem_univ _, hx.2⟩, |
| 53 | N.coordinate_map_coordinate_inverse hx.1⟩ |
| 54 | · rintro ⟨z, hz, rfl⟩ |
| 55 | have hzN : z.2 ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := |
| 56 | ⟨ha.trans_lt hz.2.1, hz.2.2.trans_le hb⟩ |
| 57 | refine ⟨N.coordinate_map_mem_of_axial_mem hzN, ?_⟩ |
| 58 | rw [N.coordinate_inverse_coordinate_map_of_axial_mem hzN] |
| 59 | exact hz.2 |
| 60 | |
| 61 | /-- Neck regions are preconnected, including empty intervals. This is |
| 62 | the connectedness used to determine the actual side of a core collar. -/ |
| 63 | theorem region_isPreconnected {a b : ℝ} |
| 64 | (ha : -N.epsilon⁻¹ ≤ a) (hb : b ≤ N.epsilon⁻¹) : IsPreconnected (N.region a b) := by |
| 65 | have hrank : 1 < Module.rank ℝ (EuclideanSpace ℝ (Fin 3)) := by |
| 66 | rw [← Module.finrank_eq_rank, finrank_euclideanSpace_fin] |
| 67 | norm_num |
| 68 | let : PreconnectedSpace UnitTwoSphere := |
| 69 | isPreconnected_iff_preconnectedSpace.mp (isPreconnected_sphere hrank 0 1) |
| 70 | rw [N.region_eq_image ha hb] |
| 71 | apply (isPreconnected_univ.prod isPreconnected_Ioo).image N.coordinate_map |
| 72 | apply N.coordinate_map_smooth.continuousOn.mono |
| 73 | intro z hz |
| 74 | exact ⟨mem_univ _, ha.trans_lt hz.2.1, hz.2.2.trans_le hb⟩ |
| 75 | |
| 76 | /-- On the actual neck, the central sphere is precisely axial height |
| 77 | zero. Both implications use the recorded inverse laws. -/ |
| 78 | theorem mem_central_sphere_iff_of_mem {x : M} (hx : x ∈ N.carrier) : |
| 79 | x ∈ N.central_sphere ↔ (N.coordinate_inverse x).2 = 0 := by |
| 80 | rw [N.central_sphere_eq] |
| 81 | constructor |
| 82 | · rintro ⟨z, hz, rfl⟩ |
| 83 | have hz0 : z.2 = 0 := hz.2 |
| 84 | have h0 : (0 : ℝ) ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := |
| 85 | ⟨neg_neg_of_pos (inv_pos.mpr N.epsilon_pos), inv_pos.mpr N.epsilon_pos⟩ |
| 86 | rw [N.coordinate_inverse_coordinate_map_of_axial_mem (by simpa only [hz0] using h0)] |
| 87 | exact hz0 |
| 88 | · intro hz |
| 89 | exact ⟨N.coordinate_inverse x, ⟨mem_univ _, hz⟩, |
| 90 | N.coordinate_map_coordinate_inverse hx⟩ |
| 91 | |
| 92 | /-- Every open neighborhood of the actual central sphere contains a |
| 93 | whole centered neck strip, with one radius before every sphere point. -/ |
| 94 | theorem exists_centered_region_subset_open {O : Set M} (hO : IsOpen O) |
| 95 | (hSO : N.central_sphere ⊆ O) : |
| 96 | ∃ r : ℝ, 0 < r ∧ r ≤ N.epsilon⁻¹ ∧ N.region (-r) r ⊆ O := by |
| 97 | let W := (univ ×ˢ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹) ∩ N.coordinate_map ⁻¹' O |
| 98 | have hW : IsOpen W := N.coordinate_map_smooth.continuousOn.isOpen_inter_preimage |
| 99 | (isOpen_univ.prod isOpen_Ioo) hO |
| 100 | have he : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 101 | have hSW : (univ : Set UnitTwoSphere) ×ˢ ({0} : Set ℝ) ⊆ W := by |
| 102 | rintro ⟨q, s⟩ ⟨_, hs⟩ |
| 103 | have hs0 : s = 0 := hs |
| 104 | subst s |
| 105 | refine ⟨⟨mem_univ _, neg_neg_of_pos he, he⟩, hSO ?_⟩ |
| 106 | rw [N.central_sphere_eq] |
| 107 | exact ⟨(q, 0), ⟨mem_univ _, rfl⟩, rfl⟩ |
| 108 | obtain ⟨u, v, _, hv, hu, h0v, huv⟩ := |
| 109 | generalized_tube_lemma isCompact_univ isCompact_singleton hW hSW |
| 110 | obtain ⟨δ, hδ, hδv⟩ := Metric.isOpen_iff.mp hv 0 (h0v rfl) |
| 111 | let r := min (δ / 2) (N.epsilon⁻¹ / 2) |
| 112 | have hr : 0 < r := lt_min (half_pos hδ) (half_pos he) |
| 113 | have hrδ : r < δ := (min_le_left _ _).trans_lt (half_lt_self hδ) |
| 114 | refine ⟨r, hr, (min_le_right _ _).trans (half_le_self he.le), ?_⟩ |
| 115 | intro x hx |
| 116 | have hball : (N.coordinate_inverse x).2 ∈ Metric.ball 0 δ := by |
| 117 | rw [Metric.mem_ball, Real.dist_eq, sub_zero, abs_lt] |
| 118 | exact ⟨(neg_lt_neg hrδ).trans hx.2.1, hx.2.2.trans hrδ⟩ |
| 119 | have hxO := (huv ⟨hu (mem_univ _), hδv hball⟩).2 |
| 120 | change N.coordinate_map (N.coordinate_inverse x) ∈ O at hxO |
| 121 | rwa [N.coordinate_map_coordinate_inverse hx.1] at hxO |
| 122 | |
| 123 | /-- A closed axial section inside the open neck has compact actual |
| 124 | image, without assuming properness of the total neck map. -/ |
| 125 | theorem isCompact_image_closed_axial_interval {a b : ℝ} |
| 126 | (ha : -N.epsilon⁻¹ < a) (hb : b < N.epsilon⁻¹) : |
| 127 | IsCompact (N.coordinate_map '' (univ ×ˢ Icc a b)) := by |
| 128 | apply (isCompact_univ.prod isCompact_Icc).image_of_continuousOn |
| 129 | apply N.coordinate_map_smooth.continuousOn.mono |
| 130 | intro z hz |
| 131 | exact ⟨mem_univ _, ha.trans_le hz.2.1, hz.2.2.trans_lt hb⟩ |
| 132 | |
| 133 | /-- Every point in a compact axial section is in the literal old neck |
| 134 | carrier; the bound is checked in the coordinate domain. -/ |
| 135 | theorem image_closed_axial_interval_subset_carrier {a b : ℝ} |
| 136 | (ha : -N.epsilon⁻¹ < a) (hb : b < N.epsilon⁻¹) : |
| 137 | N.coordinate_map '' (univ ×ˢ Icc a b) ⊆ N.carrier := by |
| 138 | rintro _ ⟨z, hz, rfl⟩ |
| 139 | exact N.coordinate_map_mem_of_axial_mem ⟨ha.trans_le hz.2.1, hz.2.2.trans_lt hb⟩ |
| 140 | |
| 141 | end PoincareMT.EpsilonNeck |
| 142 | |
| 143 | namespace PoincareMT.CapCertificate |
| 144 | |
| 145 | variable {M : Type*} [TopologicalSpace M] |
| 146 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 147 | [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 148 | {g : RiemannianMetric 3 M} (N : CapCertificate g) |
| 149 | |
| 150 | namespace StandardCapImport |
| 151 | |
| 152 | /-- The actual boundary is part of the compact closed core. -/ |
| 153 | theorem boundary_subset_closed_core : N.boundary_sphere ⊆ N.closed_core := by |
| 154 | rw [← N.core_frontier_eq_boundary] |
| 155 | exact frontier_subset_closure.trans N.closed_core_compact.isClosed.closure_subset |
| 156 | |
| 157 | end StandardCapImport |
| 158 | |
| 159 | export StandardCapImport (boundary_subset_closed_core) |
| 160 | |
| 161 | /-- The recorded core and end are disjoint by their exact complement |
| 162 | identity; no choice of collar orientation is needed. -/ |
| 163 | theorem core_disjoint_end_neck : Disjoint N.core N.end_neck.carrier := by |
| 164 | apply Set.disjoint_left.mpr |
| 165 | intro x hx he |
| 166 | have hy : x ∈ N.closed_core := interior_subset (N.core_eq_interior_closed_core ▸ hx) |
| 167 | rw [N.closed_core_eq_complement_end] at hy |
| 168 | exact hy.2 he |
| 169 | |
| 170 | /-- The actual boundary attaches at the inner end below every interior |
| 171 | height, not only below the recorded half-height (Proposition 9.79(3)). -/ |
| 172 | theorem boundary_subset_inner_end_closure {b : ℝ} (hb : -N.epsilon⁻¹ < b) : |
| 173 | N.boundary_sphere ⊆ closure (N.end_neck.region (-N.epsilon⁻¹) b) := by |
| 174 | by_cases hhalf : -N.epsilon⁻¹ / 2 ≤ b |
| 175 | · apply N.boundary_subset_negative_end_closure.trans |
| 176 | apply closure_mono |
| 177 | intro x hx |
| 178 | exact ⟨hx.1, hx.2.1, hx.2.2.trans_le hhalf⟩ |
| 179 | have hblow : -N.end_neck.epsilon⁻¹ < b := by rwa [N.end_neck_epsilon] |
| 180 | have hhigh : -N.epsilon⁻¹ / 2 < N.end_neck.epsilon⁻¹ := by |
| 181 | rw [N.end_neck_epsilon] |
| 182 | have he : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 183 | linarith |
| 184 | let K := N.end_neck.coordinate_map '' (univ ×ˢ Icc b (-N.epsilon⁻¹ / 2)) |
| 185 | have hK : IsCompact K := N.end_neck.isCompact_image_closed_axial_interval hblow hhigh |
| 186 | have hKend : K ⊆ N.end_neck.carrier := |
| 187 | N.end_neck.image_closed_axial_interval_subset_carrier hblow hhigh |
| 188 | have hsplit : N.end_neck.region (-N.epsilon⁻¹) (-N.epsilon⁻¹ / 2) ⊆ |
| 189 | N.end_neck.region (-N.epsilon⁻¹) b ∪ K := by |
| 190 | intro x hx |
| 191 | by_cases hxb : (N.end_neck.coordinate_inverse x).2 < b |
| 192 | · exact Or.inl ⟨hx.1, hx.2.1, hxb⟩ |
| 193 | · apply Or.inr |
| 194 | refine ⟨N.end_neck.coordinate_inverse x, ⟨mem_univ _, le_of_not_gt hxb, hx.2.2.le⟩, |
| 195 | N.end_neck.coordinate_map_coordinate_inverse hx.1⟩ |
| 196 | intro x hx |
| 197 | have hxsplit := closure_mono hsplit (N.boundary_subset_negative_end_closure hx) |
| 198 | rw [closure_union, hK.isClosed.closure_eq] at hxsplit |
| 199 | rcases hxsplit with hxinner | hxK |
| 200 | · exact hxinner |
| 201 | · have hxcore := N.boundary_subset_closed_core hx |
| 202 | rw [N.closed_core_eq_complement_end] at hxcore |
| 203 | exact False.elim (hxcore.2 (hKend hxK)) |
| 204 | |
| 205 | end PoincareMT.CapCertificate |