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.MeasureTheory.Function.L2Space |
| 2 | import Mathlib.MeasureTheory.Function.LpSpace.Complete |
| 3 | |
| 4 | /-! |
| 5 | # Continuity of weak equation pairings |
| 6 | |
| 7 | These lemmas pass the integral terms in a weak equation through Sobolev |
| 8 | approximation of its test function. |
| 9 | -/ |
| 10 | |
| 11 | open MeasureTheory Filter |
| 12 | open scoped Topology InnerProductSpace |
| 13 | |
| 14 | namespace Poincare.Analysis.Elliptic |
| 15 | |
| 16 | variable {α ι : Type*} [MeasurableSpace α] {μ : Measure α} |
| 17 | |
| 18 | theorem inner_toLp_eq_integral_mul {f g : α → ℝ} |
| 19 | (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : |
| 20 | ⟪hf.toLp f, hg.toLp g⟫_ℝ = ∫ x, f x * g x ∂μ := by |
| 21 | rw [L2.inner_def] |
| 22 | apply integral_congr_ae |
| 23 | filter_upwards [hf.coeFn_toLp, hg.coeFn_toLp] with x hx hy |
| 24 | simp [hx, hy, mul_comm] |
| 25 | |
| 26 | theorem tendsto_integral_mul_of_eLpNorm_sub {l : Filter ι} |
| 27 | {f g : α → ℝ} {v : ι → α → ℝ} |
| 28 | (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) |
| 29 | (hv : ∀ i, MemLp (v i) 2 μ) |
| 30 | (hlim : Tendsto (fun i => eLpNorm (v i - g) 2 μ) l (𝓝 0)) : |
| 31 | Tendsto (fun i => ∫ x, f x * v i x ∂μ) l (𝓝 (∫ x, f x * g x ∂μ)) := by |
| 32 | have hv' := (Lp.tendsto_Lp_iff_tendsto_eLpNorm'' v hv g hg).mpr hlim |
| 33 | have hi := (tendsto_const_nhds (x := hf.toLp f)).inner (𝕜 := ℝ) hv' |
| 34 | simpa only [inner_toLp_eq_integral_mul] using hi |
| 35 | |
| 36 | end Poincare.Analysis.Elliptic |