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.HomologicalAlgebra.ModuleBilinearHomology |
| 2 | import Mathlib.Algebra.Homology.ShortComplex.HomologicalComplex |
| 3 | |
| 4 | /-! |
| 5 | # Cycle representatives and homology maps |
| 6 | |
| 7 | Concrete kernel classes agree with the canonical homology projection and |
| 8 | commute with actual short-complex and homological-complex maps. |
| 9 | -/ |
| 10 | |
| 11 | set_option autoImplicit false |
| 12 | |
| 13 | open CategoryTheory |
| 14 | |
| 15 | universe u |
| 16 | |
| 17 | namespace Poincare.Topology |
| 18 | |
| 19 | noncomputable section |
| 20 | |
| 21 | def moduleHomologyCycleMap {S T : ShortComplex (ModuleCat.{u} Int)} (f : S ⟶ T) |
| 22 | (z : LinearMap.ker S.g.hom) : LinearMap.ker T.g.hom := |
| 23 | ⟨f.τ₂ z.val, by |
| 24 | have h := congrArg (fun k => k z.val) f.comm₂₃ |
| 25 | change T.g (f.τ₂ z.val) = f.τ₃ (S.g z.val) at h |
| 26 | rw [show S.g z.val = 0 from z.property, map_zero] at h |
| 27 | exact h⟩ |
| 28 | |
| 29 | theorem moduleHomologyClass_eq (S : ShortComplex (ModuleCat.{u} Int)) |
| 30 | (z : LinearMap.ker S.g.hom) : |
| 31 | moduleHomologyClass S z = S.homologyπ (S.moduleCatCyclesIso.inv z) := |
| 32 | (congrArg (fun f => f z) S.moduleCatCyclesIso_inv_π).symm |
| 33 | |
| 34 | theorem moduleHomologyClass_map {S T : ShortComplex (ModuleCat.{u} Int)} |
| 35 | (f : S ⟶ T) (z : LinearMap.ker S.g.hom) : |
| 36 | ShortComplex.homologyMap f (moduleHomologyClass S z) = |
| 37 | moduleHomologyClass T (moduleHomologyCycleMap f z) := by |
| 38 | have hz : T.moduleCatCyclesIso.hom |
| 39 | (ShortComplex.cyclesMap f (S.moduleCatCyclesIso.inv z)) = |
| 40 | moduleHomologyCycleMap f z := by |
| 41 | apply Subtype.ext |
| 42 | have hi := congrArg (fun k => k (S.moduleCatCyclesIso.inv z)) |
| 43 | (ShortComplex.cyclesMap_i f) |
| 44 | change T.iCycles (ShortComplex.cyclesMap f (S.moduleCatCyclesIso.inv z)) = |
| 45 | f.τ₂ (S.iCycles (S.moduleCatCyclesIso.inv z)) at hi |
| 46 | have hs := congrArg (fun k => k z) S.moduleCatCyclesIso_inv_iCycles |
| 47 | have ht := congrArg (fun k => k (ShortComplex.cyclesMap f (S.moduleCatCyclesIso.inv z))) |
| 48 | T.moduleCatCyclesIso_hom_i |
| 49 | exact ht.trans (hi.trans (congrArg f.τ₂ hs)) |
| 50 | rw [moduleHomologyClass_eq, moduleHomologyClass_eq] |
| 51 | have h := congrArg (fun k => k (S.moduleCatCyclesIso.inv z)) |
| 52 | (ShortComplex.homologyπ_naturality f) |
| 53 | change ShortComplex.homologyMap f (S.homologyπ (S.moduleCatCyclesIso.inv z)) = |
| 54 | T.homologyπ (ShortComplex.cyclesMap f (S.moduleCatCyclesIso.inv z)) at h |
| 55 | rw [← hz] |
| 56 | simpa only [Iso.hom_inv_id_apply] using h |
| 57 | |
| 58 | theorem complexHomologyClass_map {ι : Type*} {c : ComplexShape ι} |
| 59 | {C D : HomologicalComplex (ModuleCat.{u} Int) c} (f : C ⟶ D) (n : ι) |
| 60 | (z : LinearMap.ker (C.sc n).g.hom) : |
| 61 | HomologicalComplex.homologyMap f n (moduleHomologyClass (C.sc n) z) = |
| 62 | moduleHomologyClass (D.sc n) |
| 63 | (moduleHomologyCycleMap ((HomologicalComplex.shortComplexFunctor |
| 64 | (ModuleCat.{u} Int) c n).map f) z) := |
| 65 | moduleHomologyClass_map _ z |
| 66 | |
| 67 | end |
| 68 | |
| 69 | end Poincare.Topology |