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 PoincareLib.Geometry.Curvature.Integral.Concentration.GeometricAnnuli |
| 2 | |
| 3 | /-! # Bounded overlap of buffered geometric annuli -/ |
| 4 | |
| 5 | noncomputable section |
| 6 | set_option autoImplicit false |
| 7 | set_option backward.isDefEq.respectTransparency false |
| 8 | open Set MeasureTheory |
| 9 | open scoped BigOperators |
| 10 | namespace Poincare.CurvatureIntegral |
| 11 | |
| 12 | /-- A finite family of geometric annuli has bounded multiplicity once one |
| 13 | block of scales shrinks the outer radius below the inner radius. -/ |
| 14 | theorem card_geometric_annuli_mem_le |
| 15 | {A B r₀ q : ℝ} {L : ℕ} (hB : 0 < B) (hr₀ : 0 < r₀) |
| 16 | (hq : 0 < q) (hq1 : q ≤ 1) (hgap : B * q ^ L < A) |
| 17 | (F : Finset ℕ) (d : ℝ) : |
| 18 | (F.filter (fun j => A * (r₀ * q ^ j) ≤ d ∧ d ≤ B * (r₀ * q ^ j))).card ≤ L := by |
| 19 | classical |
| 20 | let S := F.filter (fun j => A * (r₀ * q ^ j) ≤ d ∧ d ≤ B * (r₀ * q ^ j)) |
| 21 | change S.card ≤ L |
| 22 | by_cases hS : S.Nonempty |
| 23 | · let j₀ := S.min' hS |
| 24 | have hj₀ : j₀ ∈ S := Finset.min'_mem S hS |
| 25 | have hlow := (Finset.mem_filter.mp hj₀).2.1 |
| 26 | have hrj : 0 < r₀ * q ^ j₀ := mul_pos hr₀ (pow_pos hq _) |
| 27 | have hsub : S ⊆ Finset.Ico j₀ (j₀ + L) := by |
| 28 | intro j hj |
| 29 | refine Finset.mem_Ico.mpr ⟨Finset.min'_le _ _ hj, ?_⟩ |
| 30 | by_contra hnot |
| 31 | have hpow := pow_le_pow_of_le_one hq.le hq1 (le_of_not_gt hnot) |
| 32 | have hjupper := (Finset.mem_filter.mp hj).2.2 |
| 33 | have hupper : B * (r₀ * q ^ j) < A * (r₀ * q ^ j₀) := by |
| 34 | calc |
| 35 | _ ≤ B * (r₀ * q ^ (j₀ + L)) := |
| 36 | mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hpow hr₀.le) hB.le |
| 37 | _ = (B * q ^ L) * (r₀ * q ^ j₀) := by rw [pow_add]; ring |
| 38 | _ < _ := mul_lt_mul_of_pos_right hgap hrj |
| 39 | exact (not_lt_of_ge hlow) (hjupper.trans_lt hupper) |
| 40 | exact (Finset.card_le_card hsub).trans_eq (by simp) |
| 41 | · rw [Finset.not_nonempty_iff_eq_empty.mp hS, Finset.card_empty] |
| 42 | exact Nat.zero_le L |
| 43 | |
| 44 | /-- Summing local error integrals over geometric annuli loses only their |
| 45 | uniform overlap, not the number of scales in the finite subcover. -/ |
| 46 | theorem sum_integral_geometric_annuli_le |
| 47 | {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] |
| 48 | {μ : Measure X} (p : X) {W : Set X} {K : X → ℝ} |
| 49 | (hW : MeasurableSet W) (hKi : IntegrableOn K W μ) (hKn : ∀ x, 0 ≤ K x) |
| 50 | {A B r₀ q : ℝ} {L : ℕ} (hB : 0 < B) (hr₀ : 0 < r₀) |
| 51 | (hq : 0 < q) (hq1 : q ≤ 1) (hgap : B * q ^ L < A) |
| 52 | (F : Finset ℕ) |
| 53 | (hsub : ∀ j ∈ F, |
| 54 | {x | A * (r₀ * q ^ j) ≤ dist p x ∧ dist p x ≤ B * (r₀ * q ^ j)} ⊆ W) : |
| 55 | (∑ j ∈ F, ∫ x in {x | A * (r₀ * q ^ j) ≤ dist p x ∧ |
| 56 | dist p x ≤ B * (r₀ * q ^ j)}, K x ∂μ) ≤ |
| 57 | (L : ℝ) * ∫ x in W, K x ∂μ := by |
| 58 | classical |
| 59 | let U := fun j : ℕ => {x | A * (r₀ * q ^ j) ≤ dist p x ∧ |
| 60 | dist p x ≤ B * (r₀ * q ^ j)} |
| 61 | have hUm (j : ℕ) : MeasurableSet (U j) := |
| 62 | ((isClosed_le continuous_const (continuous_const.dist continuous_id)).inter |
| 63 | (isClosed_le (continuous_const.dist continuous_id) continuous_const)).measurableSet |
| 64 | have hUi (j : ℕ) (hj : j ∈ F) : Integrable ((U j).indicator K) μ := |
| 65 | (integrable_indicator_iff (hUm j)).mpr (hKi.mono_set (hsub j hj)) |
| 66 | have hWi : Integrable (W.indicator K) μ := |
| 67 | (integrable_indicator_iff hW).mpr hKi |
| 68 | have hpoint (x : X) : (∑ j ∈ F, (U j).indicator K x) ≤ |
| 69 | (L : ℝ) * W.indicator K x := by |
| 70 | by_cases hx : x ∈ W |
| 71 | · rw [indicator_of_mem hx] |
| 72 | have he : (∑ j ∈ F, (U j).indicator K x) = |
| 73 | ((F.filter (fun j => x ∈ U j)).card : ℝ) * K x := by |
| 74 | simp only [Set.indicator, ← Finset.sum_filter, Finset.sum_const, |
| 75 | nsmul_eq_mul] |
| 76 | congr 1 |
| 77 | congr 1 |
| 78 | congr 1 |
| 79 | ext j |
| 80 | simp only [Finset.mem_filter] |
| 81 | rw [he] |
| 82 | exact mul_le_mul_of_nonneg_right |
| 83 | (Nat.cast_le.mpr (card_geometric_annuli_mem_le hB hr₀ hq hq1 hgap F |
| 84 | (dist p x))) (hKn x) |
| 85 | · rw [indicator_of_notMem hx] |
| 86 | have hz (j : ℕ) (hj : j ∈ F) : (U j).indicator K x = 0 := |
| 87 | indicator_of_notMem (fun hxj => hx (hsub j hj hxj)) K |
| 88 | simp only [Finset.sum_congr rfl hz, Finset.sum_const_zero, mul_zero, le_refl] |
| 89 | have hi := integral_mono (integrable_finsetSum F hUi) (hWi.const_mul (L : ℝ)) hpoint |
| 90 | rw [integral_finsetSum F hUi, integral_const_mul, integral_indicator hW] at hi |
| 91 | change (∑ j ∈ F, ∫ x in U j, K x ∂μ) ≤ _ |
| 92 | calc |
| 93 | _ = ∑ j ∈ F, ∫ x, (U j).indicator K x ∂μ := |
| 94 | Finset.sum_congr rfl (fun j _ => (integral_indicator (hUm j)).symm) |
| 95 | _ ≤ _ := hi |
| 96 | |
| 97 | /-- The buffered annuli used in the scalar induction have a universal |
| 98 | finite overlap at the fixed ratio 227/228. -/ |
| 99 | theorem exists_buffered_annulus_overlap : |
| 100 | ∃ L : ℕ, 0 < L ∧ 3 * (227 / 228 : ℝ) ^ L < 1 / 2 := by |
| 101 | obtain ⟨L, hL⟩ := exists_pow_lt_of_lt_one (show (0 : ℝ) < 1 / 6 by norm_num) |
| 102 | (show (227 / 228 : ℝ) < 1 by norm_num) |
| 103 | refine ⟨L, ?_, ?_⟩ |
| 104 | · by_contra h |
| 105 | have hzero : L = 0 := by omega |
| 106 | norm_num [hzero] at hL |
| 107 | · linarith |
| 108 | |
| 109 | |
| 110 | /-- Local error integrals over buffered annuli can be summed with a constant |
| 111 | independent of the smallest annular scale. -/ |
| 112 | theorem integral_le_of_weighted_geometric_annulus_bounds |
| 113 | {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] |
| 114 | {μ : Measure X} {E : Set X} (hE : IsCompact E) (p : X) |
| 115 | {W : Set X} {K : X → ℝ} (hW : MeasurableSet W) |
| 116 | (hKi : IntegrableOn K W μ) (hKn : ∀ x, 0 ≤ K x) |
| 117 | {A B A' B' r₀ q C D : ℝ} {m L : ℕ} |
| 118 | (hA : 0 < A) (hB : 0 < B) (hB' : 0 < B') (hr₀ : 0 < r₀) |
| 119 | (hq : 0 < q) (hq1 : q < 1) (hgap : A < B * q) |
| 120 | (hoverlap : B' * q ^ L < A') (hC : 0 ≤ C) (hD : 0 ≤ D) (hm : 1 ≤ m) |
| 121 | {h : X → ℝ} (hhn : ∀ x, 0 ≤ h x) (hEi : IntegrableOn h E μ) |
| 122 | (hsub : E ⊆ {x | 0 < dist p x ∧ dist p x < B * r₀}) |
| 123 | (hi : ∀ j : ℕ, IntegrableOn h |
| 124 | {x | A * (r₀ * q ^ j) < dist p x ∧ dist p x < B * (r₀ * q ^ j)} μ) |
| 125 | (herror : ∀ j : ℕ, |
| 126 | {x | A' * (r₀ * q ^ j) ≤ dist p x ∧ dist p x ≤ B' * (r₀ * q ^ j)} ⊆ W) |
| 127 | (hbound : ∀ j : ℕ, |
| 128 | (∫ x in {x | A * (r₀ * q ^ j) < dist p x ∧ dist p x < B * (r₀ * q ^ j)}, |
| 129 | h x ∂μ) ≤ C * (r₀ * q ^ j) ^ m + |
| 130 | D * ∫ x in {x | A' * (r₀ * q ^ j) ≤ dist p x ∧ |
| 131 | dist p x ≤ B' * (r₀ * q ^ j)}, K x ∂μ) : |
| 132 | (∫ x in E, h x ∂μ) ≤ C * r₀ ^ m / (1 - q ^ m) + |
| 133 | D * (L : ℝ) * ∫ x in W, K x ∂μ := by |
| 134 | classical |
| 135 | obtain ⟨F, hcover⟩ := exists_finite_geometric_annulus_cover |
| 136 | hE p hA hB hr₀ hq hq1 hgap hsub |
| 137 | let U := fun j : ℕ => |
| 138 | {x | A * (r₀ * q ^ j) < dist p x ∧ dist p x < B * (r₀ * q ^ j)} |
| 139 | let V := fun j : ℕ => |
| 140 | {x | A' * (r₀ * q ^ j) ≤ dist p x ∧ dist p x ≤ B' * (r₀ * q ^ j)} |
| 141 | have hUm (j : ℕ) : MeasurableSet (U j) := |
| 142 | ((isOpen_lt continuous_const (continuous_const.dist continuous_id)).inter |
| 143 | (isOpen_lt (continuous_const.dist continuous_id) continuous_const)).measurableSet |
| 144 | have hcoverBound := integral_le_sum_of_finset_cover hE.isClosed.measurableSet F U |
| 145 | (fun j _ => hUm j) hhn hEi (fun j _ => hi j) hcover |
| 146 | have hpow : |q ^ m| < 1 := by |
| 147 | rw [abs_of_nonneg (pow_nonneg hq.le _)] |
| 148 | exact pow_lt_one₀ hq.le hq1 (by omega) |
| 149 | have hsum := (summable_geometric_of_abs_lt_one hpow).sum_le_tsum F |
| 150 | (fun j _ => pow_nonneg (pow_nonneg hq.le m) j) |
| 151 | rw [tsum_geometric_of_abs_lt_one hpow] at hsum |
| 152 | have hgeom : (∑ j ∈ F, C * (r₀ * q ^ j) ^ m) ≤ C * r₀ ^ m / (1 - q ^ m) := by |
| 153 | calc |
| 154 | _ = C * r₀ ^ m * ∑ j ∈ F, (q ^ m) ^ j := by |
| 155 | rw [Finset.mul_sum] |
| 156 | apply Finset.sum_congr rfl |
| 157 | intro j _ |
| 158 | rw [mul_pow, ← pow_mul, Nat.mul_comm j m, pow_mul] |
| 159 | ring |
| 160 | _ ≤ C * r₀ ^ m * (1 - q ^ m)⁻¹ := |
| 161 | mul_le_mul_of_nonneg_left hsum (mul_nonneg hC (pow_nonneg hr₀.le _)) |
| 162 | _ = _ := by rw [div_eq_mul_inv] |
| 163 | have herr := sum_integral_geometric_annuli_le p hW hKi hKn hB' hr₀ hq hq1.le |
| 164 | hoverlap F (fun j _ => herror j) |
| 165 | calc |
| 166 | _ ≤ ∑ j ∈ F, ∫ x in U j, h x ∂μ := hcoverBound |
| 167 | _ ≤ ∑ j ∈ F, (C * (r₀ * q ^ j) ^ m + D * ∫ x in V j, K x ∂μ) := |
| 168 | Finset.sum_le_sum (fun j _ => hbound j) |
| 169 | _ = (∑ j ∈ F, C * (r₀ * q ^ j) ^ m) + D * ∑ j ∈ F, ∫ x in V j, K x ∂μ := by |
| 170 | rw [Finset.sum_add_distrib, Finset.mul_sum] |
| 171 | _ ≤ C * r₀ ^ m / (1 - q ^ m) + D * ((L : ℝ) * ∫ x in W, K x ∂μ) := |
| 172 | add_le_add hgeom (mul_le_mul_of_nonneg_left herr hD) |
| 173 | _ = _ := by ring |
| 174 | |
| 175 | /-- The weighted annular estimate only needs to hold above the inner cutoff. -/ |
| 176 | theorem integral_le_of_weighted_geometric_annulus_bounds_above_scale |
| 177 | {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] |
| 178 | {μ : Measure X} {E : Set X} (hE : IsCompact E) (p : X) |
| 179 | {W : Set X} {K : X → ℝ} (hW : MeasurableSet W) |
| 180 | (hKi : IntegrableOn K W μ) (hKn : ∀ x, 0 ≤ K x) |
| 181 | {A B A' B' r₀ q C D s : ℝ} {m L : ℕ} |
| 182 | (hA : 0 < A) (hB : 0 < B) (hB' : 0 < B') (hr₀ : 0 < r₀) |
| 183 | (hq : 0 < q) (hq1 : q < 1) (hgap : A < B * q) |
| 184 | (hoverlap : B' * q ^ L < A') (hC : 0 ≤ C) (hD : 0 ≤ D) (hm : 1 ≤ m) |
| 185 | (hs : 0 ≤ s) {h : X → ℝ} (hhn : ∀ x, 0 ≤ h x) |
| 186 | (hEi : IntegrableOn h E μ) |
| 187 | (hsub : E ⊆ {x | B * s < dist p x ∧ dist p x < B * r₀}) |
| 188 | (hi : ∀ j : ℕ, IntegrableOn h |
| 189 | {x | A * (r₀ * q ^ j) < dist p x ∧ dist p x < B * (r₀ * q ^ j)} μ) |
| 190 | (herror : ∀ j : ℕ, |
| 191 | {x | A' * (r₀ * q ^ j) ≤ dist p x ∧ dist p x ≤ B' * (r₀ * q ^ j)} ⊆ W) |
| 192 | (hbound : ∀ j : ℕ, s ≤ r₀ * q ^ j → |
| 193 | (∫ x in {x | A * (r₀ * q ^ j) < dist p x ∧ dist p x < B * (r₀ * q ^ j)}, |
| 194 | h x ∂μ) ≤ C * (r₀ * q ^ j) ^ m + |
| 195 | D * ∫ x in {x | A' * (r₀ * q ^ j) ≤ dist p x ∧ |
| 196 | dist p x ≤ B' * (r₀ * q ^ j)}, K x ∂μ) : |
| 197 | (∫ x in E, h x ∂μ) ≤ C * r₀ ^ m / (1 - q ^ m) + |
| 198 | D * (L : ℝ) * ∫ x in W, K x ∂μ := by |
| 199 | classical |
| 200 | have hEm : MeasurableSet E := hE.isClosed.measurableSet |
| 201 | have hIi : Integrable (E.indicator h) μ := (integrable_indicator_iff hEm).mpr hEi |
| 202 | have hIhn (x : X) : 0 ≤ E.indicator h x := indicator_nonneg (fun y _ => hhn y) x |
| 203 | have hUbound (j : ℕ) : |
| 204 | (∫ x in {x | A * (r₀ * q ^ j) < dist p x ∧ dist p x < B * (r₀ * q ^ j)}, |
| 205 | E.indicator h x ∂μ) ≤ C * (r₀ * q ^ j) ^ m + |
| 206 | D * ∫ x in {x | A' * (r₀ * q ^ j) ≤ dist p x ∧ |
| 207 | dist p x ≤ B' * (r₀ * q ^ j)}, K x ∂μ := by |
| 208 | by_cases hj : s ≤ r₀ * q ^ j |
| 209 | · apply (integral_mono hIi.integrableOn (hi j) ?_).trans (hbound j hj) |
| 210 | intro x |
| 211 | by_cases hx : x ∈ E |
| 212 | · rw [indicator_of_mem hx] |
| 213 | · rw [indicator_of_notMem hx] |
| 214 | exact hhn x |
| 215 | · have hzero : ∀ x ∈ {x | A * (r₀ * q ^ j) < dist p x ∧ |
| 216 | dist p x < B * (r₀ * q ^ j)}, E.indicator h x = 0 := by |
| 217 | intro x hx |
| 218 | apply indicator_of_notMem |
| 219 | intro hxE |
| 220 | have hlo := (hsub hxE).1 |
| 221 | have hhi := hx.2 |
| 222 | have hmul := mul_lt_mul_of_pos_left (lt_of_not_ge hj) hB |
| 223 | linarith |
| 224 | have hUm : MeasurableSet {x | A * (r₀ * q ^ j) < dist p x ∧ |
| 225 | dist p x < B * (r₀ * q ^ j)} := |
| 226 | ((isOpen_lt continuous_const (continuous_const.dist continuous_id)).inter |
| 227 | (isOpen_lt (continuous_const.dist continuous_id) continuous_const)).measurableSet |
| 228 | rw [setIntegral_congr_fun hUm hzero, integral_zero] |
| 229 | exact add_nonneg |
| 230 | (mul_nonneg hC (pow_nonneg (mul_nonneg hr₀.le (pow_nonneg hq.le _)) _)) |
| 231 | (mul_nonneg hD (integral_nonneg hKn)) |
| 232 | have hbnd := integral_le_of_weighted_geometric_annulus_bounds hE p hW hKi hKn |
| 233 | hA hB hB' hr₀ hq hq1 hgap hoverlap hC hD hm hIhn hIi.integrableOn |
| 234 | (fun x hx => ⟨(mul_nonneg hB.le hs).trans_lt (hsub hx).1, (hsub hx).2⟩) |
| 235 | (fun _ => hIi.integrableOn) herror hUbound |
| 236 | rw [setIntegral_indicator hEm] at hbnd |
| 237 | simpa only [inter_self] using hbnd |
| 238 | |
| 239 | end Poincare.CurvatureIntegral |