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.Pseudo.Lemmas |
| 2 | |
| 3 | /-! |
| 4 | # A compact-product vertical-radius lemma |
| 5 | |
| 6 | An open self-cover of a compact product has one positive radius in the metric |
| 7 | factor that works along every vertical slice. This is the compactness input |
| 8 | needed by the sampled-chord estimate; the parameter factor carries only its |
| 9 | topology. |
| 10 | |
| 11 | Morgan--Tian context: Section 19.4, Definition 19.18 and Claims 19.19-19.22, printed pp. |
| 12 | 450-453. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set Metric |
| 18 | open scoped Topology |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | /-- An open cover of a compact product has a uniform radius along its metric factor. Source: |
| 25 | Auxiliary step for MT Definition 19.18 and Claims 19.19/19.22, pp. 450-453; project |
| 26 | construction in `proof-work/tasks/M64/reports/2026-09-23-static-polygon.md`. -/ |
| 27 | theorem m64_compact_product_cover_vertical_radius |
| 28 | {X : Type u} {Y : Type v} [TopologicalSpace X] [CompactSpace X] |
| 29 | [PseudoMetricSpace Y] [CompactSpace Y] |
| 30 | (V : X × Y → Set (X × Y)) |
| 31 | (hV : ∀ w, IsOpen (V w)) (hself : ∀ w, w ∈ V w) : |
| 32 | ∃ delta : ℝ, 0 < delta ∧ ∀ w : X × Y, |
| 33 | ∃ q : X × Y, ∀ y : Y, dist y w.2 < delta → (w.1, y) ∈ V q := by |
| 34 | classical |
| 35 | have hrect (w : X × Y) : |
| 36 | ∃ U : Set X, IsOpen U ∧ w.1 ∈ U ∧ |
| 37 | ∃ r : ℝ, 0 < r ∧ U ×ˢ ball w.2 (2 * r) ⊆ V w := by |
| 38 | obtain ⟨U, W, hU, hwU, hW, hwW, hprod⟩ := |
| 39 | mem_nhds_prod_iff'.mp ((hV w).mem_nhds (hself w)) |
| 40 | obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (hW.mem_nhds hwW) |
| 41 | refine ⟨U, hU, hwU, r / 2, half_pos hr, ?_⟩ |
| 42 | have heq : 2 * (r / 2) = r := by ring |
| 43 | rw [heq] |
| 44 | exact (Set.prod_mono Subset.rfl hball).trans hprod |
| 45 | choose U hU hmem r hr hrect using hrect |
| 46 | let W : X × Y → Set (X × Y) := fun w => U w ×ˢ ball w.2 (r w) |
| 47 | have hW (w : X × Y) : IsOpen (W w) := (hU w).prod isOpen_ball |
| 48 | have hWself (w : X × Y) : w ∈ W w := ⟨hmem w, mem_ball_self (hr w)⟩ |
| 49 | obtain ⟨S, hS⟩ := isCompact_univ.elim_finite_subcover W hW |
| 50 | (fun w _ => mem_iUnion.mpr ⟨w, hWself w⟩) |
| 51 | have hmin : ∀ S : Finset (X × Y), |
| 52 | ∃ delta : ℝ, 0 < delta ∧ ∀ w ∈ S, delta ≤ r w := by |
| 53 | intro T |
| 54 | induction T using Finset.induction_on with |
| 55 | | empty => exact ⟨1, zero_lt_one, by simp⟩ |
| 56 | | @insert w T hw ih => |
| 57 | obtain ⟨delta, hdelta, hle⟩ := ih |
| 58 | refine ⟨min delta (r w), lt_min hdelta (hr w), ?_⟩ |
| 59 | intro v hv |
| 60 | rcases Finset.mem_insert.mp hv with rfl | hv |
| 61 | · exact min_le_right _ _ |
| 62 | · exact (min_le_left _ _).trans (hle v hv) |
| 63 | obtain ⟨delta, hdelta, hle⟩ := hmin S |
| 64 | refine ⟨delta, hdelta, ?_⟩ |
| 65 | intro w |
| 66 | obtain ⟨q, hqS, hwq⟩ := mem_iUnion₂.mp (hS (mem_univ w)) |
| 67 | refine ⟨q, ?_⟩ |
| 68 | intro y hy |
| 69 | apply hrect q |
| 70 | refine ⟨hwq.1, ?_⟩ |
| 71 | have hdist := dist_triangle y w.2 q.2 |
| 72 | have hnear : dist w.2 q.2 < r q := hwq.2 |
| 73 | change dist y q.2 < 2 * r q |
| 74 | linarith only [hdist, hy, hnear, hle q hqS] |
| 75 | |
| 76 | end PoincareMT |