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 PoincareLib.Geometry.RicciFlow.Surgery.StandardCap.Existence.Analysis.Energy.CutoffIntegralComparison |
| 2 | import Mathlib.MeasureTheory.Integral.Bochner.Set |
| 3 | |
| 4 | /-! |
| 5 | # A uniform compact-cutoff square bound |
| 6 | |
| 7 | The cutoff constant is chosen before every locally continuous tested |
| 8 | density. Only the density on the actual cutoff support is integrated. |
| 9 | This is used in Morgan-Tian Section 12.5, pp. 309-319 and |
| 10 | canonical-local-integral-energy.md. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set MeasureTheory |
| 16 | |
| 17 | namespace MeasureTheory |
| 18 | |
| 19 | /-- A fixed compact cutoff gives one square-weight bound before all |
| 20 | nonnegative continuous densities (Section 12.5, pp. 309-319). -/ |
| 21 | theorem exists_integral_cutoff_sq_le_setIntegral |
| 22 | {X : Type*} [TopologicalSpace X] [MeasurableSpace X] [OpensMeasurableSpace X] |
| 23 | {μ : Measure X} [IsFiniteMeasureOnCompacts μ] |
| 24 | {U : Set X} (hU : IsOpen U) {φ : X → ℝ} |
| 25 | (hφ : Continuous φ) (hφc : HasCompactSupport φ) (hφU : tsupport φ ⊆ U) : |
| 26 | ∃ B : ℝ, 0 ≤ B ∧ ∀ ρ : X → ℝ, ContinuousOn ρ U → |
| 27 | (∀ x ∈ tsupport φ, 0 ≤ ρ x) → |
| 28 | (∫ x, φ x ^ 2 * ρ x ∂μ) ≤ B * ∫ x in tsupport φ, ρ x ∂μ := by |
| 29 | obtain ⟨b, hb⟩ := hφc.exists_bound_of_continuousOn (hφ.pow 2).continuousOn |
| 30 | let B := max b 0 |
| 31 | refine ⟨B, le_max_right _ _, ?_⟩ |
| 32 | intro ρ hρ hρ0 |
| 33 | have hB (x) (hx : x ∈ tsupport φ) : φ x ^ 2 ≤ B := |
| 34 | (le_abs_self _).trans ((hb x hx).trans (le_max_left _ _)) |
| 35 | have hwc : HasCompactSupport (fun x => φ x ^ 2) := |
| 36 | hφc.comp_left (g := fun r : ℝ => r ^ 2) (by simp) |
| 37 | have hwU : tsupport (fun x => φ x ^ 2) ⊆ U := by |
| 38 | simpa only [pow_two] using |
| 39 | (tsupport_mul_subset_left (f := φ) (g := φ)).trans hφU |
| 40 | have hi : Integrable (fun x => φ x ^ 2 * ρ x) μ := |
| 41 | integrable_cutoff_mul hU (hφ.pow 2).continuousOn hwc hwU hρ |
| 42 | have hρi : IntegrableOn ρ (tsupport φ) μ := |
| 43 | ContinuousOn.integrableOn_compact' hφc (isClosed_tsupport φ).measurableSet |
| 44 | (hρ.mono hφU) |
| 45 | have hpoint (x) : φ x ^ 2 * ρ x ≤ B * (tsupport φ).indicator ρ x := by |
| 46 | by_cases hx : x ∈ tsupport φ |
| 47 | · rw [indicator_of_mem hx] |
| 48 | exact mul_le_mul_of_nonneg_right (hB x hx) (hρ0 x hx) |
| 49 | · simp [indicator_of_notMem hx, image_eq_zero_of_notMem_tsupport hx] |
| 50 | have hbnd := integral_mono hi |
| 51 | ((hρi.integrable_indicator (isClosed_tsupport φ).measurableSet).const_mul B) hpoint |
| 52 | simpa only [integral_const_mul, integral_indicator (isClosed_tsupport φ).measurableSet] using hbnd |
| 53 | |
| 54 | end MeasureTheory |