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 extended distance on a preconnected space |
| 6 | |
| 7 | The smoothing stage in Claim 18.22, Morgan-Tian p. 433, uses the real |
| 8 | distance of each selected component's actual Riemannian metric. Finite |
| 9 | distance follows from preconnectedness: every finite-distance class is |
| 10 | a nonempty clopen extended ball. The existing Mathlib metric conversion |
| 11 | can therefore be used without changing the edist or manifold topology. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | |
| 18 | namespace PoincareMT.SurgeryComparison.Transport |
| 19 | |
| 20 | /-- Every pair in a preconnected pseudo-emetric space has finite distance. |
| 21 | This supplies the compatible real metric in the quantitative smoothing |
| 22 | step of Claim 18.22, Morgan-Tian p. 433. -/ |
| 23 | theorem edist_ne_top_of_preconnected {X : Type*} [PseudoEMetricSpace X] |
| 24 | [PreconnectedSpace X] (x y : X) : edist x y ≠ ⊤ := by |
| 25 | have hc : IsClopen (Metric.eball y ⊤) := |
| 26 | ⟨Metric.isClosed_eball_top, Metric.isOpen_eball⟩ |
| 27 | have hu : Metric.eball y ⊤ = Set.univ := |
| 28 | hc.eq_univ ⟨y, Metric.mem_eball_self (by simp)⟩ |
| 29 | have hx : x ∈ Metric.eball y ⊤ := by rw [hu]; exact mem_univ x |
| 30 | exact ne_of_lt hx |
| 31 | |
| 32 | end PoincareMT.SurgeryComparison.Transport |