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 Mathlib.AlgebraicTopology.SimplicialSet.TopAdj |
| 2 | import Mathlib.Topology.Connected.TotallyDisconnected |
| 3 | import Mathlib.Analysis.Convex.Contractible |
| 4 | |
| 5 | /-! |
| 6 | # Singular simplices of a discrete space |
| 7 | |
| 8 | Every singular simplex in a discrete space is literally constant. Initial |
| 9 | vertex evaluation and constant simplices therefore give inverse simplicial |
| 10 | maps. This keeps the fiber coordinate in the cone comparison explicit. |
| 11 | Source: Hatcher, the cone case of Theorem 2.27, printed pp. 128-130. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open CategoryTheory |
| 19 | open scoped Simplicial |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.Proofs.M59 |
| 24 | |
| 25 | variable (F : Type u) [TopologicalSpace F] [DiscreteTopology F] |
| 26 | |
| 27 | /-- A continuous map from a standard simplex to a discrete space is |
| 28 | constant on all parameters. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 29 | theorem discreteSimplex_eq {n : ℕ} (f : C(stdSimplex ℝ (Fin (n + 1)), F)) |
| 30 | (x y : stdSimplex ℝ (Fin (n + 1))) : f x = f y := |
| 31 | PreconnectedSpace.constant inferInstance f.continuous |
| 32 | |
| 33 | /-- Evaluate each actual singular simplex at its initial vertex. |
| 34 | Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 35 | def discreteSingularEvaluation : TopCat.toSSet.obj (TopCat.of F) ⟶ |
| 36 | (SimplicialObject.const (Type u)).obj F where |
| 37 | app n := ↾fun s => (TopCat.of F).toSSetObjEquiv n s (stdSimplex.vertex 0) |
| 38 | naturality {n m} f := by |
| 39 | apply ConcreteCategory.hom_ext |
| 40 | intro s |
| 41 | change ((TopCat.of F).toSSetObjEquiv n s) |
| 42 | (stdSimplex.map f.unop (stdSimplex.vertex 0)) = |
| 43 | ((TopCat.of F).toSSetObjEquiv n s) (stdSimplex.vertex 0) |
| 44 | exact discreteSimplex_eq F _ _ _ |
| 45 | |
| 46 | /-- Constant singular simplices retain their actual value in the |
| 47 | discrete carrier. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 48 | def discreteSingularConstant : (SimplicialObject.const (Type u)).obj F ⟶ |
| 49 | TopCat.toSSet.obj (TopCat.of F) where |
| 50 | app n := ↾fun a => ((TopCat.of F).toSSetObjEquiv n).symm (ContinuousMap.const _ a) |
| 51 | naturality {n m} f := by |
| 52 | apply ConcreteCategory.hom_ext |
| 53 | intro a |
| 54 | apply ((TopCat.of F).toSSetObjEquiv m).injective |
| 55 | rfl |
| 56 | |
| 57 | /-- The singular simplicial set of a discrete space is literally |
| 58 | isomorphic to the constant simplicial set on that carrier. |
| 59 | Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 60 | def discreteSingularIso : TopCat.toSSet.obj (TopCat.of F) ≅ |
| 61 | (SimplicialObject.const (Type u)).obj F where |
| 62 | hom := discreteSingularEvaluation F |
| 63 | inv := discreteSingularConstant F |
| 64 | hom_inv_id := by |
| 65 | ext n : 1 |
| 66 | apply ConcreteCategory.hom_ext |
| 67 | intro s |
| 68 | apply ((TopCat.of F).toSSetObjEquiv n).injective |
| 69 | ext t |
| 70 | change ((TopCat.of F).toSSetObjEquiv n s) (stdSimplex.vertex 0) = |
| 71 | ((TopCat.of F).toSSetObjEquiv n s) t |
| 72 | exact discreteSimplex_eq F _ _ _ |
| 73 | inv_hom_id := by |
| 74 | rfl |
| 75 | |
| 76 | end PoincareMT.Proofs.M59 |