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.Compatibility.ThreeManifoldTopology |
| 2 | |
| 3 | /-! |
| 4 | # Relabeling finite order-complex realizations |
| 5 | |
| 6 | An order equivalence, including a change of universe by ULift, induces the |
| 7 | literal coordinate-permutation homeomorphism of geometric realizations. |
| 8 | This places M02's finite triangulation in the universe of the covering |
| 9 | manifold without replacing any of its geometric maps. |
| 10 | Source: Hatcher, Theorem 2.27, pp. 128-130; the universe compatibility |
| 11 | derivation in tasks/M59/derivations/2026-09-22-universal-cover.md. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open scoped BigOperators |
| 17 | |
| 18 | universe u v w |
| 19 | |
| 20 | namespace PoincareMT.Proofs.M59 |
| 21 | |
| 22 | open M02.Topology |
| 23 | |
| 24 | variable {J : Type u} {K : Type v} [PartialOrder J] [PartialOrder K] |
| 25 | [Fintype J] [Fintype K] |
| 26 | |
| 27 | /-- Relabeling coordinates preserves the actual order-complex realization. |
| 28 | Source: Hatcher, Theorem 2.27, pp. 128-130; M59 universe derivation. -/ |
| 29 | theorem orderComplex_reindex_mem (e : J ≃o K) {z : J → ℝ} |
| 30 | (hz : z ∈ (finiteOrderComplex J).space) : |
| 31 | (fun k => z (e.symm k)) ∈ (finiteOrderComplex K).space := by |
| 32 | have h := (finiteOrderComplex_space J z).mp hz |
| 33 | apply (finiteOrderComplex_space K _).mpr |
| 34 | refine ⟨fun k => h.1 (e.symm k), ?_, ?_⟩ |
| 35 | · exact (e.symm.toEquiv.sum_comp z).trans h.2.1 |
| 36 | · intro i j hi hj |
| 37 | rcases h.2.2 (e.symm i) (e.symm j) hi hj with hij | hji |
| 38 | · exact Or.inl (e.symm.le_iff_le.mp hij) |
| 39 | · exact Or.inr (e.symm.le_iff_le.mp hji) |
| 40 | |
| 41 | /-- Actual coordinate realizations are homeomorphic under every order |
| 42 | equivalence, with independent vertex universes. |
| 43 | Source: Hatcher, Theorem 2.27, pp. 128-130; M59 universe derivation. -/ |
| 44 | noncomputable def orderComplexHomeomorph (e : J ≃o K) : |
| 45 | (finiteOrderComplex J).space ≃ₜ (finiteOrderComplex K).space where |
| 46 | toFun z := ⟨fun k => z.val (e.symm k), orderComplex_reindex_mem e z.property⟩ |
| 47 | invFun z := ⟨fun j => z.val (e j), orderComplex_reindex_mem e.symm z.property⟩ |
| 48 | left_inv z := by ext j; simp |
| 49 | right_inv z := by ext k; simp |
| 50 | continuous_toFun := by |
| 51 | apply Continuous.subtype_mk |
| 52 | exact continuous_pi fun k => (continuous_apply (e.symm k)).comp continuous_subtype_val |
| 53 | continuous_invFun := by |
| 54 | apply Continuous.subtype_mk |
| 55 | exact continuous_pi fun j => (continuous_apply (e j)).comp continuous_subtype_val |
| 56 | |
| 57 | /-- The relabeling map evaluates by the inverse coordinate permutation. |
| 58 | Source: Hatcher, Theorem 2.27, pp. 128-130; M59 universe derivation. -/ |
| 59 | @[simp] theorem orderComplexHomeomorph_apply (e : J ≃o K) |
| 60 | (z : (finiteOrderComplex J).space) (k : K) : |
| 61 | (orderComplexHomeomorph e z).val k = z.val (e.symm k) := rfl |
| 62 | |
| 63 | /-- Raising the vertex universe leaves the coordinate realization |
| 64 | homeomorphic by the literal up/down permutation. |
| 65 | Source: Hatcher, Theorem 2.27, pp. 128-130; M59 universe derivation. -/ |
| 66 | noncomputable def orderComplexULiftHomeomorph (J : Type u) [PartialOrder J] [Fintype J] : |
| 67 | (finiteOrderComplex (ULift.{w} J)).space ≃ₜ (finiteOrderComplex J).space := |
| 68 | orderComplexHomeomorph ULift.orderIso |
| 69 | |
| 70 | end PoincareMT.Proofs.M59 |