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.Analysis.Elliptic.Regularity.GradientCompactness.Quadratic |
| 2 | |
| 3 | /-! # Convergence of coordinate gradient quadratic forms -/ |
| 4 | |
| 5 | noncomputable section |
| 6 | set_option autoImplicit false |
| 7 | set_option backward.isDefEq.respectTransparency false |
| 8 | |
| 9 | open Set Filter MeasureTheory |
| 10 | open scoped Topology NNReal ENNReal |
| 11 | |
| 12 | namespace Poincare.Analysis.Elliptic |
| 13 | |
| 14 | theorem tendsto_integral_abs_finsetSum |
| 15 | {X ι : Type*} [MeasurableSpace X] {μ : Measure X} |
| 16 | (s : Finset ι) {f : ℕ → ι → X → ℝ} |
| 17 | (hf : ∀ i ∈ s, ∀ᶠ k in atTop, Integrable (f k i) μ) |
| 18 | (hlim : ∀ i ∈ s, Tendsto (fun k => ∫ x, |f k i x| ∂μ) atTop (𝓝 0)) : |
| 19 | Tendsto (fun k => ∫ x, |∑ i ∈ s, f k i x| ∂μ) atTop (𝓝 0) := by |
| 20 | have hb : ∀ᶠ k in atTop, |
| 21 | (∫ x, |∑ i ∈ s, f k i x| ∂μ) ≤ ∑ i ∈ s, ∫ x, |f k i x| ∂μ := by |
| 22 | filter_upwards [s.eventually_all.mpr hf] with k hk |
| 23 | calc |
| 24 | _ ≤ ∫ x, ∑ i ∈ s, |f k i x| ∂μ := |
| 25 | integral_mono (integrable_finsetSum s hk).norm |
| 26 | (integrable_finsetSum s (fun i hi => (hk i hi).norm)) |
| 27 | (fun x => Finset.abs_sum_le_sum_abs _ _) |
| 28 | _ = _ := integral_finsetSum s (fun i hi => (hk i hi).norm) |
| 29 | apply squeeze_zero' (Eventually.of_forall fun k => integral_nonneg fun x => abs_nonneg _) hb |
| 30 | simpa only [Finset.sum_const_zero] using tendsto_finsetSum s hlim |
| 31 | |
| 32 | variable {d : ℕ} |
| 33 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 34 | |
| 35 | theorem integrable_gradient_quadratic_of_lipschitz |
| 36 | {O : Set E} (hO : IsOpen O) [IsFiniteMeasure (volume.restrict O)] |
| 37 | {u : E → ℝ} {L : ℝ≥0} (hu : LipschitzOnWith L u O) |
| 38 | {A : E → Fin d → Fin d → ℝ} |
| 39 | (hA : ∀ i j, MemLp (fun x => A x i j) ∞ (volume.restrict O)) : |
| 40 | IntegrableOn (fun x => ∑ i, ∑ j, A x i j * |
| 41 | fderiv ℝ u x (EuclideanSpace.single j 1) * |
| 42 | fderiv ℝ u x (EuclideanSpace.single i 1)) O := by |
| 43 | have hd (i : Fin d) : MemLp (fun x => fderiv ℝ u x (EuclideanSpace.single i 1)) |
| 44 | 2 (volume.restrict O) := |
| 45 | (Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn hO hu _).mono_exponent le_top |
| 46 | apply integrable_finsetSum |
| 47 | intro i _ |
| 48 | apply integrable_finsetSum |
| 49 | intro j _ |
| 50 | simpa only [Pi.mul_def, mul_assoc] using |
| 51 | ((hd j).integrable_mul (hd i)).mul_of_top_right (hA i j) |
| 52 | |
| 53 | theorem tendsto_integral_abs_partial_product_sub_of_lipschitz |
| 54 | {O U : Set E} (hO : IsOpen O) (hU : IsOpen U) (hUO : U ⊆ O) |
| 55 | [IsFiniteMeasure (volume.restrict U)] |
| 56 | {u : ℕ → E → ℝ} {v : E → ℝ} {L : ℝ≥0} |
| 57 | (hu : ∀ᶠ k in atTop, LipschitzOnWith L (u k) O) |
| 58 | (hv : LipschitzOnWith L v O) (i j : Fin d) |
| 59 | (hi : Tendsto (fun k => ∫ x in U, |
| 60 | (fderiv ℝ (u k) x (EuclideanSpace.single i 1) - |
| 61 | fderiv ℝ v x (EuclideanSpace.single i 1)) ^ 2) atTop (𝓝 0)) |
| 62 | (hj : Tendsto (fun k => ∫ x in U, |
| 63 | (fderiv ℝ (u k) x (EuclideanSpace.single j 1) - |
| 64 | fderiv ℝ v x (EuclideanSpace.single j 1)) ^ 2) atTop (𝓝 0)) : |
| 65 | Tendsto (fun k => ∫ x in U, |
| 66 | |fderiv ℝ (u k) x (EuclideanSpace.single i 1) * |
| 67 | fderiv ℝ (u k) x (EuclideanSpace.single j 1) - |
| 68 | fderiv ℝ v x (EuclideanSpace.single i 1) * |
| 69 | fderiv ℝ v x (EuclideanSpace.single j 1)|) atTop (𝓝 0) := by |
| 70 | have hum (a : Fin d) : ∀ᶠ k in atTop, |
| 71 | MemLp (fun x => fderiv ℝ (u k) x (EuclideanSpace.single a 1)) |
| 72 | 2 (volume.restrict U) := hu.mono fun k hk => |
| 73 | (Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn |
| 74 | hU (hk.mono hUO) _).mono_exponent le_top |
| 75 | have hvm (a : Fin d) : |
| 76 | MemLp (fun x => fderiv ℝ v x (EuclideanSpace.single a 1)) |
| 77 | 2 (volume.restrict U) := |
| 78 | (Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn |
| 79 | hU (hv.mono hUO) _).mono_exponent le_top |
| 80 | apply tendsto_integral_abs_mul_sub_of_integral_sq |
| 81 | (hum i) (hum j) (hvm i) (hvm j) (L := (L : ℝ)) ?_ ?_ hi hj |
| 82 | · filter_upwards [hu] with k hk |
| 83 | filter_upwards [ae_restrict_mem hU.measurableSet] with x hx |
| 84 | exact abs_partial_le_of_lipschitzOn hO hk (hUO hx) j |
| 85 | · filter_upwards [ae_restrict_mem hU.measurableSet] with x hx |
| 86 | exact abs_partial_le_of_lipschitzOn hO hv (hUO hx) i |
| 87 | |
| 88 | theorem tendsto_integral_abs_gradient_quadratic_sub |
| 89 | {O U : Set E} (hO : IsOpen O) (hU : IsOpen U) (hUO : U ⊆ O) |
| 90 | [IsFiniteMeasure (volume.restrict U)] |
| 91 | {u : ℕ → E → ℝ} {v : E → ℝ} {L : ℝ≥0} |
| 92 | (hu : ∀ᶠ k in atTop, LipschitzOnWith L (u k) O) |
| 93 | (hv : LipschitzOnWith L v O) |
| 94 | {A : ℕ → E → Fin d → Fin d → ℝ} {B : E → Fin d → Fin d → ℝ} {C : ℝ} |
| 95 | (hA : ∀ᶠ k in atTop, ∀ i j, AEStronglyMeasurable (fun x => A k x i j) |
| 96 | (volume.restrict U)) |
| 97 | (hB : ∀ i j, AEStronglyMeasurable (fun x => B x i j) (volume.restrict U)) |
| 98 | (hAb : ∀ᶠ k in atTop, ∀ i j, ∀ᵐ x ∂volume.restrict U, |A k x i j| ≤ C) |
| 99 | (hBb : ∀ i j, ∀ᵐ x ∂volume.restrict U, |B x i j| ≤ C) |
| 100 | (hAlim : ∀ i j, ∀ᵐ x ∂volume.restrict U, |
| 101 | Tendsto (fun k => A k x i j) atTop (𝓝 (B x i j))) |
| 102 | (hlim : ∀ i, Tendsto (fun k => ∫ x in U, |
| 103 | (fderiv ℝ (u k) x (EuclideanSpace.single i 1) - |
| 104 | fderiv ℝ v x (EuclideanSpace.single i 1)) ^ 2) atTop (𝓝 0)) : |
| 105 | Tendsto (fun k => ∫ x in U, |
| 106 | |(∑ i, ∑ j, A k x i j * fderiv ℝ (u k) x (EuclideanSpace.single j 1) * |
| 107 | fderiv ℝ (u k) x (EuclideanSpace.single i 1)) - |
| 108 | ∑ i, ∑ j, B x i j * fderiv ℝ v x (EuclideanSpace.single j 1) * |
| 109 | fderiv ℝ v x (EuclideanSpace.single i 1)|) atTop (𝓝 0) := by |
| 110 | let D (k : ℕ) (i j : Fin d) (x : E) := |
| 111 | A k x i j * fderiv ℝ (u k) x (EuclideanSpace.single j 1) * |
| 112 | fderiv ℝ (u k) x (EuclideanSpace.single i 1) - |
| 113 | B x i j * fderiv ℝ v x (EuclideanSpace.single j 1) * |
| 114 | fderiv ℝ v x (EuclideanSpace.single i 1) |
| 115 | have hum (a : Fin d) : ∀ᶠ k in atTop, |
| 116 | MemLp (fun x => fderiv ℝ (u k) x (EuclideanSpace.single a 1)) |
| 117 | 2 (volume.restrict U) := hu.mono fun k hk => |
| 118 | (Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn |
| 119 | hU (hk.mono hUO) _).mono_exponent le_top |
| 120 | have hvm (a : Fin d) : |
| 121 | MemLp (fun x => fderiv ℝ v x (EuclideanSpace.single a 1)) |
| 122 | 2 (volume.restrict U) := |
| 123 | (Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn |
| 124 | hU (hv.mono hUO) _).mono_exponent le_top |
| 125 | have hDi (i j : Fin d) : ∀ᶠ k in atTop, Integrable (D k i j) (volume.restrict U) := by |
| 126 | filter_upwards [hum i, hum j, hA, hAb] with k hki hkj hkA hkb |
| 127 | simpa only [D, mul_assoc, Pi.mul_def, Pi.sub_def] using |
| 128 | ((hkj.integrable_mul hki).bdd_mul (hkA i j) |
| 129 | (by simpa only [Real.norm_eq_abs] using hkb i j)).sub |
| 130 | ((hvm j |>.integrable_mul (hvm i)).bdd_mul (hB i j) |
| 131 | (by simpa only [Real.norm_eq_abs] using hBb i j)) |
| 132 | have hDl (i j : Fin d) : |
| 133 | Tendsto (fun k => ∫ x in U, |D k i j x|) atTop (𝓝 0) := by |
| 134 | have hp := tendsto_integral_abs_partial_product_sub_of_lipschitz |
| 135 | hO hU hUO hu hv j i (hlim j) (hlim i) |
| 136 | have hpI := (hum j).and (hum i) |>.mono fun k hk => hk.1.integrable_mul hk.2 |
| 137 | simpa only [D, mul_assoc, Pi.mul_apply] using |
| 138 | tendsto_integral_abs_coefficient_mul_sub |
| 139 | (hA.mono fun k hk => hk i j) (hB i j) |
| 140 | (hAb.mono fun k hk => hk i j) (hBb i j) (hAlim i j) |
| 141 | hpI ((hvm j).integrable_mul (hvm i)) hp |
| 142 | have hi (i : Fin d) : ∀ᶠ k in atTop, |
| 143 | Integrable (fun x => ∑ j, D k i j x) (volume.restrict U) := by |
| 144 | filter_upwards [eventually_all.mpr (fun j => hDi i j)] with k hk |
| 145 | exact integrable_finsetSum _ (fun j _ => hk j) |
| 146 | have hl (i : Fin d) := tendsto_integral_abs_finsetSum Finset.univ |
| 147 | (fun j _ => hDi i j) (fun j _ => hDl i j) |
| 148 | have h := tendsto_integral_abs_finsetSum Finset.univ (fun i _ => hi i) (fun i _ => hl i) |
| 149 | simpa only [D, Finset.sum_sub_distrib] using h |
| 150 | |
| 151 | end Poincare.Analysis.Elliptic |