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.Topology.MetricSpace.GromovHausdorff.Pointed.Distance |
| 2 | |
| 3 | /-! |
| 4 | # Approximating configurations in pointed metric limits |
| 5 | |
| 6 | Points in a bounded pointed Gromov--Hausdorff limit admit simultaneous |
| 7 | approximations with converging pairwise distances. This is the metric input |
| 8 | to stability of the Alexandrov four-point condition. |
| 9 | -/ |
| 10 | |
| 11 | noncomputable section |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter Topology |
| 15 | open Poincare.GromovHausdorff |
| 16 | |
| 17 | namespace Poincare.Alexandrov |
| 18 | |
| 19 | /-- All the points of a bounded pointed limit can be approximated in the |
| 20 | source spaces, with convergence of each pairwise distance. -/ |
| 21 | theorem exists_approximating_maps_of_pointedGHConverges |
| 22 | {X : ℕ → FiniteDiameterBasedMetricSpace} {Y : FiniteDiameterBasedMetricSpace} |
| 23 | (h : PointedGHConverges X Y) : |
| 24 | ∃ f : ∀ j, Y.carrier → (X j).carrier, |
| 25 | ∀ x y, Tendsto (fun j => dist (f j x) (f j y)) atTop (𝓝 (dist x y)) := by |
| 26 | classical |
| 27 | let ε : ℕ → ℝ := fun j => 1 / ((j : ℝ) + 1) |
| 28 | have hε (j : ℕ) : 0 < ε j := by dsimp [ε]; positivity |
| 29 | choose R hR using fun j => exists_pointedGHRealization_lt_add (X j) Y (hε j) |
| 30 | choose f hf using fun j y => |
| 31 | exists_left_point_lt_of_pointedHausdorffDist_lt (R j) (hR j) y |
| 32 | refine ⟨f, fun x y => ?_⟩ |
| 33 | rw [tendsto_iff_dist_tendsto_zero] |
| 34 | have hδ : Tendsto (fun j => pointedGHDistance (X j) Y + ε j) atTop (𝓝 0) := by |
| 35 | simpa only [add_zero] using h.2.add |
| 36 | (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) |
| 37 | apply squeeze_zero (fun _ => dist_nonneg) (fun j => ?_) |
| 38 | (show Tendsto (fun j => 2 * (pointedGHDistance (X j) Y + ε j)) atTop (𝓝 0) by |
| 39 | simpa using hδ.const_mul 2) |
| 40 | rw [← (R j).left_isometry.dist_eq, ← (R j).right_isometry.dist_eq] |
| 41 | exact (dist_dist_dist_le _ _ _ _).trans (by linarith [hf j x, hf j y]) |
| 42 | |
| 43 | /-- A finite configuration of distinct limiting points has distinct source |
| 44 | approximants eventually. -/ |
| 45 | theorem eventually_injective_of_tendsto_dist |
| 46 | {ι : Type*} [Finite ι] {X : ℕ → Type*} [∀ j, MetricSpace (X j)] |
| 47 | {Y : Type*} [MetricSpace Y] {q : ι → Y} {f : ∀ j, ι → X j} |
| 48 | (hq : Function.Injective q) |
| 49 | (hf : ∀ a b, Tendsto (fun j => dist (f j a) (f j b)) atTop (𝓝 (dist (q a) (q b)))) : |
| 50 | ∀ᶠ j in atTop, Function.Injective (f j) := by |
| 51 | have hpair (a b : ι) : ∀ᶠ j in atTop, f j a = f j b → a = b := by |
| 52 | by_cases hab : a = b |
| 53 | · exact Filter.Eventually.of_forall (fun _ _ => hab) |
| 54 | · have hpos : 0 < dist (q a) (q b) := dist_pos.mpr (hq.ne hab) |
| 55 | filter_upwards [(hf a b).eventually_const_lt hpos] with j hj heq |
| 56 | simp [heq] at hj |
| 57 | simpa only [Function.Injective, Filter.eventually_all] using |
| 58 | (Filter.eventually_all.mpr fun a => Filter.eventually_all.mpr (hpair a)) |
| 59 | |
| 60 | end Poincare.Alexandrov |