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.CubicalAdjunction |
| 2 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.CubicalPostcomposition |
| 3 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.CubeBoundaryQuotient |
| 4 | |
| 5 | /-! |
| 6 | # Naturality of cubical adjunction and circle descent |
| 7 | |
| 8 | Every map here postcomposes actual representatives. The commutative squares |
| 9 | are verified on their pointwise values. Source: Hatcher, Section 4.1, |
| 10 | pp. 340-342; MT Claim 18.16, p. 430. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | open scoped Topology unitInterval |
| 16 | |
| 17 | namespace PoincareMT.Proofs.M59 |
| 18 | |
| 19 | open PoincareMT.Proofs.M02 |
| 20 | |
| 21 | variable {N P S X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] |
| 22 | {x : X} {y : Y} |
| 23 | |
| 24 | /-- Actual continuous postcomposition between based cube spaces. |
| 25 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 26 | def mapGenLoopMap (N : Type*) (f : C(X, Y)) (h : f x = y) : |
| 27 | C(GenLoop N X x, GenLoop N Y y) := |
| 28 | ⟨mapGenLoop f h, |
| 29 | ((ContinuousMap.continuous_postcomp f).comp continuous_subtype_val).subtype_mk _⟩ |
| 30 | |
| 31 | /-- Based cube postcomposition carries the exact constant cube to the constant. |
| 32 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 33 | theorem mapGenLoopMap_const (N : Type*) (f : C(X, Y)) (h : f x = y) : |
| 34 | mapGenLoopMap N f h GenLoop.const = GenLoop.const := by ext v; exact h |
| 35 | |
| 36 | /-- Actual continuous postcomposition on continuous maps from S. |
| 37 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 38 | def postcomposeMap (S : Type*) [TopologicalSpace S] (f : C(X, Y)) : C(C(S, X), C(S, Y)) := |
| 39 | ⟨ContinuousMap.comp f, ContinuousMap.continuous_postcomp f⟩ |
| 40 | |
| 41 | /-- Postcomposition sends a constant map to the specified constant map. |
| 42 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 43 | theorem postcomposeMap_const (S : Type*) [TopologicalSpace S] |
| 44 | (f : C(X, Y)) (h : f x = y) : |
| 45 | postcomposeMap S f (ContinuousMap.const S x) = ContinuousMap.const S y := by |
| 46 | ext z |
| 47 | exact h |
| 48 | |
| 49 | /-- Uncurrying commutes with actual target postcomposition on cube values. |
| 50 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 51 | theorem genLoopGenLoopEquiv_map (f : C(X, Y)) (h : f x = y) |
| 52 | (a : GenLoop N (GenLoop P X x) GenLoop.const) : |
| 53 | GenLoop.genLoopGenLoopEquiv y |
| 54 | (mapGenLoop (mapGenLoopMap P f h) (mapGenLoopMap_const P f h) a) = |
| 55 | mapGenLoop f h (GenLoop.genLoopGenLoopEquiv x a) := by ext v; rfl |
| 56 | |
| 57 | /-- Reindexing commutes with target postcomposition on cube values. |
| 58 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 59 | theorem genLoop_congr_map (e : N ≃ P) (f : C(X, Y)) (h : f x = y) |
| 60 | (a : GenLoop N X x) : |
| 61 | GenLoop.congr y e (mapGenLoop f h a) = mapGenLoop f h (GenLoop.congr x e a) := by |
| 62 | ext v |
| 63 | rfl |
| 64 | |
| 65 | section Descent |
| 66 | |
| 67 | variable [TopologicalSpace S] [T2Space S] (q : CubeBoundaryQuotient P S) |
| 68 | |
| 69 | /-- Exact quotient descent commutes with target postcomposition. |
| 70 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 71 | theorem descend_mapGenLoop (f : C(X, Y)) (h : f x = y) (a : GenLoop P X x) : |
| 72 | q.descend (mapGenLoop f h a) = f.comp (q.descend a) := by |
| 73 | ext z |
| 74 | obtain ⟨v, rfl⟩ := q.surjective z |
| 75 | change q.descend (mapGenLoop f h a) (q.map v) = f (q.descend a (q.map v)) |
| 76 | rw [q.descend_map, q.descend_map] |
| 77 | rfl |
| 78 | |
| 79 | /-- The two actual maps on homotopy classes commute with circle descent. |
| 80 | Source: MT Claim 18.16, p. 430. -/ |
| 81 | theorem homotopyGroupMap_descend_naturality (f : C(X, Y)) (h : f x = y) |
| 82 | (a : HomotopyGroup N (GenLoop P X x) GenLoop.const) : |
| 83 | homotopyGroupMap N q.descendMap q.descend_const |
| 84 | (homotopyGroupMap N (mapGenLoopMap P f h) (mapGenLoopMap_const P f h) a) = |
| 85 | homotopyGroupMap N (postcomposeMap S f) (postcomposeMap_const S f h) |
| 86 | (homotopyGroupMap N q.descendMap q.descend_const a) := by |
| 87 | refine Quotient.inductionOn a fun a => ?_ |
| 88 | apply congrArg (fun b => (⟦b⟧ : HomotopyGroup N C(S, Y) (ContinuousMap.const S y))) |
| 89 | ext v z |
| 90 | exact ContinuousMap.congr_fun (descend_mapGenLoop q f h (a v)) z |
| 91 | |
| 92 | end Descent |
| 93 | |
| 94 | end PoincareMT.Proofs.M59 |