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.Basic |
| 2 | |
| 3 | /-! |
| 4 | # Compact buffers inside partial homeomorphisms |
| 5 | |
| 6 | A compact closure inside the source maps to the exact closure of the |
| 7 | image. Its frontier maps to the exact frontier of the image. Used in |
| 8 | the initial-ball length barrier for Morgan--Tian, Claim 16.6, pp. 371-372. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open Set |
| 14 | |
| 15 | namespace OpenPartialHomeomorph |
| 16 | |
| 17 | variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [T2Space Y] |
| 18 | |
| 19 | /-- A compact buffered domain has no new image-limit points outside the |
| 20 | image of its closure under a partial homeomorphism. -/ |
| 21 | theorem image_closure_of_compact_buffer (e : OpenPartialHomeomorph X Y) |
| 22 | {V : Set X} (hV : IsCompact (closure V)) (hsub : closure V ⊆ e.source) : |
| 23 | e '' closure V = closure (e '' V) := by |
| 24 | have hc : ContinuousOn e (closure V) := e.continuousOn.mono hsub |
| 25 | exact hc.image_closure.antisymm |
| 26 | (closure_minimal (image_mono subset_closure) (hV.image_of_continuousOn hc).isClosed) |
| 27 | |
| 28 | /-- The frontier of an open compact buffered domain maps to the exact |
| 29 | frontier of its image under a partial homeomorphism. -/ |
| 30 | theorem image_frontier_of_compact_buffer (e : OpenPartialHomeomorph X Y) |
| 31 | {V : Set X} (hV : IsOpen V) (hcompact : IsCompact (closure V)) |
| 32 | (hsub : closure V ⊆ e.source) : |
| 33 | e '' frontier V = frontier (e '' V) := by |
| 34 | have hopen := e.isOpen_image_of_subset_source hV (subset_closure.trans hsub) |
| 35 | rw [frontier, frontier, hV.interior_eq, hopen.interior_eq, |
| 36 | ← e.image_closure_of_compact_buffer hcompact hsub] |
| 37 | apply Subset.antisymm |
| 38 | · rintro _ ⟨x, hx, rfl⟩ |
| 39 | refine ⟨mem_image_of_mem e hx.1, ?_⟩ |
| 40 | rintro ⟨y, hy, hxy⟩ |
| 41 | exact hx.2 (e.injOn (hsub (subset_closure hy)) (hsub hx.1) hxy ▸ hy) |
| 42 | · rintro y ⟨⟨x, hx, rfl⟩, hnot⟩ |
| 43 | exact ⟨x, ⟨hx, fun hv => hnot (mem_image_of_mem e hv)⟩, rfl⟩ |
| 44 | |
| 45 | end OpenPartialHomeomorph |