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.Persistence.CapTopology.OpenRecut |
| 3 | import Mathlib.Topology.Order.Compact |
| 4 | import Mathlib.Topology.Order.IntermediateValue |
| 5 | |
| 6 | /-! |
| 7 | # Actual compact truncations of tubes and capped tubes |
| 8 | |
| 9 | Claim 10.3 of Morgan--Tian, printed pp. 248-249, uses compact regions |
| 10 | between neck cross-sections. This file constructs finite cylinder slabs |
| 11 | from the actual cylinder model, captures compact subsets, and adjoins the |
| 12 | actual closed cap core. These are topological producers; the neck shortening |
| 13 | estimate that confines minimizing competitors is a separate step. |
| 14 | -/ |
| 15 | |
| 16 | set_option autoImplicit false |
| 17 | |
| 18 | open Set |
| 19 | open scoped Manifold ContDiff Bundle Topology |
| 20 | |
| 21 | universe u |
| 22 | |
| 23 | namespace PoincareMT.OpenCylinderModel |
| 24 | |
| 25 | variable {M : Type u} [TopologicalSpace M] |
| 26 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] {U : Set M} |
| 27 | |
| 28 | /-- Valid cylinder coordinates lie in the actual carrier (Claim 10.3). -/ |
| 29 | theorem coordinate_mem_m28 (T : OpenCylinderModel U) |
| 30 | {z : RoundCylinderSpace} (hz : z.2 ∈ Ioo (0 : ℝ) 1) : |
| 31 | T.coordinate z ∈ U := by |
| 32 | simpa only [T.coordinate_eq] using |
| 33 | (T.homeomorph (z.1, ⟨z.2, hz⟩)).property |
| 34 | |
| 35 | /-- The finite coordinate slab used in the tube confinement construction. -/ |
| 36 | def compactSlab (T : OpenCylinderModel U) (a b : ℝ) : Set M := |
| 37 | T.coordinate '' (univ ×ˢ Icc a b) |
| 38 | |
| 39 | /-- Slabs strictly inside the open cylinder are compact (Claim 10.3). -/ |
| 40 | theorem isCompact_compactSlab (T : OpenCylinderModel U) {a b : ℝ} |
| 41 | (ha : 0 < a) (hb : b < 1) : IsCompact (T.compactSlab a b) := by |
| 42 | apply (isCompact_univ.prod isCompact_Icc).image_of_continuousOn |
| 43 | apply T.coordinate_smooth.continuousOn.mono |
| 44 | intro z hz |
| 45 | exact ⟨mem_univ _, ha.trans_le hz.2.1, hz.2.2.trans_lt hb⟩ |
| 46 | |
| 47 | /-- Compact finite slabs stay in the actual tube carrier (Claim 10.3). -/ |
| 48 | theorem compactSlab_subset (T : OpenCylinderModel U) {a b : ℝ} |
| 49 | (ha : 0 < a) (hb : b < 1) : T.compactSlab a b ⊆ U := by |
| 50 | rintro x ⟨z, hz, rfl⟩ |
| 51 | exact T.coordinate_mem_m28 ⟨ha.trans_le hz.2.1, hz.2.2.trans_lt hb⟩ |
| 52 | |
| 53 | /-- In the actual carrier, slab membership is the inverse-height condition. -/ |
| 54 | theorem mem_compactSlab_iff (T : OpenCylinderModel U) {a b : ℝ} |
| 55 | (ha : 0 < a) (hb : b < 1) {x : M} : |
| 56 | x ∈ T.compactSlab a b ↔ x ∈ U ∧ (T.inverse x).2 ∈ Icc a b := by |
| 57 | constructor |
| 58 | · rintro ⟨z, hz, rfl⟩ |
| 59 | have hz' : z ∈ univ ×ˢ Ioo (0 : ℝ) 1 := |
| 60 | ⟨mem_univ _, ha.trans_le hz.2.1, hz.2.2.trans_lt hb⟩ |
| 61 | exact ⟨T.coordinate_mem_m28 hz'.2, by rw [T.left_inverse hz']; exact hz.2⟩ |
| 62 | · rintro ⟨hx, hh⟩ |
| 63 | exact ⟨T.inverse x, ⟨mem_univ _, hh⟩, T.right_inverse hx⟩ |
| 64 | |
| 65 | /-- Every compact subset of a tube is captured by a finite compact slab. |
| 66 | The cutoffs are chosen after the compact subset, as in Claim 10.3. -/ |
| 67 | theorem exists_compactSlab_capturing (T : OpenCylinderModel U) |
| 68 | {K : Set M} (hK : IsCompact K) (hKU : K ⊆ U) : |
| 69 | ∃ a b : ℝ, 0 < a ∧ a < b ∧ b < 1 ∧ K ⊆ T.compactSlab a b := by |
| 70 | have hc : ContinuousOn (fun x => (T.inverse x).2) K := |
| 71 | (continuous_snd.comp_continuousOn T.inverse_smooth.continuousOn).mono hKU |
| 72 | obtain ⟨lo, hlo, hlow⟩ := hK.exists_forall_le' hc |
| 73 | (fun x hx => (T.inverse_mem x (hKU hx)).2.1) |
| 74 | obtain ⟨margin, hmargin, hhigh⟩ := hK.exists_forall_le' |
| 75 | (continuousOn_const.sub hc) |
| 76 | (fun x hx => sub_pos.mpr (T.inverse_mem x (hKU hx)).2.2) |
| 77 | have hhi : 1 - margin < (1 : ℝ) := by linarith |
| 78 | have hhigh' (x : M) (hx : x ∈ K) : (T.inverse x).2 ≤ 1 - margin := by |
| 79 | have hh := hhigh x hx |
| 80 | change margin ≤ 1 - (T.inverse x).2 at hh |
| 81 | linarith |
| 82 | obtain ⟨a, ha, halow⟩ := exists_between (lt_min hlo (by norm_num : (0 : ℝ) < 1 / 2)) |
| 83 | obtain ⟨b, hhib, hb⟩ := exists_between (max_lt hhi (by norm_num : (1 / 2 : ℝ) < 1)) |
| 84 | have hab : a < b := |
| 85 | (halow.trans_le (min_le_right _ _)).trans |
| 86 | ((le_max_right _ _).trans_lt hhib) |
| 87 | refine ⟨a, b, ha, hab, hb, ?_⟩ |
| 88 | intro x hx |
| 89 | exact (T.mem_compactSlab_iff ha hb).mpr ⟨hKU hx, |
| 90 | (halow.trans_le (min_le_left _ _)).le.trans (hlow x hx), |
| 91 | (hhigh' x hx).trans ((le_max_left _ _).trans_lt hhib).le⟩ |
| 92 | |
| 93 | /-- A continuous selected path is captured by one actual compact tube slab. -/ |
| 94 | theorem exists_compactSlab_capturing_path (T : OpenCylinderModel U) |
| 95 | {γ : ℝ → M} (hγ : ContinuousOn γ (Icc (0 : ℝ) 1)) |
| 96 | (hγU : MapsTo γ (Icc (0 : ℝ) 1) U) : |
| 97 | ∃ a b : ℝ, 0 < a ∧ a < b ∧ b < 1 ∧ |
| 98 | MapsTo γ (Icc (0 : ℝ) 1) (T.compactSlab a b) := by |
| 99 | obtain ⟨a, b, ha, hab, hb, hcapture⟩ := |
| 100 | T.exists_compactSlab_capturing (isCompact_Icc.image_of_continuousOn hγ) |
| 101 | (by rintro x ⟨t, ht, rfl⟩; exact hγU ht) |
| 102 | exact ⟨a, b, ha, hab, hb, fun t ht => hcapture ⟨t, ht, rfl⟩⟩ |
| 103 | |
| 104 | /-- A path between opposite cylinder heights crosses the intervening |
| 105 | coordinate sphere. This is the model-side separation used in Claim 10.3. -/ |
| 106 | theorem path_crosses_coordinate_sphere (T : OpenCylinderModel U) |
| 107 | {γ : ℝ → M} {a b c : ℝ} (hab : a ≤ b) |
| 108 | (hγ : ContinuousOn γ (Icc a b)) (hγU : MapsTo γ (Icc a b) U) |
| 109 | (hc : c ∈ Icc (T.inverse (γ a)).2 (T.inverse (γ b)).2) : |
| 110 | ∃ t ∈ Icc a b, γ t ∈ T.coordinate '' (univ ×ˢ ({c} : Set ℝ)) := by |
| 111 | have hheight : ContinuousOn (fun t => (T.inverse (γ t)).2) (Icc a b) := |
| 112 | continuous_snd.comp_continuousOn |
| 113 | (T.inverse_smooth.continuousOn.comp hγ hγU) |
| 114 | obtain ⟨t, ht, heq⟩ := intermediate_value_Icc hab hheight hc |
| 115 | exact ⟨t, ht, T.inverse (γ t), ⟨mem_univ _, heq⟩, |
| 116 | T.right_inverse (hγU ht)⟩ |
| 117 | |
| 118 | end PoincareMT.OpenCylinderModel |
| 119 | |
| 120 | namespace PoincareMT.CappedTubeCertificate |
| 121 | |
| 122 | variable {M : Type u} [TopologicalSpace M] |
| 123 | [ChartedSpace (EuclideanSpace ℝ (Fin 3)) M] |
| 124 | [IsManifold (𝓡 3) ∞ M] [MeasurableSpace M] [BorelSpace M] |
| 125 | [T2Space M] [T3Space M] {g : RiemannianMetric 3 M} |
| 126 | |
| 127 | omit [T2Space M] in |
| 128 | /-- The actual closed cap core and a finite tube slab form a compact set |
| 129 | inside the singly capped tube (Claim 10.3, pp. 248-249). -/ |
| 130 | theorem isCompact_closedCore_union_slab (T : CappedTubeCertificate g) |
| 131 | {a b : ℝ} (ha : 0 < a) (hb : b < 1) : |
| 132 | IsCompact (T.cap.closed_core ∪ T.tube.cylinder.compactSlab a b) ∧ |
| 133 | T.cap.closed_core ∪ T.tube.cylinder.compactSlab a b ⊆ T.carrier := by |
| 134 | refine ⟨T.cap.closed_core_compact.union |
| 135 | (T.tube.cylinder.isCompact_compactSlab ha hb), ?_⟩ |
| 136 | apply union_subset |
| 137 | · have hcore : T.cap.closed_core ⊆ T.cap.carrier := by |
| 138 | rw [T.cap.closed_core_eq_complement_end] |
| 139 | exact sdiff_subset |
| 140 | exact hcore.trans T.cap_subset |
| 141 | · exact (T.tube.cylinder.compactSlab_subset ha hb).trans T.tube_subset |
| 142 | |
| 143 | omit [T2Space M] in |
| 144 | /-- A fixed strict cap recut contains every capped-tube point outside the |
| 145 | tube. The cutoff is produced by the actual attachment tail (Claim 10.3). -/ |
| 146 | theorem exists_recut_complement_subset_tube (T : CappedTubeCertificate g) : |
| 147 | ∃ b : ℝ, 0 < b ∧ b < T.cap.epsilon⁻¹ ∧ |
| 148 | T.carrier \ (T.cap.closed_core ∪ |
| 149 | T.cap.end_neck.region (-T.cap.epsilon⁻¹) b) ⊆ T.tube.carrier := by |
| 150 | obtain ⟨s, hs, htail⟩ := T.attachment.cap_tail |
| 151 | obtain ⟨b, hsb, hb⟩ := exists_between hs.2 |
| 152 | refine ⟨b, hs.1.trans hsb, hb, ?_⟩ |
| 153 | intro x hx |
| 154 | have hxunion : x ∈ T.cap.carrier ∪ T.tube.carrier := |
| 155 | T.carrier_eq_union ▸ hx.1 |
| 156 | rcases hxunion with hxcap | hxtube |
| 157 | · have hxend : x ∈ T.cap.end_neck.carrier := by |
| 158 | by_contra hxend |
| 159 | apply hx.2 |
| 160 | apply Or.inl |
| 161 | rw [T.cap.closed_core_eq_complement_end] |
| 162 | exact ⟨hxcap, hxend⟩ |
| 163 | have hlow : -T.cap.epsilon⁻¹ < (T.cap.end_neck.coordinate_inverse x).2 := by |
| 164 | simpa only [T.cap.end_neck_epsilon] using |
| 165 | (T.cap.end_neck.coordinate_inverse_mem x hxend).2.1 |
| 166 | have hhigh : (T.cap.end_neck.coordinate_inverse x).2 < T.cap.epsilon⁻¹ := by |
| 167 | simpa only [T.cap.end_neck_epsilon] using |
| 168 | (T.cap.end_neck.coordinate_inverse_mem x hxend).2.2 |
| 169 | have hbcoord : b ≤ (T.cap.end_neck.coordinate_inverse x).2 := by |
| 170 | by_contra h |
| 171 | exact hx.2 (Or.inr ⟨hxend, hlow, lt_of_not_ge h⟩) |
| 172 | exact htail ⟨hxend, hsb.trans_le hbcoord, hhigh⟩ |
| 173 | · exact hxtube |
| 174 | |
| 175 | /-- Every compact subset of the actual capped carrier is captured by the |
| 176 | compact closure of a strict cap recut together with one finite tube slab. |
| 177 | The cap cutoff comes from the attachment, not a target confinement premise. -/ |
| 178 | theorem exists_compact_recut_union_slab_capturing (T : CappedTubeCertificate g) |
| 179 | {K : Set M} (hK : IsCompact K) (hKT : K ⊆ T.carrier) : |
| 180 | ∃ b a c : ℝ, 0 < b ∧ b < T.cap.epsilon⁻¹ ∧ |
| 181 | 0 < a ∧ a < c ∧ c < 1 ∧ |
| 182 | IsCompact (closure (T.cap.closed_core ∪ |
| 183 | T.cap.end_neck.region (-T.cap.epsilon⁻¹) b) ∪ |
| 184 | T.tube.cylinder.compactSlab a c) ∧ |
| 185 | (closure (T.cap.closed_core ∪ |
| 186 | T.cap.end_neck.region (-T.cap.epsilon⁻¹) b) ∪ |
| 187 | T.tube.cylinder.compactSlab a c) ⊆ T.carrier ∧ |
| 188 | K ⊆ closure (T.cap.closed_core ∪ |
| 189 | T.cap.end_neck.region (-T.cap.epsilon⁻¹) b) ∪ |
| 190 | T.tube.cylinder.compactSlab a c := by |
| 191 | obtain ⟨b, hb, hbA, houtside⟩ := T.exists_recut_complement_subset_tube |
| 192 | have hA : 0 < T.cap.epsilon⁻¹ := inv_pos.mpr T.cap.epsilon_pos |
| 193 | have hneg : -T.cap.epsilon⁻¹ < b := (neg_neg_of_pos hA).trans hb |
| 194 | let W : Set M := T.cap.closed_core ∪ |
| 195 | T.cap.end_neck.region (-T.cap.epsilon⁻¹) b |
| 196 | obtain ⟨hWopen, hWcompact, hWcap⟩ := T.cap.open_precompact_recut hneg hbA |
| 197 | have hrest : K \ W ⊆ T.tube.carrier := by |
| 198 | intro x hx |
| 199 | exact houtside ⟨hKT hx.1, hx.2⟩ |
| 200 | obtain ⟨a, c, ha, hac, hc, hslab⟩ := |
| 201 | T.tube.cylinder.exists_compactSlab_capturing (hK.diff hWopen) hrest |
| 202 | refine ⟨b, a, c, hb, hbA, ha, hac, hc, |
| 203 | hWcompact.union (T.tube.cylinder.isCompact_compactSlab ha hc), |
| 204 | union_subset (hWcap.trans T.cap_subset) |
| 205 | ((T.tube.cylinder.compactSlab_subset ha hc).trans T.tube_subset), ?_⟩ |
| 206 | intro x hx |
| 207 | by_cases hxW : x ∈ W |
| 208 | · exact Or.inl (subset_closure hxW) |
| 209 | · exact Or.inr (hslab ⟨hx, hxW⟩) |
| 210 | |
| 211 | end PoincareMT.CappedTubeCertificate |