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.Bochner.Set |
| 2 | import Mathlib.Analysis.SpecificLimits.Basic |
| 3 | |
| 4 | /-! # Passing a punctured integral bound through a null center -/ |
| 5 | |
| 6 | set_option autoImplicit false |
| 7 | |
| 8 | open Set MeasureTheory Filter |
| 9 | open scoped Topology |
| 10 | |
| 11 | namespace Poincare.CurvatureIntegral |
| 12 | |
| 13 | /-- Uniform integral bounds outside all positive balls pass to the full set |
| 14 | when the integrand is integrable and the center has zero measure. -/ |
| 15 | theorem integral_le_of_compl_ball_bounds |
| 16 | {X : Type*} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] |
| 17 | {μ : Measure X} [NullSingletonClass μ] {E : Set X} |
| 18 | (hE : MeasurableSet E) {h : X → ℝ} (hi : IntegrableOn h E μ) |
| 19 | (p : X) {C : ℝ} |
| 20 | (hbound : ∀ a : ℝ, 0 < a → (∫ x in E \ Metric.ball p a, h x ∂μ) ≤ C) : |
| 21 | (∫ x in E, h x ∂μ) ≤ C := by |
| 22 | let S : ℕ → Set X := fun j => E \ Metric.ball p ((1 / 2 : ℝ) ^ j) |
| 23 | have hSm (j : ℕ) : MeasurableSet (S j) := hE.diff Metric.isOpen_ball.measurableSet |
| 24 | have hmono : Monotone S := by |
| 25 | intro i j hij x hx |
| 26 | refine ⟨hx.1, ?_⟩ |
| 27 | intro hxj |
| 28 | apply hx.2 |
| 29 | exact (Metric.ball_subset_ball (pow_le_pow_of_le_one (by norm_num) (by norm_num) hij)) hxj |
| 30 | have hUnion : (⋃ j, S j) = E \ {p} := by |
| 31 | ext x |
| 32 | constructor |
| 33 | · intro hx |
| 34 | rcases mem_iUnion.mp hx with ⟨j, hxj⟩ |
| 35 | refine ⟨hxj.1, ?_⟩ |
| 36 | intro hxp |
| 37 | have heq : x = p := mem_singleton_iff.mp hxp |
| 38 | apply hxj.2 |
| 39 | simp only [heq, Metric.mem_ball, dist_self] |
| 40 | positivity |
| 41 | · intro hx |
| 42 | have hxp : x ≠ p := by simpa only [mem_singleton_iff] using hx.2 |
| 43 | obtain ⟨j, hj⟩ := ((tendsto_pow_atTop_nhds_zero_of_lt_one |
| 44 | (by norm_num : (0 : ℝ) ≤ 1 / 2) (by norm_num)).eventually_lt_const |
| 45 | (dist_pos.mpr hxp)).exists |
| 46 | apply mem_iUnion.mpr |
| 47 | exact ⟨j, hx.1, fun hb => (not_lt_of_ge hj.le) (Metric.mem_ball.mp hb)⟩ |
| 48 | have hiUnion : IntegrableOn h (⋃ j, S j) μ := by |
| 49 | rw [hUnion] |
| 50 | exact hi.mono_set sdiff_subset |
| 51 | have hlim := tendsto_setIntegral_of_monotone hSm hmono hiUnion |
| 52 | have heq : (∫ x in ⋃ j, S j, h x ∂μ) = ∫ x in E, h x ∂μ := by |
| 53 | rw [hUnion] |
| 54 | exact setIntegral_congr_set (sdiff_null_ae_eq_self (measure_singleton p)) |
| 55 | rw [heq] at hlim |
| 56 | exact le_of_tendsto hlim (Eventually.of_forall (fun j => hbound _ (by positivity))) |
| 57 | |
| 58 | end Poincare.CurvatureIntegral |