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.ContinuousOn |
| 2 | import Mathlib.Topology.Separation.Hausdorff |
| 3 | |
| 4 | /-!+# Continuous lifts from compact unique fibers |
| 5 | |
| 6 | This is the compactness step in Morgan--Tian, Remark 19.42, p. 472: |
| 7 | pointwise uniqueness in a compact class makes a continuous family of |
| 8 | endpoints lift continuously. The proof uses the compact-to-Hausdorff |
| 9 | embedding theorem, without assuming continuity of the selected lift. |
| 10 | -/ |
| 11 | |
| 12 | noncomputable section |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | open scoped Topology |
| 17 | |
| 18 | namespace PoincareMT |
| 19 | |
| 20 | /-- Unique fibers in a compact class lift a continuous map on a compact |
| 21 | parameter set continuously. The lift is defined on the parameter subtype, |
| 22 | so no nonemptiness assumption is needed. This is the topological step in |
| 23 | Morgan--Tian, Remark 19.42, p. 472. -/ |
| 24 | theorem m64_exists_continuous_lift_of_compact_unique_fibers |
| 25 | {X Y Z : Type*} [TopologicalSpace X] [T2Space X] |
| 26 | [TopologicalSpace Y] [T2Space Y] [TopologicalSpace Z] |
| 27 | {K : Set X} (hK : IsCompact K) {f : X → Y} (hf : ContinuousOn f K) |
| 28 | {J : Set Z} (hJ : IsCompact J) {g : Z → Y} (hg : ContinuousOn g J) |
| 29 | (hunique : ∀ z ∈ J, ∃! x, x ∈ K ∧ f x = g z) : |
| 30 | ∃ u : J → X, Continuous u ∧ ∀ z : J, u z ∈ K ∧ f (u z) = g z := by |
| 31 | classical |
| 32 | let C : Set X := K ∩ f ⁻¹' (g '' J) |
| 33 | have hC : IsCompact C := hK.of_isClosed_subset |
| 34 | (hf.preimage_isClosed_of_isClosed hK.isClosed |
| 35 | (hJ.image_of_continuousOn hg).isClosed) inter_subset_left |
| 36 | let : CompactSpace C := isCompact_iff_compactSpace.mp hC |
| 37 | let F : C → Y := fun x => f x |
| 38 | have hF : Continuous F := (hf.mono inter_subset_left).domRestrict |
| 39 | have hFi : Function.Injective F := by |
| 40 | intro x y hxy |
| 41 | obtain ⟨z, hz, hzx⟩ := x.property.2 |
| 42 | apply Subtype.ext |
| 43 | exact (hunique z hz).unique ⟨x.property.1, hzx.symm⟩ |
| 44 | ⟨y.property.1, hxy.symm.trans hzx.symm⟩ |
| 45 | choose u hu using (fun z : J => (hunique z z.property).exists) |
| 46 | let v : J → C := fun z => ⟨u z, (hu z).1, ⟨z, z.property, (hu z).2.symm⟩⟩ |
| 47 | have hv : Continuous v := (hF.isClosedEmbedding hFi).isEmbedding.continuous_iff.mpr |
| 48 | (hg.domRestrict.congr (fun z => (hu z).2.symm)) |
| 49 | exact ⟨u, continuous_subtype_val.comp hv, hu⟩ |
| 50 | |
| 51 | end PoincareMT |