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.SourceNames |
| 3 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.CriticalBall.CriticalBallMarginOrScale |
| 4 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.CapGeometry.CapBoundaryTransport |
| 5 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Tube.Cylinders.CylinderUniformScalar |
| 6 | |
| 7 | /-! |
| 8 | # The actual moderate critical-ball witness |
| 9 | |
| 10 | The selected chain neck supplies the moderate branch once its normalized |
| 11 | scale is above `delta / 48` and the point is in its three-quarter slab. The |
| 12 | only metric conversion is the global source homothety: a ball in the |
| 13 | intrinsic normalized tube is first bounded by the normalized ambient |
| 14 | distance, then converted back to the original neck metric before applying |
| 15 | the sharp axial escape estimate. The scalar readout is transported through |
| 16 | the same homothety, so the witness records the normalized tube connection |
| 17 | rather than an unrelated ambient connection. |
| 18 | -/ |
| 19 | |
| 20 | noncomputable section |
| 21 | set_option autoImplicit false |
| 22 | set_option backward.isDefEq.respectTransparency false |
| 23 | |
| 24 | open Set |
| 25 | open scoped Manifold ContDiff Bundle Topology ENNReal |
| 26 | |
| 27 | universe u |
| 28 | |
| 29 | namespace PoincareMT.M28.CounterexampleNeckFamily |
| 30 | |
| 31 | open PoincareMT.EpsilonNeck |
| 32 | |
| 33 | variable {epsilon C A : ℝ} |
| 34 | {E : ∀ n : ℕ, SameTimeCounterexample.{u} epsilon C A |
| 35 | ((n : ℝ) + 1) ((n : ℝ) + 1)} |
| 36 | |
| 37 | private theorem chain_neck_eq_list_node |
| 38 | (H : CounterexampleNeckFamily E) {k : ℕ} |
| 39 | (T : SourceTubeData (H.segment k)) {i : ℤ} |
| 40 | (_hi : i ∈ (T.chain.shape.active)) : |
| 41 | T.chain.neck i = (T.list.node i).2 := by |
| 42 | rw [T.neck_eq] |
| 43 | exact T.list.neckOfList_eq_node i |
| 44 | |
| 45 | private theorem normalized_ball_original_edist_lt |
| 46 | (H : CounterexampleNeckFamily E) |
| 47 | (T : ∀ k, SourceTubeData (H.segment k)) {k : ℕ} {i : ℤ} |
| 48 | {delta : ℝ} |
| 49 | (_hi : i ∈ (T k).chain.shape.active) |
| 50 | {x y : (T k).carrierOpen} |
| 51 | (hy : y ∈ (H.tubeMetric T k).ball x (delta / 48)) : |
| 52 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time).edist |
| 53 | x.1 y.1 < |
| 54 | ENNReal.ofReal |
| 55 | ((delta / 48) / Real.sqrt |
| 56 | ((E (k + H.shift)).flow.scalar |
| 57 | ⟨(E (k + H.shift)).time, (E (k + H.shift)).basepoint⟩)) := by |
| 58 | let Q := (E (k + H.shift)).flow.scalar |
| 59 | ⟨(E (k + H.shift)).time, (E (k + H.shift)).basepoint⟩ |
| 60 | have hQ : 0 < Q := H.base_scalar_pos k |
| 61 | have hsqrt : 0 < Real.sqrt Q := Real.sqrt_pos.mpr hQ |
| 62 | have hball : (H.tubeMetric T k).edist x y < ENNReal.ofReal (delta / 48) := hy |
| 63 | have hambient : (H.normalizedSliceMetric k).edist x.1 y.1 ≤ |
| 64 | (H.tubeMetric T k).edist x y := by |
| 65 | rw [tubeMetric, intrinsicOpenMetric_edist] at hball ⊢ |
| 66 | exact RiemannianMetric.edist_le_intrinsicEDist |
| 67 | (H.normalizedSliceMetric k) (T k).carrierOpen x.1 y.1 |
| 68 | have hnorm : (H.normalizedSliceMetric k).edist x.1 y.1 < |
| 69 | ENNReal.ofReal (delta / 48) := hambient.trans_lt hball |
| 70 | have hhom := M13.homothety_edist |
| 71 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time) |
| 72 | (H.normalizedSliceMetric k) (Diffeomorph.refl (𝓡 3) _ ∞) Q hQ |
| 73 | (M13.identity_metricHomothety _ Q hQ) x.1 y.1 |
| 74 | have hprod : ENNReal.ofReal (Real.sqrt Q) * |
| 75 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time).edist x.1 y.1 < |
| 76 | ENNReal.ofReal (delta / 48) := by |
| 77 | rw [← hhom] |
| 78 | exact hnorm |
| 79 | by_contra hnot |
| 80 | have hge : ENNReal.ofReal ((delta / 48) / Real.sqrt Q) ≤ |
| 81 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time).edist x.1 y.1 := |
| 82 | le_of_not_gt hnot |
| 83 | have hmul := mul_le_mul_left hge (ENNReal.ofReal (Real.sqrt Q)) |
| 84 | have hreal : Real.sqrt Q * ((delta / 48) / Real.sqrt Q) = delta / 48 := by |
| 85 | field_simp |
| 86 | have hmul' : ENNReal.ofReal (delta / 48) ≤ |
| 87 | ENNReal.ofReal (Real.sqrt Q) * |
| 88 | ENNReal.ofReal ((delta / 48) / Real.sqrt Q) := by |
| 89 | rw [← ENNReal.ofReal_mul (le_of_lt hsqrt), hreal] |
| 90 | exact (not_lt_of_ge (hmul'.trans (by simpa [mul_comm] using hmul))) hprod |
| 91 | |
| 92 | theorem exists_criticalBall_moderate_witness_accuracy : |
| 93 | ∃ epsilon₀ : ℝ, 0 < epsilon₀ ∧ epsilon₀ ≤ (1 / 200 : ℝ) ∧ |
| 94 | ∀ {epsilon C A : ℝ} |
| 95 | {E : ∀ n : ℕ, SameTimeCounterexample.{u} epsilon C A |
| 96 | ((n : ℝ) + 1) ((n : ℝ) + 1)} |
| 97 | (H : CounterexampleNeckFamily E) |
| 98 | (T : ∀ k, SourceTubeData (H.segment k)), |
| 99 | epsilon ≤ epsilon₀ → |
| 100 | ∀ {A1 delta : ℝ} {k : ℕ} |
| 101 | (x : H.tubeCriticalRegion T A1 k) {i : ℤ}, |
| 102 | i ∈ (T k).chain.shape.active → |
| 103 | (x : (T k).carrierOpen).val ∈ ((T k).chain.neck i).carrier → |
| 104 | |(((T k).chain.neck i).coordinate_inverse |
| 105 | (x : (T k).carrierOpen).val).2| ≤ |
| 106 | 3 * ((T k).chain.neck i).epsilon⁻¹ / 4 → |
| 107 | 0 < delta → |
| 108 | delta / 48 ≤ H.tubeNodeScale T k i → |
| 109 | CriticalBallModerateWitness H T (A1 := A1) (delta := delta) k x := by |
| 110 | obtain ⟨epsilonS, hSpos, hSsmall, hS⟩ := |
| 111 | tube.exists_cylinder_scalar_accuracy.{u} (delta := 1 / 100) (by norm_num) |
| 112 | let epsilon₀ := min (1 / 200 : ℝ) epsilonS |
| 113 | refine ⟨epsilon₀, lt_min (by norm_num) hSpos, min_le_left _ _, ?_⟩ |
| 114 | intro epsilon C A E H T hsmall A1 delta k x i hi hx hquarter hdelta hscale |
| 115 | let Q := (E (k + H.shift)).flow.scalar |
| 116 | ⟨(E (k + H.shift)).time, (E (k + H.shift)).basepoint⟩ |
| 117 | have hQ : 0 < Q := H.base_scalar_pos k |
| 118 | have hsqrt : 0 < Real.sqrt Q := Real.sqrt_pos.mpr hQ |
| 119 | let N := (T k).chain.neck i |
| 120 | have hN : N.epsilon = epsilon := by |
| 121 | dsimp [N] |
| 122 | exact (T k).chain.epsilon_eq i hi |
| 123 | have hNsmall : N.epsilon ≤ epsilonS := by |
| 124 | rw [hN] |
| 125 | exact hsmall.trans (min_le_right _ _) |
| 126 | have hnode : N = ((T k).list.node i).2 := chain_neck_eq_list_node H (T k) hi |
| 127 | have hscale' : delta / 48 ≤ Real.sqrt Q * N.scale := by |
| 128 | simpa only [tubeNodeScale, hnode] using hscale |
| 129 | have hquarter' : |(N.coordinate_inverse (x : (T k).carrierOpen).val).2| ≤ |
| 130 | 3 * N.epsilon⁻¹ / 4 := by |
| 131 | simpa only [N] using hquarter |
| 132 | have hball : (H.tubeMetric T k).ball (x : (T k).carrierOpen) (delta / 48) ⊆ |
| 133 | (Subtype.val : (T k).carrierOpen → _) ⁻¹' N.carrier := by |
| 134 | intro y hy |
| 135 | have hxy := normalized_ball_original_edist_lt H T hi hy |
| 136 | have hr : 0 < N.epsilon⁻¹ / 8 := by |
| 137 | exact div_pos (inv_pos.mpr N.epsilon_pos) (by norm_num) |
| 138 | have hmargin : N.epsilon⁻¹ / 8 < N.epsilon⁻¹ - |
| 139 | |(N.coordinate_inverse (x : (T k).carrierOpen).val).2| := by |
| 140 | have hepsinv : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 141 | have hquarter'' := hquarter' |
| 142 | nlinarith |
| 143 | have hroot : (1 / 2 : ℝ) < Real.sqrt (1 - N.epsilon) := by |
| 144 | have hnonneg : 0 ≤ 1 - N.epsilon := by |
| 145 | have : N.epsilon ≤ (1 / 200 : ℝ) := hNsmall.trans hSsmall |
| 146 | linarith |
| 147 | have hsquare : (Real.sqrt (1 - N.epsilon)) ^ 2 = 1 - N.epsilon := |
| 148 | Real.sq_sqrt hnonneg |
| 149 | have hpos : 0 < Real.sqrt (1 - N.epsilon) := Real.sqrt_pos.mpr (by linarith) |
| 150 | nlinarith |
| 151 | have hfactor : 1 < Real.sqrt (1 - N.epsilon) * (N.epsilon⁻¹ / 8) := by |
| 152 | have hepsinv : 200 ≤ N.epsilon⁻¹ := by |
| 153 | have heps200 : N.epsilon ≤ (1 / 200 : ℝ) := hNsmall.trans hSsmall |
| 154 | have hinv : (1 / 200 : ℝ)⁻¹ ≤ N.epsilon⁻¹ := |
| 155 | (inv_le_inv₀ (by norm_num : (0 : ℝ) < 1 / 200) N.epsilon_pos).2 heps200 |
| 156 | norm_num at hinv ⊢ |
| 157 | exact hinv |
| 158 | nlinarith |
| 159 | have hthreshold : delta / 48 < |
| 160 | Real.sqrt Q * (N.scale * Real.sqrt (1 - N.epsilon) * |
| 161 | (N.epsilon⁻¹ / 8)) := by |
| 162 | have hnonneg : 0 ≤ Real.sqrt (1 - N.epsilon) * (N.epsilon⁻¹ / 8) := by |
| 163 | positivity |
| 164 | have hmul := mul_le_mul_of_nonneg_right hscale' hnonneg |
| 165 | have hstrict : delta / 48 < (delta / 48) * |
| 166 | (Real.sqrt (1 - N.epsilon) * (N.epsilon⁻¹ / 8)) := by |
| 167 | nlinarith |
| 168 | calc |
| 169 | delta / 48 < (delta / 48) * |
| 170 | (Real.sqrt (1 - N.epsilon) * (N.epsilon⁻¹ / 8)) := hstrict |
| 171 | _ ≤ (Real.sqrt Q * N.scale) * |
| 172 | (Real.sqrt (1 - N.epsilon) * (N.epsilon⁻¹ / 8)) := hmul |
| 173 | _ = Real.sqrt Q * (N.scale * Real.sqrt (1 - N.epsilon) * |
| 174 | (N.epsilon⁻¹ / 8)) := by ring |
| 175 | apply mem_carrier_of_edist_lt_escape N (x := (x : (T k).carrierOpen).val) |
| 176 | (y := y.val) hx hr hmargin |
| 177 | have hQroot : 0 ≤ Real.sqrt Q := (Real.sqrt_pos.mpr hQ).le |
| 178 | have hleft : ENNReal.ofReal (Real.sqrt Q) * |
| 179 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time).edist |
| 180 | (x : (T k).carrierOpen).val y.val < |
| 181 | ENNReal.ofReal (delta / 48) := by |
| 182 | have hxy := normalized_ball_original_edist_lt H T hi hy |
| 183 | have hscaled := ENNReal.mul_lt_mul_left |
| 184 | (a := ENNReal.ofReal (Real.sqrt Q)) |
| 185 | (b := ((E (k + H.shift)).flow.metric (E (k + H.shift)).time).edist |
| 186 | (x : (T k).carrierOpen).val y.val) |
| 187 | (c := ENNReal.ofReal ((delta / 48) / Real.sqrt Q)) |
| 188 | (ENNReal.ofReal_pos.mpr hsqrt).ne' ENNReal.ofReal_ne_top hxy |
| 189 | calc |
| 190 | ENNReal.ofReal (Real.sqrt Q) * |
| 191 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time).edist |
| 192 | (x : (T k).carrierOpen).val y.val < |
| 193 | ENNReal.ofReal (Real.sqrt Q) * |
| 194 | ENNReal.ofReal ((delta / 48) / Real.sqrt Q) := by |
| 195 | simpa [mul_comm] using hscaled |
| 196 | _ = ENNReal.ofReal (delta / 48) := by |
| 197 | rw [← ENNReal.ofReal_mul (Real.sqrt_nonneg Q)] |
| 198 | field_simp |
| 199 | have hprod : ENNReal.ofReal (Real.sqrt Q) * |
| 200 | ENNReal.ofReal (N.scale * Real.sqrt (1 - N.epsilon) * |
| 201 | (N.epsilon⁻¹ / 8)) > ENNReal.ofReal (delta / 48) := by |
| 202 | rw [← ENNReal.ofReal_mul hQroot] |
| 203 | have hfactorpos : 0 < N.scale * Real.sqrt (1 - N.epsilon) * |
| 204 | (N.epsilon⁻¹ / 8) := by |
| 205 | exact mul_pos (mul_pos N.scale_pos (by linarith [hroot])) hr |
| 206 | have hfullpos : 0 < Real.sqrt Q * |
| 207 | (N.scale * Real.sqrt (1 - N.epsilon) * (N.epsilon⁻¹ / 8)) := |
| 208 | mul_pos hsqrt hfactorpos |
| 209 | exact (ENNReal.ofReal_lt_ofReal_iff hfullpos).mpr hthreshold |
| 210 | by_contra hnot |
| 211 | have hge : ENNReal.ofReal (N.scale * Real.sqrt (1 - N.epsilon) * |
| 212 | (N.epsilon⁻¹ / 8)) ≤ |
| 213 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time).edist |
| 214 | (x : (T k).carrierOpen).val y.val := le_of_not_gt hnot |
| 215 | exact (not_lt_of_ge (by |
| 216 | simpa [mul_comm] using |
| 217 | (mul_le_mul_left hge (ENNReal.ofReal (Real.sqrt Q))))) |
| 218 | (hleft.trans hprod) |
| 219 | have haccuracy : ∀ y ∈ (Subtype.val : (T k).carrierOpen → _) ⁻¹' N.carrier, |
| 220 | |H.tubeNodeScale T k i ^ 2 * |
| 221 | (H.tubeConnection T k).scalarCurvature y - 1| < (1 / 100 : ℝ) := by |
| 222 | intro y hy |
| 223 | have hyN : y.val ∈ N.carrier := hy |
| 224 | have h := hS ((E (k + H.shift)).flow.slice (E (k + H.shift)).time).carrier |
| 225 | ((E (k + H.shift)).flow.metric (E (k + H.shift)).time) |
| 226 | ((E (k + H.shift)).flow.connection (E (k + H.shift)).time) N hNsmall |
| 227 | y.val hyN |
| 228 | change |N.scale ^ 2 * (E (k + H.shift)).flow.scalar |
| 229 | ⟨(E (k + H.shift)).time, y.val⟩ - 1| < (1 / 100 : ℝ) at h |
| 230 | have hscalar := H.tube_scalar_eq T k y |
| 231 | have hnormalized := H.normalizedSlice_scalar_eq k y.val |
| 232 | have hscaleQ : H.tubeNodeScale T k i = Real.sqrt Q * N.scale := by |
| 233 | simp only [tubeNodeScale, hnode, Q] |
| 234 | rw [hscaleQ, hscalar, hnormalized] |
| 235 | change |(Real.sqrt Q * N.scale) ^ 2 * |
| 236 | ((E (k + H.shift)).flow.scalar |
| 237 | ⟨(E (k + H.shift)).time, y.val⟩ / Q) - 1| < (1 / 100 : ℝ) |
| 238 | have hcancel : (Real.sqrt Q * N.scale) ^ 2 * |
| 239 | ((E (k + H.shift)).flow.scalar |
| 240 | ⟨(E (k + H.shift)).time, y.val⟩ / Q) = |
| 241 | N.scale ^ 2 * (E (k + H.shift)).flow.scalar |
| 242 | ⟨(E (k + H.shift)).time, y.val⟩ := by |
| 243 | rw [mul_pow, Real.sq_sqrt hQ.le] |
| 244 | field_simp [hQ.ne'] |
| 245 | rw [hcancel] |
| 246 | exact h |
| 247 | refine ⟨i, hi, hx, hquarter, hscale, hball, haccuracy⟩ |
| 248 | |
| 249 | end PoincareMT.M28.CounterexampleNeckFamily |