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.Lefschetz.FiniteNerveChains |
| 2 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.Lefschetz.ChainTrace |
| 3 | |
| 4 | /-! |
| 5 | # Zero diagonal from moved nondegenerate simplices |
| 6 | |
| 7 | Normalized simplicial chains send a characteristic basis vector to the |
| 8 | image simplex, or zero if that simplex becomes degenerate. Thus a map |
| 9 | fixing no nondegenerate simplex has zero diagonal in the actual basis. |
| 10 | Source: Hatcher, proof of Theorem 2C.3, printed pp. 179-181. |
| 11 | -/ |
| 12 | |
| 13 | set_option autoImplicit false |
| 14 | |
| 15 | noncomputable section |
| 16 | |
| 17 | open CategoryTheory |
| 18 | open scoped Simplicial |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.Proofs.M59 |
| 23 | |
| 24 | open M02.Topology |
| 25 | |
| 26 | /-- A simplicial self-map fixing no nondegenerate simplex has zero |
| 27 | diagonal on its normalized chains. Source: Hatcher, Theorem 2C.3, |
| 28 | pp. 179-181. -/ |
| 29 | theorem normalizedIntegralChainMap_diagonal_zero {X : SSet.{u}} |
| 30 | (f : X ⟶ X) (n : ℕ) |
| 31 | (hfree : ∀ s : X.nonDegenerate n, f.app _ s.val ≠ s.val) |
| 32 | (s : X.nonDegenerate n) : |
| 33 | (normalizedIntegralChainBasis X n).repr |
| 34 | ((SSet.normalizedChainComplexMap f integralCoefficient).f n |
| 35 | (normalizedIntegralChainBasis X n s)) s = 0 := by |
| 36 | classical |
| 37 | change normalizedIntegralChainCoordinates X n |
| 38 | ((SSet.normalizedChainComplexMap f integralCoefficient).f n |
| 39 | (normalizedIntegralChainBasis X n s)) s = 0 |
| 40 | rw [normalizedIntegralChainBasis_apply] |
| 41 | have hm := congrArg (fun g => g (ULift.up (1 : ℤ))) |
| 42 | (SSet.ι_normalizedChainComplexMap_f f integralCoefficient s.val) |
| 43 | change (SSet.normalizedChainComplexMap f integralCoefficient).f n |
| 44 | (X.ιNormalizedChainComplex (R := integralCoefficient) s.val (ULift.up 1)) = |
| 45 | X.ιNormalizedChainComplex (R := integralCoefficient) (f.app _ s.val) (ULift.up 1) at hm |
| 46 | rw [hm] |
| 47 | by_cases hs : f.app _ s.val ∈ X.nonDegenerate n |
| 48 | · have hc := normalizedIntegralChainCoordinates_generator X n ⟨f.app _ s.val, hs⟩ 1 |
| 49 | rw [hc] |
| 50 | apply Finsupp.single_eq_of_ne |
| 51 | intro h |
| 52 | exact hfree s (congrArg Subtype.val h).symm |
| 53 | · rw [X.ιNormalizedChainComplex_eq_zero (f.app _ s.val) |
| 54 | ((X.mem_degenerate_iff_notMem_nonDegenerate _).mpr hs)] |
| 55 | change (normalizedIntegralChainCoordinates X n 0) s = 0 |
| 56 | simp only [map_zero, Finsupp.zero_apply] |
| 57 | |
| 58 | /-- The finite alternating chain trace vanishes for a simplicial map |
| 59 | that fixes no nondegenerate simplex through the required degree. |
| 60 | Source: Hatcher, Theorem 2C.3, pp. 179-181. -/ |
| 61 | theorem normalizedIntegralChainMap_alternatingTrace_zero {X : SSet.{u}} |
| 62 | (f : X ⟶ X) (N : ℕ) [∀ i, Finite (X.nonDegenerate i)] |
| 63 | (hfree : ∀ i ≤ N, ∀ s : X.nonDegenerate i, f.app _ s.val ≠ s.val) : |
| 64 | ChainComplex.alternatingTrace |
| 65 | (SSet.normalizedChainComplexMap f integralCoefficient.{u}) N = 0 := by |
| 66 | apply ChainComplex.alternatingTrace_eq_zero_of_diagonal_eq_zero _ N |
| 67 | (fun i => X.nonDegenerate i) (normalizedIntegralChainBasis X) |
| 68 | intro i hi s |
| 69 | exact normalizedIntegralChainMap_diagonal_zero f i (hfree i hi) s |
| 70 | |
| 71 | end PoincareMT.Proofs.M59 |