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 | |
| 3 | /-! |
| 4 | # Finite square sums under a compact cutoff |
| 5 | |
| 6 | Actual integrability permits the finite square sum and integral to be |
| 7 | interchanged. The domain and measure have the generality of local |
| 8 | compact-cutoff integration. This serves Morgan-Tian Section 12.5, |
| 9 | pp. 309-319 and actual-density-integrals.md. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set MeasureTheory |
| 15 | open scoped BigOperators |
| 16 | |
| 17 | namespace MeasureTheory |
| 18 | |
| 19 | /-- Integrating the cutoff-weighted finite square sum gives exactly the |
| 20 | sum of the scalar cutoff energies (Section 12.5, pp. 309-319). -/ |
| 21 | theorem integral_cutoff_sq_finsetSum |
| 22 | {X I : Type*} [TopologicalSpace X] [MeasurableSpace X] [OpensMeasurableSpace X] |
| 23 | {μ : Measure X} [IsFiniteMeasureOnCompacts μ] (s : Finset I) |
| 24 | {U : Set X} (hU : IsOpen U) {φ : X → ℝ} |
| 25 | (hφ : ContinuousOn φ U) (hφc : HasCompactSupport φ) (hφU : tsupport φ ⊆ U) |
| 26 | {f : I → X → ℝ} (hf : ∀ i ∈ s, ContinuousOn (f i) U) : |
| 27 | (∫ x, φ x ^ 2 * (∑ i ∈ s, f i x ^ 2) ∂μ) = |
| 28 | ∑ i ∈ s, ∫ x, (φ x * f i x) ^ 2 ∂μ := by |
| 29 | have hwc : HasCompactSupport (fun x => φ x ^ 2) := |
| 30 | hφc.comp_left (g := fun r : ℝ => r ^ 2) (by simp) |
| 31 | have hwU : tsupport (fun x => φ x ^ 2) ⊆ U := by |
| 32 | simpa only [pow_two] using (tsupport_mul_subset_left (f := φ) (g := φ)).trans hφU |
| 33 | have hi (i : I) (hi : i ∈ s) : Integrable (fun x => φ x ^ 2 * f i x ^ 2) μ := |
| 34 | integrable_cutoff_mul hU (hφ.pow 2) hwc hwU ((hf i hi).pow 2) |
| 35 | simpa only [Finset.mul_sum, mul_pow] using integral_finsetSum s hi |
| 36 | |
| 37 | end MeasureTheory |