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.Tube.NeckGeometry.NeckMinimizerTraversal |
| 3 | |
| 4 | /-! |
| 5 | # A regional neck minimum reaches every prescribed axial level |
| 6 | |
| 7 | This is the whole-carrier form of the neck traversal step. The collar |
| 8 | radius is chosen after the target point, so the result is not restricted to |
| 9 | the nine-tenths core. The only path containment used below is the literal |
| 10 | carrier of the selected neck. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.M28 |
| 21 | |
| 22 | variable {M : Type u} [TopologicalSpace M] [T2Space M] |
| 23 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] [IsManifold (𝓡 3) ∞ M] |
| 24 | {g : RiemannianMetric 3 M} |
| 25 | |
| 26 | private theorem exists_two_contained_collar_levels_same_level (W : EpsilonNeck g) |
| 27 | {r : ℝ} (hr : 0 < r) (hrA : r < W.epsilon⁻¹) |
| 28 | {γ : ℝ → M} {a b t : ℝ} (hat : a < t) (htb : t < b) |
| 29 | (hγ : ContinuousOn γ (Icc a b)) (hcenter : γ t = W.center) |
| 30 | (haout : γ a ∉ W.carrier) (hbout : γ b ∉ W.carrier) : |
| 31 | ∃ c ∈ Ioo a t, ∃ d ∈ Ioo t b, MapsTo γ (Icc c d) W.carrier ∧ |
| 32 | |(W.coordinate_inverse (γ c)).2| = r ∧ |
| 33 | |(W.coordinate_inverse (γ d)).2| = r := by |
| 34 | have htcenter : γ t ∈ W.central_sphere := by |
| 35 | rw [hcenter] |
| 36 | exact W.center_on_central_sphere |
| 37 | have htzero : (W.coordinate_inverse (γ t)).2 = 0 := |
| 38 | (W.mem_central_sphere_iff_of_mem_carrier |
| 39 | (W.central_sphere_subset htcenter)).mp htcenter |
| 40 | obtain ⟨d, htd, hdb, hdW, hdlevel⟩ := W.exists_first_neck_collar_subarc hr hrA |
| 41 | htb.le (hγ.mono (Icc_subset_Icc hat.le le_rfl)) htcenter |
| 42 | (fun h => hbout h.1) |
| 43 | have hdb' : d < b := lt_of_le_of_ne hdb (by |
| 44 | intro heq |
| 45 | subst d |
| 46 | exact hbout (hdW (right_mem_Icc.mpr htd.le))) |
| 47 | let η : ℝ → M := fun s => γ (-s) |
| 48 | have hneg : MapsTo (fun s : ℝ => -s) (Icc (-t) (-a)) (Icc a b) := by |
| 49 | intro s hs |
| 50 | constructor <;> linarith only [hs.1, hs.2, htb] |
| 51 | have hη : ContinuousOn η (Icc (-t) (-a)) := |
| 52 | hγ.comp (show Continuous (fun s : ℝ => -s) from continuous_neg).continuousOn hneg |
| 53 | have hηcenter : η (-t) ∈ W.central_sphere := by |
| 54 | simpa only [η, neg_neg] using htcenter |
| 55 | have hηout : η (-a) ∉ W.region (-r) r := by |
| 56 | intro h |
| 57 | apply haout |
| 58 | simpa only [η, neg_neg] using h.1 |
| 59 | obtain ⟨e, hte, hea, heW, helevel⟩ := W.exists_first_neck_collar_subarc hr hrA |
| 60 | (neg_le_neg hat.le) hη hηcenter hηout |
| 61 | have hac : a ≤ -e := by linarith only [hea] |
| 62 | have hct : -e < t := by linarith only [hte] |
| 63 | have hleft : MapsTo γ (Icc (-e) t) W.carrier := by |
| 64 | intro s hs |
| 65 | have hs' : -s ∈ Icc (-t) e := ⟨neg_le_neg hs.2, by linarith only [hs.1]⟩ |
| 66 | simpa only [η, neg_neg] using heW hs' |
| 67 | have hac' : a < -e := lt_of_le_of_ne hac (by |
| 68 | intro heq |
| 69 | apply haout |
| 70 | rw [heq] |
| 71 | exact hleft (left_mem_Icc.mpr hct.le)) |
| 72 | refine ⟨-e, ⟨hac', hct⟩, d, ⟨htd, hdb'⟩, ?_, ?_, ?_⟩ |
| 73 | · intro s hs |
| 74 | by_cases hst : s ≤ t |
| 75 | · exact hleft ⟨hs.1, hst⟩ |
| 76 | · exact hdW ⟨(lt_of_not_ge hst).le, hs.2⟩ |
| 77 | · simpa only [η, neg_neg, htzero, sub_zero] using helevel |
| 78 | · simpa only [htzero, sub_zero] using hdlevel |
| 79 | |
| 80 | variable [MeasurableSpace M] [BorelSpace M] [T3Space M] |
| 81 | |
| 82 | /-- A regional C1 minimum through a neck center reaches an arbitrary |
| 83 | whole-carrier axial level. The returned subinterval joining the level point |
| 84 | to the center remains in the literal neck carrier. -/ |
| 85 | theorem exists_neck_minimizer_same_level (W : EpsilonNeck g) |
| 86 | (hε : W.epsilon ≤ (1 / 1000 : ℝ)) {U : Set M} (hWU : W.carrier ⊆ U) |
| 87 | {γ : ℝ → M} {a b t : ℝ} (hat : a < t) (htb : t < b) |
| 88 | (hγ : ContMDiffOn 𝓘(ℝ, ℝ) (𝓡 3) 1 γ (Icc a b)) |
| 89 | (hγU : MapsTo γ (Icc a b) U) |
| 90 | (hmin : g.pathELength γ a b = intrinsicEDist g U (γ a) (γ b)) |
| 91 | (hcenter : γ t = W.center) |
| 92 | (haout : γ a ∉ W.carrier) (hbout : γ b ∉ W.carrier) |
| 93 | {x : M} (hx : x ∈ W.carrier) : |
| 94 | ∃ c ∈ Ioo a t, ∃ d ∈ Ioo t b, ∃ v ∈ Icc c d, |
| 95 | MapsTo γ (Icc c d) W.carrier ∧ |
| 96 | MapsTo γ (Icc (min v t) (max v t)) W.carrier ∧ |
| 97 | (W.coordinate_inverse (γ v)).2 = (W.coordinate_inverse x).2 ∧ |
| 98 | intrinsicEDist g W.carrier x (γ v) ≤ |
| 99 | ENNReal.ofReal |
| 100 | (W.scale * Real.sqrt (1 + W.epsilon) * Real.sqrt 2 * |
| 101 | (Real.pi + 1)) := by |
| 102 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : M → Type _) := |
| 103 | ⟨g.toRiemannianMetric⟩ |
| 104 | let A : ℝ := W.epsilon⁻¹ |
| 105 | have hApos : 0 < A := by |
| 106 | dsimp [A] |
| 107 | exact inv_pos.mpr W.epsilon_pos |
| 108 | have hA : (1000 : ℝ) ≤ A := by |
| 109 | have h := mul_le_mul_of_nonneg_right hε hApos.le |
| 110 | dsimp [A] at h ⊢ |
| 111 | rw [mul_inv_cancel₀ W.epsilon_pos.ne'] at h |
| 112 | linarith only [h] |
| 113 | have hxheight : |(W.coordinate_inverse x).2| < A := by |
| 114 | dsimp [A] |
| 115 | exact abs_lt.mpr (W.coordinate_inverse_mem x hx).2 |
| 116 | have hhalf : A / 2 < A := by linarith only [hApos] |
| 117 | have hmax : max (A / 2) |(W.coordinate_inverse x).2| < A := |
| 118 | max_lt hhalf hxheight |
| 119 | obtain ⟨r, hrlo, hrhi⟩ := exists_between hmax |
| 120 | have hrpos : 0 < r := by |
| 121 | exact (lt_of_lt_of_le (by positivity : 0 < A / 2) (le_max_left _ _)).trans hrlo |
| 122 | obtain ⟨c, hc, d, hd, hcdW, hcabs, hdabs⟩ := |
| 123 | exists_two_contained_collar_levels_same_level W hrpos (by simpa [A] using hrhi) |
| 124 | hat htb hγ.continuousOn hcenter haout hbout |
| 125 | have hfinite : g.pathELength γ a b ≠ ⊤ := by |
| 126 | rw [pathELength_eq_integral_fixed_segment_speed g hγ le_rfl |
| 127 | (hat.trans htb).le le_rfl] |
| 128 | exact ENNReal.ofReal_ne_top |
| 129 | have hcd : c < d := hc.2.trans hd.1 |
| 130 | have hminimum := pathELength_eq_intrinsicEDist_subsegment g hc.1.le hcd.le hd.2.le |
| 131 | hγ hγU hfinite hmin |
| 132 | have hneq : (W.coordinate_inverse (γ c)).2 ≠ |
| 133 | (W.coordinate_inverse (γ d)).2 := by |
| 134 | intro hequal |
| 135 | have hcW : γ c ∈ W.carrier := hcdW (left_mem_Icc.mpr hcd.le) |
| 136 | have hdW : γ d ∈ W.carrier := hcdW (right_mem_Icc.mpr hcd.le) |
| 137 | have hupper := (intrinsicEDist_mono_of_subset (g := g) hWU).trans |
| 138 | (W.intrinsicEDist_le_axial_add hcW hdW) |
| 139 | rw [← hequal, sub_self, abs_zero, zero_add] at hupper |
| 140 | have hroot : Real.sqrt (1 + W.epsilon) ≤ (2 : ℝ) := by |
| 141 | apply (Real.sqrt_le_iff).mpr |
| 142 | constructor |
| 143 | · norm_num |
| 144 | · linarith only [W.epsilon_lt_half] |
| 145 | have hsqrt2 : Real.sqrt 2 ≤ (2 : ℝ) := |
| 146 | (Real.sqrt_le_iff).mpr ⟨by norm_num, by norm_num⟩ |
| 147 | have hsphere : Real.sqrt 2 * (Real.pi + 1) ≤ (10 : ℝ) := by |
| 148 | calc |
| 149 | _ ≤ 2 * (Real.pi + 1) := |
| 150 | mul_le_mul_of_nonneg_right hsqrt2 (by positivity) |
| 151 | _ ≤ 10 := by linarith only [Real.pi_le_four] |
| 152 | have hcoefficient : Real.sqrt (1 + W.epsilon) * |
| 153 | (Real.sqrt 2 * (Real.pi + 1)) ≤ (20 : ℝ) := by |
| 154 | have h := mul_le_mul hroot hsphere |
| 155 | (by positivity : 0 ≤ Real.sqrt 2 * (Real.pi + 1)) (by norm_num) |
| 156 | norm_num at h |
| 157 | exact h |
| 158 | have hscaled : W.scale * Real.sqrt (1 + W.epsilon) * |
| 159 | (Real.sqrt 2 * (Real.pi + 1)) ≤ 20 * W.scale := by |
| 160 | have h := mul_le_mul_of_nonneg_left hcoefficient W.scale_pos.le |
| 161 | nlinarith only [h] |
| 162 | have hshort : intrinsicEDist g U (γ c) (γ d) ≤ |
| 163 | ENNReal.ofReal (20 * W.scale) := |
| 164 | hupper.trans (ENNReal.ofReal_le_ofReal hscaled) |
| 165 | have htzero : (W.coordinate_inverse (γ t)).2 = 0 := by |
| 166 | rw [hcenter] |
| 167 | exact (W.mem_central_sphere_iff_of_mem_carrier |
| 168 | (W.central_sphere_subset W.center_on_central_sphere)).mp |
| 169 | W.center_on_central_sphere |
| 170 | have hcost := path_axial_displacement_le W hc.2.le |
| 171 | (hγ.mono (Icc_subset_Icc hc.1.le htb.le)) |
| 172 | (fun s hs => hcdW ⟨hs.1, hs.2.trans hd.1.le⟩) |
| 173 | rw [htzero, zero_sub, abs_neg, hcabs] at hcost |
| 174 | have hlong : ENNReal.ofReal ((W.scale / 2) * r) ≤ |
| 175 | g.pathELength γ c d := |
| 176 | hcost.trans (Manifold.pathELength_mono le_rfl hd.1.le) |
| 177 | rw [hminimum] at hlong |
| 178 | have hrhalf : A / 2 < r := (le_max_left _ _).trans_lt hrlo |
| 179 | have hgap : 20 * W.scale < (W.scale / 2) * r := by |
| 180 | have hbase : (20 : ℝ) < (1 / 2 : ℝ) * r := by |
| 181 | nlinarith only [hA, hrhalf] |
| 182 | have hs := mul_lt_mul_of_pos_left hbase W.scale_pos |
| 183 | nlinarith only [hs] |
| 184 | have hpositive : 0 < (W.scale / 2) * r := |
| 185 | mul_pos (div_pos W.scale_pos (by norm_num)) hrpos |
| 186 | exact (not_lt_of_ge (hlong.trans hshort)) |
| 187 | ((ENNReal.ofReal_lt_ofReal_iff hpositive).mpr hgap) |
| 188 | have hheight : ContinuousOn |
| 189 | (fun s : ℝ => (W.coordinate_inverse (γ s)).2) (Icc c d) := |
| 190 | (continuous_snd.comp_continuousOn W.coordinate_inverse_smooth.continuousOn).comp |
| 191 | (hγ.continuousOn.mono (Icc_subset_Icc hc.1.le hd.2.le)) hcdW |
| 192 | have hxr : |(W.coordinate_inverse x).2| < r := |
| 193 | (le_max_right (A / 2) |(W.coordinate_inverse x).2|).trans_lt hrlo |
| 194 | rcases (abs_eq hrpos.le).mp hcabs with hcpos | hcneg |
| 195 | · rcases (abs_eq hrpos.le).mp hdabs with hdpos | hdneg |
| 196 | · exact False.elim (hneq (hcpos.trans hdpos.symm)) |
| 197 | · have htarget : (W.coordinate_inverse x).2 ∈ Icc |
| 198 | ((W.coordinate_inverse (γ d)).2) |
| 199 | ((W.coordinate_inverse (γ c)).2) := by |
| 200 | rw [hdneg, hcpos] |
| 201 | exact ⟨(abs_lt.mp hxr).1.le, (abs_lt.mp hxr).2.le⟩ |
| 202 | obtain ⟨v, hv, hveq⟩ := intermediate_value_Icc' hcd.le hheight htarget |
| 203 | have hvW : γ v ∈ W.carrier := hcdW hv |
| 204 | have hdist := W.intrinsicEDist_le_axial_add hx hvW |
| 205 | have hveq' : (W.coordinate_inverse (γ v)).2 = |
| 206 | (W.coordinate_inverse x).2 := hveq |
| 207 | have hzero : (W.coordinate_inverse (γ v)).2 - |
| 208 | (W.coordinate_inverse x).2 = 0 := by rw [hveq']; ring |
| 209 | rw [hzero, abs_zero, zero_add] at hdist |
| 210 | have hsub' : Icc (min v t) (max v t) ⊆ Icc c d := by |
| 211 | intro z hz |
| 212 | exact ⟨(le_min hv.1 hc.2.le).trans hz.1, |
| 213 | hz.2.trans (max_le hv.2 hd.1.le)⟩ |
| 214 | refine ⟨c, hc, d, hd, v, hv, hcdW, |
| 215 | (fun z hz => hcdW (hsub' hz)), hveq, ?_⟩ |
| 216 | convert hdist using 1 |
| 217 | all_goals ring_nf |
| 218 | · rcases (abs_eq hrpos.le).mp hdabs with hdpos | hdneg |
| 219 | · have htarget : (W.coordinate_inverse x).2 ∈ Icc |
| 220 | ((W.coordinate_inverse (γ c)).2) |
| 221 | ((W.coordinate_inverse (γ d)).2) := by |
| 222 | rw [hcneg, hdpos] |
| 223 | exact ⟨(abs_lt.mp hxr).1.le, (abs_lt.mp hxr).2.le⟩ |
| 224 | obtain ⟨v, hv, hveq⟩ := intermediate_value_Icc hcd.le hheight htarget |
| 225 | have hvW : γ v ∈ W.carrier := hcdW hv |
| 226 | have hdist := W.intrinsicEDist_le_axial_add hx hvW |
| 227 | have hveq' : (W.coordinate_inverse (γ v)).2 = |
| 228 | (W.coordinate_inverse x).2 := hveq |
| 229 | have hzero : (W.coordinate_inverse (γ v)).2 - |
| 230 | (W.coordinate_inverse x).2 = 0 := by rw [hveq']; ring |
| 231 | rw [hzero, abs_zero, zero_add] at hdist |
| 232 | have hsub' : Icc (min v t) (max v t) ⊆ Icc c d := by |
| 233 | intro z hz |
| 234 | exact ⟨(le_min hv.1 hc.2.le).trans hz.1, |
| 235 | hz.2.trans (max_le hv.2 hd.1.le)⟩ |
| 236 | refine ⟨c, hc, d, hd, v, hv, hcdW, |
| 237 | (fun z hz => hcdW (hsub' hz)), hveq, ?_⟩ |
| 238 | convert hdist using 1 |
| 239 | all_goals ring_nf |
| 240 | · exact False.elim (hneq (hcneg.trans hdneg.symm)) |
| 241 | |
| 242 | end PoincareMT.M28 |