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.AlgebraicTopology.FundamentalGroupoid.SimplyConnected |
| 2 | import Mathlib.Topology.Bases |
| 3 | |
| 4 | /-! |
| 5 | # Sheets of the path-class covering |
| 6 | |
| 7 | Endpoint-preserving path classes form the carrier of the universal cover. |
| 8 | Appending paths inside a simply connected neighborhood gives its local |
| 9 | sheets. This file proves the sheet algebra and injectivity of endpoint |
| 10 | projection. Source: Hatcher, Section 1.3, printed pp. 63-65; used in the |
| 11 | cover argument for MT Claim 18.16, p. 430. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped unitInterval |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | /-- A point of the path-class cover, before its topology is specified. |
| 22 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 23 | structure PathClassCover {X : Type u} [TopologicalSpace X] (x₀ : X) where |
| 24 | /-- The endpoint of the represented paths. -/ |
| 25 | endpoint : X |
| 26 | /-- The endpoint-preserving homotopy class from the fixed basepoint. -/ |
| 27 | pathClass : Path.Homotopic.Quotient x₀ endpoint |
| 28 | |
| 29 | namespace PathClassCover |
| 30 | |
| 31 | variable {X : Type u} [TopologicalSpace X] {x₀ : X} |
| 32 | |
| 33 | /-- The distinguished point represented by the constant path. |
| 34 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 35 | def basepoint (x₀ : X) : PathClassCover x₀ := |
| 36 | ⟨x₀, Path.Homotopic.Quotient.refl x₀⟩ |
| 37 | |
| 38 | /-- Appending paths in `U` to a fixed class produces a sheet over `U`. |
| 39 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 40 | def sheet (U : Set X) (a : PathClassCover x₀) : Set (PathClassCover x₀) := |
| 41 | {b | ∃ p : Path a.endpoint b.endpoint, |
| 42 | (∀ t, p t ∈ U) ∧ b.pathClass = a.pathClass.trans (.mk p)} |
| 43 | |
| 44 | /-- Every point in a sheet projects into its defining neighborhood. |
| 45 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 46 | theorem endpoint_mem_of_mem_sheet {U : Set X} {a b : PathClassCover x₀} |
| 47 | (hb : b ∈ sheet U a) : b.endpoint ∈ U := by |
| 48 | obtain ⟨p, hp, _⟩ := hb |
| 49 | simpa using hp 1 |
| 50 | |
| 51 | /-- A sheet center lies over the neighborhood whenever its sheet is inhabited. |
| 52 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 53 | theorem center_mem_of_mem_sheet {U : Set X} {a b : PathClassCover x₀} |
| 54 | (hb : b ∈ sheet U a) : a.endpoint ∈ U := by |
| 55 | obtain ⟨p, hp, _⟩ := hb |
| 56 | simpa using hp 0 |
| 57 | |
| 58 | /-- A class belongs to its own sheet over any neighborhood of its endpoint. |
| 59 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 60 | theorem mem_sheet_self {U : Set X} (a : PathClassCover x₀) |
| 61 | (ha : a.endpoint ∈ U) : a ∈ sheet U a := by |
| 62 | exact ⟨Path.refl a.endpoint, by simpa using fun _ : I => ha, by simp⟩ |
| 63 | |
| 64 | /-- Reversing the appended path exchanges two sheet centers. |
| 65 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 66 | theorem mem_sheet_symm {U : Set X} {a b : PathClassCover x₀} |
| 67 | (hb : b ∈ sheet U a) : a ∈ sheet U b := by |
| 68 | obtain ⟨p, hp, he⟩ := hb |
| 69 | refine ⟨p.symm, fun t => hp (unitInterval.symm t), ?_⟩ |
| 70 | simp [he] |
| 71 | |
| 72 | /-- Concatenating two paths within a neighborhood preserves sheet membership. |
| 73 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 74 | theorem mem_sheet_trans {U : Set X} {a b c : PathClassCover x₀} |
| 75 | (hb : b ∈ sheet U a) (hc : c ∈ sheet U b) : c ∈ sheet U a := by |
| 76 | obtain ⟨p, hp, he⟩ := hb |
| 77 | obtain ⟨q, hq, hf⟩ := hc |
| 78 | refine ⟨p.trans q, ?_, ?_⟩ |
| 79 | · intro t |
| 80 | have ht : (p.trans q) t ∈ Set.range p ∪ Set.range q := by |
| 81 | rw [← Path.trans_range] |
| 82 | exact Set.mem_range_self t |
| 83 | rcases ht with ⟨s, hs⟩ | ⟨s, hs⟩ |
| 84 | · exact hs ▸ hp s |
| 85 | · exact hs ▸ hq s |
| 86 | · simp [hf, he] |
| 87 | |
| 88 | /-- Any point in a sheet can serve as its center. |
| 89 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 90 | theorem sheet_eq_of_mem {U : Set X} {a b : PathClassCover x₀} |
| 91 | (hb : b ∈ sheet U a) : sheet U b = sheet U a := by |
| 92 | ext c |
| 93 | exact ⟨mem_sheet_trans hb, mem_sheet_trans (mem_sheet_symm hb)⟩ |
| 94 | |
| 95 | /-- Shrinking the neighborhood shrinks every sheet with fixed center. |
| 96 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 97 | theorem sheet_mono {U V : Set X} (hUV : U ⊆ V) (a : PathClassCover x₀) : |
| 98 | sheet U a ⊆ sheet V a := by |
| 99 | rintro b ⟨p, hp, he⟩ |
| 100 | exact ⟨p, fun t => hUV (hp t), he⟩ |
| 101 | |
| 102 | /-- Paths lying in one simply connected set are homotopic in the ambient |
| 103 | space. Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 104 | theorem paths_homotopic_in_simplyConnected {U : Set X} (hU : IsSimplyConnected U) |
| 105 | {x y : X} (p q : Path x y) (hp : ∀ t, p t ∈ U) (hq : ∀ t, q t ∈ U) : |
| 106 | p.Homotopic q := by |
| 107 | let : SimplyConnectedSpace U := hU |
| 108 | have hx : x ∈ U := by simpa using hp 0 |
| 109 | have hy : y ∈ U := by simpa using hp 1 |
| 110 | let p' : Path (⟨x, hx⟩ : U) ⟨y, hy⟩ := |
| 111 | { toFun := fun t => ⟨p t, hp t⟩ |
| 112 | continuous_toFun := p.continuous.subtype_mk _ |
| 113 | source' := Subtype.ext p.source |
| 114 | target' := Subtype.ext p.target } |
| 115 | let q' : Path (⟨x, hx⟩ : U) ⟨y, hy⟩ := |
| 116 | { toFun := fun t => ⟨q t, hq t⟩ |
| 117 | continuous_toFun := q.continuous.subtype_mk _ |
| 118 | source' := Subtype.ext q.source |
| 119 | target' := Subtype.ext q.target } |
| 120 | exact (SimplyConnectedSpace.paths_homotopic p' q').map |
| 121 | ⟨Subtype.val, continuous_subtype_val⟩ |
| 122 | |
| 123 | /-- Endpoint projection is injective on a simply connected sheet. |
| 124 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 125 | theorem endpoint_injOn_sheet {U : Set X} (hU : IsSimplyConnected U) |
| 126 | (a : PathClassCover x₀) : (sheet U a).InjOn endpoint := by |
| 127 | rintro ⟨x, b⟩ hb ⟨y, c⟩ hc hxy |
| 128 | change x = y at hxy |
| 129 | subst y |
| 130 | obtain ⟨p, hp, he⟩ := hb |
| 131 | obtain ⟨q, hq, hf⟩ := hc |
| 132 | have hpq : Path.Homotopic.Quotient.mk p = .mk q := |
| 133 | Path.Homotopic.Quotient.eq.mpr (paths_homotopic_in_simplyConnected hU p q hp hq) |
| 134 | have hbc : b = c := he.trans ((congrArg a.pathClass.trans hpq).trans hf.symm) |
| 135 | exact congrArg (fun k => PathClassCover.mk x k) hbc |
| 136 | |
| 137 | /-- A sheet over a path connected set projects onto that set. |
| 138 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 139 | theorem endpoint_surjOn_sheet {U : Set X} (hU : IsPathConnected U) |
| 140 | (a : PathClassCover x₀) (ha : a.endpoint ∈ U) : |
| 141 | (sheet U a).SurjOn endpoint U := by |
| 142 | intro y hy |
| 143 | obtain ⟨p, hp⟩ := hU.joinedIn a.endpoint ha y hy |
| 144 | exact ⟨⟨y, a.pathClass.trans (.mk p)⟩, ⟨p, hp, rfl⟩, rfl⟩ |
| 145 | |
| 146 | /-- The image of a nonempty simply connected sheet is exactly its neighborhood. |
| 147 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 148 | theorem image_sheet {U : Set X} (hU : IsPathConnected U) |
| 149 | (a : PathClassCover x₀) (ha : a.endpoint ∈ U) : endpoint '' sheet U a = U := |
| 150 | Set.Subset.antisymm (by rintro _ ⟨b, hb, rfl⟩; exact endpoint_mem_of_mem_sheet hb) |
| 151 | (endpoint_surjOn_sheet hU a ha) |
| 152 | |
| 153 | end PathClassCover |