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.ContinuousLoopComparison |
| 2 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.CubicalMapNaturality |
| 3 | |
| 4 | /-! |
| 5 | # Natural continuous-loop comparison in every positive dimension |
| 6 | |
| 7 | Combine actual based-loop inclusion with cubical adjunction and the fixed |
| 8 | coordinate reindexing. This is uniform in the target space and commutes |
| 9 | with every continuous postcomposition map. |
| 10 | Source: Hatcher, Section 4.1, printed pp. 340-342; MT Claim 18.16, p. 430. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Topology unitInterval |
| 16 | |
| 17 | noncomputable section |
| 18 | |
| 19 | namespace PoincareMT.Proofs.M59 |
| 20 | |
| 21 | open PoincareMT.Proofs.M02 |
| 22 | |
| 23 | /-- Cubical based-loop adjunction, with the outer coordinates first. |
| 24 | Source: Hatcher, Section 4.1, printed pp. 340-342. -/ |
| 25 | def basedLoopAdjunction {X : Type*} [TopologicalSpace X] |
| 26 | (n : Nat) [Nonempty (Fin n)] (x : X) : |
| 27 | HomotopyGroup.Pi n (GenLoop (Fin 1) X x) GenLoop.const ≃* |
| 28 | HomotopyGroup.Pi (n + 1) X x := |
| 29 | (HomotopyGroup.cubicalAdjunction x).trans |
| 30 | (HomotopyGroup.reindex x (finSumFinEquiv : Fin n ⊕ Fin 1 ≃ Fin (n + 1))) |
| 31 | |
| 32 | /-- Actual target postcomposition commutes with based-loop adjunction. |
| 33 | Source: Hatcher, Section 4.1, printed p. 342. -/ |
| 34 | theorem basedLoopAdjunction_naturality |
| 35 | {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] |
| 36 | (n : Nat) [Nonempty (Fin n)] {x : X} {y : Y} (f : C(X, Y)) (h : f x = y) |
| 37 | (a : HomotopyGroup.Pi n (GenLoop (Fin 1) X x) GenLoop.const) : |
| 38 | basedLoopAdjunction n y |
| 39 | (homotopyGroupMap (Fin n) (mapGenLoopMap (Fin 1) f h) |
| 40 | (mapGenLoopMap_const (Fin 1) f h) a) = |
| 41 | homotopyGroupMap (Fin (n + 1)) f h (basedLoopAdjunction n x a) := by |
| 42 | refine Quotient.inductionOn a fun a => ?_ |
| 43 | change (⟦GenLoop.congr y finSumFinEquiv (GenLoop.genLoopGenLoopEquiv y |
| 44 | (mapGenLoop (mapGenLoopMap (Fin 1) f h) (mapGenLoopMap_const (Fin 1) f h) a))⟧ : |
| 45 | HomotopyGroup.Pi (n + 1) Y y) = |
| 46 | ⟦mapGenLoop f h (GenLoop.congr x finSumFinEquiv (GenLoop.genLoopGenLoopEquiv x a))⟧ |
| 47 | rw [genLoopGenLoopEquiv_map, genLoop_congr_map] |
| 48 | |
| 49 | namespace CubeBoundaryQuotient |
| 50 | |
| 51 | variable {S : Type*} [TopologicalSpace S] [T2Space S] [LocallyCompactSpace S] |
| 52 | (q : CubeBoundaryQuotient (Fin 1) S) |
| 53 | |
| 54 | /-- The continuous-loop comparison when the same-dimensional manifold |
| 55 | homotopy group vanishes. No manifold hypothesis is needed here. |
| 56 | Source: Hatcher, Section 4.1, printed pp. 340-342; MT Claim 18.16, p. 430. -/ |
| 57 | def loopHomotopyEquiv {X : Type*} [TopologicalSpace X] |
| 58 | (n : Nat) [Nonempty (Fin n)] (x : X) |
| 59 | (hpi : Subsingleton (HomotopyGroup.Pi n X x)) : |
| 60 | HomotopyGroup.Pi n C(S, X) (ContinuousMap.const S x) ≃* |
| 61 | HomotopyGroup.Pi (n + 1) X x := |
| 62 | (q.continuousLoopEquiv x hpi).symm.trans (basedLoopAdjunction n x) |
| 63 | |
| 64 | /-- The generic continuous-loop comparison commutes with the actual |
| 65 | postcomposition maps, including maps of nonmanifold spaces. |
| 66 | Source: Hatcher, Section 4.1, printed p. 342; MT Claim 18.16, p. 430. -/ |
| 67 | theorem loopHomotopyEquiv_naturality |
| 68 | {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] |
| 69 | (n : Nat) [Nonempty (Fin n)] {x : X} {y : Y} |
| 70 | (hpiX : Subsingleton (HomotopyGroup.Pi n X x)) |
| 71 | (hpiY : Subsingleton (HomotopyGroup.Pi n Y y)) |
| 72 | (f : C(X, Y)) (h : f x = y) |
| 73 | (a : HomotopyGroup.Pi n C(S, X) (ContinuousMap.const S x)) : |
| 74 | q.loopHomotopyEquiv n y hpiY |
| 75 | (homotopyGroupMap (Fin n) (postcomposeMap S f) (postcomposeMap_const S f h) a) = |
| 76 | homotopyGroupMap (Fin (n + 1)) f h (q.loopHomotopyEquiv n x hpiX a) := by |
| 77 | let DX := q.continuousLoopEquiv x hpiX |
| 78 | let DY := q.continuousLoopEquiv y hpiY |
| 79 | let b := DX.symm a |
| 80 | let B := homotopyGroupMap (Fin n) (mapGenLoopMap (Fin 1) f h) |
| 81 | (mapGenLoopMap_const (Fin 1) f h) |
| 82 | have hD : DY (B b) = homotopyGroupMap (Fin n) (postcomposeMap S f) |
| 83 | (postcomposeMap_const S f h) a := by |
| 84 | change homotopyGroupMap (Fin n) q.descendMap q.descend_const (B b) = _ |
| 85 | rw [homotopyGroupMap_descend_naturality] |
| 86 | change homotopyGroupMap (Fin n) (postcomposeMap S f) _ (DX (DX.symm a)) = _ |
| 87 | rw [DX.apply_symm_apply] |
| 88 | change basedLoopAdjunction n y (DY.symm _) = _ |
| 89 | rw [← hD, DY.symm_apply_apply] |
| 90 | exact basedLoopAdjunction_naturality n f h b |
| 91 | |
| 92 | end CubeBoundaryQuotient |
| 93 | |
| 94 | end PoincareMT.Proofs.M59 |