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 | /- Adapted from Mapher `PoincareMT/Proofs/M03/RateFiniteAlgebra.lean` at |
| 2 | f927d9e1f0810042766d3b5f64d3f4da02ee93cc. See |
| 3 | `references/ricci-flow/mapher/local-theory/port.json`. -/ |
| 4 | |
| 5 | import PoincareLib.Geometry.RicciFlow.Local.Energy.Comparison.ScalarEnergyComparison |
| 6 | |
| 7 | /-! |
| 8 | # Finite coefficient algebra for rate estimates |
| 9 | |
| 10 | The geometric rate producers reduce their coordinate expressions to finite |
| 11 | linear combinations of the H/A/S coordinates. These lemmas provide the |
| 12 | finite-dimensional Cauchy bound used for that reduction. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open scoped BigOperators |
| 18 | |
| 19 | namespace PoincareMT.RicciFlow.Local |
| 20 | |
| 21 | theorem sum_sq_linear_combination_le |
| 22 | {I B : Type*} [Fintype I] [Fintype B] |
| 23 | (c : I → B → ℝ) (x : B → ℝ) : |
| 24 | (∑ i, (∑ b, c i b * x b) ^ 2) ≤ |
| 25 | (∑ i, ∑ b, (c i b) ^ 2) * (∑ b, (x b) ^ 2) := by |
| 26 | calc |
| 27 | (∑ i, (∑ b, c i b * x b) ^ 2) ≤ |
| 28 | ∑ i, (∑ b, (c i b) ^ 2) * (∑ b, (x b) ^ 2) := by |
| 29 | apply Finset.sum_le_sum |
| 30 | intro i hi |
| 31 | simpa only [mul_comm] using |
| 32 | (Finset.sum_mul_sq_le_sq_mul_sq |
| 33 | (s := Finset.univ) (f := fun b => c i b) (g := fun b => x b)) |
| 34 | _ = (∑ i, ∑ b, (c i b) ^ 2) * (∑ b, (x b) ^ 2) := by |
| 35 | rw [← Finset.sum_mul] |
| 36 | |
| 37 | theorem sum_two_mul_linear_combination_le |
| 38 | {I B : Type*} [Fintype I] [Fintype B] |
| 39 | (c : I → B → ℝ) (a : I → ℝ) (x : B → ℝ) |
| 40 | {ε C : ℝ} (hε : 0 < ε) |
| 41 | (hc : (∑ i, ∑ b, (c i b) ^ 2) ≤ C) |
| 42 | (hC : 0 ≤ C) : |
| 43 | (∑ i, 2 * a i * (∑ b, c i b * x b)) ≤ |
| 44 | ε * (∑ b, (x b) ^ 2) + (C / ε) * (∑ i, (a i) ^ 2) := by |
| 45 | let A₂ : ℝ := ∑ i, (a i) ^ 2 |
| 46 | let X₂ : ℝ := ∑ b, (x b) ^ 2 |
| 47 | let P : ℝ := ∑ i, a i * (∑ b, c i b * x b) |
| 48 | have hA : 0 ≤ A₂ := by |
| 49 | dsimp [A₂] |
| 50 | positivity |
| 51 | have hX : 0 ≤ X₂ := by |
| 52 | dsimp [X₂] |
| 53 | positivity |
| 54 | have hcross : P ^ 2 ≤ A₂ * (∑ i, (∑ b, c i b * x b) ^ 2) := by |
| 55 | simpa only [mul_comm] using |
| 56 | (Finset.sum_mul_sq_le_sq_mul_sq |
| 57 | (s := Finset.univ) (f := fun i => a i) |
| 58 | (g := fun i => ∑ b, c i b * x b)) |
| 59 | have hcoeff : (∑ i, (∑ b, c i b * x b) ^ 2) ≤ C * X₂ := by |
| 60 | exact (sum_sq_linear_combination_le c x).trans |
| 61 | (mul_le_mul_of_nonneg_right hc hX) |
| 62 | have hP : 2 * P ≤ ε * X₂ + (C / ε) * A₂ := by |
| 63 | by_cases hX0 : X₂ = 0 |
| 64 | · have hsum : ∑ i, (∑ b, c i b * x b) ^ 2 = 0 := by |
| 65 | have hcoeff0 := hcoeff |
| 66 | simp [hX0] at hcoeff0 |
| 67 | exact le_antisymm hcoeff0 (by positivity) |
| 68 | have hP0 : P = 0 := by |
| 69 | have hzero : ∀ i, (∑ b, c i b * x b) = 0 := by |
| 70 | intro i |
| 71 | have hi := (Finset.sum_eq_zero_iff_of_nonneg |
| 72 | (s := Finset.univ) |
| 73 | (fun k _ => sq_nonneg (∑ b, c k b * x b))).mp hsum |
| 74 | exact sq_eq_zero_iff.mp (hi i (Finset.mem_univ i)) |
| 75 | simp [P, hzero] |
| 76 | simp [hX0, hP0] |
| 77 | exact mul_nonneg (div_nonneg hC (le_of_lt hε)) hA |
| 78 | · have hXpos : 0 < X₂ := lt_of_le_of_ne hX (Ne.symm hX0) |
| 79 | have hYoung : 2 * P ≤ ε * X₂ + P ^ 2 / (ε * X₂) := by |
| 80 | have hsquare := sq_nonneg (ε * X₂ - P) |
| 81 | field_simp |
| 82 | nlinarith |
| 83 | have hquot : P ^ 2 / (ε * X₂) ≤ (C / ε) * A₂ := by |
| 84 | apply (div_le_iff₀ (mul_pos hε hXpos)).mpr |
| 85 | calc |
| 86 | P ^ 2 ≤ A₂ * (∑ i, (∑ b, c i b * x b) ^ 2) := hcross |
| 87 | _ ≤ A₂ * (C * X₂) := |
| 88 | mul_le_mul_of_nonneg_left hcoeff hA |
| 89 | _ = (C / ε) * A₂ * (ε * X₂) := by field_simp |
| 90 | exact hYoung.trans (by nlinarith [hquot]) |
| 91 | simpa [A₂, X₂, P, Finset.mul_sum, mul_assoc, mul_left_comm, mul_comm] using hP |
| 92 | |
| 93 | end PoincareMT.RicciFlow.Local |