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.Uniqueness.Imports |
| 2 | import PoincareLib.Geometry.Riemannian.Coordinates.Exponential.JetBounds.RadialIntegral |
| 3 | import Mathlib.Analysis.Calculus.ContDiff.Deriv |
| 4 | import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus |
| 5 | |
| 6 | /-! |
| 7 | # Smooth division of actual radial profiles at the tip |
| 8 | |
| 9 | Morgan-Tian Section 12.6, pp. 307-314. Dividing a smooth odd profile by |
| 10 | radius uses its genuine integrated derivative. The resulting profile is |
| 11 | smooth and even, including at zero. This is the tip extension used for |
| 12 | the actual intrinsic warping function and the repaired radial forcing. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Filter MeasureTheory |
| 18 | open scoped ContDiff Topology |
| 19 | |
| 20 | namespace PoincareMT.M35.SmoothRadial |
| 21 | |
| 22 | /-- The actual smooth divided difference, with its canonical value at zero. -/ |
| 23 | noncomputable def axisDivision (f : ℝ → ℝ) (r : ℝ) : ℝ := |
| 24 | CoordinateExponential.radialWeightedIntegral 0 (deriv f) r |
| 25 | |
| 26 | theorem axisDivision_contDiff {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) : |
| 27 | ContDiff ℝ ∞ (axisDivision f) := by |
| 28 | have hd : ContDiff ℝ ∞ (deriv f) := (contDiff_infty_iff_deriv.mp hf).2 |
| 29 | apply contDiff_iff_contDiffAt.mpr |
| 30 | intro r |
| 31 | have hr : r ∈ Metric.ball (0 : ℝ) (‖r‖ + 1) := by simp |
| 32 | exact (CoordinateExponential.contDiffOn_radialWeightedIntegral 0 |
| 33 | (r := ‖r‖ + 1) hd.contDiffOn r hr).contDiffAt (Metric.isOpen_ball.mem_nhds hr) |
| 34 | |
| 35 | /-- The integrated derivative restores the original increment at every radius. -/ |
| 36 | theorem mul_axisDivision {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) (r : ℝ) : |
| 37 | r * axisDivision f r = f r - f 0 := by |
| 38 | have hsub := intervalIntegral.integral_deriv_eq_sub |
| 39 | (a := (0 : ℝ)) (b := r) (fun x _ => hf.differentiable (by simp) x) |
| 40 | ((contDiff_infty_iff_deriv.mp hf).2.continuous.intervalIntegrable 0 r) |
| 41 | have hscale := intervalIntegral.mul_integral_comp_mul_left |
| 42 | (f := deriv f) r (a := (0 : ℝ)) (b := 1) |
| 43 | simp only [mul_zero, mul_one] at hscale |
| 44 | simpa only [axisDivision, CoordinateExponential.radialWeightedIntegral, |
| 45 | pow_zero, smul_eq_mul, one_mul, mul_one, mul_comm] using hscale.trans hsub |
| 46 | |
| 47 | theorem axisDivision_zero {f : ℝ → ℝ} : axisDivision f 0 = deriv f 0 := by |
| 48 | simp [axisDivision, CoordinateExponential.radialWeightedIntegral] |
| 49 | |
| 50 | /-- Differentiating actual evenness gives an odd derivative. -/ |
| 51 | theorem deriv_odd_of_even {f : ℝ → ℝ} (hf : Differentiable ℝ f) (he : Function.Even f) : |
| 52 | Function.Odd (deriv f) := by |
| 53 | intro r |
| 54 | have hc := (hf (-r)).hasDerivAt.comp r (hasDerivAt_id r).neg |
| 55 | have hd : HasDerivAt f (-deriv f (-r)) r := by |
| 56 | convert! hc using 1 |
| 57 | · funext a |
| 58 | exact (he a).symm |
| 59 | · ring |
| 60 | have h := hd.unique (hf r).hasDerivAt |
| 61 | linarith only [h] |
| 62 | |
| 63 | /-- Differentiating actual oddness gives an even derivative. -/ |
| 64 | theorem deriv_even_of_odd {f : ℝ → ℝ} (hf : Differentiable ℝ f) (ho : Function.Odd f) : |
| 65 | Function.Even (deriv f) := by |
| 66 | intro r |
| 67 | have hc := (hf (-r)).hasDerivAt.comp r (hasDerivAt_id r).neg |
| 68 | have hd : HasDerivAt (fun a => -f a) (-deriv f (-r)) r := by |
| 69 | convert! hc using 1 |
| 70 | · funext a |
| 71 | exact (ho a).symm |
| 72 | · ring |
| 73 | have h := hd.unique (hf r).hasDerivAt.neg |
| 74 | linarith only [h] |
| 75 | |
| 76 | theorem deriv_zero_of_even {f : ℝ → ℝ} (hf : Differentiable ℝ f) |
| 77 | (he : Function.Even f) : deriv f 0 = 0 := by |
| 78 | have h := deriv_odd_of_even hf he 0 |
| 79 | rw [neg_zero] at h |
| 80 | linarith only [h] |
| 81 | |
| 82 | /-- The actual smooth division of an odd function has even parity. -/ |
| 83 | theorem axisDivision_even_of_odd {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 84 | (ho : Function.Odd f) : Function.Even (axisDivision f) := by |
| 85 | intro r |
| 86 | have hd := deriv_even_of_odd (hf.differentiable (by simp)) ho |
| 87 | unfold axisDivision CoordinateExponential.radialWeightedIntegral |
| 88 | apply intervalIntegral.integral_congr |
| 89 | intro t _ |
| 90 | simp only [pow_zero, smul_eq_mul, one_mul, mul_neg] |
| 91 | exact hd (t * r) |
| 92 | |
| 93 | /-- Dividing the odd derivative of an even profile gives the smooth |
| 94 | radial gradient coefficient, without a puncture at the tip. -/ |
| 95 | theorem axisDivision_deriv_even {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 96 | (he : Function.Even f) : Function.Even (axisDivision (deriv f)) := |
| 97 | axisDivision_even_of_odd (contDiff_infty_iff_deriv.mp hf).2 |
| 98 | (deriv_odd_of_even (hf.differentiable (by simp)) he) |
| 99 | |
| 100 | theorem mul_axisDivision_deriv {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) |
| 101 | (he : Function.Even f) (r : ℝ) : r * axisDivision (deriv f) r = deriv f r := by |
| 102 | rw [mul_axisDivision (contDiff_infty_iff_deriv.mp hf).2, |
| 103 | deriv_zero_of_even (hf.differentiable (by simp)) he, sub_zero] |
| 104 | |
| 105 | end PoincareMT.M35.SmoothRadial |