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 PoincareLib.AlgebraicTopology.FundamentalGroup.PathMaps |
| 2 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.PathClassTopology |
| 3 | |
| 4 | /-! |
| 5 | # Functorial maps of path-class covers |
| 6 | |
| 7 | Continuous maps act on path classes and continuously on their sheet |
| 8 | topologies. If the base is already simply connected, endpoint projection |
| 9 | is a homeomorphism. These facts give the explicit path lifts in the |
| 10 | universal-cover construction. Source: Hatcher, Section 1.3, printed |
| 11 | pp. 63-65; used for MT Claim 18.16, p. 430. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set TopologicalSpace |
| 17 | |
| 18 | universe u v |
| 19 | |
| 20 | namespace PathClassCover |
| 21 | |
| 22 | variable {X : Type u} {Y : Type v} [TopologicalSpace X] [TopologicalSpace Y] |
| 23 | {x₀ : X} |
| 24 | |
| 25 | /-- Postcompose the represented path by a continuous map. |
| 26 | Source: Hatcher, Section 1.3, printed pp. 63-65. -/ |
| 27 | def map (f : C(X, Y)) (a : PathClassCover x₀) : PathClassCover (f x₀) := |
| 28 | ⟨f a.endpoint, a.pathClass.map f⟩ |
| 29 | |
| 30 | /-- The map of path-class spaces preserves their distinguished points. |
| 31 | Source: Hatcher, Section 1.3, printed pp. 63-65. -/ |
| 32 | @[simp] theorem map_basepoint (f : C(X, Y)) : map f (basepoint x₀) = basepoint (f x₀) := rfl |
| 33 | |
| 34 | /-- A sheet whose neighborhood maps into `V` maps into the corresponding |
| 35 | sheet over `V`. Source: Hatcher, Section 1.3, printed pp. 63-65. -/ |
| 36 | theorem map_mem_sheet (f : C(X, Y)) {U : Set X} {V : Set Y} |
| 37 | (hUV : U ⊆ f ⁻¹' V) {a b : PathClassCover x₀} (hb : b ∈ sheet U a) : |
| 38 | map f b ∈ sheet V (map f a) := by |
| 39 | obtain ⟨p, hp, he⟩ := hb |
| 40 | refine ⟨p.map f.continuous, fun t => hUV (hp t), ?_⟩ |
| 41 | change b.pathClass.map f = (a.pathClass.map f).trans (.mk (p.map f.continuous)) |
| 42 | rw [he, Path.Homotopic.Quotient.map_trans] |
| 43 | rfl |
| 44 | |
| 45 | /-- Postcomposition is continuous in the path-class sheet topologies. |
| 46 | Source: Hatcher, Section 1.3, printed pp. 63-65. -/ |
| 47 | theorem continuous_map [LocallySimplyConnectedSpace X] (f : C(X, Y)) : |
| 48 | Continuous (map (x₀ := x₀) f) := by |
| 49 | apply continuous_generateFrom_iff.mpr |
| 50 | rintro _ ⟨V, b, hV, hscV, hb, rfl⟩ |
| 51 | apply (isTopologicalBasis x₀).isOpen_iff.mpr |
| 52 | intro a ha |
| 53 | have hfa : map f a ∈ sheet V b := ha |
| 54 | obtain ⟨U, hU, hscU, haU, hUV⟩ := |
| 55 | LocallySimplyConnectedSpace.exists_open_simplyConnected a.endpoint (f ⁻¹' V) |
| 56 | (by change f a.endpoint ∈ V; exact endpoint_mem_of_mem_sheet hfa) |
| 57 | (hV.preimage f.continuous) |
| 58 | refine ⟨sheet U a, ⟨U, a, hU, hscU, haU, rfl⟩, mem_sheet_self a haU, ?_⟩ |
| 59 | intro c hc |
| 60 | change map f c ∈ sheet V b |
| 61 | rw [← sheet_eq_of_mem ha] |
| 62 | exact map_mem_sheet f hUV hc |
| 63 | |
| 64 | /-- Every point of a path connected base is reached by endpoint projection. |
| 65 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 66 | theorem endpoint_surjective [PathConnectedSpace X] (x₀ : X) : |
| 67 | Function.Surjective (endpoint : PathClassCover x₀ → X) := |
| 68 | fun x => ⟨⟨x, .mk (PathConnectedSpace.somePath x₀ x)⟩, rfl⟩ |
| 69 | |
| 70 | /-- A simply connected base has just one path class over each endpoint. |
| 71 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 72 | theorem endpoint_injective [SimplyConnectedSpace X] (x₀ : X) : |
| 73 | Function.Injective (endpoint : PathClassCover x₀ → X) := by |
| 74 | rintro ⟨x, a⟩ ⟨y, b⟩ h |
| 75 | change x = y at h |
| 76 | subst y |
| 77 | exact congrArg (fun k => PathClassCover.mk x k) (Subsingleton.elim a b) |
| 78 | |
| 79 | /-- Endpoint projection is a homeomorphism when the base is already simply |
| 80 | connected. Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 81 | noncomputable def endpointHomeomorph [LocallySimplyConnectedSpace X] [SimplyConnectedSpace X] |
| 82 | (x₀ : X) : PathClassCover x₀ ≃ₜ X := |
| 83 | Equiv.toHomeomorphOfContinuousOpen |
| 84 | (Equiv.ofBijective endpoint ⟨endpoint_injective x₀, endpoint_surjective x₀⟩) |
| 85 | (continuous_endpoint x₀) (isOpenMap_endpoint x₀) |
| 86 | |
| 87 | /-- The endpoint homeomorphism has the literal endpoint projection as its map. |
| 88 | Source: Hatcher, Section 1.3, printed p. 64. -/ |
| 89 | @[simp] theorem endpointHomeomorph_apply [LocallySimplyConnectedSpace X] [SimplyConnectedSpace X] |
| 90 | (x₀ : X) (a : PathClassCover x₀) : endpointHomeomorph x₀ a = a.endpoint := rfl |
| 91 | |
| 92 | end PathClassCover |