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.Transverse.ArcCuts |
| 2 | |
| 3 | /-! |
| 4 | # Separating widths for actual transverse physical cuts |
| 5 | |
| 6 | The common cut direction determines its annihilating functional. The |
| 7 | constructed graph identities make that functional positive on both adjacent |
| 8 | tangents; compactness then separates the entire finite strip family. |
| 9 | |
| 10 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481, including Claim 19.40, |
| 11 | pp. 470-471. These project constructions provide actual fitted boundary pieces and |
| 12 | contacts for the regional Gauss--Bonnet arguments. |
| 13 | -/ |
| 14 | |
| 15 | noncomputable section |
| 16 | set_option autoImplicit false |
| 17 | set_option backward.isDefEq.respectTransparency false |
| 18 | |
| 19 | open Set |
| 20 | open scoped Topology ContDiff |
| 21 | open Poincare.Topology.Plane.Curves |
| 22 | |
| 23 | namespace PoincareMT |
| 24 | |
| 25 | private theorem adjacent_transverse_width |
| 26 | {gamma : ℝ → AnnulusCoordinates} {a b c : ℝ} |
| 27 | (hab : a < b) (hbc : b < c) (hinj : InjOn gamma (Icc a c)) |
| 28 | (d : ℝ → AnnulusCoordinates) |
| 29 | (L R : AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 30 | (G H : OpenPartialHomeomorph ℝ ℝ) {f g : ℝ → ℝ} |
| 31 | (hf : ContDiffOn ℝ ∞ f G.target) (hg : ContDiffOn ℝ ∞ g H.target) |
| 32 | (hI : Icc a b ⊆ G.source) (hJ : Icc b c ⊆ H.source) |
| 33 | (hG : StrictMonoOn G G.source) (hH : StrictMonoOn H H.source) |
| 34 | (hgraph : ∀ t ∈ G.source, L (gamma t) = (G t, f (G t))) |
| 35 | (hgraph' : ∀ t ∈ H.source, R (gamma t) = (H t, g (H t))) |
| 36 | (himage : G '' Icc a b = Icc (G a) (G b)) |
| 37 | (himage' : H '' Icc b c = Icc (H b) (H c)) |
| 38 | (htarget : Icc (G a) (G b) ⊆ G.target) |
| 39 | (htarget' : Icc (H b) (H c) ⊆ H.target) |
| 40 | (hsep : 0 < inner ℝ (-quarterTurn (d b)) (L.symm (1, deriv f (G b)))) |
| 41 | (hsep' : 0 < inner ℝ (-quarterTurn (d b)) (R.symm (1, deriv g (H b)))) |
| 42 | (P : TransverseGraphCuts f (G a) (G b) |
| 43 | (L (d a)).1 (L (d a)).2 (L (d b)).1 (L (d b)).2) |
| 44 | (Q : TransverseGraphCuts g (H b) (H c) |
| 45 | (R (d b)).1 (R (d b)).2 (R (d c)).1 (R (d c)).2) : |
| 46 | ∃ delta > 0, ∀ t ∈ Icc (0 : ℝ) 1, ∀ s ∈ Icc (0 : ℝ) 1, |
| 47 | ∀ z w : ℝ, |z| < delta → |w| < delta → |
| 48 | P.linearCoordinates L.symm G.open_target hf (t, z) = |
| 49 | Q.linearCoordinates R.symm H.open_target hg (s, w) → t = 1 ∧ s = 0 := by |
| 50 | have haG := hI (left_mem_Icc.mpr hab.le) |
| 51 | have hbG := hI (right_mem_Icc.mpr hab.le) |
| 52 | have hbH := hJ (left_mem_Icc.mpr hbc.le) |
| 53 | have hcH := hJ (right_mem_Icc.mpr hbc.le) |
| 54 | have hbase : ∀ x ∈ Icc (G a) (G b), ∀ y ∈ Icc (H b) (H c), |
| 55 | L.symm (x, f x) = R.symm (y, g y) → x = G b ∧ y = H b := by |
| 56 | intro x hx y hy heq |
| 57 | obtain ⟨u, hu, rfl⟩ := (himage ▸ hx : x ∈ G '' Icc a b) |
| 58 | obtain ⟨v, hv, rfl⟩ := (himage' ▸ hy : y ∈ H '' Icc b c) |
| 59 | rw [← hgraph u (hI hu), ← hgraph' v (hJ hv), |
| 60 | L.symm_apply_apply, R.symm_apply_apply] at heq |
| 61 | have huv := hinj ⟨hu.1, hu.2.trans hbc.le⟩ ⟨hab.le.trans hv.1, hv.2⟩ heq |
| 62 | have hub : u = b := le_antisymm hu.2 (huv ▸ hv.1) |
| 63 | have hvb : v = b := huv.symm.trans hub |
| 64 | simp only [hub, hvb, and_self] |
| 65 | obtain ⟨delta, hdelta, hsep⟩ := exists_adjacent_linear_oblique_width P Q L.symm R.symm |
| 66 | G.open_target hf H.open_target hg (hG haG hbG hab) htarget (hH hbH hcH hbc) htarget' |
| 67 | (by rw [← hgraph b hbG, ← hgraph' b hbH, L.symm_apply_apply, R.symm_apply_apply]) |
| 68 | (by simp only [Prod.eta, L.symm_apply_apply, R.symm_apply_apply]) hbase |
| 69 | (innerSL ℝ (-quarterTurn (d b))) (by |
| 70 | simp only [Prod.eta, L.symm_apply_apply] |
| 71 | change inner ℝ (-quarterTurn (d b)) (d b) = 0 |
| 72 | rw [inner_neg_left, real_inner_comm, inner_quarterTurn_self, neg_zero]) hsep hsep' |
| 73 | exact ⟨delta, hdelta, fun t ht s hs z w hz hw heq => |
| 74 | (hsep t ht s hs z w hz hw).2.2 heq⟩ |
| 75 | |
| 76 | private theorem dependent_transport {X : Type*} {A : X → Sort*} {Y : Sort*} |
| 77 | (f : ∀ x, A x → Y) {x y : X} (h : x = y) (p : A y) : |
| 78 | f x (h.symm ▸ p) = f y p := by cases h; rfl |
| 79 | |
| 80 | /-- Actual positive transverse physical cuts produce a finite family of graph strips with |
| 81 | one common width and exact adjacent endpoint separation. Source: |
| 82 | `proof-work/tasks/M64/reports/2026-09-24-obstacle-strip-chain.md`. -/ |
| 83 | theorem m64Intrinsic_exists_separated_transverse_arc_strips |
| 84 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) |
| 85 | {a b : ℝ} (hab : a < b) (hinj : InjOn gamma (Icc a b)) |
| 86 | (hregular : ∀ t ∈ Icc a b, deriv gamma t ≠ 0) |
| 87 | (d : ℝ → AnnulusCoordinates) |
| 88 | (hd : ∀ t ∈ Icc a b, 0 < inner ℝ (quarterTurn (deriv gamma t)) (d t)) : |
| 89 | ∃ (n : ℕ) (c : Fin (n + 1) → ℝ) |
| 90 | (L : Fin n → AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 91 | (G : Fin n → OpenPartialHomeomorph ℝ ℝ) (f : Fin n → ℝ → ℝ) |
| 92 | (hf : ∀ i, ContDiffOn ℝ ∞ (f i) (G i).target) |
| 93 | (P : ∀ i, TransverseGraphCuts (f i) (G i (c i.castSucc)) (G i (c i.succ)) |
| 94 | (L i (d (c i.castSucc))).1 (L i (d (c i.castSucc))).2 |
| 95 | (L i (d (c i.succ))).1 (L i (d (c i.succ))).2), |
| 96 | let F (i : Fin n) := (P i).linearCoordinates (L i).symm (G i).open_target (hf i) |
| 97 | ∃ delta > 0, 0 < n ∧ StrictMono c ∧ c 0 = a ∧ c (Fin.last n) = b ∧ |
| 98 | (∀ i, Icc (c i.castSucc) (c i.succ) ⊆ (G i).source ∧ |
| 99 | StrictMonoOn (G i) (G i).source ∧ ContDiffOn ℝ ∞ (G i) (G i).source ∧ |
| 100 | (∀ t ∈ (G i).source, L i (gamma t) = (G i t, f i (G i t))) ∧ |
| 101 | G i '' Icc (c i.castSucc) (c i.succ) = |
| 102 | Icc (G i (c i.castSucc)) (G i (c i.succ)) ∧ |
| 103 | Icc (G i (c i.castSucc)) (G i (c i.succ)) ⊆ (G i).target) ∧ |
| 104 | (∀ i, delta ≤ (P i).radius ∧ |
| 105 | Icc (0 : ℝ) 1 ×ˢ Ioo (-delta) delta ⊆ (F i).source ∧ |
| 106 | (fun t => F i (t, 0)) '' Icc (0 : ℝ) 1 = |
| 107 | gamma '' Icc (c i.castSucc) (c i.succ)) ∧ |
| 108 | (∀ i j : Fin n, i.succ < j.castSucc → |
| 109 | Disjoint (F i '' (Icc (0 : ℝ) 1 ×ˢ Ioo (-delta) delta)) |
| 110 | (F j '' (Icc (0 : ℝ) 1 ×ˢ Ioo (-delta) delta))) ∧ |
| 111 | ∀ i j : Fin n, i.succ = j.castSucc → |
| 112 | ∀ t ∈ Icc (0 : ℝ) 1, ∀ s ∈ Icc (0 : ℝ) 1, |
| 113 | ∀ z w : ℝ, |z| < delta → |w| < delta → |
| 114 | F i (t, z) = F j (s, w) → t = 1 ∧ s = 0 := by |
| 115 | classical |
| 116 | obtain ⟨n, c, L, G, f, hn, hc, hfirst, hlast, hpieces⟩ := |
| 117 | m64Intrinsic_exists_arc_transverse_cut_subdivision hg hab hregular d hd |
| 118 | have hI (i : Fin n) := (hpieces i).1 |
| 119 | have hmono (i : Fin n) := (hpieces i).2.1 |
| 120 | have hG (i : Fin n) := (hpieces i).2.2.1 |
| 121 | have hf (i : Fin n) := (hpieces i).2.2.2.1 |
| 122 | have hgraph (i : Fin n) := (hpieces i).2.2.2.2.1 |
| 123 | have himage (i : Fin n) := (hpieces i).2.2.2.2.2.1 |
| 124 | have htarget (i : Fin n) := (hpieces i).2.2.2.2.2.2.1 |
| 125 | have htrans (i : Fin n) := (hpieces i).2.2.2.2.2.2.2.1 |
| 126 | let P (i : Fin n) := Classical.choice (hpieces i).2.2.2.2.2.2.2.2 |
| 127 | let F (i : Fin n) := (P i).linearCoordinates (L i).symm (G i).open_target (hf i) |
| 128 | have hstep (i : Fin n) : c i.castSucc < c i.succ := hc Fin.castSucc_lt_succ |
| 129 | have hcut (k : Fin (n + 1)) : c k ∈ Icc a b := by |
| 130 | constructor |
| 131 | · simpa only [hfirst] using hc.monotone (Fin.zero_le k) |
| 132 | · simpa only [hlast] using hc.monotone (Fin.le_last k) |
| 133 | have hGi (i : Fin n) : G i (c i.castSucc) < G i (c i.succ) := |
| 134 | hmono i (hI i (left_mem_Icc.mpr (hstep i).le)) |
| 135 | (hI i (right_mem_Icc.mpr (hstep i).le)) (hstep i) |
| 136 | have haxis (i : Fin n) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : (t, (0 : ℝ)) ∈ (F i).source := |
| 137 | (P i).linearCoordinates_axis_mem_source (L i).symm (G i).open_target (hf i) |
| 138 | (hGi i) (htarget i) ht |
| 139 | have haxis_image (i : Fin n) : (fun t => F i (t, 0)) '' Icc (0 : ℝ) 1 = |
| 140 | gamma '' Icc (c i.castSucc) (c i.succ) := |
| 141 | m64Intrinsic_graph_strip_axis_image (L i) (G i) (hf i) (hI i) (hGi i).le |
| 142 | (hgraph i) (himage i) (P i) |
| 143 | have hseparate (i j : Fin n) (hij : i.succ < j.castSucc) : |
| 144 | Disjoint ((fun t => F i (t, 0)) '' Icc (0 : ℝ) 1) |
| 145 | ((fun t => F j (t, 0)) '' Icc (0 : ℝ) 1) := by |
| 146 | rw [haxis_image, haxis_image] |
| 147 | apply disjoint_left.mpr |
| 148 | rintro p ⟨t, ht, htp⟩ ⟨s, hs, hsp⟩ |
| 149 | have hts := hinj ⟨(hcut i.castSucc).1.trans ht.1, ht.2.trans (hcut i.succ).2⟩ |
| 150 | ⟨(hcut j.castSucc).1.trans hs.1, hs.2.trans (hcut j.succ).2⟩ (htp.trans hsp.symm) |
| 151 | have hlt := hc hij |
| 152 | linarith [ht.2, hs.1] |
| 153 | let J := {p : Fin n × Fin n // p.1.succ = p.2.castSucc} |
| 154 | have hadj (p : J) : ∃ r > 0, |
| 155 | ∀ t ∈ Icc (0 : ℝ) 1, ∀ s ∈ Icc (0 : ℝ) 1, |
| 156 | ∀ z w : ℝ, |z| < r → |w| < r → |
| 157 | F p.1.1 (t, z) = F p.1.2 (s, w) → t = 1 ∧ s = 0 := by |
| 158 | let i := p.1.1 |
| 159 | let j := p.1.2 |
| 160 | have he : c i.succ = c j.castSucc := congrArg c p.2 |
| 161 | have hbc : c i.succ < c j.succ := by rw [he]; exact hstep j |
| 162 | have hsub : InjOn gamma (Icc (c i.castSucc) (c j.succ)) := |
| 163 | hinj.mono (Icc_subset_Icc (hcut i.castSucc).1 (hcut j.succ).2) |
| 164 | have hJ : Icc (c i.succ) (c j.succ) ⊆ (G j).source := by rw [he]; exact hI j |
| 165 | have himage' : G j '' Icc (c i.succ) (c j.succ) = |
| 166 | Icc (G j (c i.succ)) (G j (c j.succ)) := by rw [he]; exact himage j |
| 167 | have htarget' : Icc (G j (c i.succ)) (G j (c j.succ)) ⊆ (G j).target := by |
| 168 | rw [he]; exact htarget j |
| 169 | have hsep' : 0 < inner ℝ (-quarterTurn (d (c i.succ))) |
| 170 | ((L j).symm (1, deriv (f j) (G j (c i.succ)))) := by |
| 171 | rw [he] |
| 172 | exact (htrans j _ (left_mem_Icc.mpr (hstep j).le)).2.2 |
| 173 | let Q : TransverseGraphCuts (f j) (G j (c i.succ)) (G j (c j.succ)) |
| 174 | (L j (d (c i.succ))).1 (L j (d (c i.succ))).2 |
| 175 | (L j (d (c j.succ))).1 (L j (d (c j.succ))).2 := he.symm ▸ P j |
| 176 | obtain ⟨r, hr, hsep⟩ := adjacent_transverse_width |
| 177 | (hstep i) hbc hsub d (L i) (L j) (G i) (G j) (hf i) (hf j) |
| 178 | (hI i) hJ (hmono i) (hmono j) (hgraph i) (hgraph j) (himage i) himage' |
| 179 | (htarget i) htarget' (htrans i _ (right_mem_Icc.mpr (hstep i).le)).2.2 hsep' (P i) Q |
| 180 | have hQ : Q.linearCoordinates (L j).symm (G j).open_target (hf j) = F j := |
| 181 | dependent_transport |
| 182 | (A := fun t => TransverseGraphCuts (f j) (G j t) (G j (c j.succ)) |
| 183 | (L j (d t)).1 (L j (d t)).2 |
| 184 | (L j (d (c j.succ))).1 (L j (d (c j.succ))).2) |
| 185 | (fun _ R => R.linearCoordinates (L j).symm (G j).open_target (hf j)) he (P j) |
| 186 | refine ⟨r, hr, fun t ht s hs z w hz hw heq => ?_⟩ |
| 187 | apply hsep t ht s hs z w hz hw |
| 188 | simpa only [hQ] using heq |
| 189 | choose width hwidth hsep using hadj |
| 190 | obtain ⟨epsilon, hepsilon, hle⟩ := exists_pos_le_finite_family width hwidth |
| 191 | obtain ⟨delta, hdelta, hbound, hsource, hdisjoint⟩ := |
| 192 | exists_finite_disjoint_strip_width F haxis (fun i j => i.succ < j.castSucc) |
| 193 | hseparate (fun i => min (P i).radius epsilon) |
| 194 | (fun i => lt_min (P i).radius_pos hepsilon) |
| 195 | refine ⟨n, c, L, G, f, hf, P, delta, hdelta, hn, hc, hfirst, hlast, |
| 196 | fun i => ⟨hI i, hmono i, hG i, hgraph i, himage i, htarget i⟩, |
| 197 | fun i => ⟨(hbound i).trans (min_le_left _ _), hsource i, haxis_image i⟩, |
| 198 | hdisjoint, ?_⟩ |
| 199 | intro i j hij t ht s hs z w hz hw heq |
| 200 | let p : J := ⟨(i, j), hij⟩ |
| 201 | have hdw : delta ≤ width p := ((hbound i).trans (min_le_right _ _)).trans (hle p) |
| 202 | exact hsep p t ht s hs z w (hz.trans_le hdw) (hw.trans_le hdw) heq |
| 203 | |
| 204 | end PoincareMT |