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.Geometry.RicciFlow.Generalized.BoundedDistance.GeometryImports |
| 2 | import PoincareLib.Geometry.RicciFlow.Generalized.BoundedDistance.Predecessors.Necks.Geometry.SaturatedHeight |
| 3 | |
| 4 | /-! |
| 5 | # Opposite components at every retained neck level |
| 6 | |
| 7 | A separating central sphere and the actual saturated height determine |
| 8 | the complementary components of each retained coordinate sphere. A |
| 9 | restricted translated collar supplies the full frontier and coverage |
| 10 | statements. This is a prerequisite for Morgan--Tian A.12-A.13, |
| 11 | pp. 504-505; see the independently reviewed tube-band-gluing plan, |
| 12 | 2026-09-22. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | |
| 17 | open Set |
| 18 | open scoped Manifold ContDiff ENNReal |
| 19 | |
| 20 | universe u |
| 21 | |
| 22 | namespace PoincareMT.EpsilonNeck |
| 23 | |
| 24 | variable {M : Type u} [TopologicalSpace M] |
| 25 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 26 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 27 | [T3Space M] {g : RiemannianMetric 3 M} |
| 28 | |
| 29 | /-- Every actual retained slice has opposite complementary components, |
| 30 | with exact frontiers and coverage of the center's component. |
| 31 | MT A.12-A.13, pp. 504-505; reviewed tube-band-gluing derivation, |
| 32 | 2026-09-22. -/ |
| 33 | theorem exists_opposite_retained_components |
| 34 | (N : EpsilonNeck g) (hsep : N.IsSeparating) |
| 35 | {t : ℝ} (ht : t ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹) : |
| 36 | ∃ a b : M, |
| 37 | a ∈ N.region (-N.epsilon⁻¹) t ∧ |
| 38 | b ∈ N.region t N.epsilon⁻¹ ∧ |
| 39 | let S := range (fun q : UnitTwoSphere => N.coordinate_map (q, t)) |
| 40 | let A := connectedComponentIn Sᶜ a |
| 41 | let B := connectedComponentIn Sᶜ b |
| 42 | N.region (-N.epsilon⁻¹) t ⊆ A ∧ |
| 43 | N.region t N.epsilon⁻¹ ⊆ B ∧ |
| 44 | A ≠ B ∧ |
| 45 | frontier A = S ∧ frontier B = S ∧ |
| 46 | A ∪ S ∪ B = connectedComponent N.center := by |
| 47 | classical |
| 48 | let : T2Space M := @T25Space.t2Space M _ (@T3Space.t25Space M _ inferInstance) |
| 49 | let : LocallyConnectedSpace M := |
| 50 | ChartedSpace.locallyConnectedSpace (EuclideanSpace ℝ (Fin 3)) M |
| 51 | let : ConnectedSpace UnitTwoSphere := by |
| 52 | apply isConnected_iff_connectedSpace.mp |
| 53 | exact isConnected_sphere (by rw [← Module.finrank_eq_rank]; norm_num) 0 (by norm_num) |
| 54 | obtain ⟨a₀, b₀, ha₀, hb₀, _, _, _, _, _, hcover⟩ := |
| 55 | N.exists_opposite_central_components hsep |
| 56 | obtain ⟨H, hH, hinside, hnegative, hpositive, _, _⟩ := |
| 57 | N.exists_saturatedAxialHeight hsep a₀ b₀ ha₀ hb₀ |
| 58 | have houtside : ∀ x ∈ connectedComponent N.center \ N.carrier, |
| 59 | H x = -N.epsilon⁻¹ ∨ H x = N.epsilon⁻¹ := by |
| 60 | intro x hx |
| 61 | rw [← hcover] at hx |
| 62 | rcases hx.1 with (hn | hs) | hp |
| 63 | · exact Or.inl (hnegative x ⟨hn, hx.2⟩) |
| 64 | · exact False.elim (hx.2 (N.central_sphere_subset hs)) |
| 65 | · exact Or.inr (hpositive x ⟨hp, hx.2⟩) |
| 66 | let S := range (fun q : UnitTwoSphere => N.coordinate_map (q, t)) |
| 67 | have hmemS {x : M} : x ∈ S ↔ x ∈ N.carrier ∧ (N.coordinate_inverse x).2 = t := by |
| 68 | constructor |
| 69 | · rintro ⟨q, rfl⟩ |
| 70 | exact ⟨N.coordinate_map_mem ⟨mem_univ _, ht⟩, |
| 71 | congrArg Prod.snd (N.coordinate_inverse_map _ ht)⟩ |
| 72 | · rintro ⟨hx, he⟩ |
| 73 | refine ⟨(N.coordinate_inverse x).1, ?_⟩ |
| 74 | rw [← he] |
| 75 | exact N.coordinate_map_inverse hx |
| 76 | have hlevel {x : M} (hx : x ∈ connectedComponent N.center) (he : H x = t) : x ∈ S := by |
| 77 | by_cases hxc : x ∈ N.carrier |
| 78 | · exact hmemS.mpr ⟨hxc, (hinside x hxc).symm.trans he⟩ |
| 79 | · rcases houtside x ⟨hx, hxc⟩ with hn | hp |
| 80 | · exact False.elim (ne_of_lt ht.1 (hn.symm.trans he)) |
| 81 | · exact False.elim (ne_of_gt ht.2 (hp.symm.trans he)) |
| 82 | let r := min (t + N.epsilon⁻¹) (N.epsilon⁻¹ - t) / 2 |
| 83 | have hmin : 0 < min (t + N.epsilon⁻¹) (N.epsilon⁻¹ - t) := |
| 84 | lt_min (by linarith [ht.1]) (by linarith [ht.2]) |
| 85 | have hr : 0 < r := half_pos hmin |
| 86 | have hlo : -N.epsilon⁻¹ < t - r := by |
| 87 | have hm := min_le_left (t + N.epsilon⁻¹) (N.epsilon⁻¹ - t) |
| 88 | dsimp only [r] |
| 89 | linarith |
| 90 | have hhi : t + r < N.epsilon⁻¹ := by |
| 91 | have hm := min_le_right (t + N.epsilon⁻¹) (N.epsilon⁻¹ - t) |
| 92 | dsimp only [r] |
| 93 | linarith |
| 94 | have hshift (s : Ioo (-r) r) : t + (s : ℝ) ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ := by |
| 95 | constructor <;> linarith [s.property.1, s.property.2] |
| 96 | let V := N.region (t - r) (t + r) |
| 97 | let e : (UnitTwoSphere × Ioo (-r) r) ≃ₜ V := |
| 98 | { toFun := fun z => ⟨N.coordinate_map (z.1, t + (z.2 : ℝ)), by |
| 99 | refine ⟨N.coordinate_map_mem ⟨mem_univ _, hshift z.2⟩, ?_, ?_⟩ |
| 100 | · rw [N.coordinate_inverse_map _ (hshift z.2)] |
| 101 | dsimp only |
| 102 | linarith [z.2.property.1] |
| 103 | · rw [N.coordinate_inverse_map _ (hshift z.2)] |
| 104 | dsimp only |
| 105 | linarith [z.2.property.2]⟩ |
| 106 | invFun := fun x => ((N.coordinate_inverse x).1, |
| 107 | ⟨(N.coordinate_inverse x).2 - t, by |
| 108 | constructor <;> linarith [x.property.2.1, x.property.2.2]⟩) |
| 109 | left_inv := by |
| 110 | intro z |
| 111 | apply Prod.ext |
| 112 | · change (N.coordinate_inverse (N.coordinate_map (z.1, t + (z.2 : ℝ)))).1 = z.1 |
| 113 | exact congrArg Prod.fst |
| 114 | (N.coordinate_inverse_map (z.1, t + (z.2 : ℝ)) (hshift z.2)) |
| 115 | · apply Subtype.ext |
| 116 | change (N.coordinate_inverse (N.coordinate_map (z.1, t + (z.2 : ℝ)))).2 - t = _ |
| 117 | rw [N.coordinate_inverse_map _ (hshift z.2)] |
| 118 | dsimp only |
| 119 | ring |
| 120 | right_inv := by |
| 121 | intro x |
| 122 | apply Subtype.ext |
| 123 | change N.coordinate_map ((N.coordinate_inverse x).1, |
| 124 | t + ((N.coordinate_inverse x).2 - t)) = x |
| 125 | rw [show t + ((N.coordinate_inverse x).2 - t) = (N.coordinate_inverse x).2 by ring] |
| 126 | exact N.coordinate_map_inverse x.property.1 |
| 127 | continuous_toFun := by |
| 128 | apply Continuous.subtype_mk |
| 129 | apply N.coordinate_map_smooth.continuousOn.comp_continuous |
| 130 | · exact continuous_fst.prodMk (continuous_const.add |
| 131 | (continuous_subtype_val.comp continuous_snd)) |
| 132 | · intro z |
| 133 | exact ⟨mem_univ _, hshift z.2⟩ |
| 134 | continuous_invFun := by |
| 135 | have hc : Continuous (fun x : V => N.coordinate_inverse x) := |
| 136 | N.coordinate_inverse_smooth.continuousOn.comp_continuous continuous_subtype_val |
| 137 | (fun x => x.property.1) |
| 138 | exact hc.fst.prodMk ((hc.snd.sub continuous_const).subtype_mk _) } |
| 139 | have hcentral : range (fun q : UnitTwoSphere => |
| 140 | (e (q, ⟨0, neg_lt_zero.mpr hr, hr⟩) : M)) = S := by |
| 141 | change range (fun q : UnitTwoSphere => N.coordinate_map (q, t + 0)) = |
| 142 | range (fun q : UnitTwoSphere => N.coordinate_map (q, t)) |
| 143 | simp only [add_zero] |
| 144 | let Cminus := (fun z => (e z : M)) '' {z | (z.2 : ℝ) < 0} |
| 145 | let Cplus := (fun z => (e z : M)) '' {z | 0 < (z.2 : ℝ)} |
| 146 | have hminus : IsConnected Cminus := Poincare.Topology.isConnected_collar_negative hr e |
| 147 | have hplus : IsConnected Cplus := Poincare.Topology.isConnected_collar_positive hr e |
| 148 | have hminusRegion : Cminus ⊆ N.region (-N.epsilon⁻¹) t := by |
| 149 | rintro x ⟨z, hz, rfl⟩ |
| 150 | refine ⟨(e z).property.1, (N.coordinate_inverse_mem _ (e z).property.1).2.1, ?_⟩ |
| 151 | change (N.coordinate_inverse (N.coordinate_map (z.1, t + (z.2 : ℝ)))).2 < t |
| 152 | rw [N.coordinate_inverse_map _ (hshift z.2)] |
| 153 | dsimp only |
| 154 | change (z.2 : ℝ) < 0 at hz |
| 155 | linarith |
| 156 | have hplusRegion : Cplus ⊆ N.region t N.epsilon⁻¹ := by |
| 157 | rintro x ⟨z, hz, rfl⟩ |
| 158 | refine ⟨(e z).property.1, ?_, (N.coordinate_inverse_mem _ (e z).property.1).2.2⟩ |
| 159 | change t < (N.coordinate_inverse (N.coordinate_map (z.1, t + (z.2 : ℝ)))).2 |
| 160 | rw [N.coordinate_inverse_map _ (hshift z.2)] |
| 161 | dsimp only |
| 162 | change 0 < (z.2 : ℝ) at hz |
| 163 | linarith |
| 164 | have hregionConnected (a b : ℝ) (hab : a < b) |
| 165 | (ha : -N.epsilon⁻¹ ≤ a) (hb : b ≤ N.epsilon⁻¹) : IsConnected (N.region a b) := by |
| 166 | have hdom : univ ×ˢ Ioo a b ⊆ N.cylinderDomain := by |
| 167 | rintro z ⟨_, hz⟩ |
| 168 | exact ⟨mem_univ _, ha.trans_lt hz.1, hz.2.trans_le hb⟩ |
| 169 | have heq : N.coordinate_map '' (univ ×ˢ Ioo a b) = N.region a b := by |
| 170 | apply Subset.antisymm |
| 171 | · rintro x ⟨z, hz, rfl⟩ |
| 172 | refine ⟨N.coordinate_map_mem (hdom hz), ?_⟩ |
| 173 | simpa only [N.coordinate_inverse_map z (hdom hz).2, mem_Ioo] using hz.2 |
| 174 | · intro x hx |
| 175 | exact ⟨N.coordinate_inverse x, ⟨mem_univ _, hx.2⟩, N.coordinate_map_inverse hx.1⟩ |
| 176 | rw [← heq] |
| 177 | exact (isConnected_univ.prod (isConnected_Ioo hab)).image _ |
| 178 | (N.coordinate_map_smooth.continuousOn.mono hdom) |
| 179 | obtain ⟨a, haHalf⟩ := hminus.nonempty |
| 180 | obtain ⟨b, hbHalf⟩ := hplus.nonempty |
| 181 | have ha := hminusRegion haHalf |
| 182 | have hb := hplusRegion hbHalf |
| 183 | have hnegS : N.region (-N.epsilon⁻¹) t ⊆ Sᶜ := by |
| 184 | intro x hx hxS |
| 185 | exact ne_of_lt hx.2.2 (hmemS.mp hxS).2 |
| 186 | have hposS : N.region t N.epsilon⁻¹ ⊆ Sᶜ := by |
| 187 | intro x hx hxS |
| 188 | exact ne_of_gt hx.2.1 (hmemS.mp hxS).2 |
| 189 | let A := connectedComponentIn Sᶜ a |
| 190 | let B := connectedComponentIn Sᶜ b |
| 191 | have hnegA : N.region (-N.epsilon⁻¹) t ⊆ A := |
| 192 | (hregionConnected _ _ ht.1 le_rfl ht.2.le).isPreconnected.subset_connectedComponentIn ha hnegS |
| 193 | have hposB : N.region t N.epsilon⁻¹ ⊆ B := |
| 194 | (hregionConnected _ _ ht.2 ht.1.le le_rfl).isPreconnected.subset_connectedComponentIn hb hposS |
| 195 | have hAc : IsConnected A := isConnected_connectedComponentIn_iff.mpr (hnegS ha) |
| 196 | have hAS : A ⊆ Sᶜ := connectedComponentIn_subset _ _ |
| 197 | have hBS : B ⊆ Sᶜ := connectedComponentIn_subset _ _ |
| 198 | have hAK : A ⊆ connectedComponent N.center := by |
| 199 | intro x hx |
| 200 | have hc := hAc.subset_connectedComponent (hnegA ha) hx |
| 201 | rwa [← connectedComponent_eq (N.m25_carrier_subset_connectedComponent ha.1)] at hc |
| 202 | have hne : A ≠ B := by |
| 203 | intro heq |
| 204 | have havoid : ∀ x ∈ A, H x ≠ t := by |
| 205 | intro x hx he |
| 206 | exact hAS hx (hlevel (hAK hx) he) |
| 207 | have hsign : t < H a := hAc.isPreconnected.lt_of_ne hH.continuousOn havoid |
| 208 | ⟨b, heq.symm ▸ hposB hb, by rw [hinside b hb.1]; exact hb.2.1⟩ (hnegA ha) |
| 209 | rw [hinside a ha.1] at hsign |
| 210 | exact (not_lt_of_gt ha.2.2) hsign |
| 211 | have hfront : S ⊆ frontier A ∩ frontier B := by |
| 212 | intro x hx |
| 213 | obtain ⟨q, rfl⟩ := hcentral.symm ▸ hx |
| 214 | have hn := Poincare.Topology.collar_center_mem_closure_negative hr e q |
| 215 | have hp := Poincare.Topology.collar_center_mem_closure_positive hr e q |
| 216 | refine ⟨⟨closure_mono (hminusRegion.trans hnegA) hn, ?_⟩, |
| 217 | ⟨closure_mono (hplusRegion.trans hposB) hp, ?_⟩⟩ |
| 218 | · intro hi |
| 219 | exact hAS (interior_subset hi) (hcentral ▸ mem_range_self q) |
| 220 | · intro hi |
| 221 | exact hBS (interior_subset hi) (hcentral ▸ mem_range_self q) |
| 222 | have hopp := Poincare.Topology.opposite_collar_components hr (N.isOpen_region _ _) e |
| 223 | (a := a) (b := b) |
| 224 | dsimp only at hopp |
| 225 | rw [hcentral] at hopp |
| 226 | have hout := hopp (hnegS ha) (hposS hb) hne hfront |
| 227 | refine ⟨a, b, ha, hb, hnegA, hposB, hne, hout.1, hout.2.1, ?_⟩ |
| 228 | exact hout.2.2.2.2.trans |
| 229 | (connectedComponent_eq (N.m25_carrier_subset_connectedComponent ha.1)).symm |
| 230 | |
| 231 | end PoincareMT.EpsilonNeck |