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.OpenPartialHomeomorph.Continuity |
| 2 | import Mathlib.Topology.Separation.Hausdorff |
| 3 | |
| 4 | /-! A local inverse identifies a limit point of an injectivity domain. |
| 5 | Used for MT Lemma 19.53, p. 478; local-inverse-self-return derivation, |
| 6 | Section 4. Only continuity and uniqueness of limits are required. -/ |
| 7 | |
| 8 | set_option autoImplicit false |
| 9 | |
| 10 | open Set Filter |
| 11 | open scoped Topology |
| 12 | |
| 13 | namespace PoincareMT |
| 14 | |
| 15 | /-- A continuous map injective on S cannot send a limit point of S to a different point in |
| 16 | an inverse chart whose source lies in S. This is the closure argument in |
| 17 | local-inverse-self-return, Section 4. Source/construction: |
| 18 | proof-work/tasks/M64/derivations/2026-09-27-local-inverse-self-return.md, Section 4. -/ |
| 19 | theorem m64_eq_local_inverse_of_injOn_closure |
| 20 | {X Y : Type*} [TopologicalSpace X] [T2Space X] [TopologicalSpace Y] |
| 21 | {f : X → Y} {S : Set X} {x : X} |
| 22 | (hf : ContinuousAt f x) (hinj : InjOn f S) (hx : x ∈ closure S) |
| 23 | (F : OpenPartialHomeomorph X Y) (hF : EqOn F f F.source) |
| 24 | (hsource : F.source ⊆ S) (htarget : f x ∈ F.target) : |
| 25 | x = F.symm (f x) := by |
| 26 | have : NeBot (𝓝[S] x) := mem_closure_iff_nhdsWithin_neBot.mp hx |
| 27 | have hlim : Tendsto f (𝓝[S] x) (𝓝 (f x)) := |
| 28 | hf.tendsto.mono_left nhdsWithin_le_nhds |
| 29 | have htargetNear : ∀ᶠ y in 𝓝[S] x, f y ∈ F.target := |
| 30 | hlim.eventually (F.open_target.mem_nhds htarget) |
| 31 | have heq : (fun y => F.symm (f y)) =ᶠ[𝓝[S] x] id := by |
| 32 | filter_upwards [self_mem_nhdsWithin, htargetNear] with y hy hfy |
| 33 | have hpre : F.symm (f y) ∈ F.source := F.map_target hfy |
| 34 | exact hinj (hsource hpre) hy ((hF hpre).symm.trans (F.right_inv hfy)) |
| 35 | have hinverse : Tendsto (fun y => F.symm (f y)) (𝓝[S] x) (𝓝 (F.symm (f x))) := |
| 36 | (F.continuousAt_symm htarget).tendsto.comp hlim |
| 37 | exact tendsto_nhds_unique (tendsto_id.mono_left nhdsWithin_le_nhds) |
| 38 | (hinverse.congr' heq) |
| 39 | |
| 40 | end PoincareMT |