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 | /- |
| 2 | Provenance and modification notice (recorded 2026-09-29). |
| 3 | Notices for the adapted portions: |
| 4 | Copyright 2026 The DifferentialGeometry contributors |
| 5 | Source: https://github.com/qinz1yang/differential-geometry |
| 6 | DifferentialGeometry/Analysis/Spectral/Intrinsic/Garding/EigenvalueTailSummableFromCounting.lean |
| 7 | Comparison revision: 1b535dd102b94cc42b107cca27059687888f08b3. |
| 8 | Changes: The dyadic summability proof is adapted to an arbitrary index type and finite-subset counting. |
| 9 | License: Apache-2.0. Source licenses and notices are retained under |
| 10 | PoincareConjecture/provenance/2026-09-29/licenses/. |
| 11 | See PoincareConjecture/MODIFICATIONS.md for the reviewed source mapping. |
| 12 | -/ |
| 13 | |
| 14 | import Mathlib.Analysis.SpecialFunctions.Pow.Real |
| 15 | import Mathlib.Analysis.SpecialFunctions.Exp |
| 16 | import Mathlib.Analysis.SpecificLimits.Normed |
| 17 | import Mathlib.Data.Nat.Log |
| 18 | import Mathlib.Tactic.Positivity |
| 19 | import Mathlib.Tactic.Linarith |
| 20 | import Mathlib.Tactic.Ring |
| 21 | import Mathlib.Tactic.NormNum |
| 22 | |
| 23 | /-! |
| 24 | # Summability from polynomial spectral counting |
| 25 | |
| 26 | The finite-subset formulation applies to arbitrary spectral index types. |
| 27 | The dyadic argument adapts Chow--Liao--Qin, `counting_summable_dyadic`, in |
| 28 | `Analysis/Spectral/Intrinsic/Garding/EigenvalueTailSummableFromCounting.lean`, |
| 29 | revision `1b535dd102b94cc42b107cca27059687888f08b3` (Apache-2.0). |
| 30 | -/ |
| 31 | |
| 32 | set_option autoImplicit false |
| 33 | |
| 34 | noncomputable section |
| 35 | |
| 36 | namespace Poincare.Analysis.Spectral.Counting |
| 37 | |
| 38 | open scoped BigOperators |
| 39 | |
| 40 | /-- Polynomial counting of weights bounded below by one gives a summable |
| 41 | inverse power. The counting hypothesis is tested only on finite subsets. -/ |
| 42 | theorem summable_neg_rpow_of_counting {ι : Type*} (w : ι → ℝ) |
| 43 | (hw : ∀ i, 1 ≤ w i) (q : ℕ) (A : ℝ) (hA : 0 ≤ A) |
| 44 | (hcount : ∀ (R : ℝ), 1 ≤ R → ∀ s : Finset ι, |
| 45 | (∀ i ∈ s, w i ≤ R) → (s.card : ℝ) ≤ A * R ^ q) : |
| 46 | Summable (fun i => (w i) ^ (-((q : ℝ) + 2))) := by |
| 47 | classical |
| 48 | set p : ℝ := (q : ℝ) + 2 with hp_def |
| 49 | have hp_nn : (0 : ℝ) ≤ p := by rw [hp_def]; positivity |
| 50 | set f : ι → ℝ := fun i => (w i) ^ (-p) with hf_def |
| 51 | set shell : ι → ℕ := fun i => Nat.log 2 ⌊w i⌋₊ with hshell_def |
| 52 | have hwpos : ∀ i, 0 < w i := fun i => lt_of_lt_of_le one_pos (hw i) |
| 53 | have hwnn : ∀ i, 0 ≤ w i := fun i => (hwpos i).le |
| 54 | have hfloor1 : ∀ i, 1 ≤ ⌊w i⌋₊ := fun i => (Nat.one_le_floor_iff (w i)).mpr (hw i) |
| 55 | have h_lower : ∀ i, (2 : ℝ) ^ (shell i) ≤ w i := by |
| 56 | intro i |
| 57 | have h1 : 2 ^ (shell i) ≤ ⌊w i⌋₊ := |
| 58 | Nat.pow_log_le_self 2 (Nat.one_le_iff_ne_zero.mp (hfloor1 i)) |
| 59 | calc (2 : ℝ) ^ (shell i) = ((2 ^ (shell i) : ℕ) : ℝ) := by push_cast; ring |
| 60 | _ ≤ (⌊w i⌋₊ : ℝ) := by exact_mod_cast h1 |
| 61 | _ ≤ w i := Nat.floor_le (hwnn i) |
| 62 | have h_upper : ∀ i, w i < 2 ^ (shell i + 1) := by |
| 63 | intro i |
| 64 | have h0 : ⌊w i⌋₊ < 2 ^ (shell i + 1) := |
| 65 | Nat.lt_pow_succ_log_self one_lt_two ⌊w i⌋₊ |
| 66 | have h1 : ⌊w i⌋₊ + 1 ≤ 2 ^ (shell i + 1) := Nat.succ_le_of_lt h0 |
| 67 | have h2 : w i < (⌊w i⌋₊ : ℝ) + 1 := Nat.lt_floor_add_one (w i) |
| 68 | have h3 : (⌊w i⌋₊ : ℝ) + 1 ≤ (2 : ℝ) ^ (shell i + 1) := by |
| 69 | exact_mod_cast h1 |
| 70 | linarith |
| 71 | have hf_nn : ∀ i, 0 ≤ f i := fun i => Real.rpow_nonneg (hwnn i) _ |
| 72 | have hf_le : ∀ i, f i ≤ (2 : ℝ) ^ (-(shell i : ℝ) * p) := by |
| 73 | intro i |
| 74 | rw [hf_def] |
| 75 | have h2pos : (0 : ℝ) < (2 : ℝ) ^ (shell i) := by positivity |
| 76 | have hstep : (w i) ^ (-p) ≤ ((2 : ℝ) ^ (shell i)) ^ (-p) := |
| 77 | Real.rpow_le_rpow_of_nonpos h2pos (h_lower i) (neg_nonpos.mpr hp_nn) |
| 78 | refine hstep.trans (le_of_eq ?_) |
| 79 | rw [← Real.rpow_natCast (2 : ℝ) (shell i), |
| 80 | ← Real.rpow_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 81 | ring_nf |
| 82 | set g : ℕ → ℝ := fun m => A * 2 ^ q * (2 : ℝ) ^ (-(2 : ℝ) * m) with hg_def |
| 83 | have hsummand_eq : (fun m : ℕ => (2 : ℝ) ^ (-(2 : ℝ) * m)) = |
| 84 | fun m : ℕ => ((1 : ℝ) / 4) ^ m := by |
| 85 | funext m |
| 86 | rw [show (-(2 : ℝ) * (m : ℝ)) = ((m : ℝ) * (-(2 : ℝ))) by ring, |
| 87 | Real.rpow_natCast_mul (by norm_num : (0 : ℝ) ≤ 2)] |
| 88 | have h2m_pos : (0 : ℝ) < (2 : ℝ) ^ m := by positivity |
| 89 | rw [show (-(2 : ℝ)) = -((2 : ℕ) : ℝ) by norm_num, |
| 90 | Real.rpow_neg h2m_pos.le, Real.rpow_natCast] |
| 91 | rw [← pow_mul, mul_comm m 2, pow_mul, ← inv_pow] |
| 92 | norm_num |
| 93 | have hbase_summable : Summable (fun m : ℕ => (2 : ℝ) ^ (-(2 : ℝ) * m)) := by |
| 94 | rw [hsummand_eq] |
| 95 | exact summable_geometric_of_lt_one (by norm_num) (by norm_num) |
| 96 | have hg_summable : Summable g := hbase_summable.mul_left (A * 2 ^ q) |
| 97 | have hg_nn : ∀ m, 0 ≤ g m := fun m => by rw [hg_def]; positivity |
| 98 | refine summable_of_sum_le (c := ∑' m, g m) hf_nn (fun u => ?_) |
| 99 | have hpartition : |
| 100 | ∑ m ∈ u.image shell, ∑ i ∈ u with shell i = m, f i = ∑ i ∈ u, f i := |
| 101 | Finset.sum_fiberwise_of_maps_to (fun i hi => Finset.mem_image_of_mem shell hi) f |
| 102 | rw [← hpartition] |
| 103 | have hfiber : ∀ m ∈ u.image shell, |
| 104 | ∑ i ∈ u with shell i = m, f i ≤ g m := by |
| 105 | intro m _hm |
| 106 | have hbound_each : ∀ i ∈ u.filter (fun i => shell i = m), |
| 107 | f i ≤ (2 : ℝ) ^ (-(m : ℝ) * p) := by |
| 108 | intro i hi |
| 109 | have hsi : shell i = m := (Finset.mem_filter.mp hi).2 |
| 110 | simpa only [hsi] using hf_le i |
| 111 | have hcard_le : ((u.filter (fun i => shell i = m)).card : ℝ) ≤ |
| 112 | A * (2 : ℝ) ^ ((m + 1) * q) := by |
| 113 | rw [pow_mul] |
| 114 | apply hcount _ (one_le_pow₀ (by norm_num)) |
| 115 | intro i hi |
| 116 | have hsi : shell i = m := (Finset.mem_filter.mp hi).2 |
| 117 | simpa only [hsi] using (h_upper i).le |
| 118 | calc ∑ i ∈ u with shell i = m, f i |
| 119 | ≤ ∑ _i ∈ u.filter (fun i => shell i = m), (2 : ℝ) ^ (-(m : ℝ) * p) := |
| 120 | Finset.sum_le_sum hbound_each |
| 121 | _ = ((u.filter (fun i => shell i = m)).card : ℝ) * |
| 122 | (2 : ℝ) ^ (-(m : ℝ) * p) := by rw [Finset.sum_const, nsmul_eq_mul] |
| 123 | _ ≤ (A * 2 ^ ((m + 1) * q)) * (2 : ℝ) ^ (-(m : ℝ) * p) := |
| 124 | mul_le_mul_of_nonneg_right hcard_le (Real.rpow_nonneg (by norm_num) _) |
| 125 | _ = g m := by |
| 126 | simp only [hg_def, hp_def] |
| 127 | have h2pos : (0 : ℝ) < 2 := by norm_num |
| 128 | have h2q : (2 : ℝ) ^ ((m + 1) * q) = |
| 129 | (2 : ℝ) ^ (((m : ℝ) * q + q) : ℝ) := by |
| 130 | rw [← Real.rpow_natCast (2 : ℝ) ((m + 1) * q)] |
| 131 | congr 1 |
| 132 | push_cast |
| 133 | ring |
| 134 | have h2qcast : (2 : ℝ) ^ q = (2 : ℝ) ^ ((q : ℝ)) := |
| 135 | (Real.rpow_natCast 2 q).symm |
| 136 | have hexpL : ((m : ℝ) * q + q) + (-(m : ℝ) * (q + 2)) = |
| 137 | (q : ℝ) + (-2 * (m : ℝ)) := by ring |
| 138 | rw [h2q, h2qcast, mul_assoc A, mul_assoc A, |
| 139 | ← Real.rpow_add h2pos, ← Real.rpow_add h2pos, hexpL] |
| 140 | refine (Finset.sum_le_sum hfiber).trans ?_ |
| 141 | exact hg_summable.sum_le_tsum _ (fun m _ => hg_nn m) |
| 142 | |
| 143 | /-- A polynomial finite-subset counting bound implies every polynomially |
| 144 | weighted positive-time exponential is summable, with no countability hypothesis. -/ |
| 145 | theorem summable_weighted_exp_of_counting {ι : Type*} (lam : ι → ℝ) |
| 146 | (hlam : ∀ i, 0 ≤ lam i) (C : ℝ) (hC : 0 ≤ C) (p : ℝ) |
| 147 | (hcount : ∀ (L : ℝ), 0 ≤ L → ∀ s : Finset ι, |
| 148 | (∀ i ∈ s, lam i ≤ L) → (s.card : ℝ) ≤ C * (1 + L) ^ p) |
| 149 | {t : ℝ} (ht : 0 < t) (m : ℕ) : |
| 150 | Summable (fun i => (1 + lam i) ^ m * Real.exp (-t * lam i)) := by |
| 151 | let q : ℕ := ⌈p⌉₊ |
| 152 | have hw : ∀ i, 1 ≤ 1 + lam i := fun i => by linarith [hlam i] |
| 153 | have htail := summable_neg_rpow_of_counting (fun i => 1 + lam i) hw q C hC |
| 154 | (by |
| 155 | intro R hR s hs |
| 156 | have hb := hcount (R - 1) (by linarith) s (fun i hi => by linarith [hs i hi]) |
| 157 | have hRq : R ^ p ≤ R ^ q := by |
| 158 | rw [← Real.rpow_natCast] |
| 159 | exact Real.rpow_le_rpow_of_exponent_le hR (Nat.le_ceil p) |
| 160 | have hRone : 1 + (R - 1) = R := by ring |
| 161 | rw [hRone] at hb |
| 162 | exact hb.trans (mul_le_mul_of_nonneg_left hRq hC)) |
| 163 | have hsum : Summable (fun i => ((1 + lam i) ^ (q + 2))⁻¹) := by |
| 164 | convert htail using 1 |
| 165 | funext i |
| 166 | rw [show (q : ℝ) + 2 = ((q + 2 : ℕ) : ℝ) by push_cast; ring, |
| 167 | Real.rpow_neg (by linarith [hlam i]), Real.rpow_natCast] |
| 168 | let k : ℕ := m + q + 2 |
| 169 | let B : ℝ := Real.exp t * ((k.factorial : ℝ) / t ^ k) |
| 170 | refine (hsum.mul_left B).of_nonneg_of_le |
| 171 | (fun i => mul_nonneg (pow_nonneg (by linarith [hlam i]) _) (Real.exp_pos _).le) |
| 172 | (fun i => ?_) |
| 173 | have hx : 0 < 1 + lam i := by linarith [hlam i] |
| 174 | have hfac : (0 : ℝ) < k.factorial := by positivity |
| 175 | have he := Real.pow_div_factorial_le_exp ((1 + lam i) * t) |
| 176 | (mul_nonneg hx.le ht.le) k |
| 177 | rw [div_le_iff₀ hfac] at he |
| 178 | have he' := mul_le_mul_of_nonneg_right he |
| 179 | (Real.exp_pos (-((1 + lam i) * t))).le |
| 180 | rw [mul_assoc, mul_comm (k.factorial : ℝ), ← mul_assoc, |
| 181 | ← Real.exp_add, add_neg_cancel, Real.exp_zero, one_mul] at he' |
| 182 | have hb : (1 + lam i) ^ k * Real.exp (-((1 + lam i) * t)) ≤ |
| 183 | (k.factorial : ℝ) / t ^ k := by |
| 184 | apply (le_div_iff₀ (pow_pos ht k)).mpr |
| 185 | calc |
| 186 | (1 + lam i) ^ k * Real.exp (-((1 + lam i) * t)) * t ^ k = |
| 187 | ((1 + lam i) * t) ^ k * Real.exp (-((1 + lam i) * t)) := by |
| 188 | rw [mul_pow]; ring |
| 189 | _ ≤ (k.factorial : ℝ) := he' |
| 190 | have hexp : Real.exp (-t * lam i) = |
| 191 | Real.exp t * Real.exp (-((1 + lam i) * t)) := by |
| 192 | rw [← Real.exp_add] |
| 193 | congr 1 |
| 194 | ring |
| 195 | change (1 + lam i) ^ m * Real.exp (-t * lam i) ≤ B / (1 + lam i) ^ (q + 2) |
| 196 | apply (le_div_iff₀ (pow_pos hx (q + 2))).mpr |
| 197 | calc |
| 198 | (1 + lam i) ^ m * Real.exp (-t * lam i) * (1 + lam i) ^ (q + 2) = |
| 199 | Real.exp t * ((1 + lam i) ^ k * Real.exp (-((1 + lam i) * t))) := by |
| 200 | rw [hexp, show k = m + (q + 2) by simp [k, Nat.add_assoc], pow_add] |
| 201 | ring |
| 202 | _ ≤ B := mul_le_mul_of_nonneg_left hb (Real.exp_pos t).le |
| 203 | |
| 204 | end Poincare.Analysis.Spectral.Counting |