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.ReducedGeometry.ReducedVolume.Analysis.Integration.SupportedCalculus |
| 2 | import Mathlib.Analysis.Calculus.BumpFunction.FiniteDimension |
| 3 | |
| 4 | /-! |
| 5 | # Compact smooth representatives of scalar C2 germs |
| 6 | |
| 7 | A smooth bump supported in the local C2 region and equal to one near |
| 8 | the base point produces the compact global representative needed when |
| 9 | differentiating convolutions on the regular locus. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter Metric |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT.ReducedVolume |
| 18 | |
| 19 | variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] |
| 20 | |
| 21 | /-- Every scalar C2 germ has a compactly supported global C2 representative. -/ |
| 22 | theorem exists_compact_contDiff_two_of_germ {f : E → ℝ} {x : E} |
| 23 | (hf : ContDiffAt ℝ 2 f x) : |
| 24 | ∃ g : E → ℝ, ContDiff ℝ 2 g ∧ HasCompactSupport g ∧ f =ᶠ[𝓝 x] g := by |
| 25 | obtain ⟨r, hr, hball⟩ := nhds_basis_closedBall.mem_iff.mp (hf.eventually (by norm_num)) |
| 26 | let χ : ContDiffBump x := |
| 27 | { rIn := r / 2 |
| 28 | rOut := r |
| 29 | rIn_pos := half_pos hr |
| 30 | rIn_lt_rOut := half_lt_self hr } |
| 31 | let g := fun y ↦ χ y * f y |
| 32 | have hs : ContDiff ℝ 2 g := by |
| 33 | apply contDiff_iff_contDiffAt.mpr |
| 34 | intro y |
| 35 | by_cases hy : y ∈ tsupport χ |
| 36 | · exact χ.contDiffAt.mul (hball (by simpa only [χ.tsupport_eq] using hy)) |
| 37 | · have hz : g =ᶠ[𝓝 y] fun _ ↦ (0 : ℝ) := by |
| 38 | filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hy] with z hz |
| 39 | simp only [g, hz, Pi.zero_apply, zero_mul] |
| 40 | exact contDiffAt_const.congr_of_eventuallyEq hz |
| 41 | refine ⟨g, hs, χ.hasCompactSupport.mul_right, ?_⟩ |
| 42 | filter_upwards [χ.eventuallyEq_one] with y hy |
| 43 | simp only [g, hy, Pi.one_apply, one_mul] |
| 44 | |
| 45 | end PoincareMT.ReducedVolume |