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.DifferenceQuotient.WeakDerivative |
| 2 | import PoincareLib.Analysis.Elliptic.Regularity.EnergyEstimate.CrossTerms.Principal |
| 3 | import PoincareLib.Analysis.Elliptic.Regularity.Sobolev.Iterated.WeakDerivatives |
| 4 | import PoincareLib.Analysis.Sobolev.Euclidean.L2 |
| 5 | |
| 6 | /-! |
| 7 | # Second weak derivatives from the local energy bound |
| 8 | |
| 9 | The square-integral estimate on the difference quotients gives actual weak |
| 10 | derivatives by the local Riesz representation argument. |
| 11 | -/ |
| 12 | |
| 13 | noncomputable section |
| 14 | |
| 15 | open Set MeasureTheory |
| 16 | open scoped ENNReal |
| 17 | open Poincare.Analysis.Sobolev |
| 18 | open Poincare.Analysis.Sobolev.NirenbergCrossBoundsNonSmooth |
| 19 | open Poincare.Analysis.Sobolev.Weak |
| 20 | open Poincare.Analysis.Sobolev.Euclidean |
| 21 | |
| 22 | namespace Poincare.Analysis.Elliptic |
| 23 | |
| 24 | variable {d : ℕ} |
| 25 | local notation "E" => EuclideanSpace ℝ (Fin d) |
| 26 | |
| 27 | theorem memW1p_of_integral_diffQuot_bound |
| 28 | {V : Set E} (hV : IsOpen V) (hVc : IsCompact (closure V)) |
| 29 | {p : Fin d → E → ℝ} (hp : ∀ i, MemLp (p i) 2 volume) |
| 30 | {h₀ : ℝ} (hh₀ : 0 < h₀) |
| 31 | (hbound : ∀ k : Fin d, ∃ C : ℝ, ∀ h : ℝ, h ≠ 0 → |h| ≤ h₀ → |
| 32 | (∫ x in V, ∑ i, diffQuot k h (p i) x ^ 2) ≤ C) : |
| 33 | ∀ i, MemW1p 2 (p i) V := by |
| 34 | intro i |
| 35 | refine ⟨(hp i).restrict V, fun k => ?_⟩ |
| 36 | obtain ⟨C, hC⟩ := hbound k |
| 37 | have hb (h : ℝ) (hh : 0 < |h|) (hle : |h| ≤ h₀) : |
| 38 | eLpNorm (diffQuot k h (p i)) 2 (volume.restrict V) ≤ |
| 39 | ENNReal.ofReal (Real.sqrt C) := by |
| 40 | have hq (j : Fin d) := (memLp_diffQuot_two k h (hp j)).restrict V |
| 41 | have hsq (j : Fin d) : Integrable (fun x => diffQuot k h (p j) x ^ 2) |
| 42 | (volume.restrict V) := by |
| 43 | simpa only [pow_two, Pi.mul_def] using (hq j).integrable_mul (hq j) |
| 44 | apply eLpNorm_two_le_sqrt_of_integral_sq_le (hq i) |
| 45 | apply le_trans _ (hC h (abs_pos.mp hh) hle) |
| 46 | apply integral_mono (hsq i) |
| 47 | (integrable_finsetSum _ (fun j _ => hsq j)) |
| 48 | intro x |
| 49 | exact Finset.single_le_sum (fun j _ => sq_nonneg (diffQuot k h (p j) x)) |
| 50 | (Finset.mem_univ i) |
| 51 | obtain ⟨q, hq, hweak, _⟩ := hasWeakPartialDeriv_of_diffQuot_uniform_bound_loc |
| 52 | isOpen_univ hV hVc hh₀ (subset_univ _) (by simpa using hp i) |
| 53 | k (Real.sqrt_nonneg C) hb |
| 54 | exact ⟨q, hq, hweak⟩ |
| 55 | |
| 56 | theorem memWkp_two_of_integral_diffQuot_bound |
| 57 | [NeZero d] {V : Set E} (hV : IsOpen V) (hVc : IsCompact (closure V)) |
| 58 | {u : E → ℝ} {p : Fin d → E → ℝ} |
| 59 | (hu : MemLp u 2 volume) (hp : ∀ i, MemLp (p i) 2 volume) |
| 60 | (hw : ∀ i, HasWeakPartialDeriv i (p i) u univ) |
| 61 | {h₀ : ℝ} (hh₀ : 0 < h₀) |
| 62 | (hbound : ∀ k : Fin d, ∃ C : ℝ, ∀ h : ℝ, h ≠ 0 → |h| ≤ h₀ → |
| 63 | (∫ x in V, ∑ i, diffQuot k h (p i) x ^ 2) ≤ C) : |
| 64 | MemWkp 2 2 u V := by |
| 65 | apply memWkp_succ_of_weakDerivatives hV (by norm_num : (1 : ℝ≥0∞) ≤ 2) |
| 66 | (hu.restrict V) (g := p) |
| 67 | · intro i |
| 68 | exact MemWkp.one_iff_memW1p.mpr |
| 69 | (memW1p_of_integral_diffQuot_bound hV hVc hp hh₀ hbound i) |
| 70 | · intro i |
| 71 | exact (hw i).restrict hV (subset_univ V) |
| 72 | |
| 73 | end Poincare.Analysis.Elliptic |