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.CurveShortening.Estimates.Pointwise |
| 2 | import Mathlib.Analysis.Calculus.ContDiff.Deriv |
| 3 | |
| 4 | /-! |
| 5 | # Positive regularized curvature evolution |
| 6 | |
| 7 | The weighted second derivative retains the derivative of the actual curve |
| 8 | speed. The pointwise estimate then cancels the spatial normal square using |
| 9 | the regularized gradient bound. Source: MT2015Correction pp. 6-7; |
| 10 | see `references/ricci-flow/mapher/curve-evolution/derivations/2026-09-20-regularized-pointwise.md`. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open scoped Manifold ContDiff Bundle |
| 17 | |
| 18 | namespace PoincareMT.M62 |
| 19 | |
| 20 | variable {n : ℕ} {M : Type*} [TopologicalSpace M] |
| 21 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 22 | {a b : ℝ} |
| 23 | |
| 24 | /-- Twice differentiating the positive regularization with the actual arc |
| 25 | derivative retains speed variation; MT2015Correction pp. 6-7. -/ |
| 26 | theorem regularized_arcSecond_identity |
| 27 | (F : RicciFlow n M (Set.Icc a b)) (c : ℝ → ℝ → M) |
| 28 | (hc : M62ShrinkingCurve F c) {ε t : ℝ} |
| 29 | (hε : 0 < ε) (ht : t ∈ Set.Ioo a b) (x : ℝ) : |
| 30 | m62ArcSecondDerivative F c t (m62CurvatureSquared F c t) x = |
| 31 | 2 * (m62ArcDerivative F c t (m62RegularizedCurvature F c ε t) x) ^ 2 + |
| 32 | 2 * m62RegularizedCurvature F c ε t x * |
| 33 | m62ArcSecondDerivative F c t (m62RegularizedCurvature F c ε t) x := by |
| 34 | let h := m62RegularizedCurvature F c ε t |
| 35 | have hh : ContDiff ℝ ∞ h := |
| 36 | (regularized_smooth F c hε (curvatureSquared_contDiffOn F c hc)).comp_contDiff |
| 37 | (contDiff_id.prodMk contDiff_const) (fun _ => ⟨Set.mem_univ _, ht⟩) |
| 38 | have hv : ContDiff ℝ ∞ (curveSpeed F c t) := |
| 39 | (speed_joint_contDiffOn F c hc).comp_contDiff |
| 40 | (contDiff_id.prodMk contDiff_const) (fun _ => ⟨Set.mem_univ _, ht⟩) |
| 41 | have hL : ContDiff ℝ ∞ (m62ArcDerivative F c t h) := |
| 42 | (hv.inv (fun y => (speed_pos F c hc (Set.Ioo_subset_Icc_self ht) y).ne')).mul |
| 43 | (contDiff_infty_iff_deriv.mp hh).2 |
| 44 | have hq (y : ℝ) : HasDerivAt (m62CurvatureSquared F c t) |
| 45 | (2 * h y * deriv h y) y := by |
| 46 | have hd := (((hh.differentiable (by simp)) y).hasDerivAt.pow 2).sub_const (ε ^ 2) |
| 47 | convert! hd using 1 |
| 48 | · funext z |
| 49 | change m62CurvatureSquared F c t z = |
| 50 | m62RegularizedCurvature F c ε t z ^ 2 - ε ^ 2 |
| 51 | rw [regularized_sq F c ε t z] |
| 52 | ring |
| 53 | · ring |
| 54 | have harc : m62ArcDerivative F c t (m62CurvatureSquared F c t) = |
| 55 | fun y => 2 * h y * m62ArcDerivative F c t h y := by |
| 56 | funext y |
| 57 | dsimp only [m62ArcDerivative] |
| 58 | rw [(hq y).deriv] |
| 59 | ring |
| 60 | have hd : deriv (fun y => 2 * h y * m62ArcDerivative F c t h y) x = |
| 61 | 2 * deriv h x * m62ArcDerivative F c t h x + |
| 62 | 2 * h x * deriv (m62ArcDerivative F c t h) x := |
| 63 | ((((hh.differentiable (by simp)) x).hasDerivAt.const_mul 2).mul |
| 64 | ((hL.differentiable (by simp)) x).hasDerivAt).deriv |
| 65 | unfold m62ArcSecondDerivative |
| 66 | rw [harc] |
| 67 | change (curveSpeed F c t x)⁻¹ * |
| 68 | deriv (fun y => 2 * h y * m62ArcDerivative F c t h y) x = |
| 69 | 2 * (m62ArcDerivative F c t h x) ^ 2 + |
| 70 | 2 * h x * ((curveSpeed F c t x)⁻¹ * deriv (m62ArcDerivative F c t h) x) |
| 71 | rw [hd] |
| 72 | dsimp only [m62ArcDerivative] |
| 73 | ring |
| 74 | |
| 75 | /-- The positive regularization satisfies the corrected pointwise |
| 76 | inequality without differentiating the curvature norm at zero; |
| 77 | MT2015Correction pp. 6-7. -/ |
| 78 | theorem regularized_deriv_le [T2Space M] |
| 79 | (F : RicciFlow n M (Set.Icc a b)) (c : ℝ → ℝ → M) |
| 80 | (hc : M62ShrinkingCurve F c) {K0 K1 K2 : ℝ} |
| 81 | (h0 : 0 ≤ K0) (h1 : 0 ≤ K1) (h2 : 0 ≤ K2) |
| 82 | (hBounds : CurveEvolutionAmbientBounds F K0 K1 K2) |
| 83 | {ε t : ℝ} (hε : 0 < ε) (ht : t ∈ Set.Ioo a b) (x : ℝ) : |
| 84 | deriv (fun s => m62RegularizedCurvature F c ε s x) t ≤ |
| 85 | m62ArcSecondDerivative F c t (m62RegularizedCurvature F c ε t) x + |
| 86 | (m62Curvature F c t x) ^ 3 + |
| 87 | m62C1 K0 K1 K2 * (m62RegularizedCurvature F c ε t x + 1) := by |
| 88 | let h := m62RegularizedCurvature F c ε t x |
| 89 | let k := m62Curvature F c t x |
| 90 | let q := m62CurvatureSquared F c t x |
| 91 | have hh : 0 < h := regularized_pos F c hε t x |
| 92 | have hk : 0 ≤ k := curvature_nonneg F c t x |
| 93 | have hkq : k ^ 2 = q := curvature_sq F c t x |
| 94 | have hkh : k ≤ h := curvature_le_regularized F c ε t x |
| 95 | have hsq : h ^ 2 = q + ε ^ 2 := regularized_sq F c ε t x |
| 96 | have hquartic : q ^ 2 ≤ h * k ^ 3 := by |
| 97 | calc |
| 98 | q ^ 2 = k ^ 4 := by rw [← hkq]; ring |
| 99 | _ ≤ h * k ^ 3 := by |
| 100 | convert! mul_le_mul_of_nonneg_right hkh (pow_nonneg hk 3) using 1 |
| 101 | ring |
| 102 | have hsum : q + k ≤ h * (h + 1) := by |
| 103 | nlinarith only [hkh, hsq, sq_nonneg ε] |
| 104 | have hC : 0 ≤ m62C0 K0 K1 K2 := by |
| 105 | dsimp only [m62C0] |
| 106 | positivity |
| 107 | have herror := mul_le_mul_of_nonneg_left hsum hC |
| 108 | have hgrad := regularized_gradient_le F c hc hε ht x |
| 109 | have hbound := spatial_squared_bound F c hc h0 h1 h2 hBounds ht x |
| 110 | rw [(hasDerivAt_curvatureSquared F c hc ht x).deriv, |
| 111 | regularized_arcSecond_identity F c hc hε ht x] at hbound |
| 112 | rw [(regularized_hasDerivAt_time F c hε |
| 113 | (hasDerivAt_curvatureSquared F c hc ht x)).deriv] |
| 114 | apply (div_le_iff₀ (mul_pos (by norm_num) hh)).mpr |
| 115 | dsimp only [m62C1] |
| 116 | nlinarith only [hbound, hgrad, hquartic, herror] |
| 117 | |
| 118 | end PoincareMT.M62 |