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 | |
| 3 | /-! |
| 4 | # Actual normalized characteristic-chain comparison |
| 5 | |
| 6 | Normalization has a natural inclusion in the unnormalized complex. Compose |
| 7 | it with a literal characteristic-simplex map to compare normalized chains |
| 8 | with singular chains. Naturality retains the given continuous map exactly. |
| 9 | Source: Hatcher, Theorem 2.27, printed pp. 128-130. |
| 10 | -/ |
| 11 | |
| 12 | set_option autoImplicit false |
| 13 | |
| 14 | noncomputable section |
| 15 | |
| 16 | open CategoryTheory HomologicalComplex |
| 17 | |
| 18 | universe u |
| 19 | |
| 20 | namespace PoincareMT.Proofs.M59 |
| 21 | |
| 22 | open M02.Topology |
| 23 | |
| 24 | /-- The normalization inclusion is natural for every simplicial map. |
| 25 | Source: the normalization used in Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 26 | theorem normalizedIntegralChainMap_fromNormalized {A B : SSet.{u}} (f : A ⟶ B) : |
| 27 | SSet.normalizedChainComplexMap f integralCoefficient ≫ |
| 28 | B.fromNormalizedChainComplex integralCoefficient = |
| 29 | A.fromNormalizedChainComplex integralCoefficient ≫ |
| 30 | SSet.chainComplexMap f integralCoefficient := by |
| 31 | apply (cancel_epi (A.toNormalizedChainComplex integralCoefficient)).mp |
| 32 | simp only [← Category.assoc, SSet.toNormalizedChainComplex_normalizedChainComplexMap] |
| 33 | rw [Category.assoc, SSet.toNormalizedChainComplex_fromNormalizedChainComplex, |
| 34 | SSet.toNormalizedChainComplex_fromNormalizedChainComplex] |
| 35 | exact SSet.chainComplexMap_PInfty f integralCoefficient |
| 36 | |
| 37 | variable {X Y : Type u} [TopologicalSpace X] [TopologicalSpace Y] |
| 38 | |
| 39 | /-- The actual comparison obtained from a chosen characteristic-simplex |
| 40 | map, with the normalization inclusion retained. Source: Hatcher, |
| 41 | Theorem 2.27, pp. 128-130. -/ |
| 42 | def normalizedSingularComparison {A : SSet.{u}} |
| 43 | (χ : A ⟶ TopCat.toSSet.obj (TopCat.of X)) : |
| 44 | A.normalizedChainComplex integralCoefficient.{u} ⟶ integralChains X := |
| 45 | A.fromNormalizedChainComplex integralCoefficient ≫ |
| 46 | SSet.chainComplexMap χ integralCoefficient |
| 47 | |
| 48 | set_option backward.isDefEq.respectTransparency false in |
| 49 | /-- Literal characteristic-simplex compatibility gives literal |
| 50 | naturality of the normalized singular comparison. |
| 51 | Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 52 | theorem normalizedSingularComparison_naturality {A B : SSet.{u}} |
| 53 | (χ : A ⟶ TopCat.toSSet.obj (TopCat.of X)) |
| 54 | (ψ : B ⟶ TopCat.toSSet.obj (TopCat.of Y)) |
| 55 | (a : A ⟶ B) (f : C(X, Y)) |
| 56 | (h : a ≫ ψ = χ ≫ TopCat.toSSet.map (TopCat.ofHom f)) : |
| 57 | SSet.normalizedChainComplexMap a integralCoefficient ≫ |
| 58 | normalizedSingularComparison ψ = |
| 59 | normalizedSingularComparison χ ≫ integralChainsFunctor.map (TopCat.ofHom f) := by |
| 60 | dsimp only [normalizedSingularComparison] |
| 61 | rw [← Category.assoc, normalizedIntegralChainMap_fromNormalized, Category.assoc] |
| 62 | change _ = _ ≫ SSet.chainComplexMap (TopCat.toSSet.map (TopCat.ofHom f)) _ |
| 63 | have hm := ((SSet.chainComplexFunctor (ModuleCat.{u} ℤ)).obj |
| 64 | integralCoefficient).congr_map h |
| 65 | simp only [Functor.map_comp] at hm |
| 66 | simpa only [Category.assoc] using |
| 67 | congrArg (fun k => A.fromNormalizedChainComplex integralCoefficient ≫ k) hm |
| 68 | |
| 69 | /-- The normalized characteristic map is a quasi-isomorphism exactly |
| 70 | when its unnormalized counterpart is. Source: Hatcher, Theorem 2.27, |
| 71 | pp. 128-130. -/ |
| 72 | theorem normalizedSingularComparison_quasiIso_iff {A : SSet.{u}} |
| 73 | (χ : A ⟶ TopCat.toSSet.obj (TopCat.of X)) : |
| 74 | QuasiIso (normalizedSingularComparison χ) ↔ |
| 75 | QuasiIso (SSet.chainComplexMap χ integralCoefficient.{u}) := by |
| 76 | exact quasiIso_iff_comp_left (A.fromNormalizedChainComplex integralCoefficient) |
| 77 | (SSet.chainComplexMap χ integralCoefficient) |
| 78 | |
| 79 | end PoincareMT.Proofs.M59 |