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.CircleFreeClasses |
| 2 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.LoopTranspose |
| 3 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.CubicalPostcomposition |
| 4 | |
| 5 | /-! |
| 6 | # Based and free continuous loop homotopy groups |
| 7 | |
| 8 | If pi_n(X,x) vanishes and n is positive, the inclusion of based loops into |
| 9 | free circle maps induces an isomorphism on pi_n. Transposition reduces the |
| 10 | claim to free loops in the path-connected space of based n-cubes; its |
| 11 | fundamental group is abelian. Source: Hatcher 4.1 and 4A.2; MT Claim 18.16. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped Topology unitInterval |
| 17 | |
| 18 | noncomputable section |
| 19 | |
| 20 | namespace PoincareMT.Proofs.M59.CubeBoundaryQuotient |
| 21 | |
| 22 | open PoincareMT.Proofs.M02 |
| 23 | |
| 24 | variable {N S X : Type*} [DecidableEq N] [Nonempty N] |
| 25 | [TopologicalSpace S] [T2Space S] [LocallyCompactSpace S] [TopologicalSpace X] |
| 26 | (q : CubeBoundaryQuotient (Fin 1) S) (x : X) |
| 27 | |
| 28 | omit [DecidableEq N] [Nonempty N] in |
| 29 | /-- Transposing the inclusion of based circle maps descends the cube with |
| 30 | its two coordinate sets interchanged. Source: MT Claim 18.16, p. 430. -/ |
| 31 | theorem transpose_map_descend |
| 32 | (F : GenLoop N (GenLoop (Fin 1) X x) GenLoop.const) : |
| 33 | GenLoop.transpose (mapGenLoop q.descendMap q.descend_const F) = |
| 34 | q.descend (GenLoop.swapNested F) := by |
| 35 | ext z v |
| 36 | obtain ⟨w, rfl⟩ := q.surjective z |
| 37 | change q.descend (F v) (q.map w) = q.descend (GenLoop.swapNested F) (q.map w) v |
| 38 | rw [q.descend_map, q.descend_map] |
| 39 | rfl |
| 40 | |
| 41 | omit [DecidableEq N] in |
| 42 | /-- Based-loop inclusion is injective on every positive cubical homotopy |
| 43 | group. Source: Hatcher 4A.2, p. 422, and cubical adjunction. -/ |
| 44 | theorem homotopyGroupMap_descend_injective : |
| 45 | Function.Injective (homotopyGroupMap N q.descendMap |
| 46 | (q.descend_const (x := x))) := by |
| 47 | intro a b |
| 48 | refine Quotient.inductionOn₂ a b ?_ |
| 49 | intro F G h |
| 50 | have hFG : GenLoop.Homotopic (mapGenLoop q.descendMap q.descend_const F) |
| 51 | (mapGenLoop q.descendMap q.descend_const G) := Quotient.exact h |
| 52 | have ht := GenLoop.transpose_homotopic hFG |
| 53 | rw [q.transpose_map_descend x, q.transpose_map_descend x] at ht |
| 54 | have hs := q.homotopic_of_descend_homotopic |
| 55 | (HomotopyGroup.fundamentalGroup_genLoop_mul_comm x) ht |
| 56 | have hh : GenLoop.Homotopic F G := by |
| 57 | simpa only [GenLoop.swapNested_swapNested] using GenLoop.swapNested_homotopic hs |
| 58 | exact Quotient.sound hh |
| 59 | |
| 60 | omit [DecidableEq N] [Nonempty N] in |
| 61 | /-- Vanishing pi_n makes based-loop inclusion surjective on pi_n. |
| 62 | Source: Hatcher 4.1, pp. 341-342, and MT Claim 18.16, p. 430. -/ |
| 63 | theorem homotopyGroupMap_descend_surjective |
| 64 | (hpi : Subsingleton (HomotopyGroup N X x)) : |
| 65 | Function.Surjective (homotopyGroupMap N q.descendMap |
| 66 | (q.descend_const (x := x))) := by |
| 67 | let : PathConnectedSpace (GenLoop N X x) := GenLoop.pathConnectedSpace_of_subsingleton hpi |
| 68 | intro a |
| 69 | refine Quotient.inductionOn a ?_ |
| 70 | intro F |
| 71 | obtain ⟨b, hb⟩ := q.exists_based_descend (GenLoop.transpose F) |
| 72 | (PathConnectedSpace.somePath _ GenLoop.const) |
| 73 | let G := GenLoop.swapNested b |
| 74 | have ht : (GenLoop.transpose F).Homotopic |
| 75 | (GenLoop.transpose (mapGenLoop q.descendMap q.descend_const G)) := by |
| 76 | rw [q.transpose_map_descend x, GenLoop.swapNested_swapNested] |
| 77 | exact hb |
| 78 | exact ⟨⟦G⟧, Quotient.sound (GenLoop.homotopic_iff_transpose_homotopic.mpr ht).symm⟩ |
| 79 | |
| 80 | /-- Actual based-loop inclusion induces the continuous loop comparison |
| 81 | when pi_n vanishes. Source: MT Claim 18.16, p. 430. -/ |
| 82 | def continuousLoopEquiv (hpi : Subsingleton (HomotopyGroup N X x)) : |
| 83 | HomotopyGroup N (GenLoop (Fin 1) X x) GenLoop.const ≃* |
| 84 | HomotopyGroup N C(S, X) (ContinuousMap.const S x) := |
| 85 | MulEquiv.ofBijective (homotopyGroupMapHom (N := N) q.descendMap q.descend_const) |
| 86 | ⟨q.homotopyGroupMap_descend_injective x, q.homotopyGroupMap_descend_surjective x hpi⟩ |
| 87 | |
| 88 | end PoincareMT.Proofs.M59.CubeBoundaryQuotient |