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.Analysis.SpecialFunctions.Pow.Asymptotics |
| 2 | |
| 3 | /-! |
| 4 | # Fixed scalar thresholds for the gradient estimate |
| 5 | |
| 6 | A decaying normalized Ricci defect bounds the Hamilton barrier reaction |
| 7 | on all positive scalar values. A second threshold absorbs its remaining |
| 8 | linear scalar term into an arbitrarily small cubic term. These are the |
| 9 | real comparisons for Hamilton (1982), Section 11, used in Morgan--Tian, |
| 10 | Theorem 4.23, pp. 74-75. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | namespace PoincareMT.M47Positive |
| 16 | |
| 17 | /-- A fixed normalized-defect bound supplies a uniform upper bound for |
| 18 | the scalar reaction, with the threshold chosen before time. This is the |
| 19 | reaction comparison in Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 20 | theorem exists_gradient_reaction_upper {epsilon beta C : ℝ} |
| 21 | (hepsilon : 0 < epsilon) (hbeta : 0 < beta) : |
| 22 | ∃ L : ℝ, 0 ≤ L ∧ ∀ R D : ℝ, 0 < R → D ≤ R ^ 2 → |
| 23 | D / R ^ 2 ≤ C / R ^ epsilon → 960 * R * D - (4 * beta / 3) * R ^ 3 ≤ L := by |
| 24 | obtain ⟨B0, hB0⟩ := Filter.tendsto_atTop_atTop.mp |
| 25 | (tendsto_rpow_atTop hepsilon) (720 * C / beta) |
| 26 | let B := max 1 B0 |
| 27 | have hB : 0 < B := (by norm_num : (0 : ℝ) < 1).trans_le (le_max_left _ _) |
| 28 | refine ⟨960 * B ^ 3, by positivity, ?_⟩ |
| 29 | intro R D hR hD hnormalized |
| 30 | by_cases hlarge : B ≤ R |
| 31 | · have hpower : 720 * C / beta ≤ R ^ epsilon := |
| 32 | hB0 R ((le_max_right _ _).trans hlarge) |
| 33 | have hratio : C / R ^ epsilon ≤ beta / 720 := by |
| 34 | apply (div_le_iff₀ (Real.rpow_pos_of_pos hR epsilon)).mpr |
| 35 | have h := (div_le_iff₀ hbeta).mp hpower |
| 36 | nlinarith only [h] |
| 37 | have hdef := (div_le_iff₀ (sq_pos_of_pos hR)).mp (hnormalized.trans hratio) |
| 38 | have hmul := mul_le_mul_of_nonneg_left hdef (show 0 ≤ 960 * R by positivity) |
| 39 | have hnonpos : 960 * R * D - (4 * beta / 3) * R ^ 3 ≤ 0 := by |
| 40 | nlinarith only [hmul] |
| 41 | exact hnonpos.trans (by positivity) |
| 42 | · have hRB : R ≤ B := (lt_of_not_ge hlarge).le |
| 43 | have hmul := mul_le_mul_of_nonneg_left hD (show 0 ≤ 960 * R by positivity) |
| 44 | have hcube : R ^ 3 ≤ B ^ 3 := by gcongr |
| 45 | have hsubtract : 0 ≤ (4 * beta / 3) * R ^ 3 := by positivity |
| 46 | nlinarith only [hmul, hcube, hsubtract] |
| 47 | |
| 48 | /-- A fixed nonnegative linear scalar term is absorbed by any positive |
| 49 | cubic coefficient plus a fixed positive constant, as in the final |
| 50 | gradient comparison of Morgan--Tian, Theorem 4.23, pp. 74-75. -/ |
| 51 | theorem exists_linear_cubic_absorption {eta C : ℝ} (heta : 0 < eta) (hC : 0 ≤ C) : |
| 52 | ∃ K : ℝ, 0 < K ∧ ∀ R : ℝ, 0 < R → C * R ≤ eta * R ^ 3 + K := by |
| 53 | let B := max 1 (C / eta) |
| 54 | let K := max 1 (C * B) |
| 55 | have hK : 0 < K := (by norm_num : (0 : ℝ) < 1).trans_le (le_max_left _ _) |
| 56 | refine ⟨K, hK, ?_⟩ |
| 57 | intro R hR |
| 58 | by_cases hlarge : B ≤ R |
| 59 | · have hR1 : 1 ≤ R := (le_max_left _ _).trans hlarge |
| 60 | have hCR : C ≤ R * eta := (div_le_iff₀ heta).mp ((le_max_right _ _).trans hlarge) |
| 61 | have hsq : R ≤ R ^ 2 := by nlinarith only [hR1, sq_nonneg (R - 1)] |
| 62 | have hsq' := mul_le_mul_of_nonneg_left hsq heta.le |
| 63 | have hbound : C ≤ eta * R ^ 2 := by nlinarith only [hCR, hsq'] |
| 64 | have hmul := mul_le_mul_of_nonneg_right hbound hR.le |
| 65 | nlinarith only [hmul, hK] |
| 66 | · have hsmall := mul_le_mul_of_nonneg_left (le_of_lt (lt_of_not_ge hlarge)) hC |
| 67 | have hCB : C * B ≤ K := le_max_right _ _ |
| 68 | have hcube : 0 ≤ eta * R ^ 3 := by positivity |
| 69 | linarith only [hsmall, hCB, hcube] |
| 70 | |
| 71 | end PoincareMT.M47Positive |