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.SupportedNerve |
| 2 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.Lefschetz.OrderComplexSimplex |
| 3 | import PoincareLib.AlgebraicTopology.HomotopyGroup.LoopSpace.Comparison.Lefschetz.OrderComplexNeighborhoods |
| 4 | |
| 5 | /-! |
| 6 | # Actual characteristic maps on supported lifted subcomplexes |
| 7 | |
| 8 | A characteristic simplex with vertices in s has total selected weight one. |
| 9 | Its lift therefore lies in the actual inverse image of the open coordinate |
| 10 | neighborhood U_s. These characteristic maps commute literally with every |
| 11 | inclusion s subset t and with the map to all singular simplices. |
| 12 | Source: Hatcher, Theorem 2.27, printed pp. 128-130. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | noncomputable section |
| 18 | |
| 19 | open CategoryTheory |
| 20 | open scoped Simplicial |
| 21 | |
| 22 | universe u |
| 23 | |
| 24 | namespace PoincareMT.Proofs.M59 |
| 25 | |
| 26 | open M02.Topology |
| 27 | |
| 28 | variable {J : Type u} [PartialOrder J] [Fintype J] |
| 29 | |
| 30 | /-- An actual characteristic simplex on selected vertices is entirely |
| 31 | inside their coordinate neighborhood. Source: Hatcher, Theorem 2.27. -/ |
| 32 | theorem orderComplexSimplex_mem_neighborhood (s : Finset J) {n : ℕ} |
| 33 | (z : (supportedNerve s).toSSet _⦋n⦌) (t : stdSimplex ℝ (Fin (n + 1))) : |
| 34 | orderComplexSimplex z.val t ∈ orderComplexNeighborhood s := by |
| 35 | classical |
| 36 | have hsupp (j : J) (hj : j ∉ s) : (orderComplexSimplex z.val t).val j = 0 := by |
| 37 | change FunOnFinite.linearMap ℝ ℝ z.val.obj t.val j = 0 |
| 38 | rw [FunOnFinite.linearMap_apply_apply] |
| 39 | apply Finset.sum_eq_zero |
| 40 | intro i hi |
| 41 | exact (hj ((Finset.mem_filter.mp hi).2 ▸ z.property i)).elim |
| 42 | change 0 < orderComplexRestrictionWeight s _ |
| 43 | rw [orderComplexRestrictionWeight_eq_one s _ hsupp] |
| 44 | exact zero_lt_one |
| 45 | |
| 46 | variable {E : Type u} [TopologicalSpace E] (p : C(E, (finiteOrderComplex J).space)) |
| 47 | |
| 48 | /-- The actual inverse image of a selected coordinate neighborhood. |
| 49 | Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 50 | def liftedCoordinateNeighborhood (s : Finset J) : Set E := |
| 51 | p ⁻¹' orderComplexNeighborhood s |
| 52 | |
| 53 | /-- A supported characteristic simplex, restricted to its actual |
| 54 | covering neighborhood. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 55 | def supportedLiftSimplex (s : Finset J) {n : ℕ} |
| 56 | (z : (supportedSingularLift p (orderComplexSingular J) s).toSSet _⦋n⦌) : |
| 57 | C(stdSimplex ℝ (Fin (n + 1)), liftedCoordinateNeighborhood p s) := by |
| 58 | refine ⟨fun t => ⟨(TopCat.of E).toSSetObjEquiv _ z.val.val.2 t, ?_⟩, ?_⟩ |
| 59 | · change p ((TopCat.of E).toSSetObjEquiv _ z.val.val.2 t) ∈ |
| 60 | orderComplexNeighborhood s |
| 61 | have h := congrArg (fun a => (TopCat.of (finiteOrderComplex J).space).toSSetObjEquiv _ a t) |
| 62 | z.val.property |
| 63 | change p ((TopCat.of E).toSSetObjEquiv _ z.val.val.2 t) = |
| 64 | orderComplexSimplex z.val.val.1 t at h |
| 65 | rw [h] |
| 66 | exact orderComplexSimplex_mem_neighborhood s ⟨z.val.val.1, z.property⟩ t |
| 67 | · exact ((TopCat.of E).toSSetObjEquiv _ z.val.val.2).continuous.subtype_mk _ |
| 68 | |
| 69 | /-- The actual characteristic-simplex comparison on a supported lifted |
| 70 | subcomplex, valued in its open covering neighborhood. |
| 71 | Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 72 | def supportedSingularComparison (s : Finset J) : |
| 73 | (supportedSingularLift p (orderComplexSingular J) s).toSSet ⟶ |
| 74 | TopCat.toSSet.obj (TopCat.of (liftedCoordinateNeighborhood p s)) := |
| 75 | singularMapOfContinuousSimplices _ _ (fun _ z => supportedLiftSimplex p s z) (by |
| 76 | intro n m f z |
| 77 | ext t : 1 |
| 78 | apply Subtype.ext |
| 79 | rfl) |
| 80 | |
| 81 | /-- Projection of the supported comparison gives the original literal |
| 82 | singular projection of the lifted model. Source: Hatcher, Theorem 2.27. -/ |
| 83 | theorem supportedSingularComparison_projection (s : Finset J) : |
| 84 | supportedSingularComparison p s ≫ TopCat.toSSet.map |
| 85 | (TopCat.ofHom (⟨Subtype.val, continuous_subtype_val⟩ : |
| 86 | C(liftedCoordinateNeighborhood p s, E))) = |
| 87 | (supportedSingularLift p (orderComplexSingular J) s).ι ≫ |
| 88 | singularLiftProjection p (nerve J) (orderComplexSingular J) := by |
| 89 | ext n : 1 |
| 90 | apply ConcreteCategory.hom_ext |
| 91 | intro z |
| 92 | apply ((TopCat.of E).toSSetObjEquiv n).injective |
| 93 | rfl |
| 94 | |
| 95 | /-- The actual inclusion between lifted coordinate neighborhoods. |
| 96 | Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 97 | def liftedCoordinateNeighborhoodInclusion {s t : Finset J} (h : s ⊆ t) : |
| 98 | C(liftedCoordinateNeighborhood p s, liftedCoordinateNeighborhood p t) := |
| 99 | ⟨fun e => ⟨e.val, orderComplexNeighborhood_mono h e.property⟩, |
| 100 | continuous_subtype_val.subtype_mk _⟩ |
| 101 | |
| 102 | /-- Selected-set inclusions commute with the actual characteristic |
| 103 | comparisons. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 104 | theorem supportedSingularComparison_naturality {s t : Finset J} (h : s ⊆ t) : |
| 105 | SSet.Subcomplex.homOfLE (show supportedSingularLift p (orderComplexSingular J) s ≤ |
| 106 | supportedSingularLift p (orderComplexSingular J) t from |
| 107 | fun _ _ hz i => h (hz i)) ≫ |
| 108 | supportedSingularComparison p t = |
| 109 | supportedSingularComparison p s ≫ TopCat.toSSet.map |
| 110 | (TopCat.ofHom (liftedCoordinateNeighborhoodInclusion p h)) := by |
| 111 | ext n : 1 |
| 112 | apply ConcreteCategory.hom_ext |
| 113 | intro z |
| 114 | apply ((TopCat.of (liftedCoordinateNeighborhood p t)).toSSetObjEquiv n).injective |
| 115 | rfl |
| 116 | |
| 117 | end PoincareMT.Proofs.M59 |