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.InnerProductSpace.Adjoint |
| 2 | import Mathlib.Analysis.InnerProductSpace.Orthonormal |
| 3 | import Mathlib.MeasureTheory.Integral.Bochner.Basic |
| 4 | import PoincareLib.Analysis.Sobolev.Euclidean.L2 |
| 5 | |
| 6 | /-! |
| 7 | # Kernel trace estimates for localized orthonormal families |
| 8 | |
| 9 | Bessel's inequality bounds a finite sum of squares of kernel pairings after a |
| 10 | bounded localization map. Integrating this pointwise estimate gives the trace |
| 11 | bound needed for quantitative spectral counting. |
| 12 | -/ |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | open MeasureTheory |
| 17 | open scoped BigOperators ENNReal |
| 18 | |
| 19 | namespace Poincare.Analysis.Spectral.Counting |
| 20 | |
| 21 | variable {H K X ι : Type*} |
| 22 | [NormedAddCommGroup H] [InnerProductSpace ℝ H] [CompleteSpace H] |
| 23 | [NormedAddCommGroup K] [InnerProductSpace ℝ K] [CompleteSpace K] |
| 24 | |
| 25 | /-- Bessel's inequality after a bounded linear localization map. -/ |
| 26 | theorem sum_inner_map_sq_le (A : H →L[ℝ] K) {b : ι → H} |
| 27 | (hb : Orthonormal ℝ b) (s : Finset ι) (k : K) : |
| 28 | ∑ i ∈ s, (inner ℝ k (A (b i))) ^ 2 ≤ ‖A‖ ^ 2 * ‖k‖ ^ 2 := by |
| 29 | calc |
| 30 | ∑ i ∈ s, (inner ℝ k (A (b i))) ^ 2 |
| 31 | = ∑ i ∈ s, ‖inner ℝ (b i) (A.adjoint k)‖ ^ 2 := by |
| 32 | apply Finset.sum_congr rfl |
| 33 | intro i hi |
| 34 | rw [A.adjoint_inner_right, real_inner_comm] |
| 35 | simp |
| 36 | _ ≤ ‖A.adjoint k‖ ^ 2 := hb.sum_inner_products_le _ |
| 37 | _ ≤ (‖A.adjoint‖ * ‖k‖) ^ 2 := by |
| 38 | exact pow_le_pow_left₀ (norm_nonneg _) (A.adjoint.le_opNorm k) 2 |
| 39 | _ = ‖A‖ ^ 2 * ‖k‖ ^ 2 := by simp [mul_pow] |
| 40 | |
| 41 | variable [MeasurableSpace X] {ν : Measure X} |
| 42 | |
| 43 | /-- Integrating the pointwise Bessel bound gives a finite trace estimate. -/ |
| 44 | theorem sum_integral_inner_map_sq_le (A : H →L[ℝ] K) {b : ι → H} |
| 45 | (hb : Orthonormal ℝ b) (s : Finset ι) (k : X → K) |
| 46 | (hk : Integrable (fun x => ‖k x‖ ^ 2) ν) |
| 47 | (hi : ∀ i ∈ s, Integrable (fun x => (inner ℝ (k x) (A (b i))) ^ 2) ν) : |
| 48 | ∑ i ∈ s, ∫ x, (inner ℝ (k x) (A (b i))) ^ 2 ∂ν ≤ |
| 49 | ‖A‖ ^ 2 * ∫ x, ‖k x‖ ^ 2 ∂ν := by |
| 50 | rw [← integral_finsetSum s hi, ← integral_const_mul] |
| 51 | exact integral_mono (integrable_finsetSum _ hi) (hk.const_mul _) |
| 52 | (fun x => sum_inner_map_sq_le A hb s (k x)) |
| 53 | |
| 54 | /-- A uniform bound on the kernel energy yields a trace bound on a finite |
| 55 | measure region. -/ |
| 56 | theorem sum_integral_inner_map_sq_le_const [IsFiniteMeasure ν] |
| 57 | (A : H →L[ℝ] K) {b : ι → H} (hb : Orthonormal ℝ b) |
| 58 | (s : Finset ι) (k : X → K) {C : ℝ} |
| 59 | (hk : ∀ x, ‖k x‖ ^ 2 ≤ C) |
| 60 | (hi : ∀ i ∈ s, Integrable (fun x => (inner ℝ (k x) (A (b i))) ^ 2) ν) : |
| 61 | ∑ i ∈ s, ∫ x, (inner ℝ (k x) (A (b i))) ^ 2 ∂ν ≤ |
| 62 | ν.real Set.univ * (‖A‖ ^ 2 * C) := by |
| 63 | rw [← integral_finsetSum s hi] |
| 64 | change _ ≤ ν.real Set.univ • (‖A‖ ^ 2 * C) |
| 65 | rw [← integral_const] |
| 66 | apply integral_mono (integrable_finsetSum _ hi) (integrable_const _) |
| 67 | intro x |
| 68 | exact (sum_inner_map_sq_le A hb s (k x)).trans |
| 69 | (mul_le_mul_of_nonneg_left (hk x) (sq_nonneg _)) |
| 70 | |
| 71 | section KernelOperator |
| 72 | |
| 73 | variable (S : Set X) (hS : MeasurableSet S) (hνS : ν S ≠ ∞) |
| 74 | (k : X → K) (hk : ∀ u : K, AEStronglyMeasurable (fun x => inner ℝ (k x) u) ν) |
| 75 | (C : ℝ) (hC : 0 ≤ C) (hbound : ∀ x, ‖k x‖ ≤ C) |
| 76 | |
| 77 | include hS hνS hk hC hbound |
| 78 | |
| 79 | omit [CompleteSpace K] hC in |
| 80 | theorem kernelOn_memLp (u : K) : |
| 81 | MemLp (S.indicator fun x => inner ℝ (k x) u) 2 ν := by |
| 82 | rw [memLp_indicator_iff_restrict hS] |
| 83 | let : IsFiniteMeasure (ν.restrict S) := ⟨by simpa using hνS.lt_top⟩ |
| 84 | apply MemLp.of_bound ((hk u).mono_measure Measure.restrict_le_self) (C * ‖u‖) |
| 85 | exact Filter.Eventually.of_forall fun x => |
| 86 | (norm_inner_le_norm (k x) u).trans (mul_le_mul_of_nonneg_right (hbound x) (norm_nonneg _)) |
| 87 | |
| 88 | private def kernelOnLinear : K →ₗ[ℝ] Lp ℝ 2 ν where |
| 89 | toFun u := (kernelOn_memLp S hS hνS k hk C hbound u).toLp _ |
| 90 | map_add' u v := by |
| 91 | apply Lp.ext |
| 92 | filter_upwards [(kernelOn_memLp S hS hνS k hk C hbound (u + v)).coeFn_toLp, |
| 93 | (kernelOn_memLp S hS hνS k hk C hbound u).coeFn_toLp, |
| 94 | (kernelOn_memLp S hS hνS k hk C hbound v).coeFn_toLp, |
| 95 | Lp.coeFn_add |
| 96 | ((kernelOn_memLp S hS hνS k hk C hbound u).toLp _) |
| 97 | ((kernelOn_memLp S hS hνS k hk C hbound v).toLp _)] with x huv hu hv ha |
| 98 | rw [huv, ha, Pi.add_apply, hu, hv] |
| 99 | simp [inner_add_right, Set.indicator_add] |
| 100 | map_smul' a u := by |
| 101 | simp only [RingHom.id_apply] |
| 102 | apply Lp.ext |
| 103 | filter_upwards [(kernelOn_memLp S hS hνS k hk C hbound (a • u)).coeFn_toLp, |
| 104 | (kernelOn_memLp S hS hνS k hk C hbound u).coeFn_toLp, |
| 105 | Lp.coeFn_smul a ((kernelOn_memLp S hS hνS k hk C hbound u).toLp _)] |
| 106 | with x hau hu ha |
| 107 | rw [hau, ha, Pi.smul_apply, hu] |
| 108 | by_cases hx : x ∈ S <;> simp [inner_smul_right, hx] |
| 109 | |
| 110 | omit [CompleteSpace K] hC in |
| 111 | private theorem norm_kernelOnLinear_sq_le (u : K) : |
| 112 | ‖kernelOnLinear S hS hνS k hk C hbound u‖ ^ 2 ≤ |
| 113 | ν.real S * C ^ 2 * ‖u‖ ^ 2 := by |
| 114 | rw [kernelOnLinear, LinearMap.coe_mk, AddHom.coe_mk, |
| 115 | Poincare.Analysis.Sobolev.norm_toLp_sq_eq_integral] |
| 116 | have h_ind : (fun x => (S.indicator (fun y => inner ℝ (k y) u) x) ^ 2) = |
| 117 | S.indicator (fun x => (inner ℝ (k x) u) ^ 2) := by |
| 118 | ext x |
| 119 | by_cases hx : x ∈ S <;> simp [hx] |
| 120 | rw [h_ind, integral_indicator hS] |
| 121 | let : IsFiniteMeasure (ν.restrict S) := ⟨by simpa using hνS.lt_top⟩ |
| 122 | have hm : MemLp (fun x => inner ℝ (k x) u) 2 (ν.restrict S) := |
| 123 | (memLp_indicator_iff_restrict hS).mp (kernelOn_memLp S hS hνS k hk C hbound u) |
| 124 | have hi := hm.integrable_sq |
| 125 | calc |
| 126 | (∫ x in S, (inner ℝ (k x) u) ^ 2 ∂ν) ≤ |
| 127 | ∫ _ in S, C ^ 2 * ‖u‖ ^ 2 ∂ν := by |
| 128 | apply integral_mono hi (integrable_const _) |
| 129 | intro x |
| 130 | have hb := (norm_inner_le_norm (𝕜 := ℝ) (k x) u).trans |
| 131 | (mul_le_mul_of_nonneg_right (hbound x) (norm_nonneg _)) |
| 132 | simpa [mul_pow] using pow_le_pow_left₀ (norm_nonneg _) hb 2 |
| 133 | _ = ν.real S * C ^ 2 * ‖u‖ ^ 2 := by |
| 134 | simp [Measure.real, mul_assoc] |
| 135 | |
| 136 | /-- A uniformly bounded weakly measurable kernel, restricted to a finite |
| 137 | measure region, defines a bounded operator into `L²`. -/ |
| 138 | def kernelOn : K →L[ℝ] Lp ℝ 2 ν := |
| 139 | (kernelOnLinear S hS hνS k hk C hbound).mkContinuous |
| 140 | (Real.sqrt (ν.real S) * C) fun u => by |
| 141 | apply (sq_le_sq₀ (norm_nonneg _) (by positivity)).mp |
| 142 | have h := norm_kernelOnLinear_sq_le S hS hνS k hk C hbound u |
| 143 | simpa [mul_pow, Real.sq_sqrt (measureReal_nonneg : 0 ≤ ν.real S), mul_assoc] using h |
| 144 | |
| 145 | omit [CompleteSpace K] in |
| 146 | theorem kernelOn_coeFn (u : K) : |
| 147 | ⇑(kernelOn S hS hνS k hk C hC hbound u) =ᵐ[ν] |
| 148 | S.indicator (fun x => inner ℝ (k x) u) := |
| 149 | (kernelOn_memLp S hS hνS k hk C hbound u).coeFn_toLp |
| 150 | |
| 151 | omit [CompleteSpace K] in |
| 152 | theorem norm_kernelOn_sq_eq_integral (u : K) : |
| 153 | ‖kernelOn S hS hνS k hk C hC hbound u‖ ^ 2 = |
| 154 | ∫ x in S, (inner ℝ (k x) u) ^ 2 ∂ν := by |
| 155 | change ‖(kernelOn_memLp S hS hνS k hk C hbound u).toLp _‖ ^ 2 = _ |
| 156 | rw [Poincare.Analysis.Sobolev.norm_toLp_sq_eq_integral] |
| 157 | have h_ind : (fun x => (S.indicator (fun y => inner ℝ (k y) u) x) ^ 2) = |
| 158 | S.indicator (fun x => (inner ℝ (k x) u) ^ 2) := by |
| 159 | ext x |
| 160 | by_cases hx : x ∈ S <;> simp [hx] |
| 161 | rw [h_ind, integral_indicator hS] |
| 162 | |
| 163 | /-- The trace estimate for a truncated kernel operator after localization. -/ |
| 164 | theorem sum_norm_kernelOn_map_sq_le (A : H →L[ℝ] K) {b : ι → H} |
| 165 | (hb : Orthonormal ℝ b) (s : Finset ι) {B : ℝ} |
| 166 | (hB : ∀ x, ‖k x‖ ^ 2 ≤ B) : |
| 167 | ∑ i ∈ s, ‖kernelOn S hS hνS k hk C hC hbound (A (b i))‖ ^ 2 ≤ |
| 168 | ν.real S * (‖A‖ ^ 2 * B) := by |
| 169 | simp_rw [norm_kernelOn_sq_eq_integral] |
| 170 | let : IsFiniteMeasure (ν.restrict S) := ⟨by simpa using hνS.lt_top⟩ |
| 171 | have hi (i : ι) : Integrable (fun x => (inner ℝ (k x) (A (b i))) ^ 2) |
| 172 | (ν.restrict S) := by |
| 173 | have hm := (memLp_indicator_iff_restrict hS).mp |
| 174 | (kernelOn_memLp S hS hνS k hk C hbound (A (b i))) |
| 175 | exact hm.integrable_sq |
| 176 | simpa [Measure.real] using |
| 177 | sum_integral_inner_map_sq_le_const (ν := ν.restrict S) A hb s k hB (fun i _ => hi i) |
| 178 | |
| 179 | end KernelOperator |
| 180 | |
| 181 | end Poincare.Analysis.Spectral.Counting |