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.Covering.Basic |
| 2 | import Mathlib.Topology.Compactness.Compact |
| 3 | import Mathlib.Topology.Separation.Hausdorff |
| 4 | |
| 5 | /-! |
| 6 | # Geometric separation for the compact deck calculation |
| 7 | |
| 8 | Uniqueness of covering lifts makes a deck map fixing one point the identity. |
| 9 | A fixed-point-free continuous map on a compact Hausdorff space admits a |
| 10 | finite open cover in which each member is disjoint from its image. This |
| 11 | keeps the fixed-point hypothesis on the actual carrier, as required in the |
| 12 | Lefschetz argument of Hatcher, Theorem 2C.3, printed pp. 179-181, and the |
| 13 | compact-cover branch of MT Claim 18.16, p. 430. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace IsCoveringMap |
| 23 | |
| 24 | variable {E : Type u} {X : Type v} [TopologicalSpace E] [TopologicalSpace X] |
| 25 | {p : E → X} |
| 26 | |
| 27 | /-- A deck map fixing a point is the identity on a preconnected covering |
| 28 | space. Source: Hatcher, Proposition 1.34, printed p. 62. -/ |
| 29 | theorem deck_eq_id_of_fixed [PreconnectedSpace E] (hp : IsCoveringMap p) |
| 30 | (d : C(E, E)) (hd : p ∘ d = p) (x : E) (hx : d x = x) : |
| 31 | d = ContinuousMap.id E := by |
| 32 | apply ContinuousMap.ext |
| 33 | exact congrFun (hp.eq_of_comp_eq d.continuous continuous_id hd x hx) |
| 34 | |
| 35 | /-- Every nonidentity deck map on a preconnected covering space is |
| 36 | fixed-point-free. Source: Hatcher, Proposition 1.34, printed p. 62. -/ |
| 37 | theorem deck_fixedPointFree_of_ne_id [PreconnectedSpace E] (hp : IsCoveringMap p) |
| 38 | (d : C(E, E)) (hd : p ∘ d = p) (hne : d ≠ ContinuousMap.id E) : |
| 39 | ∀ x, d x ≠ x := |
| 40 | fun x hx => hne (hp.deck_eq_id_of_fixed d hd x hx) |
| 41 | |
| 42 | end IsCoveringMap |
| 43 | |
| 44 | namespace ContinuousMap |
| 45 | |
| 46 | /-- Each point of a fixed-point-free map has an open neighborhood disjoint |
| 47 | from its image. Source: Hatcher, Theorem 2C.3, printed pp. 179-181. -/ |
| 48 | theorem exists_open_disjoint_image_of_fixedPointFree |
| 49 | {X : Type u} [TopologicalSpace X] [T2Space X] |
| 50 | (f : C(X, X)) (hfree : ∀ x, f x ≠ x) (x : X) : |
| 51 | ∃ U : Set X, IsOpen U ∧ x ∈ U ∧ Disjoint U (f '' U) := by |
| 52 | obtain ⟨U, V, hU, hV, hxU, hfxV, hUV⟩ := t2_separation (hfree x).symm |
| 53 | refine ⟨U ∩ f ⁻¹' V, hU.inter (hV.preimage f.continuous), ⟨hxU, hfxV⟩, ?_⟩ |
| 54 | apply hUV.mono inter_subset_left |
| 55 | rintro _ ⟨z, hz, rfl⟩ |
| 56 | exact hz.2 |
| 57 | |
| 58 | /-- A compact Hausdorff carrier has a finite open cover with each member |
| 59 | disjoint from its image under a fixed-point-free map. |
| 60 | Source: Hatcher, Theorem 2C.3, printed pp. 179-181. -/ |
| 61 | theorem exists_finite_open_cover_disjoint_image_of_fixedPointFree |
| 62 | {X : Type u} [TopologicalSpace X] [T2Space X] [CompactSpace X] |
| 63 | (f : C(X, X)) (hfree : ∀ x, f x ≠ x) : |
| 64 | ∃ (S : Finset X) (U : X → Set X), |
| 65 | (∀ x, IsOpen (U x)) ∧ (∀ x, Disjoint (U x) (f '' U x)) ∧ |
| 66 | (univ : Set X) ⊆ ⋃ x ∈ S, U x := by |
| 67 | classical |
| 68 | choose U hU hxU hdis using f.exists_open_disjoint_image_of_fixedPointFree hfree |
| 69 | obtain ⟨S, hS⟩ := isCompact_univ.elim_finite_subcover U hU |
| 70 | (fun x _ => mem_iUnion.mpr ⟨x, hxU x⟩) |
| 71 | exact ⟨S, U, hU, hdis, hS⟩ |
| 72 | |
| 73 | end ContinuousMap |