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.Separation.Hausdorff |
| 2 | |
| 3 | /-! |
| 4 | # Global injectivity from an open dense injective set |
| 5 | |
| 6 | A continuous open map cannot have two disjoint neighborhoods over the same |
| 7 | point while remaining injective on an open dense set. This supplies the |
| 8 | global step in the exponential-chart equality argument. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set |
| 14 | |
| 15 | namespace PoincareMT.ReducedVolume |
| 16 | |
| 17 | variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [T2Space X] |
| 18 | |
| 19 | /-- A continuous open map injective on an open dense set is globally injective. -/ |
| 20 | theorem injective_of_open_dense_injOn {f : X → Y} (hf : Continuous f) |
| 21 | (hfopen : IsOpenMap f) {S : Set X} (hS : IsOpen S) (hdense : Dense S) |
| 22 | (hinj : InjOn f S) : Function.Injective f := by |
| 23 | intro x y hxy |
| 24 | by_contra hne |
| 25 | obtain ⟨U, V, hU, hV, hxU, hyV, hdisj⟩ := t2_separation hne |
| 26 | have hopen₁ : IsOpen (U ∩ f ⁻¹' (f '' V)) := hU.inter ((hfopen V hV).preimage hf) |
| 27 | have hnonempty₁ : (U ∩ f ⁻¹' (f '' V)).Nonempty := |
| 28 | ⟨x, hxU, y, hyV, hxy.symm⟩ |
| 29 | obtain ⟨u, huS, hu⟩ := hdense.exists_mem_open hopen₁ hnonempty₁ |
| 30 | obtain ⟨v, hvV, hvu⟩ := hu.2 |
| 31 | have hopen₂ : IsOpen (V ∩ f ⁻¹' (f '' (U ∩ S))) := |
| 32 | hV.inter ((hfopen (U ∩ S) (hU.inter hS)).preimage hf) |
| 33 | have hnonempty₂ : (V ∩ f ⁻¹' (f '' (U ∩ S))).Nonempty := |
| 34 | ⟨v, hvV, u, ⟨hu.1, huS⟩, hvu.symm⟩ |
| 35 | obtain ⟨v', hv'S, hv'⟩ := hdense.exists_mem_open hopen₂ hnonempty₂ |
| 36 | obtain ⟨u', hu', heq⟩ := hv'.2 |
| 37 | have huv := hinj hu'.2 hv'S heq |
| 38 | exact Set.disjoint_left.mp hdisj hu'.1 (huv.symm ▸ hv'.1) |
| 39 | |
| 40 | end PoincareMT.ReducedVolume |