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.AbsolutelyContinuousFun |
| 2 | import Mathlib.Analysis.Calculus.Deriv.Basic |
| 3 | import Mathlib.Topology.MetricSpace.Lipschitz |
| 4 | import Mathlib.Topology.Algebra.MetricSpace.Lipschitz |
| 5 | import Mathlib.Tactic |
| 6 | |
| 7 | /-! |
| 8 | # Uniform local Lipschitz constants on an interval |
| 9 | |
| 10 | Absolute continuity and the derivative bound globalize a common local |
| 11 | Lipschitz constant across a closed interval, including its endpoints. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set Filter MeasureTheory |
| 17 | open scoped Topology NNReal |
| 18 | |
| 19 | namespace Poincare.Analysis |
| 20 | |
| 21 | theorem abs_sub_le_of_uniform_local_lipschitz_on_interval |
| 22 | {f : ℝ → ℝ} {a b : ℝ} (hab : a ≤ b) (D : ℝ≥0) |
| 23 | (hf : ∀ t ∈ Icc a b, ∃ U ∈ 𝓝[Icc a b] t, LipschitzOnWith D f U) : |
| 24 | |f b - f a| ≤ D * (b - a) := by |
| 25 | have hloc : LocallyLipschitzOn (Icc a b) f := fun t ht => ⟨D, hf t ht⟩ |
| 26 | obtain ⟨C, hC⟩ := hloc.exists_lipschitzOnWith_of_compact isCompact_Icc |
| 27 | have hAC : AbsolutelyContinuousOnInterval f a b := |
| 28 | (show LipschitzOnWith C f (uIcc a b) by rwa [uIcc_of_le hab]).absolutelyContinuousOnInterval |
| 29 | have hd : ∀ᵐ t ∂volume.restrict (Icc a b), |deriv f t| ≤ D := by |
| 30 | rw [← restrict_Ioo_eq_restrict_Icc] |
| 31 | filter_upwards [ae_restrict_mem measurableSet_Ioo] with t ht |
| 32 | obtain ⟨U, hU, hlip⟩ := hf t ⟨ht.1.le, ht.2.le⟩ |
| 33 | rw [(nhdsWithin_eq_nhds.mpr (Icc_mem_nhds ht.1 ht.2))] at hU |
| 34 | simpa only [Real.norm_eq_abs] using norm_deriv_le_of_lipschitzOn hU hlip |
| 35 | calc |
| 36 | _ = |∫ t in a..b, deriv f t| := by rw [hAC.integral_deriv_eq_sub] |
| 37 | _ ≤ ∫ t in a..b, |deriv f t| := intervalIntegral.abs_integral_le_integral_abs hab |
| 38 | _ ≤ ∫ _t in a..b, (D : ℝ) := intervalIntegral.integral_mono_ae_restrict hab |
| 39 | hAC.intervalIntegrable_deriv.abs intervalIntegrable_const hd |
| 40 | _ = _ := by rw [intervalIntegral.integral_const]; simp only [smul_eq_mul]; ring |
| 41 | |
| 42 | end Poincare.Analysis |