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.Integral.IntervalIntegral.Basic |
| 2 | |
| 3 | /-! Integrability on physical cells from actual scaled coordinates, |
| 4 | and finite assembly over adjacent closed cells. Source: MT Lemma 19.15, |
| 5 | pp. 447-449; `2026-09-26-periodic-finite-collar.md`. -/ |
| 6 | |
| 7 | noncomputable section |
| 8 | set_option autoImplicit false |
| 9 | set_option warningAsError true |
| 10 | |
| 11 | open Set MeasureTheory |
| 12 | |
| 13 | namespace PoincareMT.M64 |
| 14 | |
| 15 | /-- A continuous integrand in a positive affine coordinate gives |
| 16 | the original integrand's interval integrability on the physical cell. |
| 17 | Source: MT Lemma 19.15, pp. 447-449; the periodic-finite-collar derivation. -/ |
| 18 | theorem intervalIntegrable_of_scaled_coordinates {a b r x : ℝ} (hab : a ≤ b) (hr : 0 < r) |
| 19 | {f F : ℝ → ℝ} |
| 20 | (hf : ContinuousOn f (Icc ((a - x) / r) ((b - x) / r))) |
| 21 | (heq : ∀ t ∈ Icc ((a - x) / r) ((b - x) / r), f t = F (x + r * t)) : |
| 22 | IntervalIntegrable F volume a b := by |
| 23 | have hmap : MapsTo (fun s => (s - x) / r) (Icc a b) |
| 24 | (Icc ((a - x) / r) ((b - x) / r)) := by |
| 25 | intro s hs |
| 26 | exact ⟨div_le_div_of_nonneg_right (sub_le_sub_right hs.1 x) hr.le, |
| 27 | div_le_div_of_nonneg_right (sub_le_sub_right hs.2 x) hr.le⟩ |
| 28 | have hc : ContinuousOn F (Icc a b) := by |
| 29 | have hpsi : Continuous (fun s : ℝ => (s - x) / r) := |
| 30 | (continuous_id.sub continuous_const).div_const r |
| 31 | apply (hf.comp hpsi.continuousOn hmap).congr |
| 32 | intro s hs |
| 33 | have hh := heq ((s - x) / r) (hmap hs) |
| 34 | simpa only [Function.comp_apply, mul_div_cancel₀ _ hr.ne', add_sub_cancel] using hh.symm |
| 35 | exact hc.intervalIntegrable_of_Icc hab |
| 36 | |
| 37 | /-- Integrability on every actual adjacent grid cell gives |
| 38 | integrability on the whole displayed interval. |
| 39 | Source: MT Lemma 19.15, pp. 447-449; the periodic-finite-collar derivation. -/ |
| 40 | theorem intervalIntegrable_of_grid {N : ℕ} (v : ℕ → ℝ) (f : ℝ → ℝ) |
| 41 | (hf : ∀ k < N, IntervalIntegrable f volume (v k) (v (k + 1))) : |
| 42 | IntervalIntegrable f volume (v 0) (v N) := by |
| 43 | induction N with |
| 44 | | zero => exact IntervalIntegrable.refl |
| 45 | | succ N ih => |
| 46 | exact (ih (fun k hk => hf k (Nat.lt_succ_of_lt hk))).trans (hf N (Nat.lt_succ_self N)) |
| 47 | |
| 48 | end PoincareMT.M64 |