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.Topology.OpenPartialHomeomorph.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Compactly supported tests transported through a partial chart |
| 6 | |
| 7 | The indicator is essential: an inverse chart is totalized away from |
| 8 | its target. Its zero extension has support in the compact chart image |
| 9 | of the original test support and preserves the germ inside the chart. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped ContDiff Topology |
| 16 | |
| 17 | namespace PoincareMT.ReducedVolume |
| 18 | |
| 19 | variable {M E : Type*} [TopologicalSpace M] |
| 20 | [NormedAddCommGroup E] [NormedSpace ℝ E] |
| 21 | |
| 22 | /-- The zero extension of a scalar test written in a partial chart. -/ |
| 23 | noncomputable def chartSupportedTest (e : OpenPartialHomeomorph M E) (φ : M → ℝ) : E → ℝ := |
| 24 | e.target.indicator (φ ∘ e.symm) |
| 25 | |
| 26 | omit [NormedSpace ℝ E] in |
| 27 | /-- The supported chart test has the same scalar germ at every chart target point. -/ |
| 28 | theorem chartSupportedTest_eventuallyEq (e : OpenPartialHomeomorph M E) (φ : M → ℝ) |
| 29 | {x : E} (hx : x ∈ e.target) : |
| 30 | chartSupportedTest e φ =ᶠ[𝓝 x] φ ∘ e.symm := |
| 31 | eqOn_indicator.eventuallyEq_of_mem (e.open_target.mem_nhds hx) |
| 32 | |
| 33 | omit [NormedSpace ℝ E] in |
| 34 | /-- The zero extension has compact support contained in the target chart. -/ |
| 35 | theorem chartSupportedTest_support (e : OpenPartialHomeomorph M E) {φ : M → ℝ} |
| 36 | (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ e.source) : |
| 37 | HasCompactSupport (chartSupportedTest e φ) ∧ |
| 38 | tsupport (chartSupportedTest e φ) ⊆ e '' tsupport φ ∧ |
| 39 | tsupport (chartSupportedTest e φ) ⊆ e.target := by |
| 40 | classical |
| 41 | have hK : IsCompact (e '' tsupport φ) := |
| 42 | hc.image_of_continuousOn (e.continuousOn.mono hs) |
| 43 | have hsub : tsupport (chartSupportedTest e φ) ⊆ e '' tsupport φ := by |
| 44 | apply closure_minimal _ hK.isClosed |
| 45 | intro x hx |
| 46 | have hxt : x ∈ e.target := by |
| 47 | by_contra hnot |
| 48 | exact hx (indicator_of_notMem hnot _) |
| 49 | have hφ : φ (e.symm x) ≠ 0 := by |
| 50 | simpa only [Function.mem_support, chartSupportedTest, indicator_of_mem hxt, |
| 51 | Function.comp_apply] using hx |
| 52 | exact ⟨e.symm x, subset_tsupport φ hφ, e.right_inv hxt⟩ |
| 53 | exact ⟨hK.of_isClosed_subset (isClosed_tsupport _) hsub, hsub, |
| 54 | hsub.trans (image_subset_iff.mpr (fun q hq ↦ e.map_source (hs hq)))⟩ |
| 55 | |
| 56 | /-- A smooth scalar coordinate germ gives a globally smooth compactly supported chart test. -/ |
| 57 | theorem chartSupportedTest_contDiff (e : OpenPartialHomeomorph M E) {φ : M → ℝ} |
| 58 | (hc : HasCompactSupport φ) (hs : tsupport φ ⊆ e.source) {k : ℕ∞ω} |
| 59 | (hf : ContDiffOn ℝ k (φ ∘ e.symm) e.target) : |
| 60 | ContDiff ℝ k (chartSupportedTest e φ) := by |
| 61 | apply contDiff_of_contDiffOn_of_tsupport_subset e.open_target _ |
| 62 | (chartSupportedTest_support e hc hs).2.2 |
| 63 | intro x hx |
| 64 | exact ((hf.contDiffAt (e.open_target.mem_nhds hx)).congr_of_eventuallyEq |
| 65 | (chartSupportedTest_eventuallyEq e φ hx)).contDiffWithinAt |
| 66 | |
| 67 | end PoincareMT.ReducedVolume |