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.InnerProduct |
| 2 | import PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.InitialMetric.RoundTipSeries |
| 3 | import Mathlib.Analysis.InnerProductSpace.Calculus |
| 4 | |
| 5 | /-! |
| 6 | # Smoothness of the actual cap inner product |
| 7 | |
| 8 | This completes the tip smoothness step in Morgan-Tian Lemma 12.2, |
| 9 | printed pp. 294-295. At positive radius, ordinary smooth calculus applies. |
| 10 | At the origin, the exact spherical profile agrees with analytic functions |
| 11 | of the smooth squared norm, including the correct removable values. |
| 12 | See `proof-work/tasks/M34/derivations/tip-smoothness.md`. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Filter |
| 18 | open scoped ContDiff Topology |
| 19 | |
| 20 | namespace PoincareMT.M34 |
| 21 | |
| 22 | /-- Exact agreement of the angular metric coefficient with its analytic |
| 23 | round extension before the cutoff (Lemma 12.2, p. 294). -/ |
| 24 | theorem capAngularCoefficient_eq_round {a r : ℝ} (ha : 0 ≤ a) (hr : r ≤ a) : |
| 25 | capAngularCoefficient a r = roundTipAngular (r ^ 2) := by |
| 26 | by_cases h : r = 0 |
| 27 | · simp only [h, capAngularCoefficient, if_true, zero_pow (by decide : 2 ≠ 0), |
| 28 | roundTipAngular_zero] |
| 29 | · rw [capAngularCoefficient, if_neg h, capProfile_eq_round ha hr, roundTipAngular_sq h] |
| 30 | have hc := Real.cos_two_mul (r / 2) |
| 31 | rw [show 2 * (r / 2) = r by ring] at hc |
| 32 | have hs := Real.sin_sq_add_cos_sq (r / 2) |
| 33 | field_simp |
| 34 | nlinarith |
| 35 | |
| 36 | /-- Exact agreement of the radial correction with its analytic round |
| 37 | extension before the cutoff (Lemma 12.2, p. 294). -/ |
| 38 | theorem capRadialCoefficient_eq_round {a r : ℝ} (ha : 0 ≤ a) (hr : r ≤ a) : |
| 39 | capRadialCoefficient a r = roundTipRadial (r ^ 2) := by |
| 40 | by_cases h : r = 0 |
| 41 | · simp only [h, capRadialCoefficient, if_true, zero_pow (by decide : 2 ≠ 0), |
| 42 | roundTipRadial_zero] |
| 43 | · rw [capRadialCoefficient, if_neg h, capAngularCoefficient_eq_round ha hr, |
| 44 | roundTipRadial_sq h] |
| 45 | |
| 46 | /-- Smoothness of the scalar angular coefficient off its removable |
| 47 | point (Lemma 12.2, pp. 294-295). -/ |
| 48 | theorem capAngularCoefficient_contDiffAt (a : ℝ) {r : ℝ} (hr : r ≠ 0) : |
| 49 | ContDiffAt ℝ ∞ (capAngularCoefficient a) r := by |
| 50 | apply (((capProfile_contDiff a).contDiffAt.div contDiffAt_id hr).pow 2).congr_of_eventuallyEq |
| 51 | filter_upwards [eventually_ne_nhds hr] with s hs |
| 52 | exact if_neg hs |
| 53 | |
| 54 | /-- Smoothness of the scalar radial correction off its removable |
| 55 | point (Lemma 12.2, pp. 294-295). -/ |
| 56 | theorem capRadialCoefficient_contDiffAt (a : ℝ) {r : ℝ} (hr : r ≠ 0) : |
| 57 | ContDiffAt ℝ ∞ (capRadialCoefficient a) r := by |
| 58 | apply (((contDiffAt_const (c := (1 : ℝ))).sub (capAngularCoefficient_contDiffAt a hr)).div |
| 59 | (contDiffAt_id.pow 2) (pow_ne_zero 2 hr)).congr_of_eventuallyEq |
| 60 | filter_upwards [eventually_ne_nhds hr] with s hs |
| 61 | exact if_neg hs |
| 62 | |
| 63 | /-- Smoothness of the angular coefficient as a function on all of |
| 64 | Euclidean three-space, including the origin (Lemma 12.2, p. 294). -/ |
| 65 | theorem capAngularCoefficient_norm_contDiff {a : ℝ} (ha : 0 < a) : |
| 66 | ContDiff ℝ ∞ (fun x : StandardCapSpace => capAngularCoefficient a ‖x‖) := by |
| 67 | rw [contDiff_iff_contDiffAt] |
| 68 | intro x |
| 69 | by_cases hx : x = 0 |
| 70 | · subst x |
| 71 | have hs : ContDiffAt ℝ ∞ roundTipAngular (‖(0 : StandardCapSpace)‖ ^ 2) := by |
| 72 | simpa only [norm_zero, zero_pow (by decide : 2 ≠ 0)] using |
| 73 | roundTipAngular_analyticAt.contDiffAt (n := ∞) |
| 74 | apply (hs.comp 0 (contDiffAt_id.norm_sq ℝ)).congr_of_eventuallyEq |
| 75 | filter_upwards [Metric.ball_mem_nhds (0 : StandardCapSpace) ha] with y hy |
| 76 | exact capAngularCoefficient_eq_round ha.le |
| 77 | (le_of_lt (by simpa only [Metric.mem_ball, dist_zero_right] using hy)) |
| 78 | · exact (capAngularCoefficient_contDiffAt a (norm_ne_zero_iff.mpr hx)).comp x |
| 79 | (contDiffAt_norm ℝ hx) |
| 80 | |
| 81 | /-- Smoothness of the radial correction as a function on all of |
| 82 | Euclidean three-space, including its nonzero limiting value at the tip |
| 83 | (Lemma 12.2, p. 294). -/ |
| 84 | theorem capRadialCoefficient_norm_contDiff {a : ℝ} (ha : 0 < a) : |
| 85 | ContDiff ℝ ∞ (fun x : StandardCapSpace => capRadialCoefficient a ‖x‖) := by |
| 86 | rw [contDiff_iff_contDiffAt] |
| 87 | intro x |
| 88 | by_cases hx : x = 0 |
| 89 | · subst x |
| 90 | have hs : ContDiffAt ℝ ∞ roundTipRadial (‖(0 : StandardCapSpace)‖ ^ 2) := by |
| 91 | simpa only [norm_zero, zero_pow (by decide : 2 ≠ 0)] using |
| 92 | roundTipRadial_analyticAt.contDiffAt (n := ∞) |
| 93 | apply (hs.comp 0 (contDiffAt_id.norm_sq ℝ)).congr_of_eventuallyEq |
| 94 | filter_upwards [Metric.ball_mem_nhds (0 : StandardCapSpace) ha] with y hy |
| 95 | exact capRadialCoefficient_eq_round ha.le |
| 96 | (le_of_lt (by simpa only [Metric.mem_ball, dist_zero_right] using hy)) |
| 97 | · exact (capRadialCoefficient_contDiffAt a (norm_ne_zero_iff.mpr hx)).comp x |
| 98 | (contDiffAt_norm ℝ hx) |
| 99 | |
| 100 | /-- Smoothness into the normed space of actual continuous bilinear maps, |
| 101 | not just separate scalar coefficients (Lemma 12.2, pp. 294-295). -/ |
| 102 | theorem capMetricInner_contDiff {a : ℝ} (ha : 0 < a) : |
| 103 | ContDiff ℝ ∞ (capMetricInner a) := by |
| 104 | let B : StandardCapSpace →L[ℝ] StandardCapSpace →L[ℝ] ℝ := innerSL ℝ |
| 105 | have : IsBoundedSMul ℝ (StandardCapSpace →L[ℝ] StandardCapSpace →L[ℝ] ℝ) := |
| 106 | NormedSpace.toIsBoundedSMul (𝕜 := ℝ) |
| 107 | (E := StandardCapSpace →L[ℝ] StandardCapSpace →L[ℝ] ℝ) |
| 108 | exact ((capAngularCoefficient_norm_contDiff ha).smul (contDiff_const (c := B))).add |
| 109 | ((capRadialCoefficient_norm_contDiff ha).smul (B.contDiff.smulRight B.contDiff)) |
| 110 | |
| 111 | end PoincareMT.M34 |