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.Topology.Manifold.NeckCap.Theory |
| 3 | import Mathlib.Data.Int.Init |
| 4 | import Mathlib.Geometry.Manifold.ContMDiff.Constructions |
| 5 | import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace |
| 6 | |
| 7 | /-! |
| 8 | # Integer recursion for actual cylinder transitions |
| 9 | |
| 10 | The global transition maps are accumulated from an arbitrary integer |
| 11 | base. Their positive and negative affine tails propagate at fixed |
| 12 | thresholds and give uniform escape estimates. This is C6 of the approved |
| 13 | chain-chart-recursion-plan, for Morgan--Tian A.13, pp. 504-505, and |
| 14 | the tube coordinate construction of A.19, p. 507. |
| 15 | -/ |
| 16 | |
| 17 | set_option autoImplicit false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Manifold ContDiff |
| 21 | |
| 22 | namespace PoincareMT |
| 23 | |
| 24 | /-- Actual positive fiber transitions admit a global integer cocycle with |
| 25 | smooth tail shifts and uniform escape in both directions; MT A.13/A.19, |
| 26 | chain-chart-recursion-plan, C6. -/ |
| 27 | theorem exists_integer_cylinder_cocycle |
| 28 | {L : ℝ} (hL : 0 < L) |
| 29 | (A : ℤ → Diffeomorph (𝓡 2) (𝓡 2) |
| 30 | UnitTwoSphere UnitTwoSphere ∞) |
| 31 | (D : ℤ → Diffeomorph ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 32 | ((𝓡 2).prod 𝓘(ℝ, ℝ)) RoundCylinderSpace RoundCylinderSpace ∞) |
| 33 | (m p : ℤ → UnitTwoSphere → ℝ) |
| 34 | (hfirst : ∀ i : ℤ, ∀ z : RoundCylinderSpace, (D i z).1 = A i z.1) |
| 35 | (hmono : ∀ i : ℤ, ∀ q : UnitTwoSphere, |
| 36 | StrictMono (fun s : ℝ => (D i (q, s)).2)) |
| 37 | (hshift : ∀ i : ℤ, ∀ q : UnitTwoSphere, |
| 38 | m i q < -(3 * L / 16) ∧ p i q < -(9 * L / 32)) |
| 39 | (hlower : ∀ i : ℤ, ∀ q : UnitTwoSphere, ∀ s : ℝ, |
| 40 | s ≤ 11 * L / 16 → D i (q, s) = (A i q, s + m i q)) |
| 41 | (hupper : ∀ i : ℤ, ∀ q : UnitTwoSphere, ∀ s : ℝ, |
| 42 | 13 * L / 16 ≤ s → D i (q, s) = (A i q, s + p i q)) |
| 43 | (k : ℤ) : |
| 44 | ∃ (F : ℤ → Diffeomorph ((𝓡 2).prod 𝓘(ℝ, ℝ)) |
| 45 | ((𝓡 2).prod 𝓘(ℝ, ℝ)) RoundCylinderSpace RoundCylinderSpace ∞) |
| 46 | (B : ℤ → Diffeomorph (𝓡 2) (𝓡 2) |
| 47 | UnitTwoSphere UnitTwoSphere ∞) |
| 48 | (c : ℤ → UnitTwoSphere → ℝ), |
| 49 | F k = Diffeomorph.refl ((𝓡 2).prod 𝓘(ℝ, ℝ)) RoundCylinderSpace ∞ ∧ |
| 50 | B k = Diffeomorph.refl (𝓡 2) UnitTwoSphere ∞ ∧ |
| 51 | (∀ i : ℤ, F i = (D i).trans (F (i + 1)) ∧ |
| 52 | B i = (A i).trans (B (i + 1))) ∧ |
| 53 | (∀ i : ℤ, ∀ z : RoundCylinderSpace, |
| 54 | (F i z).1 = B i z.1 ∧ ((F i).symm z).1 = (B i).symm z.1) ∧ |
| 55 | (∀ i : ℤ, ∀ q : UnitTwoSphere, |
| 56 | StrictMono (fun s : ℝ => (F i (q, s)).2)) ∧ |
| 57 | (∀ i : ℤ, ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ (c i)) ∧ |
| 58 | (∀ i : ℤ, k ≤ i → |
| 59 | (∀ q : UnitTwoSphere, ∀ s : ℝ, 9 * L / 16 ≤ s → |
| 60 | F i (q, s) = (B i q, s + c i q)) ∧ |
| 61 | (∀ q : UnitTwoSphere, ((i - k : ℤ) : ℝ) * (9 * L / 32) ≤ c i q)) ∧ |
| 62 | (∀ i : ℤ, i ≤ k → |
| 63 | (∀ q : UnitTwoSphere, ∀ s : ℝ, s ≤ 5 * L / 8 → |
| 64 | F i (q, s) = (B i q, s + c i q)) ∧ |
| 65 | (∀ q : UnitTwoSphere, c i q ≤ -(((k - i : ℤ) : ℝ) * (3 * L / 16)))) := by |
| 66 | classical |
| 67 | let J := (𝓡 2).prod 𝓘(ℝ, ℝ) |
| 68 | let X : ℤ → |
| 69 | Diffeomorph J J RoundCylinderSpace RoundCylinderSpace ∞ × |
| 70 | Diffeomorph (𝓡 2) (𝓡 2) UnitTwoSphere UnitTwoSphere ∞ := fun i => |
| 71 | Int.inductionOn' i k |
| 72 | (Diffeomorph.refl J RoundCylinderSpace ∞, |
| 73 | Diffeomorph.refl (𝓡 2) UnitTwoSphere ∞) |
| 74 | (fun j _ e => ((D j).symm.trans e.1, (A j).symm.trans e.2)) |
| 75 | (fun j _ e => ((D (j - 1)).trans e.1, (A (j - 1)).trans e.2)) |
| 76 | let F := fun i => (X i).1 |
| 77 | let B := fun i => (X i).2 |
| 78 | have hXbase : X k = (Diffeomorph.refl J RoundCylinderSpace ∞, |
| 79 | Diffeomorph.refl (𝓡 2) UnitTwoSphere ∞) := by |
| 80 | exact Int.inductionOn'_self |
| 81 | have hXsucc (i : ℤ) (hi : k ≤ i) : |
| 82 | X (i + 1) = ((D i).symm.trans (F i), (A i).symm.trans (B i)) := by |
| 83 | exact Int.inductionOn'_add_one hi |
| 84 | have hXpred (i : ℤ) (hi : i ≤ k) : |
| 85 | X (i - 1) = ((D (i - 1)).trans (F i), (A (i - 1)).trans (B i)) := by |
| 86 | exact Int.inductionOn'_sub_one hi |
| 87 | have hFk : F k = Diffeomorph.refl J RoundCylinderSpace ∞ := |
| 88 | congrArg Prod.fst hXbase |
| 89 | have hBk : B k = Diffeomorph.refl (𝓡 2) UnitTwoSphere ∞ := |
| 90 | congrArg Prod.snd hXbase |
| 91 | have hFs (i : ℤ) (hi : k ≤ i) : F (i + 1) = (D i).symm.trans (F i) := |
| 92 | congrArg Prod.fst (hXsucc i hi) |
| 93 | have hBs (i : ℤ) (hi : k ≤ i) : B (i + 1) = (A i).symm.trans (B i) := |
| 94 | congrArg Prod.snd (hXsucc i hi) |
| 95 | have hFp (i : ℤ) (hi : i ≤ k) : F (i - 1) = (D (i - 1)).trans (F i) := |
| 96 | congrArg Prod.fst (hXpred i hi) |
| 97 | have hBp (i : ℤ) (hi : i ≤ k) : B (i - 1) = (A (i - 1)).trans (B i) := |
| 98 | congrArg Prod.snd (hXpred i hi) |
| 99 | have hrec (i : ℤ) : F i = (D i).trans (F (i + 1)) ∧ |
| 100 | B i = (A i).trans (B (i + 1)) := by |
| 101 | by_cases hi : k ≤ i |
| 102 | · rw [hFs i hi, hBs i hi] |
| 103 | constructor |
| 104 | · apply Diffeomorph.ext |
| 105 | intro z |
| 106 | simp only [Diffeomorph.coe_trans, Function.comp_apply, Diffeomorph.symm_apply_apply] |
| 107 | · apply Diffeomorph.ext |
| 108 | intro q |
| 109 | simp only [Diffeomorph.coe_trans, Function.comp_apply, Diffeomorph.symm_apply_apply] |
| 110 | · have hj : i + 1 ≤ k := by omega |
| 111 | simpa only [add_sub_cancel_right] using And.intro (hFp (i + 1) hj) (hBp (i + 1) hj) |
| 112 | have hDi (i : ℤ) (z : RoundCylinderSpace) : |
| 113 | ((D i).symm z).1 = (A i).symm z.1 := by |
| 114 | apply (A i).injective |
| 115 | change A i ((D i).symm z).1 = A i ((A i).symm z.1) |
| 116 | rw [← hfirst i ((D i).symm z), Diffeomorph.apply_symm_apply, |
| 117 | Diffeomorph.apply_symm_apply] |
| 118 | have hDpair (i : ℤ) (q : UnitTwoSphere) (s : ℝ) : |
| 119 | D i (q, s) = (A i q, (D i (q, s)).2) := |
| 120 | Prod.ext (hfirst i (q, s)) rfl |
| 121 | have hDipair (i : ℤ) (q : UnitTwoSphere) (s : ℝ) : |
| 122 | (D i).symm (q, s) = ((A i).symm q, ((D i).symm (q, s)).2) := |
| 123 | Prod.ext (hDi i (q, s)) rfl |
| 124 | have hDimono (i : ℤ) (q : UnitTwoSphere) : |
| 125 | StrictMono (fun s : ℝ => ((D i).symm (q, s)).2) := by |
| 126 | intro s t hst |
| 127 | by_contra h |
| 128 | have hle := (hmono i ((A i).symm q)).monotone (le_of_not_gt h) |
| 129 | have he (r : ℝ) : |
| 130 | D i ((A i).symm q, ((D i).symm (q, r)).2) = (q, r) := by |
| 131 | rw [← hDipair i q r] |
| 132 | exact (D i).apply_symm_apply (q, r) |
| 133 | rw [he t, he s] at hle |
| 134 | exact (not_le_of_gt hst) hle |
| 135 | have hFfirst (i : ℤ) : ∀ z : RoundCylinderSpace, (F i z).1 = B i z.1 := by |
| 136 | refine Int.inductionOn' i k ?_ ?_ ?_ |
| 137 | · intro z |
| 138 | rw [hFk, hBk] |
| 139 | rfl |
| 140 | · intro j hj ih z |
| 141 | rw [hFs j hj, hBs j hj] |
| 142 | change (F j ((D j).symm z)).1 = B j ((A j).symm z.1) |
| 143 | rw [ih, hDi] |
| 144 | · intro j hj ih z |
| 145 | rw [hFp j hj, hBp j hj] |
| 146 | change (F j (D (j - 1) z)).1 = B j (A (j - 1) z.1) |
| 147 | rw [ih, hfirst] |
| 148 | have hFfirstInv (i : ℤ) (z : RoundCylinderSpace) : |
| 149 | ((F i).symm z).1 = (B i).symm z.1 := by |
| 150 | apply (B i).injective |
| 151 | change B i ((F i).symm z).1 = B i ((B i).symm z.1) |
| 152 | rw [← hFfirst i ((F i).symm z), Diffeomorph.apply_symm_apply, |
| 153 | Diffeomorph.apply_symm_apply] |
| 154 | have hFmono (i : ℤ) : ∀ q : UnitTwoSphere, |
| 155 | StrictMono (fun s : ℝ => (F i (q, s)).2) := by |
| 156 | refine Int.inductionOn' i k ?_ ?_ ?_ |
| 157 | · intro q s t hst |
| 158 | simpa only [hFk, Diffeomorph.coe_refl, id_eq] using hst |
| 159 | · intro j hj ih q s t hst |
| 160 | rw [hFs j hj] |
| 161 | change (F j ((D j).symm (q, s))).2 < (F j ((D j).symm (q, t))).2 |
| 162 | rw [hDipair j q s, hDipair j q t] |
| 163 | exact ih ((A j).symm q) (hDimono j q hst) |
| 164 | · intro j hj ih q s t hst |
| 165 | rw [hFp j hj] |
| 166 | change (F j (D (j - 1) (q, s))).2 < (F j (D (j - 1) (q, t))).2 |
| 167 | rw [hDpair (j - 1) q s, hDpair (j - 1) q t] |
| 168 | exact ih (A (j - 1) q) (hmono (j - 1) q hst) |
| 169 | let cu : ℝ := 9 * L / 16 |
| 170 | let cd : ℝ := 5 * L / 8 |
| 171 | let cU : ℤ → UnitTwoSphere → ℝ := fun i q => (F i (q, cu)).2 - cu |
| 172 | let cD : ℤ → UnitTwoSphere → ℝ := fun i q => (F i (q, cd)).2 - cd |
| 173 | have hInvUpper (i : ℤ) (q : UnitTwoSphere) (s : ℝ) (hs : cu ≤ s) : |
| 174 | (D i).symm (q, s) = ((A i).symm q, s - p i ((A i).symm q)) := by |
| 175 | have hp := (hshift i ((A i).symm q)).2 |
| 176 | have harg : 13 * L / 16 ≤ s - p i ((A i).symm q) := by |
| 177 | dsimp only [cu] at hs |
| 178 | linarith |
| 179 | apply (D i).injective |
| 180 | change D i ((D i).symm (q, s)) = D i ((A i).symm q, s - p i ((A i).symm q)) |
| 181 | rw [Diffeomorph.apply_symm_apply, hupper i _ _ harg] |
| 182 | simp only [Diffeomorph.apply_symm_apply, sub_add_cancel] |
| 183 | have hU (i : ℤ) (hi : k ≤ i) : |
| 184 | (∀ q : UnitTwoSphere, ∀ s : ℝ, cu ≤ s → F i (q, s) = (B i q, s + cU i q)) ∧ |
| 185 | (∀ q : UnitTwoSphere, ((i - k : ℤ) : ℝ) * (9 * L / 32) ≤ cU i q) := by |
| 186 | refine Int.leInduction (motive := fun i _ => |
| 187 | (∀ q : UnitTwoSphere, ∀ s : ℝ, cu ≤ s → F i (q, s) = (B i q, s + cU i q)) ∧ |
| 188 | (∀ q : UnitTwoSphere, ((i - k : ℤ) : ℝ) * (9 * L / 32) ≤ cU i q)) ?_ ?_ i hi |
| 189 | · simp only [cU, hFk, hBk, Diffeomorph.coe_refl, id_eq, sub_self, |
| 190 | add_zero, Int.cast_zero, zero_mul, le_refl, implies_true, and_self] |
| 191 | · intro j hj ih |
| 192 | have hform (q : UnitTwoSphere) (s : ℝ) (hs : cu ≤ s) : |
| 193 | F (j + 1) (q, s) = |
| 194 | (B (j + 1) q, s + (cU j ((A j).symm q) - p j ((A j).symm q))) := by |
| 195 | rw [hFs j hj] |
| 196 | change F j ((D j).symm (q, s)) = _ |
| 197 | rw [hInvUpper j q s hs] |
| 198 | have harg : cu ≤ s - p j ((A j).symm q) := by |
| 199 | have hp := (hshift j ((A j).symm q)).2 |
| 200 | linarith |
| 201 | rw [ih.1 _ _ harg] |
| 202 | apply Prod.ext |
| 203 | · rw [hBs j hj] |
| 204 | rfl |
| 205 | · dsimp only [Prod.snd] |
| 206 | ring |
| 207 | have hc (q : UnitTwoSphere) : |
| 208 | cU (j + 1) q = cU j ((A j).symm q) - p j ((A j).symm q) := by |
| 209 | change (F (j + 1) (q, cu)).2 - cu = _ |
| 210 | rw [hform q cu le_rfl] |
| 211 | dsimp only [Prod.snd] |
| 212 | ring |
| 213 | constructor |
| 214 | · intro q s hs |
| 215 | rw [hc] |
| 216 | exact hform q s hs |
| 217 | · intro q |
| 218 | rw [hc] |
| 219 | have hh := ih.2 ((A j).symm q) |
| 220 | have hp := (hshift j ((A j).symm q)).2 |
| 221 | simp only [Int.cast_sub, Int.cast_add, Int.cast_one] at hh ⊢ |
| 222 | nlinarith |
| 223 | have hV (i : ℤ) (hi : i ≤ k) : |
| 224 | (∀ q : UnitTwoSphere, ∀ s : ℝ, s ≤ cd → F i (q, s) = (B i q, s + cD i q)) ∧ |
| 225 | (∀ q : UnitTwoSphere, cD i q ≤ -(((k - i : ℤ) : ℝ) * (3 * L / 16))) := by |
| 226 | refine Int.leInductionDown (motive := fun i _ => |
| 227 | (∀ q : UnitTwoSphere, ∀ s : ℝ, s ≤ cd → F i (q, s) = (B i q, s + cD i q)) ∧ |
| 228 | (∀ q : UnitTwoSphere, cD i q ≤ -(((k - i : ℤ) : ℝ) * (3 * L / 16)))) ?_ ?_ i hi |
| 229 | · simp only [cD, hFk, hBk, Diffeomorph.coe_refl, id_eq, sub_self, |
| 230 | add_zero, Int.cast_zero, zero_mul, neg_zero, le_refl, implies_true, and_self] |
| 231 | · intro j hj ih |
| 232 | have hform (q : UnitTwoSphere) (s : ℝ) (hs : s ≤ cd) : |
| 233 | F (j - 1) (q, s) = |
| 234 | (B (j - 1) q, s + (m (j - 1) q + cD j (A (j - 1) q))) := by |
| 235 | rw [hFp j hj] |
| 236 | change F j (D (j - 1) (q, s)) = _ |
| 237 | have hs0 : s ≤ 11 * L / 16 := by |
| 238 | dsimp only [cd] at hs |
| 239 | linarith |
| 240 | rw [hlower (j - 1) q s hs0] |
| 241 | have harg : s + m (j - 1) q ≤ cd := by |
| 242 | have hm := (hshift (j - 1) q).1 |
| 243 | linarith |
| 244 | rw [ih.1 _ _ harg] |
| 245 | apply Prod.ext |
| 246 | · rw [hBp j hj] |
| 247 | rfl |
| 248 | · dsimp only [Prod.snd] |
| 249 | ring |
| 250 | have hc (q : UnitTwoSphere) : |
| 251 | cD (j - 1) q = m (j - 1) q + cD j (A (j - 1) q) := by |
| 252 | change (F (j - 1) (q, cd)).2 - cd = _ |
| 253 | rw [hform q cd le_rfl] |
| 254 | dsimp only [Prod.snd] |
| 255 | ring |
| 256 | constructor |
| 257 | · intro q s hs |
| 258 | rw [hc] |
| 259 | exact hform q s hs |
| 260 | · intro q |
| 261 | rw [hc] |
| 262 | have hh := ih.2 (A (j - 1) q) |
| 263 | have hm := (hshift (j - 1) q).1 |
| 264 | simp only [Int.cast_sub, Int.cast_one] at hh ⊢ |
| 265 | nlinarith |
| 266 | let c : ℤ → UnitTwoSphere → ℝ := fun i => if k ≤ i then cU i else cD i |
| 267 | have hcSmooth (i : ℤ) : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ (c i) := by |
| 268 | have heval (t : ℝ) : ContMDiff (𝓡 2) 𝓘(ℝ, ℝ) ∞ |
| 269 | (fun q : UnitTwoSphere => (F i (q, t)).2 - t) := |
| 270 | (contDiff_id.sub contDiff_const).contMDiff.comp |
| 271 | (contMDiff_snd.comp ((F i).contMDiff.comp (contMDiff_id.prodMk contMDiff_const))) |
| 272 | dsimp only [c] |
| 273 | split_ifs |
| 274 | · exact heval cu |
| 275 | · exact heval cd |
| 276 | refine ⟨F, B, c, hFk, hBk, hrec, fun i z => ⟨hFfirst i z, hFfirstInv i z⟩, |
| 277 | hFmono, hcSmooth, ?_, ?_⟩ |
| 278 | · intro i hi |
| 279 | simpa only [c, if_pos hi] using hU i hi |
| 280 | · intro i hi |
| 281 | by_cases hki : k ≤ i |
| 282 | · have hik : i = k := le_antisymm hi hki |
| 283 | subst i |
| 284 | simpa only [c, if_pos le_rfl, cU, cD, hFk, Diffeomorph.coe_refl, |
| 285 | id_eq, sub_self] using hV k le_rfl |
| 286 | · simpa only [c, if_neg hki] using hV i hi |
| 287 | |
| 288 | end PoincareMT |