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.Analysis.Calculus.ContDiff.Basic |
| 2 | import Mathlib.MeasureTheory.Function.LocallyIntegrable |
| 3 | |
| 4 | /-! |
| 5 | # Local calculus for functions supported inside an open set |
| 6 | |
| 7 | Outside the closed support the function is a zero germ. This extends |
| 8 | local smoothness or continuity to the whole space, and produces the |
| 9 | compact-support integrability needed by local Green identities. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set MeasureTheory |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT.ReducedVolume |
| 18 | |
| 19 | variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 20 | [NormedAddCommGroup F] [NormedSpace ℝ F] |
| 21 | |
| 22 | /-- Local smoothness extends globally when the whole closed support lies in the open domain. -/ |
| 23 | theorem contDiff_of_contDiffOn_of_tsupport_subset {U : Set E} (hU : IsOpen U) |
| 24 | {f : E → F} {k : ℕ∞ω} (hf : ContDiffOn ℝ k f U) (hs : tsupport f ⊆ U) : |
| 25 | ContDiff ℝ k f := by |
| 26 | apply contDiff_iff_contDiffAt.mpr |
| 27 | intro x |
| 28 | by_cases hx : x ∈ tsupport f |
| 29 | · exact hf.contDiffAt (hU.mem_nhds (hs hx)) |
| 30 | · exact contDiffAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hx) |
| 31 | |
| 32 | omit [NormedSpace ℝ E] [NormedSpace ℝ F] in |
| 33 | /-- Continuity on an open domain and a compact supported subset produce full integrability. -/ |
| 34 | theorem integrable_of_continuousOn_of_tsupport_subset |
| 35 | [MeasurableSpace E] [BorelSpace E] {μ : Measure E} [IsFiniteMeasureOnCompacts μ] |
| 36 | {U K : Set E} (hU : IsOpen U) (hK : IsCompact K) (hKU : K ⊆ U) |
| 37 | {f : E → F} (hf : ContinuousOn f U) (hs : tsupport f ⊆ K) : Integrable f μ := by |
| 38 | have hcont := hf.continuous_of_tsupport_subset hU (hs.trans hKU) |
| 39 | exact hcont.integrable_of_hasCompactSupport |
| 40 | (hK.of_isClosed_subset (isClosed_tsupport _) hs) |
| 41 | |
| 42 | end PoincareMT.ReducedVolume |