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.Geometry.Manifold.ChartedSpace |
| 2 | |
| 3 | /-! # Connected components as open submanifolds -/ |
| 4 | |
| 5 | set_option autoImplicit false |
| 6 | |
| 7 | namespace Poincare |
| 8 | |
| 9 | variable (H : Type*) [TopologicalSpace H] [LocallyConnectedSpace H] |
| 10 | {M : Type*} [TopologicalSpace M] [ChartedSpace H M] |
| 11 | |
| 12 | /-- A connected component of a locally connected manifold, as an open domain. -/ |
| 13 | def connectedComponentOpens (p : M) : TopologicalSpace.Opens M := by |
| 14 | let : LocallyConnectedSpace M := ChartedSpace.locallyConnectedSpace H M |
| 15 | exact ⟨connectedComponent p, isOpen_connectedComponent⟩ |
| 16 | |
| 17 | @[simp] theorem coe_connectedComponentOpens (p : M) : |
| 18 | (connectedComponentOpens H p : Set M) = connectedComponent p := rfl |
| 19 | |
| 20 | instance connectedComponentOpens_connectedSpace (p : M) : |
| 21 | ConnectedSpace (connectedComponentOpens H p) := |
| 22 | Subtype.connectedSpace isConnected_connectedComponent |
| 23 | |
| 24 | end Poincare |