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.CurveShortening.Comparison.IntrinsicComparison.Cross.RayRegion |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Embedded.Collar |
| 3 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Normal.ReturnRegion |
| 4 | import PoincareLib.Geometry.CurveShortening.Comparison.IntrinsicComparison.Return.Side |
| 5 | |
| 6 | /-! |
| 7 | # Jordan regions at an inward normal-ray collision |
| 8 | |
| 9 | For rays strictly inside the annulus until their contact, the coordinate |
| 10 | norm separates both rays from the actual inner boundary arc. Thus the |
| 11 | first-crossing theorem gives a region with the literal boundary arc and |
| 12 | the literal truncated rays as frontier. |
| 13 | |
| 14 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. These project |
| 15 | Jordan-region constructions supply the actual domains, boundary charts and finite |
| 16 | faces used in its regional Gauss--Bonnet arguments. |
| 17 | -/ |
| 18 | |
| 19 | noncomputable section |
| 20 | set_option autoImplicit false |
| 21 | |
| 22 | open Set Function |
| 23 | open scoped Topology ContDiff |
| 24 | |
| 25 | namespace PoincareMT |
| 26 | |
| 27 | /-- The inner coordinate boundary is the Euclidean unit circle. Source: |
| 28 | `proof-work/tasks/M64/reports/2026-09-24-intrinsic-radial-scalar.md`, First-return sides and |
| 29 | the inner-disk alternative. -/ |
| 30 | theorem m64Intrinsic_inner_boundary_norm (x : ℝ) : |
| 31 | ‖intrinsicAnnulusBoundary 1 x‖ = 1 := by |
| 32 | have h := m64Intrinsic_boundary_self_inner 1 x |
| 33 | rw [real_inner_self_eq_norm_sq] at h |
| 34 | nlinarith [norm_nonneg (intrinsicAnnulusBoundary 1 x)] |
| 35 | |
| 36 | /-- A crossing of two individually embedded inward rays constructs a Jordan region using the |
| 37 | actual short inner-boundary arc. Separation from that arc follows from the norm constraint; |
| 38 | it is not an extra premise. Source: |
| 39 | `proof-work/tasks/M64/reports/2026-09-24-intrinsic-radial-scalar.md`, First-return sides and |
| 40 | the inner-disk alternative. -/ |
| 41 | theorem m64Intrinsic_inward_crossing_region |
| 42 | {alpha beta : ℝ → AnnulusCoordinates} {a b A B : ℝ} |
| 43 | (hab : a < b) (hperiod : b - a < rampPeriod) |
| 44 | (ha : Continuous alpha) (hb : Continuous beta) |
| 45 | (hai : InjOn alpha (Icc 0 A)) (hbi : InjOn beta (Icc 0 B)) |
| 46 | (ha0 : alpha 0 = intrinsicAnnulusBoundary 1 a) |
| 47 | (hb0 : beta 0 = intrinsicAnnulusBoundary 1 b) |
| 48 | (haInterior : ∀ s ∈ Ioc 0 A, 1 < ‖alpha s‖) |
| 49 | (hbInterior : ∀ t ∈ Ioc 0 B, 1 < ‖beta t‖) |
| 50 | (hmeet : ∃ s ∈ Icc 0 A, ∃ t ∈ Icc 0 B, alpha s = beta t) : |
| 51 | ∃ s t : ℝ, 0 < s ∧ s ≤ A ∧ 0 < t ∧ t ≤ B ∧ alpha s = beta t ∧ |
| 52 | ∃ U V : Set AnnulusCoordinates, |
| 53 | IsOpen U ∧ IsOpen V ∧ IsPathConnected U ∧ IsPathConnected V ∧ |
| 54 | Bornology.IsBounded U ∧ ¬ Bornology.IsBounded V ∧ Disjoint U V ∧ |
| 55 | U ∪ V = (intrinsicAnnulusBoundary 1 '' Icc a b ∪ |
| 56 | (alpha '' Icc 0 s ∪ beta '' Icc 0 t))ᶜ ∧ |
| 57 | frontier U = intrinsicAnnulusBoundary 1 '' Icc a b ∪ |
| 58 | (alpha '' Icc 0 s ∪ beta '' Icc 0 t) ∧ |
| 59 | frontier V = intrinsicAnnulusBoundary 1 '' Icc a b ∪ |
| 60 | (alpha '' Icc 0 s ∪ beta '' Icc 0 t) ∧ IsCompact (closure U) := by |
| 61 | let c : ℝ → AnnulusCoordinates := |
| 62 | fun x => intrinsicAnnulusBoundary 1 ((b - a) * x + a) |
| 63 | have hparam (x : ℝ) (hx : x ∈ Icc 0 1) : (b - a) * x + a ∈ Icc a b := |
| 64 | ⟨by nlinarith [hx.1], by nlinarith [hx.2]⟩ |
| 65 | have hc : ContinuousOn c (Icc 0 1) := |
| 66 | ((m64Intrinsic_contDiff_boundary 1).continuous.comp |
| 67 | ((continuous_const.mul continuous_id).add continuous_const)).continuousOn |
| 68 | have hci : InjOn c (Icc 0 1) := by |
| 69 | intro x hx y hy hxy |
| 70 | have h := m64Intrinsic_boundary_injOn_short_arc hperiod |
| 71 | (hparam x hx) (hparam y hy) hxy |
| 72 | nlinarith |
| 73 | have hc0 : c 0 = alpha 0 := by simpa only [c, mul_zero, zero_add] using ha0.symm |
| 74 | have hc1 : c 1 = beta 0 := by simpa only [c, mul_one, sub_add_cancel] using hb0.symm |
| 75 | have hca : ∀ x ∈ Icc 0 1, ∀ t ∈ Icc 0 A, |
| 76 | c x = alpha t → x = 0 ∧ t = 0 := by |
| 77 | intro x hx t ht heq |
| 78 | have ht0 : t = 0 := by |
| 79 | by_contra hne |
| 80 | have hnorm := haInterior t ⟨lt_of_le_of_ne ht.1 (Ne.symm hne), ht.2⟩ |
| 81 | rw [← heq] at hnorm |
| 82 | exact (lt_irrefl (1 : ℝ)) |
| 83 | (by simpa only [c, m64Intrinsic_inner_boundary_norm] using hnorm) |
| 84 | refine ⟨hci hx (by norm_num) ?_, ht0⟩ |
| 85 | rw [heq, ht0, hc0] |
| 86 | have hcb : ∀ x ∈ Icc 0 1, ∀ t ∈ Icc 0 B, |
| 87 | c x = beta t → x = 1 ∧ t = 0 := by |
| 88 | intro x hx t ht heq |
| 89 | have ht0 : t = 0 := by |
| 90 | by_contra hne |
| 91 | have hnorm := hbInterior t ⟨lt_of_le_of_ne ht.1 (Ne.symm hne), ht.2⟩ |
| 92 | rw [← heq] at hnorm |
| 93 | exact (lt_irrefl (1 : ℝ)) |
| 94 | (by simpa only [c, m64Intrinsic_inner_boundary_norm] using hnorm) |
| 95 | refine ⟨hci hx (by norm_num) ?_, ht0⟩ |
| 96 | rw [heq, ht0, hc1] |
| 97 | have hcimage : c '' Icc 0 1 = intrinsicAnnulusBoundary 1 '' Icc a b := by |
| 98 | change (intrinsicAnnulusBoundary 1 ∘ fun x => (b - a) * x + a) '' Icc 0 1 = _ |
| 99 | rw [image_comp, image_affine_Icc' (sub_pos.mpr hab)] |
| 100 | simp only [mul_zero, zero_add, mul_one, sub_add_cancel] |
| 101 | obtain ⟨s, t, hs, hsA, ht, htB, hst, U, V, hU, hV, hpU, hpV, hbU, hbV, |
| 102 | hdisj, hcover, hfU, hfV, hcompact⟩ := |
| 103 | m64Intrinsic_exists_crossing_ray_region ha hb hai hbi hc hci hc0 hc1 hca hcb hmeet |
| 104 | rw [hcimage] at hcover hfU hfV |
| 105 | exact ⟨s, t, hs, hsA, ht, htB, hst, U, V, hU, hV, hpU, hpV, hbU, hbV, |
| 106 | hdisj, hcover, hfU, hfV, hcompact⟩ |
| 107 | |
| 108 | /-- Any collision of two regular inward rays produces a genuine Jordan region. A ray that is |
| 109 | not embedded supplies its own simple return loop; otherwise the first mutual contact |
| 110 | supplies the region above. Thus no individual-ray injectivity is assumed. The result retains |
| 111 | the exact annular confinement alternative needed before integrating curvature. Source: |
| 112 | `proof-work/tasks/M64/reports/2026-09-24-intrinsic-radial-scalar.md`, First-return sides and |
| 113 | the inner-disk alternative. -/ |
| 114 | theorem m64Intrinsic_regular_inward_collision_jordan |
| 115 | {alpha beta : ℝ → AnnulusCoordinates} {a b A B : ℝ} |
| 116 | (hab : a < b) (hperiod : b - a < rampPeriod) |
| 117 | (ha : ContDiff ℝ ∞ alpha) (hb : ContDiff ℝ ∞ beta) |
| 118 | (haRegular : ∀ s ∈ Icc 0 A, deriv alpha s ≠ 0) |
| 119 | (hbRegular : ∀ t ∈ Icc 0 B, deriv beta t ≠ 0) |
| 120 | (ha0 : alpha 0 = intrinsicAnnulusBoundary 1 a) |
| 121 | (hb0 : beta 0 = intrinsicAnnulusBoundary 1 b) |
| 122 | (haInterior : ∀ s ∈ Ioc 0 A, 1 < ‖alpha s‖ ∧ ‖alpha s‖ ≤ 2) |
| 123 | (hbInterior : ∀ t ∈ Ioc 0 B, 1 < ‖beta t‖ ∧ ‖beta t‖ ≤ 2) |
| 124 | (hmeet : ∃ s ∈ Icc 0 A, ∃ t ∈ Icc 0 B, alpha s = beta t) : |
| 125 | ∃ U V : Set AnnulusCoordinates, |
| 126 | IsOpen U ∧ IsOpen V ∧ IsPathConnected U ∧ IsPathConnected V ∧ |
| 127 | Bornology.IsBounded U ∧ ¬ Bornology.IsBounded V ∧ Disjoint U V ∧ |
| 128 | U ∪ V = (frontier U)ᶜ ∧ frontier V = frontier U ∧ |
| 129 | IsCompact (closure U) ∧ |
| 130 | frontier U ⊆ intrinsicAnnulusBoundary 1 '' Icc a b ∪ |
| 131 | (alpha '' Icc 0 A ∪ beta '' Icc 0 B) ∧ |
| 132 | (closure U ⊆ standardAnnulusDomain ∨ Metric.ball (0 : AnnulusCoordinates) 1 ⊆ U) := by |
| 133 | let trace : Set AnnulusCoordinates := intrinsicAnnulusBoundary 1 '' Icc a b ∪ |
| 134 | (alpha '' Icc 0 A ∪ beta '' Icc 0 B) |
| 135 | have htrace : trace ⊆ standardAnnulusDomain := by |
| 136 | rintro p (⟨x, _, rfl⟩ | ⟨s, hs, rfl⟩ | ⟨t, ht, rfl⟩) |
| 137 | · change 1 ≤ ‖intrinsicAnnulusBoundary 1 x‖ ∧ ‖intrinsicAnnulusBoundary 1 x‖ ≤ 2 |
| 138 | rw [m64Intrinsic_inner_boundary_norm] |
| 139 | norm_num |
| 140 | · by_cases hs0 : s = 0 |
| 141 | · subst s |
| 142 | change 1 ≤ ‖alpha 0‖ ∧ ‖alpha 0‖ ≤ 2 |
| 143 | rw [ha0, m64Intrinsic_inner_boundary_norm] |
| 144 | norm_num |
| 145 | · have h := haInterior s ⟨lt_of_le_of_ne hs.1 (Ne.symm hs0), hs.2⟩ |
| 146 | exact ⟨h.1.le, h.2⟩ |
| 147 | · by_cases ht0 : t = 0 |
| 148 | · subst t |
| 149 | change 1 ≤ ‖beta 0‖ ∧ ‖beta 0‖ ≤ 2 |
| 150 | rw [hb0, m64Intrinsic_inner_boundary_norm] |
| 151 | norm_num |
| 152 | · have h := hbInterior t ⟨lt_of_le_of_ne ht.1 (Ne.symm ht0), ht.2⟩ |
| 153 | exact ⟨h.1.le, h.2⟩ |
| 154 | have finish (C U V : Set AnnulusCoordinates) |
| 155 | (hU : IsOpen U) (hV : IsOpen V) |
| 156 | (hdisj : Disjoint U V) (hcover : U ∪ V = Cᶜ) |
| 157 | (hfU : frontier U = C) (hfV : frontier V = C) |
| 158 | (hcompact : IsCompact (closure U)) (hsub : C ⊆ trace) : |
| 159 | IsCompact (closure U) ∧ frontier U ⊆ trace ∧ |
| 160 | (closure U ⊆ standardAnnulusDomain ∨ Metric.ball (0 : AnnulusCoordinates) 1 ⊆ U) := by |
| 161 | refine ⟨hcompact, by simpa only [hfU] using hsub, ?_⟩ |
| 162 | exact m64Intrinsic_jordan_annulus_dichotomy hU hV hdisj hcover hfU hcompact |
| 163 | (hsub.trans htrace) |
| 164 | by_cases hai : InjOn alpha (Icc 0 A) |
| 165 | · by_cases hbi : InjOn beta (Icc 0 B) |
| 166 | · obtain ⟨s, t, hs, hsA, ht, htB, _, U, V, hU, hV, hpU, hpV, hbU, hbV, |
| 167 | hdisj, hcover, hfU, hfV, hcompact⟩ := |
| 168 | m64Intrinsic_inward_crossing_region hab hperiod ha.continuous hb.continuous |
| 169 | hai hbi ha0 hb0 (fun s hs => (haInterior s hs).1) |
| 170 | (fun t ht => (hbInterior t ht).1) hmeet |
| 171 | refine ⟨U, V, hU, hV, hpU, hpV, hbU, hbV, hdisj, |
| 172 | by simpa only [hfU] using hcover, hfV.trans hfU.symm, ?_⟩ |
| 173 | apply finish _ U V hU hV hdisj hcover hfU hfV hcompact |
| 174 | exact union_subset_union_right _ (union_subset_union |
| 175 | (image_mono (Icc_subset_Icc_right hsA)) (image_mono (Icc_subset_Icc_right htB))) |
| 176 | · obtain ⟨s, t, hs, hst, htB, _, _, U, V, hU, hV, hpU, hpV, hbU, hbV, |
| 177 | hdisj, hcover, hfU, hfV, hcompact⟩ := |
| 178 | m64Intrinsic_regular_selfintersection_region hb hbRegular hbi |
| 179 | refine ⟨U, V, hU, hV, hpU, hpV, hbU, hbV, hdisj, |
| 180 | by simpa only [hfU] using hcover, hfV.trans hfU.symm, ?_⟩ |
| 181 | apply finish _ U V hU hV hdisj hcover hfU hfV hcompact |
| 182 | exact (image_mono (Icc_subset_Icc hs htB)).trans |
| 183 | (subset_union_of_subset_right (subset_union_right) _) |
| 184 | · obtain ⟨s, t, hs, hst, htA, _, _, U, V, hU, hV, hpU, hpV, hbU, hbV, |
| 185 | hdisj, hcover, hfU, hfV, hcompact⟩ := |
| 186 | m64Intrinsic_regular_selfintersection_region ha haRegular hai |
| 187 | refine ⟨U, V, hU, hV, hpU, hpV, hbU, hbV, hdisj, |
| 188 | by simpa only [hfU] using hcover, hfV.trans hfU.symm, ?_⟩ |
| 189 | apply finish _ U V hU hV hdisj hcover hfU hfV hcompact |
| 190 | exact (image_mono (Icc_subset_Icc hs htA)).trans |
| 191 | (subset_union_of_subset_right (subset_union_left) _) |
| 192 | |
| 193 | /-- The regularity of the actual normal differential supplies the regular rays in the |
| 194 | preceding construction. Every interior collision has a compact Jordan region subordinate to |
| 195 | the original ray and boundary traces. Source: |
| 196 | `proof-work/tasks/M64/reports/2026-09-24-intrinsic-radial-scalar.md`, First-return sides and |
| 197 | the inner-disk alternative. -/ |
| 198 | theorem m64Intrinsic_normal_interior_collision_jordan |
| 199 | {u : ℝ × ℝ → AnnulusCoordinates} (hu : ContDiff ℝ ∞ u) |
| 200 | (hboundary : ∀ x, u (x, 0) = intrinsicAnnulusBoundary 1 x) |
| 201 | {a b A B : ℝ} (hab : a < b) (hperiod : b - a < rampPeriod) |
| 202 | (hai : ∀ s ∈ Icc 0 A, Function.Injective (fderiv ℝ u (a, s))) |
| 203 | (hbi : ∀ t ∈ Icc 0 B, Function.Injective (fderiv ℝ u (b, t))) |
| 204 | (haInterior : ∀ s ∈ Ioc 0 A, 1 < ‖u (a, s)‖ ∧ ‖u (a, s)‖ ≤ 2) |
| 205 | (hbInterior : ∀ t ∈ Ioc 0 B, 1 < ‖u (b, t)‖ ∧ ‖u (b, t)‖ ≤ 2) |
| 206 | (hmeet : ∃ s ∈ Icc 0 A, ∃ t ∈ Icc 0 B, u (a, s) = u (b, t)) : |
| 207 | ∃ U V : Set AnnulusCoordinates, |
| 208 | IsOpen U ∧ IsOpen V ∧ IsPathConnected U ∧ IsPathConnected V ∧ |
| 209 | Bornology.IsBounded U ∧ ¬ Bornology.IsBounded V ∧ Disjoint U V ∧ |
| 210 | U ∪ V = (frontier U)ᶜ ∧ frontier V = frontier U ∧ |
| 211 | IsCompact (closure U) ∧ |
| 212 | frontier U ⊆ intrinsicAnnulusBoundary 1 '' Icc a b ∪ |
| 213 | ((fun s => u (a, s)) '' Icc 0 A ∪ (fun t => u (b, t)) '' Icc 0 B) ∧ |
| 214 | (closure U ⊆ standardAnnulusDomain ∨ Metric.ball (0 : AnnulusCoordinates) 1 ⊆ U) := by |
| 215 | have hregular (x T : ℝ) |
| 216 | (hi : ∀ s ∈ Icc 0 T, Function.Injective (fderiv ℝ u (x, s))) : |
| 217 | ∀ s ∈ Icc 0 T, deriv (fun t => u (x, t)) s ≠ 0 := by |
| 218 | intro s hs hzero |
| 219 | rw [m64Intrinsic_normal_ray_deriv (hu.differentiable (by simp) (x, s))] at hzero |
| 220 | have h := hi s hs (hzero.trans (fderiv ℝ u (x, s)).map_zero.symm) |
| 221 | have hlast := congrArg Prod.snd h |
| 222 | norm_num at hlast |
| 223 | exact m64Intrinsic_regular_inward_collision_jordan hab hperiod |
| 224 | (hu.comp (by fun_prop)) (hu.comp (by fun_prop)) |
| 225 | (hregular a A hai) (hregular b B hbi) |
| 226 | (hboundary a) (hboundary b) haInterior hbInterior hmeet |
| 227 | |
| 228 | end PoincareMT |