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 Mathlib.Data.Real.Basic |
| 2 | import Mathlib.Tactic.FieldSimp |
| 3 | import Mathlib.Tactic.Linarith |
| 4 | import Mathlib.Tactic.Positivity |
| 5 | |
| 6 | /-! |
| 7 | # Explicit damping for the radial heat barrier |
| 8 | |
| 9 | This is the real algebra prerequisite for the profile |
| 10 | `exp (-C * (t - a)) * exp (-1 / s)`, where `s = rho ^ 2 - |y| ^ 2`. |
| 11 | The positive scale and damping constant are explicit functions of the uniform |
| 12 | coefficient bounds. No differential or heat positivity conclusion is assumed. |
| 13 | |
| 14 | Source context: Morgan--Tian, Theorem 4.16, p. 95. Adapted from the checked |
| 15 | AxelWorkspace moving-bump proof. |
| 16 | -/ |
| 17 | |
| 18 | namespace PoincareMT.RicciFlow.Splitting.MaximumPrinciple.Barrier |
| 19 | |
| 20 | /-- A positive boundary scale, chosen without taking a square root. -/ |
| 21 | noncomputable def boundaryScale (rho lam H0 : ℝ) : ℝ := |
| 22 | min (rho ^ 2 / 2) (min (1 / 4) (lam * rho ^ 2 / (2 * (H0 + 1)))) |
| 23 | |
| 24 | /-- The explicit scale has all bounds needed for the boundary/inner split. -/ |
| 25 | theorem boundaryScale_bounds {rho lam H0 : ℝ} |
| 26 | (hrho : 0 < rho) (hlam : 0 < lam) (hH0 : 0 ≤ H0) : |
| 27 | 0 < boundaryScale rho lam H0 ∧ |
| 28 | boundaryScale rho lam H0 ≤ rho ^ 2 / 2 ∧ |
| 29 | boundaryScale rho lam H0 ≤ 1 / 4 ∧ |
| 30 | 2 * H0 * boundaryScale rho lam H0 ^ 2 ≤ lam * rho ^ 2 := by |
| 31 | let d := boundaryScale rho lam H0 |
| 32 | have hd : 0 < d := by dsimp [d, boundaryScale]; positivity |
| 33 | have hdr : d ≤ rho ^ 2 / 2 := min_le_left _ _ |
| 34 | have hdq : d ≤ 1 / 4 := (min_le_right _ _).trans (min_le_left _ _) |
| 35 | have hdf : d ≤ lam * rho ^ 2 / (2 * (H0 + 1)) := |
| 36 | (min_le_right _ _).trans (min_le_right _ _) |
| 37 | have hden : 0 < 2 * (H0 + 1) := by positivity |
| 38 | have hmul := (le_div_iff₀ hden).mp hdf |
| 39 | have hd2 : d ^ 2 ≤ d := by nlinarith |
| 40 | have hHmul := mul_le_mul_of_nonneg_left hd2 hH0 |
| 41 | exact ⟨hd, hdr, hdq, by dsimp [d] at *; nlinarith⟩ |
| 42 | |
| 43 | /-- Uniform damping depending only on radius and coefficient bounds. -/ |
| 44 | noncomputable def dampingConstant (rho lam Lam H0 : ℝ) : ℝ := |
| 45 | 8 * Lam * rho ^ 2 / boundaryScale rho lam H0 ^ 3 + |
| 46 | 2 * H0 / boundaryScale rho lam H0 ^ 2 |
| 47 | |
| 48 | /-- The explicitly chosen damping is nonnegative. -/ |
| 49 | theorem dampingConstant_nonneg {rho lam Lam H0 : ℝ} |
| 50 | (hrho : 0 < rho) (hlam : 0 < lam) (hLam : lam ≤ Lam) (hH0 : 0 ≤ H0) : |
| 51 | 0 ≤ dampingConstant rho lam Lam H0 := by |
| 52 | have hd := (boundaryScale_bounds hrho hlam hH0).1 |
| 53 | have hLam0 : 0 < Lam := lt_of_lt_of_le hlam hLam |
| 54 | unfold dampingConstant |
| 55 | positivity |
| 56 | |
| 57 | private theorem near_boundary_nonneg {rho lam H0 d s Q H : ℝ} |
| 58 | (hlam : 0 < lam) (hH0 : 0 ≤ H0) (hs : 0 < s) (hsd : s ≤ d) |
| 59 | (hdr : d ≤ rho ^ 2 / 2) (hdq : d ≤ 1 / 4) |
| 60 | (hdH : 2 * H0 * d ^ 2 ≤ lam * rho ^ 2) |
| 61 | (hQ : lam * (rho ^ 2 - s) ≤ Q) (hH : H ≤ H0) : |
| 62 | 0 ≤ 4 * Q / s ^ 4 - 8 * Q / s ^ 3 - 2 * H / s ^ 2 := by |
| 63 | have hr : rho ^ 2 / 2 ≤ rho ^ 2 - s := by linarith |
| 64 | have hlr := mul_le_mul_of_nonneg_left hr hlam.le |
| 65 | have hQ0 : 0 ≤ Q := by nlinarith [sq_nonneg rho] |
| 66 | have hQs : 8 * Q * s ≤ 2 * Q := by nlinarith |
| 67 | have hs2 : s ^ 2 ≤ d ^ 2 := by nlinarith |
| 68 | have hH2 := mul_le_mul_of_nonneg_left hs2 hH0 |
| 69 | have hHs := mul_le_mul_of_nonneg_right hH (sq_nonneg s) |
| 70 | have hnum : 0 ≤ 4 * Q - 8 * Q * s - 2 * H * s ^ 2 := by nlinarith |
| 71 | have hid : 4 * Q / s ^ 4 - 8 * Q / s ^ 3 - 2 * H / s ^ 2 = |
| 72 | (4 * Q - 8 * Q * s - 2 * H * s ^ 2) / s ^ 4 := by |
| 73 | field_simp |
| 74 | rw [hid] |
| 75 | exact div_nonneg hnum (pow_nonneg hs.le _) |
| 76 | |
| 77 | /-- Uniform lower bound for the radial coefficient, with the chosen damping. |
| 78 | The squared radial variable has been eliminated using `r2 = rho ^ 2 - s`. -/ |
| 79 | theorem radial_coefficient_nonneg {rho lam Lam H0 s Q H : ℝ} |
| 80 | (hrho : 0 < rho) (hlam : 0 < lam) (hLam : lam ≤ Lam) (hH0 : 0 ≤ H0) |
| 81 | (hs : 0 < s) (hsrho : s ≤ rho ^ 2) |
| 82 | (hQlo : lam * (rho ^ 2 - s) ≤ Q) |
| 83 | (hQhi : Q ≤ Lam * (rho ^ 2 - s)) (hH : H ≤ H0) : |
| 84 | 0 ≤ dampingConstant rho lam Lam H0 + 4 * Q / s ^ 4 - |
| 85 | 8 * Q / s ^ 3 - 2 * H / s ^ 2 := by |
| 86 | obtain ⟨hd, hdr, hdq, hdH⟩ := boundaryScale_bounds hrho hlam hH0 |
| 87 | have hC := dampingConstant_nonneg hrho hlam hLam hH0 |
| 88 | by_cases hsd : s ≤ boundaryScale rho lam H0 |
| 89 | · have hn := near_boundary_nonneg hlam hH0 hs hsd hdr hdq hdH hQlo hH |
| 90 | linarith |
| 91 | · have hds := le_of_lt (lt_of_not_ge hsd) |
| 92 | have hLam0 : 0 ≤ Lam := (lt_of_lt_of_le hlam hLam).le |
| 93 | have hQ0 : 0 ≤ Q := (mul_nonneg hlam.le (sub_nonneg.mpr hsrho)).trans hQlo |
| 94 | have hQr : Q ≤ Lam * rho ^ 2 := by nlinarith |
| 95 | have hpow3 : boundaryScale rho lam H0 ^ 3 ≤ s ^ 3 := |
| 96 | pow_le_pow_left₀ hd.le hds 3 |
| 97 | have hpow2 : boundaryScale rho lam H0 ^ 2 ≤ s ^ 2 := |
| 98 | pow_le_pow_left₀ hd.le hds 2 |
| 99 | have hQdiv : 8 * Q / s ^ 3 ≤ |
| 100 | 8 * Lam * rho ^ 2 / boundaryScale rho lam H0 ^ 3 := by |
| 101 | calc |
| 102 | 8 * Q / s ^ 3 ≤ (8 * Lam * rho ^ 2) / s ^ 3 := |
| 103 | div_le_div_of_nonneg_right (by nlinarith) (pow_nonneg hs.le _) |
| 104 | _ ≤ _ := div_le_div_of_nonneg_left (by positivity) (by positivity) hpow3 |
| 105 | have hHdiv : 2 * H / s ^ 2 ≤ 2 * H0 / boundaryScale rho lam H0 ^ 2 := by |
| 106 | calc |
| 107 | 2 * H / s ^ 2 ≤ 2 * H0 / s ^ 2 := |
| 108 | div_le_div_of_nonneg_right (by linarith) (sq_nonneg s) |
| 109 | _ ≤ _ := div_le_div_of_nonneg_left (by positivity) (by positivity) hpow2 |
| 110 | have hpos : 0 ≤ 4 * Q / s ^ 4 := by positivity |
| 111 | unfold dampingConstant |
| 112 | linarith |
| 113 | |
| 114 | /-- The same estimate with an explicit squared-radius variable `r2`. -/ |
| 115 | theorem radial_coefficient_nonneg_of_radius_sq {rho lam Lam H0 s r2 Q H : ℝ} |
| 116 | (hrho : 0 < rho) (hlam : 0 < lam) (hLam : lam ≤ Lam) (hH0 : 0 ≤ H0) |
| 117 | (hs : 0 < s) (hsrho : s ≤ rho ^ 2) (hr2 : r2 = rho ^ 2 - s) |
| 118 | (hQlo : lam * r2 ≤ Q) (hQhi : Q ≤ Lam * r2) (hH : H ≤ H0) : |
| 119 | 0 ≤ dampingConstant rho lam Lam H0 + 4 * Q / s ^ 4 - |
| 120 | 8 * Q / s ^ 3 - 2 * H / s ^ 2 := by |
| 121 | subst r2 |
| 122 | exact radial_coefficient_nonneg hrho hlam hLam hH0 hs hsrho hQlo hQhi hH |
| 123 | |
| 124 | end PoincareMT.RicciFlow.Splitting.MaximumPrinciple.Barrier |
| 125 |