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 | import Mathlib.Analysis.Convex.Contractible |
| 3 | |
| 4 | /-! |
| 5 | # Contractible vertex-star intersections in a finite order complex |
| 6 | |
| 7 | The star of a vertex is the set where its barycentric coordinate is |
| 8 | positive. Every nonempty finite intersection contracts to the barycenter |
| 9 | of the prescribed vertices. These are actual subsets of the geometric |
| 10 | realization supplied by M02. Sources: Hatcher, Theorem 2.27, pp. 128-130, |
| 11 | and the subdivision argument in Theorem 2C.3, pp. 179-181. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | noncomputable section |
| 17 | |
| 18 | open scoped BigOperators |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.Proofs.M59 |
| 23 | |
| 24 | open M02.Topology |
| 25 | |
| 26 | variable {J : Type u} [PartialOrder J] [Fintype J] |
| 27 | |
| 28 | /-- The common vertex star, as a subset of the coordinate ambient space. |
| 29 | Source: Hatcher's simplicial subdivision proof, Theorem 2C.3, pp. 179-181. -/ |
| 30 | def orderComplexStar (s : Finset J) : Set (J → ℝ) := |
| 31 | {z | z ∈ (finiteOrderComplex J).space ∧ ∀ i ∈ s, 0 < z i} |
| 32 | |
| 33 | /-- A nonempty common star can only prescribe a linearly ordered set of |
| 34 | vertices. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 35 | theorem orderComplexStar_chain {s : Finset J} (h : (orderComplexStar s).Nonempty) : |
| 36 | ∀ i ∈ s, ∀ j ∈ s, i ≤ j ∨ j ≤ i := by |
| 37 | obtain ⟨z, hz, hpos⟩ := h |
| 38 | intro i hi j hj |
| 39 | exact ((finiteOrderComplex_space J z).mp hz).2.2 i j |
| 40 | (ne_of_gt (hpos i hi)) (ne_of_gt (hpos j hj)) |
| 41 | |
| 42 | open scoped Classical in |
| 43 | /-- The equal-weight point on a nonempty prescribed chain belongs to |
| 44 | its common star. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 45 | theorem orderComplexStar_barycenter_mem (s : Finset J) (hne : s.Nonempty) |
| 46 | (hchain : ∀ i ∈ s, ∀ j ∈ s, i ≤ j ∨ j ≤ i) : |
| 47 | (fun i => if i ∈ s then (s.card : ℝ)⁻¹ else 0) ∈ orderComplexStar s := by |
| 48 | classical |
| 49 | have hcard : 0 < (s.card : ℝ) := by exact_mod_cast hne.card_pos |
| 50 | constructor |
| 51 | · apply (finiteOrderComplex_space J _).mpr |
| 52 | refine ⟨fun i => ?_, ?_, ?_⟩ |
| 53 | · split_ifs |
| 54 | · exact le_of_lt (inv_pos.mpr hcard) |
| 55 | · exact le_rfl |
| 56 | · simp only [Finset.sum_ite_mem, Finset.univ_inter, Finset.sum_const, nsmul_eq_mul] |
| 57 | exact mul_inv_cancel₀ (ne_of_gt hcard) |
| 58 | · intro i j hi hj |
| 59 | have his : i ∈ s := by by_contra h; simp [h] at hi |
| 60 | have hjs : j ∈ s := by by_contra h; simp [h] at hj |
| 61 | exact hchain i his j hjs |
| 62 | · intro i hi |
| 63 | simpa only [if_pos hi] using inv_pos.mpr hcard |
| 64 | |
| 65 | /-- A common star is star-convex about every point supported exactly on |
| 66 | its prescribed vertices. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 67 | theorem orderComplexStar_starConvex (s : Finset J) (c : J → ℝ) |
| 68 | (hc : c ∈ orderComplexStar s) (hsupp : ∀ i ∉ s, c i = 0) : |
| 69 | StarConvex ℝ c (orderComplexStar s) := by |
| 70 | intro z hz a b ha hb hab |
| 71 | have hc' := (finiteOrderComplex_space J c).mp hc.1 |
| 72 | have hz' := (finiteOrderComplex_space J z).mp hz.1 |
| 73 | have hsupport (i : J) (hi : (a • c + b • z) i ≠ 0) : z i ≠ 0 := by |
| 74 | intro hzi |
| 75 | have his : i ∉ s := fun his => (ne_of_gt (hz.2 i his)) hzi |
| 76 | simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul, hsupp i his, hzi, |
| 77 | mul_zero, add_zero] at hi |
| 78 | exact hi rfl |
| 79 | constructor |
| 80 | · apply (finiteOrderComplex_space J _).mpr |
| 81 | refine ⟨?_, ?_, ?_⟩ |
| 82 | · intro i |
| 83 | exact add_nonneg (mul_nonneg ha (hc'.1 i)) (mul_nonneg hb (hz'.1 i)) |
| 84 | · change (∑ i : J, (a * c i + b * z i)) = 1 |
| 85 | rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum, |
| 86 | hc'.2.1, hz'.2.1, mul_one, mul_one, hab] |
| 87 | · intro i j hi hj |
| 88 | exact hz'.2.2 i j (hsupport i hi) (hsupport j hj) |
| 89 | · intro i hi |
| 90 | change 0 < a * c i + b * z i |
| 91 | have hci := hc.2 i hi |
| 92 | have hzi := hz.2 i hi |
| 93 | rcases eq_or_lt_of_le ha with ha0 | ha0 |
| 94 | · have hb1 : b = 1 := by linarith |
| 95 | simpa only [← ha0, hb1, zero_mul, one_mul, zero_add] using hzi |
| 96 | · exact add_pos_of_pos_of_nonneg (mul_pos ha0 hci) (mul_nonneg hb hzi.le) |
| 97 | |
| 98 | /-- Every nonempty common star for a nonempty prescribed vertex set is |
| 99 | contractible. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 100 | theorem orderComplexStar_contractible (s : Finset J) (hne : s.Nonempty) |
| 101 | (h : (orderComplexStar s).Nonempty) : ContractibleSpace (orderComplexStar s) := by |
| 102 | classical |
| 103 | let c : J → ℝ := fun i => if i ∈ s then (s.card : ℝ)⁻¹ else 0 |
| 104 | have hc : c ∈ orderComplexStar s := |
| 105 | orderComplexStar_barycenter_mem s hne (orderComplexStar_chain h) |
| 106 | exact (orderComplexStar_starConvex s c hc (by |
| 107 | intro i hi |
| 108 | simp only [c, if_neg hi])).contractibleSpace h |
| 109 | |
| 110 | /-- The ambient common-star subtype is homeomorphic to the same open |
| 111 | intersection inside the realization. Source: Hatcher, Theorem 2.27, |
| 112 | pp. 128-130. -/ |
| 113 | def orderComplexStarHomeomorph (s : Finset J) : |
| 114 | orderComplexStar s ≃ₜ |
| 115 | {z : (finiteOrderComplex J).space | ∀ i ∈ s, 0 < z.val i} where |
| 116 | toFun z := ⟨⟨z.val, z.property.1⟩, z.property.2⟩ |
| 117 | invFun z := ⟨z.val.val, z.val.property, z.property⟩ |
| 118 | left_inv _ := rfl |
| 119 | right_inv _ := rfl |
| 120 | continuous_toFun := (continuous_subtype_val.subtype_mk _).subtype_mk _ |
| 121 | continuous_invFun := (continuous_subtype_val.comp continuous_subtype_val).subtype_mk _ |
| 122 | |
| 123 | /-- Every nonempty intersection of the actual vertex-star cover is |
| 124 | contractible. Source: Hatcher, Theorem 2.27, pp. 128-130. -/ |
| 125 | theorem orderComplex_vertexStarIntersection_contractible (s : Finset J) |
| 126 | (hne : s.Nonempty) |
| 127 | (h : Nonempty {z : (finiteOrderComplex J).space | ∀ i ∈ s, 0 < z.val i}) : |
| 128 | ContractibleSpace {z : (finiteOrderComplex J).space | ∀ i ∈ s, 0 < z.val i} := by |
| 129 | let e := orderComplexStarHomeomorph s |
| 130 | have hs : (orderComplexStar s).Nonempty := by |
| 131 | obtain ⟨z⟩ := h |
| 132 | exact ⟨(e.symm z).val, (e.symm z).property⟩ |
| 133 | let := orderComplexStar_contractible s hne hs |
| 134 | exact e.contractibleSpace_iff.mp inferInstance |
| 135 | |
| 136 | /-- Vertex stars are open in the actual order-complex realization. |
| 137 | Source: Hatcher, Theorem 2C.3, pp. 179-181. -/ |
| 138 | theorem isOpen_orderComplex_vertexStar (i : J) : |
| 139 | IsOpen {z : (finiteOrderComplex J).space | 0 < z.val i} := |
| 140 | isOpen_lt continuous_const ((continuous_apply i).comp continuous_subtype_val) |
| 141 | |
| 142 | /-- The finitely many vertex stars cover the actual realization. |
| 143 | Source: Hatcher, Theorem 2C.3, pp. 179-181. -/ |
| 144 | theorem orderComplex_vertexStars_cover (z : (finiteOrderComplex J).space) : |
| 145 | ∃ i, 0 < z.val i := by |
| 146 | have hz := (finiteOrderComplex_space J z.val).mp z.property |
| 147 | by_contra! h |
| 148 | have hzero (i : J) : z.val i = 0 := le_antisymm (h i) (hz.1 i) |
| 149 | have hsum := hz.2.1 |
| 150 | simp only [hzero, Finset.sum_const_zero] at hsum |
| 151 | exact zero_ne_one hsum |
| 152 | |
| 153 | end PoincareMT.Proofs.M59 |