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.HomotopyGroup.LoopSpace.Comparison.CubeBoundaryConnected |
| 2 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.CubicalPostcomposition |
| 3 | import Mathlib.Topology.Homotopy.Lifting |
| 4 | import Mathlib.Topology.Algebra.Module.LocallyConvex |
| 5 | |
| 6 | /-! |
| 7 | # Higher homotopy groups of a covering space |
| 8 | |
| 9 | Simply connected cubes lift through a covering map. In dimension at least |
| 10 | two their connected boundaries force these lifts to be based generalized |
| 11 | loops. Relative homotopy lifting proves injectivity. The resulting group |
| 12 | equivalence is the actual cubical postcomposition map. |
| 13 | Source: Hatcher, Proposition 4.1, printed p. 342; MT Claim 18.16, p. 430. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Topology unitInterval |
| 20 | |
| 21 | universe u v w |
| 22 | |
| 23 | namespace IsCoveringMap |
| 24 | |
| 25 | open PoincareMT.Proofs.M02 PoincareMT.Proofs.M59 |
| 26 | |
| 27 | variable {E : Type u} {X : Type v} {N : Type w} |
| 28 | [TopologicalSpace E] [TopologicalSpace X] {p : E → X} |
| 29 | |
| 30 | /-- Every higher generalized loop has a unique based lift at the chosen |
| 31 | fiber point. The existence assertion suffices here. Source: Hatcher, |
| 32 | Proposition 4.1, printed p. 342. -/ |
| 33 | theorem exists_genLoop_lift [Finite N] [Nontrivial N] (hp : IsCoveringMap p) |
| 34 | (e : E) (f : GenLoop N X (p e)) : |
| 35 | ∃ g : GenLoop N E e, mapGenLoop ⟨p, hp.continuous⟩ rfl g = f := by |
| 36 | let : ContractibleSpace (I^N) := Cube.contractibleSpace N |
| 37 | let : LocallyPathConnectedSpace I := (convex_Icc (0 : ℝ) 1).locallyPathConnectedSpace |
| 38 | let z : I^N := fun _ => 0 |
| 39 | have hz : z ∈ Cube.boundary N := |
| 40 | ⟨Classical.choice (inferInstance : Nonempty N), Or.inl rfl⟩ |
| 41 | obtain ⟨F, hF, _⟩ := hp.existsUnique_continuousMap_lifts f.val z e |
| 42 | (GenLoop.boundary f z hz).symm |
| 43 | have hproj (v : I^N) : p (F v) = f v := congrFun hF.2 v |
| 44 | have hboundary (v : I^N) (hv : v ∈ Cube.boundary N) : F v = e := by |
| 45 | let : PreconnectedSpace (Cube.boundary N) := |
| 46 | isPreconnected_iff_preconnectedSpace.mp |
| 47 | (Cube.isPathConnected_boundary (N := N)).isConnected.isPreconnected |
| 48 | have h := hp.const_of_comp (F.continuous.comp continuous_subtype_val) |
| 49 | (fun a b : Cube.boundary N => |
| 50 | ((hproj a).trans (GenLoop.boundary f a a.2)).trans |
| 51 | ((hproj b).trans (GenLoop.boundary f b b.2)).symm) |
| 52 | (⟨v, hv⟩ : Cube.boundary N) ⟨z, hz⟩ |
| 53 | exact h.trans hF.1 |
| 54 | refine ⟨⟨F, hboundary⟩, ?_⟩ |
| 55 | apply Subtype.ext |
| 56 | exact ContinuousMap.ext hproj |
| 57 | |
| 58 | /-- Relative homotopy lifting makes covering postcomposition injective on |
| 59 | every positive cubical homotopy group. Source: Hatcher, Proposition 4.1, |
| 60 | printed p. 342. -/ |
| 61 | theorem homotopyGroupMap_injective [Nonempty N] (hp : IsCoveringMap p) (e : E) : |
| 62 | Function.Injective (homotopyGroupMap N ⟨p, hp.continuous⟩ (rfl : p e = p e)) := by |
| 63 | intro a b |
| 64 | refine Quotient.inductionOn₂ a b ?_ |
| 65 | intro f g h |
| 66 | apply Quotient.sound |
| 67 | let z : I^N := fun _ => 0 |
| 68 | have hz : z ∈ Cube.boundary N := |
| 69 | ⟨Classical.choice (inferInstance : Nonempty N), Or.inl rfl⟩ |
| 70 | apply (hp.homotopicRel_iff_comp |
| 71 | ⟨z, hz, (GenLoop.boundary f z hz).trans (GenLoop.boundary g z hz).symm⟩).mpr |
| 72 | exact Quotient.exact h |
| 73 | |
| 74 | /-- Every higher cubical homotopy class comes from the covering space. |
| 75 | Source: Hatcher, Proposition 4.1, printed p. 342. -/ |
| 76 | theorem homotopyGroupMap_surjective [Finite N] [Nontrivial N] |
| 77 | (hp : IsCoveringMap p) (e : E) : |
| 78 | Function.Surjective (homotopyGroupMap N ⟨p, hp.continuous⟩ (rfl : p e = p e)) := by |
| 79 | intro a |
| 80 | refine Quotient.inductionOn a ?_ |
| 81 | intro f |
| 82 | obtain ⟨g, hg⟩ := hp.exists_genLoop_lift e f |
| 83 | exact ⟨⟦g⟧, congrArg (fun k => (⟦k⟧ : HomotopyGroup N X (p e))) hg⟩ |
| 84 | |
| 85 | /-- Actual covering postcomposition is an equivalence on all homotopy groups |
| 86 | of dimension at least two. Source: Hatcher, Proposition 4.1, printed p. 342. -/ |
| 87 | noncomputable def homotopyGroupEquiv [Finite N] [Nontrivial N] [DecidableEq N] |
| 88 | (hp : IsCoveringMap p) (e : E) : HomotopyGroup N E e ≃* HomotopyGroup N X (p e) := |
| 89 | MulEquiv.ofBijective (homotopyGroupMapHom ⟨p, hp.continuous⟩ rfl) |
| 90 | ⟨hp.homotopyGroupMap_injective e, hp.homotopyGroupMap_surjective e⟩ |
| 91 | |
| 92 | /-- The covering equivalence has the literal cubical postcomposition map. |
| 93 | Source: Hatcher, Proposition 4.1, printed p. 342. -/ |
| 94 | @[simp] theorem homotopyGroupEquiv_apply [Finite N] [Nontrivial N] [DecidableEq N] |
| 95 | (hp : IsCoveringMap p) (e : E) (a : HomotopyGroup N E e) : |
| 96 | hp.homotopyGroupEquiv e a = homotopyGroupMap N ⟨p, hp.continuous⟩ rfl a := rfl |
| 97 | |
| 98 | end IsCoveringMap |