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.Compactness.Compact |
| 2 | import Mathlib.Topology.MetricSpace.Basic |
| 3 | |
| 4 | /-! |
| 5 | # Uniform open neighborhoods for compact parameter families |
| 6 | |
| 7 | An open condition on a continuous compact family persists on one metric |
| 8 | neighborhood of its parameter. MT2007 Claim 19.1, p. 437; |
| 9 | `2026-09-21-compact-parameter-neighborhood.md`. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set Filter |
| 15 | open scoped Topology |
| 16 | |
| 17 | namespace PoincareMT.M63 |
| 18 | |
| 19 | /-- A compact family in an open set remains there on one positive |
| 20 | metric neighborhood of its parameter. MT2007 Claim 19.1, p. 437; |
| 21 | compact parameter neighborhood derivation. No separation or |
| 22 | nonemptiness hypothesis on the compact parameter space is needed. -/ |
| 23 | theorem exists_uniform_open_parameter_radius |
| 24 | {X K Y : Type*} [MetricSpace X] [TopologicalSpace K] [CompactSpace K] |
| 25 | [TopologicalSpace Y] {f : X × K → Y} (hf : Continuous f) |
| 26 | {O : Set Y} (hO : IsOpen O) {x0 : X} (hx0 : ∀ y : K, f (x0, y) ∈ O) : |
| 27 | ∃ eps : ℝ, 0 < eps ∧ ∀ x : X, dist x x0 < eps → ∀ y : K, f (x, y) ∈ O := by |
| 28 | have hnear : ∀ᶠ x in 𝓝 x0, ∀ y ∈ (univ : Set K), f (x, y) ∈ O := |
| 29 | isCompact_univ.eventually_forall_of_forall_eventually |
| 30 | (fun y _ => hf.continuousAt.eventually (hO.mem_nhds (hx0 y))) |
| 31 | obtain ⟨eps, heps, hball⟩ := Metric.mem_nhds_iff.mp hnear |
| 32 | exact ⟨eps, heps, fun x hx y => hball hx y (mem_univ _)⟩ |
| 33 | |
| 34 | end PoincareMT.M63 |