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.IsImage |
| 2 | import Mathlib.Topology.Separation.Hausdorff |
| 3 | |
| 4 | /-! |
| 5 | # Compact closures and frontiers under actual partial homeomorphisms |
| 6 | |
| 7 | Compact capture inside the source makes the local closure and frontier |
| 8 | identities global on the displayed image. Source: Morgan-Tian |
| 9 | Proposition 9.79, p. 234; cap-ball-confinement.md. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | |
| 16 | namespace OpenPartialHomeomorph |
| 17 | |
| 18 | variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] |
| 19 | (e : OpenPartialHomeomorph X Y) {S : Set X} |
| 20 | |
| 21 | namespace StandardCapImport |
| 22 | |
| 23 | /-- The literal image of a subset of the actual source satisfies the |
| 24 | local image relation (cap transport, Proposition 9.79). -/ |
| 25 | theorem isImage_image_of_subset_source (hS : S ⊆ e.source) : e.IsImage S (e '' S) := by |
| 26 | intro x hx |
| 27 | constructor |
| 28 | · rintro ⟨y, hy, he⟩ |
| 29 | exact e.injOn (hS hy) hx he ▸ hy |
| 30 | · exact mem_image_of_mem e |
| 31 | |
| 32 | end StandardCapImport |
| 33 | |
| 34 | export StandardCapImport (isImage_image_of_subset_source) |
| 35 | |
| 36 | /-- A compact source closure has exactly its actual image closure; |
| 37 | continuity is needed only on the partial map's displayed source |
| 38 | (cap transport, Proposition 9.79). -/ |
| 39 | theorem image_closure_eq_of_isCompact [T2Space Y] |
| 40 | (hK : IsCompact (closure S)) (hsource : closure S ⊆ e.source) : |
| 41 | e '' closure S = closure (e '' S) := by |
| 42 | apply Subset.antisymm |
| 43 | · rintro _ ⟨x, hx, rfl⟩ |
| 44 | exact ((e.continuousOn x (hsource hx)).mono (subset_closure.trans hsource)).mem_closure_image hx |
| 45 | · apply closure_minimal (image_mono subset_closure) |
| 46 | exact (hK.image_of_continuousOn (e.continuousOn.mono hsource)).isClosed |
| 47 | |
| 48 | /-- Compact capture puts every actual image-closure point in the open |
| 49 | target of the partial map (cap transport, Proposition 9.79). -/ |
| 50 | theorem closure_image_subset_target_of_isCompact [T2Space Y] |
| 51 | (hK : IsCompact (closure S)) (hsource : closure S ⊆ e.source) : |
| 52 | closure (e '' S) ⊆ e.target := by |
| 53 | rw [← e.image_closure_eq_of_isCompact hK hsource] |
| 54 | rintro _ ⟨x, hx, rfl⟩ |
| 55 | exact e.map_source (hsource hx) |
| 56 | |
| 57 | /-- The full actual frontier is transported whenever the compact |
| 58 | closure is captured in the source, with no openness assumption on S |
| 59 | (cap transport, Proposition 9.79). -/ |
| 60 | theorem image_frontier_eq_of_isCompact [T2Space Y] |
| 61 | (hK : IsCompact (closure S)) (hsource : closure S ⊆ e.source) : |
| 62 | e '' frontier S = frontier (e '' S) := by |
| 63 | have himage := e.isImage_image_of_subset_source (subset_closure.trans hsource) |
| 64 | apply Subset.antisymm |
| 65 | · rintro _ ⟨x, hx, rfl⟩ |
| 66 | exact (himage.frontier.apply_mem_iff (hsource (frontier_subset_closure hx))).mpr hx |
| 67 | · intro y hy |
| 68 | have htarget := e.closure_image_subset_target_of_isCompact hK hsource |
| 69 | (frontier_subset_closure hy) |
| 70 | exact ⟨e.symm y, (himage.frontier.symm_apply_mem_iff htarget).mpr hy, |
| 71 | e.right_inv htarget⟩ |
| 72 | |
| 73 | end OpenPartialHomeomorph |