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.Compatibility.ThreeManifoldTopology |
| 2 | |
| 3 | /-! |
| 4 | # Multiplication under cubical postcomposition |
| 5 | |
| 6 | Continuous postcomposition preserves the concatenation formulas on actual |
| 7 | cube representatives. Source: Hatcher, Section 4.1, pp. 340-342. |
| 8 | -/ |
| 9 | |
| 10 | set_option autoImplicit false |
| 11 | |
| 12 | open scoped Topology unitInterval |
| 13 | |
| 14 | namespace PoincareMT.Proofs.M59 |
| 15 | |
| 16 | open PoincareMT.Proofs.M02 |
| 17 | |
| 18 | variable {N X Y : Type*} [DecidableEq N] [TopologicalSpace X] [TopologicalSpace Y] |
| 19 | {x : X} {y : Y} |
| 20 | |
| 21 | /-- Postcomposition commutes with concatenation in each cube coordinate. |
| 22 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 23 | theorem mapGenLoop_transAt (f : C(X, Y)) (h : f x = y) (i : N) |
| 24 | (a b : GenLoop N X x) : |
| 25 | mapGenLoop f h (GenLoop.transAt i a b) = |
| 26 | GenLoop.transAt i (mapGenLoop f h a) (mapGenLoop f h b) := by |
| 27 | ext v |
| 28 | change f ((GenLoop.transAt i a b) v) = _ |
| 29 | simp only [GenLoop.transAt, GenLoop.coe_copy] |
| 30 | split_ifs <;> rfl |
| 31 | |
| 32 | /-- Continuous postcomposition is a homomorphism on nonzero homotopy groups. |
| 33 | Source: Hatcher, Section 4.1, pp. 340-342. -/ |
| 34 | noncomputable def homotopyGroupMapHom [Nonempty N] (f : C(X, Y)) (h : f x = y) : |
| 35 | HomotopyGroup N X x →* HomotopyGroup N Y y where |
| 36 | toFun := homotopyGroupMap N f h |
| 37 | map_one' := by |
| 38 | change (⟦mapGenLoop f h GenLoop.const⟧ : HomotopyGroup N Y y) = ⟦GenLoop.const⟧ |
| 39 | exact congrArg (fun a => (⟦a⟧ : HomotopyGroup N Y y)) (by ext v; exact h) |
| 40 | map_mul' a b := Quotient.inductionOn₂ a b fun a b => by |
| 41 | let i : N := Classical.choice inferInstance |
| 42 | exact (congrArg (homotopyGroupMap N f h) |
| 43 | (HomotopyGroup.mul_spec (i := i) (p := a) (q := b))).trans |
| 44 | ((congrArg (fun a => (⟦a⟧ : HomotopyGroup N Y y)) |
| 45 | (mapGenLoop_transAt f h i b a)).trans (HomotopyGroup.mul_spec (i := i)).symm) |
| 46 | |
| 47 | end PoincareMT.Proofs.M59 |