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.CanonicalNeighborhood.Neck.Separation.Ambient |
| 2 | import PoincareLib.Topology.Manifold.NeckCap.Tube.Gluing.ContainedCollar |
| 3 | import PoincareLib.Topology.Connected.BoundaryIncidence |
| 4 | |
| 5 | /-! |
| 6 | # A compact side of a neck contained in a coordinate neighborhood |
| 7 | |
| 8 | The local separator step of Morgan--Tian Claims 11.14--11.15, pp. 275--277, |
| 9 | uses Proposition 2.19 and Lemma 2.20, pp. 31--32. A thin collar inside the |
| 10 | supplied Euclidean neighborhood yields an actual ambient compact side. |
| 11 | Preconnectedness retains one entire original coordinate half-neck. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | |
| 16 | open Set |
| 17 | open scoped Manifold ContDiff Topology |
| 18 | |
| 19 | universe u |
| 20 | |
| 21 | namespace PoincareMT.M30 |
| 22 | |
| 23 | /-- The local compact-side implication used in Claims 11.14--11.15, |
| 24 | pp. 275--277, with the coordinate signs of Proposition 2.19 and Lemma 2.20, |
| 25 | pp. 31--32. The frontier and the full half-neck are the original neck sets. -/ |
| 26 | theorem exists_precompact_neck_side_of_central_sphere_subset_chart |
| 27 | {M : Type u} [TopologicalSpace M] [T2Space M] [T3Space M] |
| 28 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 29 | [IsManifold (𝓡 3) ∞ M] |
| 30 | [MeasurableSpace M] [BorelSpace M] |
| 31 | {g : RiemannianMetric 3 M} (N : EpsilonNeck g) |
| 32 | {U : Set M} (hU : IsOpen U) |
| 33 | (h : U ≃ₜ EuclideanSpace ℝ (Fin 3)) |
| 34 | (hS : N.central_sphere ⊆ U) : |
| 35 | ∃ A : Set M, |
| 36 | IsOpen A ∧ IsCompact (closure A) ∧ closure A ⊆ U ∧ |
| 37 | frontier A = N.central_sphere ∧ |
| 38 | (N.region (-N.epsilon⁻¹) 0 ⊆ A ∨ |
| 39 | N.region 0 N.epsilon⁻¹ ⊆ A) := by |
| 40 | classical |
| 41 | let : ConnectedSpace UnitTwoSphere := by |
| 42 | apply isConnected_iff_connectedSpace.mp |
| 43 | exact isConnected_sphere |
| 44 | (by rw [← Module.finrank_eq_rank]; norm_num) 0 (by norm_num) |
| 45 | have heps : 0 < N.epsilon⁻¹ := inv_pos.mpr N.epsilon_pos |
| 46 | obtain ⟨r, hr, hcollar⟩ := N.exists_slice_collar_in_open |
| 47 | (s := 0) ⟨neg_lt_zero.mpr heps, heps⟩ U hU (by |
| 48 | intro q |
| 49 | apply hS |
| 50 | rw [N.central_sphere_eq] |
| 51 | exact ⟨(q, 0), ⟨mem_univ _, rfl⟩, rfl⟩) |
| 52 | have hcollar' (q : UnitTwoSphere) (t : ℝ) (ht : |t| < r) : |
| 53 | t ∈ Ioo (-N.epsilon⁻¹) N.epsilon⁻¹ ∧ |
| 54 | N.coordinate_map (q, t) ∈ U := by |
| 55 | simpa only [zero_add] using hcollar q t ht |
| 56 | let D : Set RoundCylinderSpace := univ ×ˢ Ioo (-r) r |
| 57 | have hD : D ⊆ N.coordinatePartialHomeomorph.source := by |
| 58 | intro z hz |
| 59 | exact ⟨mem_univ _, (hcollar' z.1 z.2 (abs_lt.mpr hz.2)).1⟩ |
| 60 | let V : Set M := N.coordinate_map '' D |
| 61 | have hV : IsOpen V := |
| 62 | N.coordinatePartialHomeomorph.isOpen_image_of_subset_source |
| 63 | (isOpen_univ.prod isOpen_Ioo) hD |
| 64 | have hVU : V ⊆ U := by |
| 65 | rintro x ⟨z, hz, rfl⟩ |
| 66 | exact (hcollar' z.1 z.2 (abs_lt.mpr hz.2)).2 |
| 67 | let eD : (UnitTwoSphere × Ioo (-r) r) ≃ₜ D := |
| 68 | ((Homeomorph.Set.univ UnitTwoSphere).symm.prodCongr |
| 69 | (Homeomorph.refl (Ioo (-r) r))).trans |
| 70 | (Homeomorph.Set.prod (univ : Set UnitTwoSphere) (Ioo (-r) r)).symm |
| 71 | let eM : (UnitTwoSphere × Ioo (-r) r) ≃ₜ V := |
| 72 | eD.trans (N.coordinatePartialHomeomorph.homeomorphOfImageSubsetSource hD rfl) |
| 73 | let fU : UnitTwoSphere × Ioo (-r) r → U := |
| 74 | fun z => ⟨(eM z : M), hVU (eM z).property⟩ |
| 75 | have hfUc : Continuous fU := |
| 76 | (continuous_subtype_val.comp eM.continuous).subtype_mk _ |
| 77 | have hfUo : IsOpenMap fU := |
| 78 | (hV.isOpenMap_subtype_val.comp eM.isOpenMap).subtype_mk _ |
| 79 | have hfUi : Function.Injective fU := by |
| 80 | intro z w hzw |
| 81 | apply eM.injective |
| 82 | apply Subtype.ext |
| 83 | exact congrArg (fun x : U => (x : M)) hzw |
| 84 | let f : UnitTwoSphere × Ioo (-r) r → EuclideanSpace ℝ (Fin 3) := h ∘ fU |
| 85 | have hf : Topology.IsOpenEmbedding f := |
| 86 | Topology.IsOpenEmbedding.of_continuous_injective_isOpenMap |
| 87 | (h.continuous.comp hfUc) (h.injective.comp hfUi) (h.isOpenMap.comp hfUo) |
| 88 | let e : (UnitTwoSphere × Ioo (-r) r) ≃ₜ range f := hf.isEmbedding.toHomeomorph |
| 89 | let j : EuclideanSpace ℝ (Fin 3) → M := fun z => (h.symm z : M) |
| 90 | have hjc : Continuous j := continuous_subtype_val.comp h.symm.continuous |
| 91 | have hji : Function.Injective j := Subtype.val_injective.comp h.symm.injective |
| 92 | have hjo : IsOpenMap j := hU.isOpenMap_subtype_val.comp h.symm.isOpenMap |
| 93 | have hemap (z : UnitTwoSphere × Ioo (-r) r) : |
| 94 | j (e z : EuclideanSpace ℝ (Fin 3)) = N.coordinate_map (z.1, (z.2 : ℝ)) := by |
| 95 | change (h.symm (h (fU z)) : M) = _ |
| 96 | rw [h.symm_apply_apply] |
| 97 | rfl |
| 98 | let S : Set (EuclideanSpace ℝ (Fin 3)) := |
| 99 | range (fun q : UnitTwoSphere => |
| 100 | (e (q, ⟨0, neg_lt_zero.mpr hr, hr⟩) : EuclideanSpace ℝ (Fin 3))) |
| 101 | have hSc : IsCompact S := isCompact_range |
| 102 | ((continuous_subtype_val.comp e.continuous).comp |
| 103 | (continuous_id.prodMk continuous_const)) |
| 104 | have hjS : j '' S = N.central_sphere := by |
| 105 | rw [N.central_sphere_eq] |
| 106 | ext x |
| 107 | constructor |
| 108 | · rintro ⟨z, ⟨q, rfl⟩, rfl⟩ |
| 109 | rw [hemap] |
| 110 | exact ⟨(q, 0), ⟨mem_univ _, rfl⟩, rfl⟩ |
| 111 | · rintro ⟨⟨q, t⟩, ⟨_, ht⟩, rfl⟩ |
| 112 | have ht0 : t = 0 := ht |
| 113 | subst t |
| 114 | exact ⟨e (q, ⟨0, neg_lt_zero.mpr hr, hr⟩), ⟨q, rfl⟩, hemap _⟩ |
| 115 | obtain ⟨A₀, B₀, hA₀, hB₀, _hAc, _hBc, hdisj, hcover, |
| 116 | hfrontA₀, hfrontB₀, hneg, hpos⟩ := |
| 117 | Poincare.Topology.exists_collar_complementary_regions hr hf.isOpen_range e |
| 118 | have hbounded := |
| 119 | Poincare.Topology.bounded_side_of_compact_complement_partition_euclidean_three |
| 120 | hSc hA₀ hB₀ hdisj hcover |
| 121 | obtain ⟨C, hCopen, hCc, hCfront, hCside⟩ : |
| 122 | ∃ C : Set (EuclideanSpace ℝ (Fin 3)), |
| 123 | IsOpen C ∧ IsCompact (closure C) ∧ frontier C = S ∧ |
| 124 | ((fun z => (e z : EuclideanSpace ℝ (Fin 3))) '' |
| 125 | {z | (z.2 : ℝ) < 0} ⊆ C ∨ |
| 126 | (fun z => (e z : EuclideanSpace ℝ (Fin 3))) '' |
| 127 | {z | 0 < (z.2 : ℝ)} ⊆ C) := by |
| 128 | rcases hbounded with ⟨hAb, _⟩ | ⟨hBb, _⟩ |
| 129 | · exact ⟨A₀, hA₀, hAb.isCompact_closure, hfrontA₀, Or.inl hneg⟩ |
| 130 | · exact ⟨B₀, hB₀, hBb.isCompact_closure, hfrontB₀, Or.inr hpos⟩ |
| 131 | let A : Set M := j '' C |
| 132 | have hA : IsOpen A := hjo C hCopen |
| 133 | have hclosure : j '' closure C = closure A := |
| 134 | image_closure_of_isCompact hCc hjc.continuousOn |
| 135 | have hAc : IsCompact (closure A) := hclosure ▸ hCc.image hjc |
| 136 | have hAU : closure A ⊆ U := by |
| 137 | rw [← hclosure] |
| 138 | rintro x ⟨z, _, rfl⟩ |
| 139 | exact (h.symm z).property |
| 140 | have hpre : j ⁻¹' frontier A = frontier C := by |
| 141 | rw [hjo.preimage_frontier_eq_frontier_preimage hjc, |
| 142 | show j ⁻¹' A = C from preimage_image_eq C hji] |
| 143 | have hfront : frontier A = N.central_sphere := by |
| 144 | rw [← hjS, ← hCfront] |
| 145 | apply Subset.antisymm |
| 146 | · intro x hx |
| 147 | have hxU : x ∈ U := hAU (frontier_subset_closure hx) |
| 148 | let z := h ⟨x, hxU⟩ |
| 149 | have hz : j z = x := by |
| 150 | change (h.symm (h ⟨x, hxU⟩) : M) = x |
| 151 | rw [h.symm_apply_apply] |
| 152 | refine ⟨z, ?_, hz⟩ |
| 153 | rw [← hpre] |
| 154 | change j z ∈ frontier A |
| 155 | rwa [hz] |
| 156 | · rintro x ⟨z, hz, rfl⟩ |
| 157 | exact show z ∈ j ⁻¹' frontier A from hpre.symm ▸ hz |
| 158 | refine ⟨A, hA, hAc, hAU, hfront, ?_⟩ |
| 159 | let q : UnitTwoSphere := Classical.choice (inferInstance : Nonempty UnitTwoSphere) |
| 160 | rcases hCside with hnegative | hpositive |
| 161 | · left |
| 162 | have hconn : IsPreconnected (N.region (-N.epsilon⁻¹) 0) := by |
| 163 | rw [← N.coordinate_negative_image] |
| 164 | exact (Poincare.Topology.isConnected_collar_negative heps N.coordinate).isPreconnected |
| 165 | have havoid : Disjoint (N.region (-N.epsilon⁻¹) 0) (frontier A) := by |
| 166 | rw [hfront] |
| 167 | exact (N.central_sphere_disjoint_region _ _ (Or.inl le_rfl)).symm |
| 168 | let z : UnitTwoSphere × Ioo (-r) r := |
| 169 | (q, ⟨-r / 2, by constructor <;> linarith⟩) |
| 170 | have hzneg : (z.2 : ℝ) < 0 := by dsimp only [z]; linarith |
| 171 | have hzD : (z.1, (z.2 : ℝ)) ∈ N.cylinderDomain := hD (eD z).property |
| 172 | have hzregion : N.coordinate_map (z.1, (z.2 : ℝ)) ∈ |
| 173 | N.region (-N.epsilon⁻¹) 0 := by |
| 174 | refine ⟨N.coordinate_map_mem hzD, ?_, ?_⟩ |
| 175 | · rw [N.coordinate_inverse_coordinate_map hzD] |
| 176 | exact hzD.2.1 |
| 177 | · rw [N.coordinate_inverse_coordinate_map hzD] |
| 178 | exact hzneg |
| 179 | have hzA : N.coordinate_map (z.1, (z.2 : ℝ)) ∈ A := by |
| 180 | rw [← hemap z] |
| 181 | exact ⟨e z, hnegative ⟨z, hzneg, rfl⟩, rfl⟩ |
| 182 | have hmeet : (N.region (-N.epsilon⁻¹) 0 ∩ interior A).Nonempty := by |
| 183 | rw [hA.interior_eq] |
| 184 | exact ⟨_, hzregion, hzA⟩ |
| 185 | simpa only [hA.interior_eq] using |
| 186 | Poincare.Topology.preconnected_subset_interior_of_disjoint_frontier hconn havoid hmeet |
| 187 | · right |
| 188 | have hconn : IsPreconnected (N.region 0 N.epsilon⁻¹) := by |
| 189 | rw [← N.coordinate_positive_image] |
| 190 | exact (Poincare.Topology.isConnected_collar_positive heps N.coordinate).isPreconnected |
| 191 | have havoid : Disjoint (N.region 0 N.epsilon⁻¹) (frontier A) := by |
| 192 | rw [hfront] |
| 193 | exact (N.central_sphere_disjoint_region _ _ (Or.inr le_rfl)).symm |
| 194 | let z : UnitTwoSphere × Ioo (-r) r := |
| 195 | (q, ⟨r / 2, by constructor <;> linarith⟩) |
| 196 | have hzpos : 0 < (z.2 : ℝ) := by dsimp only [z]; linarith |
| 197 | have hzD : (z.1, (z.2 : ℝ)) ∈ N.cylinderDomain := hD (eD z).property |
| 198 | have hzregion : N.coordinate_map (z.1, (z.2 : ℝ)) ∈ |
| 199 | N.region 0 N.epsilon⁻¹ := by |
| 200 | refine ⟨N.coordinate_map_mem hzD, ?_, ?_⟩ |
| 201 | · rw [N.coordinate_inverse_coordinate_map hzD] |
| 202 | exact hzpos |
| 203 | · rw [N.coordinate_inverse_coordinate_map hzD] |
| 204 | exact hzD.2.2 |
| 205 | have hzA : N.coordinate_map (z.1, (z.2 : ℝ)) ∈ A := by |
| 206 | rw [← hemap z] |
| 207 | exact ⟨e z, hpositive ⟨z, hzpos, rfl⟩, rfl⟩ |
| 208 | have hmeet : (N.region 0 N.epsilon⁻¹ ∩ interior A).Nonempty := by |
| 209 | rw [hA.interior_eq] |
| 210 | exact ⟨_, hzregion, hzA⟩ |
| 211 | simpa only [hA.interior_eq] using |
| 212 | Poincare.Topology.preconnected_subset_interior_of_disjoint_frontier hconn havoid hmeet |
| 213 | |
| 214 | end PoincareMT.M30 |