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.CanonicalInduction.Positive.PositiveGradientEvolution |
| 2 | |
| 3 | /-! |
| 4 | # The scalar-gradient quotient estimate |
| 5 | |
| 6 | The quotient `|gradient R|^2/R` has a global parabolic upper bound: |
| 7 | the Hessian quadratic cross term cancels against a completed square. |
| 8 | This is the gradient argument of Hamilton (1982), Section 11, supporting |
| 9 | Morgan--Tian, Theorem 4.23, pp. 74-75. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | -- The retained metric and tangent-fiber inner products agree definitionally. |
| 14 | set_option backward.isDefEq.respectTransparency false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Bundle BigOperators Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M47Positive |
| 22 | |
| 23 | private theorem hessian_quotient_remainder_nonpos {R G H K : ℝ} |
| 24 | (hR : 0 < R) (hH : 0 ≤ H) (hK : K ≤ Real.sqrt H * G) : |
| 25 | -2 * H / R + 4 * K / R ^ 2 - 2 * G ^ 2 / R ^ 3 ≤ 0 := by |
| 26 | have hsquare := sq_nonneg (Real.sqrt H * R - G) |
| 27 | simp only [sub_sq, mul_pow, Real.sq_sqrt hH] at hsquare |
| 28 | have hKR := mul_le_mul_of_nonneg_right hK hR.le |
| 29 | have hcore : -2 * H * R ^ 2 + 4 * K * R - 2 * G ^ 2 ≤ 0 := by |
| 30 | nlinarith only [hsquare, hKR] |
| 31 | apply nonpos_of_mul_nonpos_left (b := R ^ 3) ?_ (pow_pos hR 3) |
| 32 | have hid : (-2 * H / R + 4 * K / R ^ 2 - 2 * G ^ 2 / R ^ 3) * R ^ 3 = |
| 33 | -2 * H * R ^ 2 + 4 * K * R - 2 * G ^ 2 := by |
| 34 | field_simp [hR.ne'] |
| 35 | rw [hid] |
| 36 | exact hcore |
| 37 | |
| 38 | private theorem quotient_parabolic_bound {R G S H K V Lr Lg Lq W dq : ℝ} |
| 39 | (hR : 0 < R) (hH : 0 ≤ H) (hK : K ≤ Real.sqrt H * G) |
| 40 | (hgradient : 2 * K = G / R * G + R * W) |
| 41 | (hspace : Lg = G / R * Lr + R * Lq + 2 * W) |
| 42 | (htime : dq * R + G / R * (Lr + 2 * S) = Lg - 2 * H + 4 * V) : |
| 43 | dq ≤ Lq + 4 / R * V - 2 * S * G / R ^ 2 := by |
| 44 | have hrem := hessian_quotient_remainder_nonpos hR hH hK |
| 45 | have hid : dq - (Lq + 4 / R * V - 2 * S * G / R ^ 2) = |
| 46 | -2 * H / R + 4 * K / R ^ 2 - 2 * G ^ 2 / R ^ 3 := by |
| 47 | field_simp [hR.ne'] at htime hspace hgradient ⊢ |
| 48 | linear_combination R * htime + R * hspace - 2 * hgradient |
| 49 | linarith only [hid, hrem] |
| 50 | |
| 51 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 52 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 53 | |
| 54 | /-- The actual positive scalar-gradient quotient satisfies the global |
| 55 | parabolic upper bound obtained by completing the Hessian square. This is |
| 56 | the quotient step in Hamilton (1982), Section 11, and Morgan--Tian, |
| 57 | Theorem 4.23, pp. 74-75. -/ |
| 58 | theorem scalar_gradient_quotient_evolution_le |
| 59 | (hC : RicciFlowCurvatureTheory.{u}) {J : Set ℝ} (F : RicciFlow n M J) |
| 60 | {t : ℝ} (ht : t ∈ interior J) |
| 61 | (hR : ∀ y, 0 < (F.connection t).scalarCurvature y) (x : M) : |
| 62 | deriv (fun s => (F.metric s).inner x |
| 63 | ((F.connection s).gradient (F.connection s).scalarCurvature x) |
| 64 | ((F.connection s).gradient (F.connection s).scalarCurvature x) / |
| 65 | (F.connection s).scalarCurvature x) t ≤ |
| 66 | (F.connection t).laplacian (fun y => (F.metric t).inner y |
| 67 | ((F.connection t).gradient (F.connection t).scalarCurvature y) |
| 68 | ((F.connection t).gradient (F.connection t).scalarCurvature y) / |
| 69 | (F.connection t).scalarCurvature y) x + |
| 70 | 4 / (F.connection t).scalarCurvature x * (F.metric t).inner x |
| 71 | ((F.connection t).gradient (F.connection t).scalarCurvature x) |
| 72 | ((F.connection t).gradient (F.connection t).ricciNormSq x) - |
| 73 | 2 * (F.connection t).ricciNormSq x * (F.metric t).inner x |
| 74 | ((F.connection t).gradient (F.connection t).scalarCurvature x) |
| 75 | ((F.connection t).gradient (F.connection t).scalarCurvature x) / |
| 76 | (F.connection t).scalarCurvature x ^ 2 := by |
| 77 | let D := F.connection t |
| 78 | let R := D.scalarCurvature |
| 79 | let S := D.ricciNormSq |
| 80 | let G := fun y => (F.metric t).inner y (D.gradient R y) (D.gradient R y) |
| 81 | let q := fun y => G y / R y |
| 82 | let H := ∑ i, ∑ j, (D.hessian R x |
| 83 | ((F.metric t).orthonormalBasis x i) ((F.metric t).orthonormalBasis x j)) ^ 2 |
| 84 | let K := D.hessian R x (D.gradient R x) (D.gradient R x) |
| 85 | let V := (F.metric t).inner x (D.gradient R x) (D.gradient S x) |
| 86 | let W := (F.metric t).inner x (D.gradient q x) (D.gradient R x) |
| 87 | let dq := deriv (fun s => (F.metric s).inner x |
| 88 | ((F.connection s).gradient (F.connection s).scalarCurvature x) |
| 89 | ((F.connection s).gradient (F.connection s).scalarCurvature x) / |
| 90 | (F.connection s).scalarCurvature x) t |
| 91 | have hD := hC.tensor_calculus n M (F.metric t) D |
| 92 | have hRs := hD.contMDiff_scalarCurvature |
| 93 | have hGs := contMDiff_gradient_energy D hRs |
| 94 | have hqs : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ q := |
| 95 | hGs.div₀ hRs (fun y => (hR y).ne') |
| 96 | have hprod : (fun y => q y * R y) = G := by |
| 97 | funext y |
| 98 | exact div_mul_cancel₀ _ (hR y).ne' |
| 99 | have hgradient : 2 * K = G x / R x * G x + R x * W := by |
| 100 | have hg := D.gradient_mul ((hqs x).mdifferentiableAt (by simp)) |
| 101 | ((hRs x).mdifferentiableAt (by simp)) |
| 102 | change D.gradient (fun y => q y * R y) x = |
| 103 | q x • D.gradient R x + R x • D.gradient q x at hg |
| 104 | rw [hprod] at hg |
| 105 | have hinner := congrArg (fun v => (F.metric t).inner x v (D.gradient R x)) hg |
| 106 | rw [gradient_energy_pairing D hRs x] at hinner |
| 107 | simpa only [map_add, add_apply, map_smul, smul_apply, smul_eq_mul] using hinner |
| 108 | have hspace : D.laplacian G x = G x / R x * D.laplacian R x + |
| 109 | R x * D.laplacian q x + 2 * W := by |
| 110 | have h := D.laplacian_mul hqs hRs x |
| 111 | change D.laplacian (fun y => q y * R y) x = _ at h |
| 112 | rw [hprod] at h |
| 113 | exact h |
| 114 | have hdR := (hC.scalar_evolution n M J F t (interior_subset ht) x).hasDerivAt |
| 115 | (mem_interior_iff_mem_nhds.mp ht) |
| 116 | have hdG := hasDerivAt_scalar_gradient_energy hC F ht x |
| 117 | have hdq := hdG.div hdR (hR x).ne' |
| 118 | have hRx : 0 < R x := hR x |
| 119 | have htime : dq * R x + G x / R x * (D.laplacian R x + 2 * S x) = |
| 120 | D.laplacian G x - 2 * H + 4 * V := by |
| 121 | have h := hdq.deriv |
| 122 | change dq = ((D.laplacian G x - 2 * H + 4 * V) * R x - |
| 123 | G x * (D.laplacian R x + 2 * S x)) / R x ^ 2 at h |
| 124 | rw [h] |
| 125 | field_simp [hRx.ne'] |
| 126 | ring |
| 127 | have hH : 0 ≤ H := |
| 128 | Finset.sum_nonneg fun _ _ => Finset.sum_nonneg fun _ _ => sq_nonneg _ |
| 129 | have hK : K ≤ Real.sqrt H * G x := |
| 130 | (le_abs_self K).trans (D.abs_hessian_quadratic_le_normSq (hRs x) (D.gradient R x)) |
| 131 | exact quotient_parabolic_bound (hR x) hH hK hgradient hspace htime |
| 132 | |
| 133 | end PoincareMT.M47Positive |