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.Products |
| 2 | |
| 3 | /-! # Strong convergence of fluxes tested against bounded vector fields -/ |
| 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 | variable {d : ℕ} |
| 15 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 16 | |
| 17 | theorem integrable_gradient_pairing_of_lipschitz |
| 18 | {O : Set E} (hO : IsOpen O) [IsFiniteMeasure (volume.restrict O)] |
| 19 | {u : E → ℝ} {L : ℝ≥0} (hu : LipschitzOnWith L u O) |
| 20 | {A : E → Fin d → Fin d → ℝ} {χ : Fin d → E → ℝ} |
| 21 | (hA : ∀ i j, MemLp (fun x => A x i j) ∞ (volume.restrict O)) |
| 22 | (hχ : ∀ i, MemLp (χ i) ∞ (volume.restrict O)) : |
| 23 | IntegrableOn (fun x => ∑ i, ∑ j, |
| 24 | A x i j * fderiv ℝ u x (EuclideanSpace.single j 1) * χ i x) O := by |
| 25 | have hd (j : Fin d) : MemLp (fun x => fderiv ℝ u x (EuclideanSpace.single j 1)) |
| 26 | ∞ (volume.restrict O) := |
| 27 | Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn hO hu _ |
| 28 | apply integrable_finsetSum |
| 29 | intro i _ |
| 30 | apply integrable_finsetSum |
| 31 | intro j _ |
| 32 | exact ((hχ i).mul' (r := ∞) ((hd j).mul' (r := ∞) (hA i j))).integrable le_top |
| 33 | |
| 34 | theorem tendsto_integral_abs_gradient_pairing_sub |
| 35 | {O U : Set E} (hO : IsOpen O) (hU : IsOpen U) (hUO : U ⊆ O) |
| 36 | [IsFiniteMeasure (volume.restrict U)] |
| 37 | {u : ℕ → E → ℝ} {v : E → ℝ} {L : ℝ≥0} |
| 38 | (hu : ∀ᶠ k in atTop, LipschitzOnWith L (u k) O) (hv : LipschitzOnWith L v O) |
| 39 | {A : ℕ → E → Fin d → Fin d → ℝ} {B : E → Fin d → Fin d → ℝ} |
| 40 | {C D : ℝ} {χ : Fin d → E → ℝ} |
| 41 | (hA : ∀ᶠ k in atTop, ∀ i j, AEStronglyMeasurable (fun x => A k x i j) (volume.restrict U)) |
| 42 | (hB : ∀ i j, AEStronglyMeasurable (fun x => B x i j) (volume.restrict U)) |
| 43 | (hAb : ∀ᶠ k in atTop, ∀ i j, ∀ᵐ x ∂volume.restrict U, |A k x i j| ≤ C) |
| 44 | (hBb : ∀ i j, ∀ᵐ x ∂volume.restrict U, |B x i j| ≤ C) |
| 45 | (hAlim : ∀ i j, ∀ᵐ x ∂volume.restrict U, |
| 46 | Tendsto (fun k => A k x i j) atTop (𝓝 (B x i j))) |
| 47 | (hχ : ∀ i, AEStronglyMeasurable (χ i) (volume.restrict U)) |
| 48 | (hχb : ∀ i, ∀ᵐ x ∂volume.restrict U, |χ i x| ≤ D) |
| 49 | (hdu : ∀ j, Tendsto (fun k => ∫ x in U, |
| 50 | (fderiv ℝ (u k) x (EuclideanSpace.single j 1) - |
| 51 | fderiv ℝ v x (EuclideanSpace.single j 1)) ^ 2) atTop (𝓝 0)) : |
| 52 | Tendsto (fun k => ∫ x in U, |
| 53 | |(∑ i, ∑ j, A k x i j * fderiv ℝ (u k) x (EuclideanSpace.single j 1) * χ i x) - |
| 54 | ∑ i, ∑ j, B x i j * fderiv ℝ v x (EuclideanSpace.single j 1) * χ i x|) |
| 55 | atTop (𝓝 0) := by |
| 56 | let du := fun k j x => fderiv ℝ (u k) x (EuclideanSpace.single j 1) |
| 57 | let dv := fun j x => fderiv ℝ v x (EuclideanSpace.single j 1) |
| 58 | have hdup : ∀ᶠ k in atTop, ∀ j, MemLp (du k j) 2 (volume.restrict U) := by |
| 59 | filter_upwards [hu] with k hk j |
| 60 | exact (Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn |
| 61 | hU (hk.mono hUO) (EuclideanSpace.single j 1)).mono_exponent le_top |
| 62 | have hdvp (j) : MemLp (dv j) 2 (volume.restrict U) := |
| 63 | (Poincare.Analysis.Sobolev.Weak.memLp_top_fderiv_apply_of_lipschitzOn |
| 64 | hU (hv.mono hUO) (EuclideanSpace.single j 1)).mono_exponent le_top |
| 65 | have hf : ∀ᶠ k in atTop, ∀ i j, Integrable |
| 66 | (fun x => A k x i j * du k j x) (volume.restrict U) := by |
| 67 | filter_upwards [hdup, hA, hAb] with k hk hkA hkb i j |
| 68 | exact ((hk j).integrable (by norm_num)).bdd_mul (hkA i j) (hkb i j) |
| 69 | have hg (i j) : Integrable (fun x => B x i j * dv j x) (volume.restrict U) := |
| 70 | ((hdvp j).integrable (by norm_num)).bdd_mul (hB i j) (hBb i j) |
| 71 | have hpair (i j) : Tendsto (fun k => ∫ x in U, |
| 72 | |A k x i j * du k j x - B x i j * dv j x|) atTop (𝓝 0) := by |
| 73 | apply tendsto_integral_abs_coefficient_mul_sub |
| 74 | (hA.mono fun k hk => hk i j) (hB i j) |
| 75 | (hAb.mono fun k hk => hk i j) (hBb i j) (hAlim i j) |
| 76 | (hdup.mono fun k hk => (hk j).integrable (by norm_num)) |
| 77 | ((hdvp j).integrable (by norm_num)) |
| 78 | exact tendsto_integral_abs_of_integral_sq |
| 79 | (hdup.mono fun k hk => (hk j).sub (hdvp j)) (hdu j) |
| 80 | have ht (i j) : Tendsto (fun k => ∫ x in U, |
| 81 | |A k x i j * du k j x * χ i x - B x i j * dv j x * χ i x|) atTop (𝓝 0) := by |
| 82 | simpa only [mul_comm (χ i _)] using tendsto_integral_abs_coefficient_mul_sub |
| 83 | (Eventually.of_forall fun _ => hχ i) (hχ i) |
| 84 | (Eventually.of_forall fun _ => hχb i) (hχb i) |
| 85 | (Eventually.of_forall fun _ => tendsto_const_nhds) |
| 86 | (hf.mono fun k hk => hk i j) (hg i j) (hpair i j) |
| 87 | have hti : ∀ᶠ k in atTop, ∀ i j, Integrable |
| 88 | (fun x => A k x i j * du k j x * χ i x - |
| 89 | B x i j * dv j x * χ i x) (volume.restrict U) := by |
| 90 | filter_upwards [hf] with k hk i j |
| 91 | exact ((hk i j).mul_bdd (hχ i) (hχb i)).sub |
| 92 | ((hg i j).mul_bdd (hχ i) (hχb i)) |
| 93 | have hi (i) : Tendsto (fun k => ∫ x in U, |
| 94 | |∑ j, (A k x i j * du k j x * χ i x - B x i j * dv j x * χ i x)|) |
| 95 | atTop (𝓝 0) := |
| 96 | tendsto_integral_abs_finsetSum Finset.univ |
| 97 | (fun j _ => hti.mono fun k hk => hk i j) (fun j _ => ht i j) |
| 98 | have htotal := tendsto_integral_abs_finsetSum Finset.univ |
| 99 | (fun i _ => hti.mono fun k hk => integrable_finsetSum _ (fun j _ => hk i j)) |
| 100 | (fun i _ => hi i) |
| 101 | simpa only [Finset.sum_sub_distrib] using htotal |
| 102 | |
| 103 | end Poincare.Analysis.Elliptic |