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.MetricSpace.Basic |
| 2 | import Mathlib.Topology.Connected.Clopen |
| 3 | |
| 4 | /-! |
| 5 | # Finite distances in a connected extended metric space |
| 6 | |
| 7 | An infinite-radius open ball is also closed. Connectedness makes it |
| 8 | the whole space, so conversion to a metric preserves the original |
| 9 | uniformity and its completeness. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Metric |
| 15 | |
| 16 | namespace PoincareMT.ReducedVolume |
| 17 | |
| 18 | /-- Every distance in a preconnected extended metric space is finite. -/ |
| 19 | theorem edist_ne_top_of_preconnected {X : Type*} [EMetricSpace X] [PreconnectedSpace X] |
| 20 | (x y : X) : edist x y ≠ ⊤ := by |
| 21 | have hball : eball x ⊤ = (univ : Set X) := |
| 22 | IsClopen.eq_univ ⟨isClosed_eball_top, isOpen_eball⟩ ⟨x, by simp⟩ |
| 23 | have hy : y ∈ eball x ⊤ := by rw [hball]; trivial |
| 24 | exact (by simpa only [mem_eball, edist_comm] using hy : edist x y < ⊤).ne |
| 25 | |
| 26 | end PoincareMT.ReducedVolume |