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.ConvergenceInMeasure |
| 2 | import Mathlib.MeasureTheory.Integral.Bochner.Basic |
| 3 | |
| 4 | /-! # Almost-everywhere order under strong integral convergence -/ |
| 5 | |
| 6 | set_option autoImplicit false |
| 7 | |
| 8 | open Set Filter MeasureTheory |
| 9 | open scoped Topology ENNReal |
| 10 | |
| 11 | namespace Poincare.Analysis |
| 12 | |
| 13 | /-- Real L1 convergence gives almost-everywhere convergence along a strict |
| 14 | subsequence, with integrability required only eventually. -/ |
| 15 | theorem exists_subseq_tendsto_ae_of_integral_abs_sub |
| 16 | {X : Type*} [MeasurableSpace X] {μ : Measure X} |
| 17 | {f : ℕ → X → ℝ} {g : X → ℝ} |
| 18 | (hf : ∀ᶠ k in atTop, Integrable (f k) μ) (hg : Integrable g μ) |
| 19 | (hfg : Tendsto (fun k => ∫ x, |f k x - g x| ∂μ) atTop (𝓝 0)) : |
| 20 | ∃ σ : ℕ → ℕ, StrictMono σ ∧ |
| 21 | ∀ᵐ x ∂μ, Tendsto (fun k => f (σ k) x) atTop (𝓝 (g x)) := by |
| 22 | obtain ⟨N, hN⟩ := eventually_atTop.1 hf |
| 23 | have hi (k : ℕ) : Integrable (f (k + N)) μ := hN _ (Nat.le_add_left N k) |
| 24 | have hnorm : Tendsto (fun k => eLpNorm (f (k + N) - g) 1 μ) atTop (𝓝 0) := by |
| 25 | have h := ENNReal.continuous_ofReal.continuousAt.tendsto.comp |
| 26 | (hfg.comp (tendsto_add_atTop_nat N)) |
| 27 | simp only [ENNReal.ofReal_zero] at h |
| 28 | convert h using 1 |
| 29 | ext k |
| 30 | rw [eLpNorm_one_eq_lintegral_enorm, |
| 31 | ← ofReal_integral_norm_eq_lintegral_enorm ((hi k).sub hg)] |
| 32 | simp only [Pi.sub_apply, Real.norm_eq_abs, Function.comp_def] |
| 33 | obtain ⟨σ, hσ, hpoint⟩ := |
| 34 | (tendstoInMeasure_of_tendsto_eLpNorm (by norm_num : (1 : ℝ≥0∞) ≠ 0) |
| 35 | (fun k => (hi k).aestronglyMeasurable) hg.aestronglyMeasurable hnorm).exists_seq_tendsto_ae |
| 36 | exact ⟨fun k => σ k + N, fun _ _ h => Nat.add_lt_add_right (hσ h) N, hpoint⟩ |
| 37 | |
| 38 | /-- An eventually integrable sequence converging in L1 preserves an |
| 39 | almost-everywhere upper bound whose right side converges pointwise. -/ |
| 40 | theorem ae_le_of_tendsto_integral_abs_sub |
| 41 | {X : Type*} [MeasurableSpace X] {μ : Measure X} |
| 42 | {f b : ℕ → X → ℝ} {g c : X → ℝ} |
| 43 | (hf : ∀ᶠ k in atTop, Integrable (f k) μ) (hg : Integrable g μ) |
| 44 | (hfg : Tendsto (fun k => ∫ x, |f k x - g x| ∂μ) atTop (𝓝 0)) |
| 45 | (hb : ∀ᶠ k in atTop, ∀ᵐ x ∂μ, f k x ≤ b k x) |
| 46 | (hbc : ∀ᵐ x ∂μ, Tendsto (fun k => b k x) atTop (𝓝 (c x))) : |
| 47 | ∀ᵐ x ∂μ, g x ≤ c x := by |
| 48 | obtain ⟨σ, hσ, hpoint⟩ := exists_subseq_tendsto_ae_of_integral_abs_sub hf hg hfg |
| 49 | obtain ⟨N, hN⟩ := eventually_atTop.1 hb |
| 50 | have hall : ∀ᵐ x ∂μ, ∀ k : ℕ, N ≤ k → f k x ≤ b k x := by |
| 51 | apply ae_all_iff.mpr |
| 52 | intro k |
| 53 | by_cases hk : N ≤ k |
| 54 | · exact (hN k hk).mono fun _ h _ => h |
| 55 | · exact Eventually.of_forall fun _ h => (hk h).elim |
| 56 | filter_upwards [hpoint, hall, hbc] with x hx hxb hxc |
| 57 | exact le_of_tendsto_of_tendsto hx (hxc.comp hσ.tendsto_atTop) |
| 58 | ((hσ.tendsto_atTop.eventually (eventually_ge_atTop N)).mono fun k hk => hxb (σ k) hk) |
| 59 | |
| 60 | end Poincare.Analysis |