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.InitialMetric.RadialBounds |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Basic.RegularizedNorm |
| 3 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Basic.GradientDistance |
| 4 | |
| 5 | /-! |
| 6 | # Distance estimates for the initial cap |
| 7 | |
| 8 | Morgan-Tian Lemma 12.2, printed pp. 294-295. A regularized radius has |
| 9 | differential bounded by the cap tangent norm, even at the tip. The path |
| 10 | distance estimates use the actual metric-selected tangent norms. |
| 11 | See `proof-work/tasks/M34/derivations/radial-distance.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Poincare Manifold |
| 17 | open scoped Manifold ContDiff Bundle ENNReal NNReal |
| 18 | |
| 19 | namespace PoincareMT.M34 |
| 20 | |
| 21 | /-- The smooth regularized radius has speed at most the metric speed, |
| 22 | including at the origin (Lemma 12.2, pp. 294-295). -/ |
| 23 | theorem capRiemannianMetric_regularizedRadius_speed {a e : ℝ} (ha : 0 < a) |
| 24 | (hapi : a ≤ Real.pi / 2) (he : 0 < e) (x v : StandardCapSpace) : |
| 25 | |(regularizedNorm e x)⁻¹ * inner ℝ x v| ≤ |
| 26 | (capRiemannianMetric a ha hapi).tangentNorm x v := by |
| 27 | have hg : 0 ≤ capMetricInner a x v v := by |
| 28 | by_cases hv : v = 0 |
| 29 | · simp [hv] |
| 30 | · exact (capMetricInner_pos ha.le hapi x v hv).le |
| 31 | have hp := regularizedNorm_pos he x |
| 32 | have hs : regularizedNorm e x ^ 2 = ‖x‖ ^ 2 + e ^ 2 := |
| 33 | Real.sq_sqrt (by positivity) |
| 34 | have ht : Real.sqrt (capMetricInner a x v v) ^ 2 = capMetricInner a x v v := |
| 35 | Real.sq_sqrt hg |
| 36 | have hr := capMetricInner_radial_lower ha.le hapi x v |
| 37 | have hsq : (inner ℝ x v) ^ 2 ≤ |
| 38 | (regularizedNorm e x * Real.sqrt (capMetricInner a x v v)) ^ 2 := by |
| 39 | rw [mul_pow, hs, ht] |
| 40 | nlinarith [mul_nonneg (sq_nonneg e) hg] |
| 41 | have habs : |inner ℝ x v| ≤ |
| 42 | regularizedNorm e x * Real.sqrt (capMetricInner a x v v) := by |
| 43 | have hn := mul_nonneg hp.le (Real.sqrt_nonneg (capMetricInner a x v v)) |
| 44 | nlinarith [sq_abs (inner ℝ x v), abs_nonneg (inner ℝ x v)] |
| 45 | change |(regularizedNorm e x)⁻¹ * inner ℝ x v| ≤ Real.sqrt (capMetricInner a x v v) |
| 46 | rw [abs_mul, abs_inv, abs_of_pos hp, inv_mul_eq_div] |
| 47 | exact (div_le_iff₀ hp).mpr (by simpa only [mul_comm] using habs) |
| 48 | |
| 49 | set_option backward.isDefEq.respectTransparency false in |
| 50 | /-- The regularized radius is nonexpanding for the actual cap distance |
| 51 | (Lemma 12.2, pp. 294-295). -/ |
| 52 | theorem capRiemannianMetric_regularizedRadius_edist {a e : ℝ} (ha : 0 < a) |
| 53 | (hapi : a ≤ Real.pi / 2) (he : 0 < e) (x y : StandardCapSpace) : |
| 54 | edist (regularizedNorm e x) (regularizedNorm e y) ≤ |
| 55 | (capRiemannianMetric a ha hapi).edist x y := by |
| 56 | let g := capRiemannianMetric a ha hapi |
| 57 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : StandardCapSpace → Type) := |
| 58 | ⟨g.toRiemannianMetric⟩ |
| 59 | apply edist_le_riemannianEDist_of_mfderiv_le_one |
| 60 | (contMDiff_iff_contDiff.mpr ((regularizedNorm_contDiff he).of_le (by simp))) |
| 61 | intro z |
| 62 | let L : TangentSpace (𝓡 3) z →L[ℝ] ℝ := |
| 63 | mfderiv (𝓡 3) 𝓘(ℝ, ℝ) (regularizedNorm e) z |
| 64 | change ‖L‖ₑ ≤ 1 |
| 65 | rw [← ofReal_norm, ENNReal.ofReal_le_one] |
| 66 | apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one |
| 67 | intro v |
| 68 | rw [one_mul] |
| 69 | change |L v| ≤ |
| 70 | Real.sqrt (capMetricInner a z v v) |
| 71 | have hL : L = (regularizedNorm e z)⁻¹ • innerSL ℝ z := by |
| 72 | simpa only [L, mfderiv_eq_fderiv] using (regularizedNorm_hasFDerivAt he z).fderiv |
| 73 | rw [hL] |
| 74 | exact capRiemannianMetric_regularizedRadius_speed ha hapi he z v |
| 75 | |
| 76 | set_option backward.isDefEq.respectTransparency false in |
| 77 | /-- Ambient Euclidean distance is an upper bound for the actual cap |
| 78 | distance, by integrating the straight segment (Lemma 12.2, pp. 294-295). -/ |
| 79 | theorem capRiemannianMetric_edist_le {a : ℝ} (ha : 0 < a) |
| 80 | (hapi : a ≤ Real.pi / 2) (x y : StandardCapSpace) : |
| 81 | (capRiemannianMetric a ha hapi).edist x y ≤ edist x y := by |
| 82 | let g := capRiemannianMetric a ha hapi |
| 83 | let : Bundle.RiemannianBundle (TangentSpace (𝓡 3) : StandardCapSpace → Type) := |
| 84 | ⟨g.toRiemannianMetric⟩ |
| 85 | change riemannianEDist (𝓡 3) x y ≤ edist x y |
| 86 | calc |
| 87 | _ ≤ (1 : ℝ≥0∞) * edist x y := by |
| 88 | apply riemannianEDist_le_mul_edist_of_convex (I := 𝓡 3) |
| 89 | (f := fun z : StandardCapSpace => z) (s := Set.univ) (K := 1) |
| 90 | convex_univ (fun _ _ => contMDiffAt_id) ?_ (Set.mem_univ x) (Set.mem_univ y) |
| 91 | intro z _ |
| 92 | let L : StandardCapSpace →L[ℝ] TangentSpace (𝓡 3) z := |
| 93 | mfderiv (𝓡 3) (𝓡 3) (fun z : StandardCapSpace => z) z |
| 94 | change ‖L‖ₑ ≤ (1 : ℝ≥0) |
| 95 | rw [← ofReal_norm, ENNReal.ofReal_le_coe] |
| 96 | apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one |
| 97 | intro v |
| 98 | rw [one_mul] |
| 99 | change g.tangentNorm z |
| 100 | (mfderiv (𝓡 3) (𝓡 3) (fun z : StandardCapSpace => z) z v) ≤ ‖v‖ |
| 101 | rw [mfderiv_eq_fderiv, fderiv_fun_id] |
| 102 | exact capRiemannianMetric_tangentNorm_le ha hapi z v |
| 103 | _ = _ := one_mul _ |
| 104 | |
| 105 | /-- Distance from the tip is bounded below by the radial coordinate. |
| 106 | The positive regularization tends to zero only after the uniform distance |
| 107 | bound is established (Lemma 12.2, pp. 294-295). -/ |
| 108 | theorem capRiemannianMetric_radius_le_edist {a : ℝ} (ha : 0 < a) |
| 109 | (hapi : a ≤ Real.pi / 2) (x : StandardCapSpace) : |
| 110 | ENNReal.ofReal ‖x‖ ≤ (capRiemannianMetric a ha hapi).edist 0 x := by |
| 111 | have hfinite : (capRiemannianMetric a ha hapi).edist 0 x ≠ ⊤ := |
| 112 | ne_top_of_le_ne_top (edist_ne_top 0 x) (capRiemannianMetric_edist_le ha hapi 0 x) |
| 113 | apply (ENNReal.ofReal_le_iff_le_toReal hfinite).mpr |
| 114 | by_contra h |
| 115 | have hlt : ((capRiemannianMetric a ha hapi).edist 0 x).toReal < ‖x‖ := |
| 116 | lt_of_not_ge h |
| 117 | let e := (‖x‖ - ((capRiemannianMetric a ha hapi).edist 0 x).toReal) / 2 |
| 118 | have he : 0 < e := by dsimp [e]; linarith |
| 119 | have hb := capRiemannianMetric_regularizedRadius_edist ha hapi he 0 x |
| 120 | rw [regularizedNorm_zero he.le, edist_dist, Real.dist_eq, |
| 121 | ENNReal.ofReal_le_iff_le_toReal hfinite, abs_sub_comm] at hb |
| 122 | have hs := (le_abs_self (regularizedNorm e x - e)).trans hb |
| 123 | have hn := norm_le_regularizedNorm e x |
| 124 | dsimp [e] at hs |
| 125 | linarith |
| 126 | |
| 127 | /-- Meridian arclength is the actual Riemannian distance from the tip, |
| 128 | including at the origin (Lemma 12.2, pp. 294-295). -/ |
| 129 | theorem capRiemannianMetric_edist_zero {a : ℝ} (ha : 0 < a) |
| 130 | (hapi : a ≤ Real.pi / 2) (x : StandardCapSpace) : |
| 131 | (capRiemannianMetric a ha hapi).edist 0 x = ENNReal.ofReal ‖x‖ := by |
| 132 | apply le_antisymm |
| 133 | · simpa only [edist_dist, dist_zero_left] using capRiemannianMetric_edist_le ha hapi 0 x |
| 134 | · exact capRiemannianMetric_radius_le_edist ha hapi x |
| 135 | |
| 136 | /-- Radial metric balls are exactly the ambient Euclidean balls, |
| 137 | also for nonpositive radii (Lemma 12.2, pp. 294-295). -/ |
| 138 | theorem capRiemannianMetric_ball_zero {a : ℝ} (ha : 0 < a) |
| 139 | (hapi : a ≤ Real.pi / 2) (r : ℝ) : |
| 140 | (capRiemannianMetric a ha hapi).ball 0 r = Metric.ball 0 r := by |
| 141 | ext x |
| 142 | simp only [RiemannianMetric.ball, Set.mem_ofPred_eq, capRiemannianMetric_edist_zero ha hapi, |
| 143 | Metric.mem_ball, dist_zero_right] |
| 144 | exact ENNReal.ofReal_lt_ofReal_iff_of_nonneg (norm_nonneg x) |
| 145 | |
| 146 | /-- The closed radial core is a compact Euclidean ball. The nonnegative |
| 147 | radius hypothesis is essential for extended-real conversion |
| 148 | (Lemma 12.2, pp. 294-295). -/ |
| 149 | theorem capRiemannianMetric_closedBall_zero {a r : ℝ} (ha : 0 < a) |
| 150 | (hapi : a ≤ Real.pi / 2) (hr : 0 ≤ r) : |
| 151 | {x : StandardCapSpace | (capRiemannianMetric a ha hapi).edist 0 x ≤ |
| 152 | ENNReal.ofReal r} = Metric.closedBall 0 r := by |
| 153 | ext x |
| 154 | simp only [Set.mem_ofPred_eq, capRiemannianMetric_edist_zero ha hapi, |
| 155 | Metric.mem_closedBall, dist_zero_right] |
| 156 | exact ENNReal.ofReal_le_ofReal_iff hr |
| 157 | |
| 158 | end PoincareMT.M34 |