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.Instances.Real.Lemmas |
| 3 | |
| 4 | /-! |
| 5 | # Combining the actual compact time neighborhoods |
| 6 | |
| 7 | Proposition 16.21, pp. 384-387. Compactness of the physical time |
| 8 | interval combines uniform local cages into one compact spacetime cage. |
| 9 | The local sets may depend on the flow and the selected test. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | open Set |
| 15 | |
| 16 | universe u |
| 17 | |
| 18 | namespace PoincareMT.Proofs.M46 |
| 19 | |
| 20 | /-- A family whose clock lies in a compact interval is contained in |
| 21 | one compact set whenever each clock has a uniform compact local cage. |
| 22 | Source: Proposition 16.21, pp. 384-387. -/ |
| 23 | theorem exists_compact_of_local_time_cages |
| 24 | {X : Type u} [TopologicalSpace X] {clock : X → ℝ} {Z : Set X} |
| 25 | {a b : ℝ} (hclock : MapsTo clock Z (Icc a b)) |
| 26 | (hlocal : ∀ t ∈ Icc a b, ∃ N : Set X, IsCompact N ∧ |
| 27 | ∃ delta : ℝ, 0 < delta ∧ ∀ z ∈ Z, |clock z - t| < delta → z ∈ N) : |
| 28 | ∃ K : Set X, IsCompact K ∧ Z ⊆ K := by |
| 29 | classical |
| 30 | choose N hN delta hdelta hcapture using (fun t : Icc a b => hlocal t.val t.property) |
| 31 | let U (t : Icc a b) : Set ℝ := Ioo (t.val - delta t) (t.val + delta t) |
| 32 | obtain ⟨cover, hcover⟩ := isCompact_Icc.elim_finite_subcover U |
| 33 | (fun _ => isOpen_Ioo) (by |
| 34 | intro t ht |
| 35 | apply mem_iUnion.mpr |
| 36 | refine ⟨⟨t, ht⟩, ?_⟩ |
| 37 | constructor <;> linarith [hdelta ⟨t, ht⟩]) |
| 38 | refine ⟨⋃ t ∈ cover, N t, cover.isCompact_biUnion (fun t _ => hN t), ?_⟩ |
| 39 | intro z hz |
| 40 | obtain ⟨t, ht, htime⟩ := mem_iUnion₂.mp (hcover (hclock hz)) |
| 41 | apply mem_iUnion₂.mpr |
| 42 | refine ⟨t, ht, hcapture t z hz ?_⟩ |
| 43 | exact abs_lt.mpr ⟨by linarith [htime.1], by linarith [htime.2]⟩ |
| 44 | |
| 45 | end PoincareMT.Proofs.M46 |