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.Real |
| 2 | import Mathlib.Tactic.Linarith |
| 3 | |
| 4 | /-! |
| 5 | # Coercive perturbations of the Hamilton quadratic |
| 6 | |
| 7 | Young's inequality controls the mixed term in the lower bound for Hamilton's |
| 8 | quadratic. A large coefficient in the vector direction then makes the |
| 9 | perturbed form positive on nonzero test pairs. This is the initial-time and |
| 10 | spatial-localization estimate in Chow et al., Part II, Section 15.4.5, |
| 11 | printed p. 287 (PDF p. 314). |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | namespace Poincare.RicciFlow.Harnack |
| 17 | |
| 18 | /-- The mixed lower bound is absorbed by two positive quadratic coefficients. -/ |
| 19 | lemma quadratic_perturbation_pos |
| 20 | {q u w C α δ : ℝ} (hδ : 0 < δ) |
| 21 | (hα : C + C ^ 2 / (2 * δ) < α) |
| 22 | (hlower : -C * w ^ 2 - C * u * w ≤ q) |
| 23 | (hnonzero : u ≠ 0 ∨ w ≠ 0) : |
| 24 | 0 < q + α * w ^ 2 + δ * u ^ 2 := by |
| 25 | have hgap : C ^ 2 < (α - C) * (2 * δ) := |
| 26 | (div_lt_iff₀ (mul_pos (by norm_num) hδ)).mp (by linarith only [hα]) |
| 27 | have hbound : |
| 28 | ((2 * δ * (α - C) - C ^ 2) * w ^ 2 + δ ^ 2 * u ^ 2) ≤ |
| 29 | 2 * δ * (q + α * w ^ 2 + δ * u ^ 2) := by |
| 30 | have h := mul_le_mul_of_nonneg_left hlower hδ.le |
| 31 | nlinarith only [h, sq_nonneg (δ * u - C * w)] |
| 32 | have hpositive : 0 < (2 * δ * (α - C) - C ^ 2) * w ^ 2 + δ ^ 2 * u ^ 2 := by |
| 33 | rcases hnonzero with hu | hw |
| 34 | · have hp := mul_pos (sq_pos_of_pos hδ) (sq_pos_of_ne_zero hu) |
| 35 | have hn := mul_nonneg (show 0 ≤ 2 * δ * (α - C) - C ^ 2 by linarith) |
| 36 | (sq_nonneg w) |
| 37 | linarith only [hp, hn] |
| 38 | · have hp := mul_pos (show 0 < 2 * δ * (α - C) - C ^ 2 by linarith) |
| 39 | (sq_pos_of_ne_zero hw) |
| 40 | have hn := mul_nonneg (sq_nonneg δ) (sq_nonneg u) |
| 41 | linarith only [hp, hn] |
| 42 | exact pos_of_mul_pos_right (hpositive.trans_le hbound) (by positivity) |
| 43 | |
| 44 | /-- One positive time works for every quadratic with the same lower bound, |
| 45 | when the reciprocal-time perturbation is bounded below by epsilon/t. -/ |
| 46 | lemma exists_initial_time_quadratic_perturbation_pos |
| 47 | {C ε δ : ℝ} (hC : 0 ≤ C) (hε : 0 < ε) (hδ : 0 < δ) : |
| 48 | ∃ t₀ : ℝ, 0 < t₀ ∧ ∀ t ∈ Set.Ioc 0 t₀, |
| 49 | ∀ q u w α ψ : ℝ, |
| 50 | -C * w ^ 2 - C * u * w ≤ q → u ≠ 0 ∨ w ≠ 0 → |
| 51 | ε / t ≤ α → δ ≤ ψ → 0 < q + α * w ^ 2 + ψ * u ^ 2 := by |
| 52 | let B := C + C ^ 2 / (2 * δ) + 1 |
| 53 | have hB : 0 < B := by dsimp [B]; positivity |
| 54 | refine ⟨ε / B, div_pos hε hB, ?_⟩ |
| 55 | intro t ht q u w α ψ hlower hnonzero hα hψ |
| 56 | have hBt : B * t ≤ ε := by |
| 57 | have h := (le_div_iff₀ hB).mp ht.2 |
| 58 | linarith only [h] |
| 59 | have hBα : B ≤ α := ((le_div_iff₀ ht.1).mpr hBt).trans hα |
| 60 | have hp := quadratic_perturbation_pos hδ |
| 61 | (show C + C ^ 2 / (2 * δ) < α by dsimp [B] at hBα; linarith) |
| 62 | hlower hnonzero |
| 63 | have hψu := mul_le_mul_of_nonneg_right hψ (sq_nonneg u) |
| 64 | linarith only [hp, hψu] |
| 65 | |
| 66 | end Poincare.RicciFlow.Harnack |