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 PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.GeometryImports |
| 2 | import Mathlib.Topology.MetricSpace.Completion |
| 3 | import Mathlib.Tactic.Linarith |
| 4 | |
| 5 | /-! |
| 6 | # Missing completion points stay outside precompact balls |
| 7 | |
| 8 | Compact local balls give a quantitative lower bound for the distance to |
| 9 | a completion point outside the original space. No completeness of the |
| 10 | original space is used. Source: M28 derivation 155. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open Set |
| 16 | |
| 17 | namespace UniformSpace.Completion |
| 18 | |
| 19 | /-- A completion point outside the original metric space has distance |
| 20 | at least the radius of any ball with compact closure. Derivation 155. -/ |
| 21 | theorem radius_le_dist_of_precompact_ball |
| 22 | {Y : Type*} [MetricSpace Y] (E : Completion Y) |
| 23 | (houtside : E ∉ range ((↑) : Y → Completion Y)) |
| 24 | (x : Y) {rho : ℝ} (hcompact : IsCompact (closure (Metric.ball x rho))) : |
| 25 | rho ≤ dist (x : Completion Y) E := by |
| 26 | apply le_of_not_gt |
| 27 | intro hsmall |
| 28 | let K : Set (Completion Y) := |
| 29 | ((↑) : Y → Completion Y) '' closure (Metric.ball x rho) |
| 30 | have hK : IsCompact K := hcompact.image (continuous_coe Y) |
| 31 | have hEK : E ∈ K := by |
| 32 | rw [← hK.isClosed.closure_eq] |
| 33 | rw [Metric.mem_closure_iff] |
| 34 | intro epsilon hepsilon |
| 35 | obtain ⟨q, hq⟩ := denseRange_coe.exists_dist_lt E |
| 36 | (lt_min hepsilon (sub_pos.mpr hsmall)) |
| 37 | have hqball : q ∈ Metric.ball x rho := by |
| 38 | have htriangle := dist_triangle (x : Completion Y) E (q : Completion Y) |
| 39 | rw [Completion.dist_eq] at htriangle |
| 40 | have hclose := hq.trans_le (min_le_right _ _) |
| 41 | rw [Metric.mem_ball, dist_comm] |
| 42 | linarith only [htriangle, hclose] |
| 43 | exact ⟨(q : Completion Y), ⟨q, subset_closure hqball, rfl⟩, |
| 44 | hq.trans_le (min_le_left _ _)⟩ |
| 45 | obtain ⟨q, _hq, hqE⟩ := hEK |
| 46 | exact houtside ⟨q, hqE⟩ |
| 47 | |
| 48 | end UniformSpace.Completion |