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.PiL2 |
| 2 | import Mathlib.MeasureTheory.Function.LocallyIntegrable |
| 3 | import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp |
| 4 | import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar |
| 5 | import Mathlib.Analysis.Normed.Lp.MeasurableSpace |
| 6 | |
| 7 | /-! # Local L2 multiplication and test pairings -/ |
| 8 | |
| 9 | noncomputable section |
| 10 | |
| 11 | open Set MeasureTheory |
| 12 | open scoped ENNReal |
| 13 | |
| 14 | namespace Poincare.Analysis.Elliptic |
| 15 | |
| 16 | variable {n : ℕ} {O : Set (EuclideanSpace ℝ (Fin n))} |
| 17 | {u c : EuclideanSpace ℝ (Fin n) → ℝ} |
| 18 | |
| 19 | /-- The compact-local L2 hypotheses imply the usual local integrability. -/ |
| 20 | theorem locallyIntegrableOn_of_compact_memLp (hO : IsOpen O) |
| 21 | (hu : ∀ K, IsCompact K → K ⊆ O → MemLp u 2 (volume.restrict K)) : |
| 22 | LocallyIntegrableOn u O := by |
| 23 | apply (locallyIntegrableOn_iff hO.isLocallyClosed).mpr |
| 24 | intro K hKO hK |
| 25 | letI : IsFiniteMeasure (volume.restrict K) := ⟨by |
| 26 | simpa only [Measure.restrict_apply_univ] using hK.measure_lt_top (μ := volume)⟩ |
| 27 | exact (hu K hK hKO).integrable (by norm_num) |
| 28 | |
| 29 | /-- Multiplication by a continuous coefficient preserves compact-local L2. -/ |
| 30 | theorem compact_memLp_mul_continuousOn (hc : ContinuousOn c O) |
| 31 | (hu : ∀ K, IsCompact K → K ⊆ O → MemLp u 2 (volume.restrict K)) |
| 32 | {K : Set (EuclideanSpace ℝ (Fin n))} (hK : IsCompact K) (hKO : K ⊆ O) : |
| 33 | MemLp (fun x => c x * u x) 2 (volume.restrict K) := by |
| 34 | obtain ⟨C, hC⟩ := hK.bddAbove_image (hc.mono hKO).norm |
| 35 | have hcK : MemLp c ∞ (volume.restrict K) := by |
| 36 | apply memLp_top_of_bound ((hc.mono hKO).aestronglyMeasurable hK.measurableSet) C |
| 37 | filter_upwards [ae_restrict_mem hK.measurableSet] with x hx |
| 38 | exact hC (mem_image_of_mem _ hx) |
| 39 | exact (hu K hK hKO).mul hcK |
| 40 | |
| 41 | end Poincare.Analysis.Elliptic |