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.Topology.MetricSpace.Thickening |
| 2 | |
| 3 | /-! |
| 4 | # A common target-chart margin for compact source patches |
| 5 | |
| 6 | The finite-chart construction in the SurgeryComparison.Transport full contract, following |
| 7 | Morgan--Tian Claim 18.22, printed p. 433, fixes the chart data before |
| 8 | choosing successive smoothing parameters. Compact image thickenings |
| 9 | provide one positive distance margin valid for every nearby map. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter Metric |
| 15 | open scoped Topology ENNReal |
| 16 | |
| 17 | universe uM uN uI |
| 18 | |
| 19 | namespace PoincareMT.SurgeryComparison.Topology |
| 20 | |
| 21 | variable {M : Type uM} [TopologicalSpace M] |
| 22 | {N : Type uN} [PseudoEMetricSpace N] |
| 23 | {ι : Type uI} [Finite ι] |
| 24 | |
| 25 | /-- One positive uniform distance margin keeps the images of finitely |
| 26 | many compact source sets inside their prescribed open target sets. The |
| 27 | perturbed map need not be continuous. This is the fixed-chart validity |
| 28 | step in the SurgeryComparison.Transport full contract, Claim 18.22, Morgan--Tian p. 433. -/ |
| 29 | theorem exists_pos_uniform_mapsTo_of_edist_lt |
| 30 | (K : ι → Set M) (V : ι → Set N) (f₀ : M → N) |
| 31 | (hK : ∀ i, IsCompact (K i)) (hV : ∀ i, IsOpen (V i)) |
| 32 | (hf₀ : ∀ i, ContinuousOn f₀ (K i)) |
| 33 | (hmap : ∀ i, MapsTo f₀ (K i) (V i)) : |
| 34 | ∃ δ : ℝ, 0 < δ ∧ ∀ f : M → N, |
| 35 | (∀ x, edist (f x) (f₀ x) < ENNReal.ofReal δ) → |
| 36 | ∀ i, MapsTo f (K i) (V i) := by |
| 37 | classical |
| 38 | have hradii : ∀ i, ∃ r : ℝ, 0 < r ∧ thickening r (f₀ '' K i) ⊆ V i := |
| 39 | fun i => ((hK i).image_of_continuousOn (hf₀ i)).exists_thickening_subset_open |
| 40 | (hV i) (hmap i).image_subset |
| 41 | choose r hr hrange using hradii |
| 42 | have hsmall : ∀ᶠ δ : ℝ in 𝓝 0, ∀ i, δ < r i := |
| 43 | eventually_all.mpr (fun i => eventually_lt_nhds (hr i)) |
| 44 | have hpos : ∀ᶠ δ : ℝ in 𝓝[>] 0, 0 < δ := self_mem_nhdsWithin |
| 45 | have hsmall' : ∀ᶠ δ : ℝ in 𝓝[>] 0, ∀ i, δ < r i := |
| 46 | nhdsWithin_le_nhds hsmall |
| 47 | obtain ⟨δ, hδ, hδr⟩ := (hpos.and hsmall').exists |
| 48 | refine ⟨δ, hδ, ?_⟩ |
| 49 | intro f hf i x hx |
| 50 | apply hrange i |
| 51 | exact (mem_thickening_iff_exists_edist_lt _ _).mpr |
| 52 | ⟨f₀ x, mem_image_of_mem f₀ hx, |
| 53 | (hf x).trans_le (ENNReal.ofReal_le_ofReal (hδr i).le)⟩ |
| 54 | |
| 55 | end PoincareMT.SurgeryComparison.Topology |