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.Loop.GraphNeighborhood |
| 2 | import PoincareLib.Topology.Plane.Curves.Graphs.Subdivision |
| 3 | import PoincareLib.Topology.Plane.Curves.Graphs.LinearCoordinates |
| 4 | |
| 5 | /-! |
| 6 | # Common normal cuts for actual graph subdivisions |
| 7 | |
| 8 | The graph frames are constructed from a regular arc. Their normal cuts use |
| 9 | the same physical quarter-turned tangent at each shared parameter, and the |
| 10 | original tangent supplies the separator required by adjacent-strip gluing. |
| 11 | |
| 12 | Morgan--Tian context: Proposition 19.35, printed pp. 467-481. These project |
| 13 | Jordan-region constructions supply the actual domains, boundary charts and finite |
| 14 | faces used in its regional Gauss--Bonnet arguments. |
| 15 | -/ |
| 16 | |
| 17 | noncomputable section |
| 18 | set_option autoImplicit false |
| 19 | |
| 20 | open Set Filter |
| 21 | open scoped Topology ContDiff |
| 22 | open Poincare.Topology.Plane.Curves |
| 23 | |
| 24 | namespace PoincareMT |
| 25 | |
| 26 | private theorem quarterTurn_coordinates (w : AnnulusCoordinates) : |
| 27 | quarterTurn w 0 = -w 1 ∧ quarterTurn w 1 = w 0 := by |
| 28 | simp [quarterTurn_apply, Complex.orthonormalBasisOneI_repr_apply, |
| 29 | Complex.orthonormalBasisOneI_repr_symm_apply] |
| 30 | |
| 31 | private theorem projection_quarterTurn |
| 32 | {v : AnnulusCoordinates} (L : AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 33 | (hL : ∀ w, L w = (inner ℝ v w, inner ℝ (quarterTurn v) w)) |
| 34 | (w : AnnulusCoordinates) : L (quarterTurn w) = (-(L w).2, (L w).1) := by |
| 35 | rw [hL, hL] |
| 36 | have hv := quarterTurn_coordinates v |
| 37 | have hw := quarterTurn_coordinates w |
| 38 | ext <;> simp [EuclideanSpace.inner_eq_star_dotProduct, dotProduct, Fin.sum_univ_two, |
| 39 | hv.1, hv.2, hw.1, hw.2] |
| 40 | ring |
| 41 | |
| 42 | /-- The original arc derivative, computed in its constructed smooth graph coordinates. This |
| 43 | includes endpoints since the graph domain is open. Source: |
| 44 | `proof-work/tasks/M64/reports/2026-09-24-arc-normal-cuts.md`. -/ |
| 45 | theorem m64Intrinsic_graph_tangent |
| 46 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) |
| 47 | (L : AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 48 | (G : OpenPartialHomeomorph ℝ ℝ) {f : ℝ → ℝ} |
| 49 | (hG : ContDiffOn ℝ ∞ G G.source) (hf : ContDiffOn ℝ ∞ f G.target) |
| 50 | (hgraph : ∀ t ∈ G.source, L (gamma t) = (G t, f (G t))) |
| 51 | {t : ℝ} (ht : t ∈ G.source) : |
| 52 | L (deriv gamma t) = deriv G t • ((1 : ℝ), deriv f (G t)) := by |
| 53 | have hdG := (hG.contDiffAt (G.open_source.mem_nhds ht)).differentiableAt (by simp) |
| 54 | have hdf := (hf.contDiffAt (G.open_target.mem_nhds (G.map_source ht))).differentiableAt |
| 55 | (by simp) |
| 56 | have hleft : HasDerivAt (fun s => L (gamma s)) (L (deriv gamma t)) t := |
| 57 | L.hasFDerivAt.comp_hasDerivAt t ((hg.differentiable (by simp)) t).hasDerivAt |
| 58 | have hright := hdG.hasDerivAt.prodMk (hdf.hasDerivAt.comp t hdG.hasDerivAt) |
| 59 | have heq : (fun s => L (gamma s)) =ᶠ[𝓝 t] fun s => (G s, f (G s)) := by |
| 60 | filter_upwards [G.open_source.mem_nhds ht] with s hs using hgraph s hs |
| 61 | have hderiv := (hleft.congr_of_eventuallyEq heq.symm).unique hright |
| 62 | change L (deriv gamma t) = (deriv G t * 1, deriv G t * deriv f (G t)) |
| 63 | simpa only [mul_one, one_mul, mul_comm] using hderiv |
| 64 | |
| 65 | /-- The physical normal is positive transverse in every tangent-projection frame. The |
| 66 | physical tangent annihilates the cut and is positive on the normalized graph tangent. |
| 67 | Source: `proof-work/tasks/M64/reports/2026-09-24-arc-normal-cuts.md`. -/ |
| 68 | theorem m64Intrinsic_graph_normal_transverse |
| 69 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) |
| 70 | {v : AnnulusCoordinates} (L : AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 71 | (hL : ∀ w, L w = (inner ℝ v w, inner ℝ (quarterTurn v) w)) |
| 72 | (G : OpenPartialHomeomorph ℝ ℝ) {f : ℝ → ℝ} |
| 73 | (hG : ContDiffOn ℝ ∞ G G.source) (hf : ContDiffOn ℝ ∞ f G.target) |
| 74 | (hgraph : ∀ t ∈ G.source, L (gamma t) = (G t, f (G t))) |
| 75 | {t : ℝ} (ht : t ∈ G.source) (hpos : 0 < (L (deriv gamma t)).1) : |
| 76 | 0 < (L (quarterTurn (deriv gamma t))).2 - |
| 77 | deriv f (G t) * (L (quarterTurn (deriv gamma t))).1 ∧ |
| 78 | inner ℝ (deriv gamma t) (quarterTurn (deriv gamma t)) = 0 ∧ |
| 79 | 0 < inner ℝ (deriv gamma t) (L.symm (1, deriv f (G t))) := by |
| 80 | have htan := m64Intrinsic_graph_tangent hg L G hG hf hgraph ht |
| 81 | have hfirst := congrArg Prod.fst htan |
| 82 | simp only [Prod.smul_fst, smul_eq_mul, mul_one] at hfirst |
| 83 | have hd : 0 < deriv G t := hfirst ▸ hpos |
| 84 | have hregular : deriv gamma t ≠ 0 := by |
| 85 | intro hzero |
| 86 | simp [hzero] at hpos |
| 87 | refine ⟨?_, inner_quarterTurn_self _, ?_⟩ |
| 88 | · rw [projection_quarterTurn L hL, htan] |
| 89 | simp only [Prod.smul_fst, Prod.smul_snd, smul_eq_mul, mul_one] |
| 90 | nlinarith [mul_nonneg hd.le (sq_nonneg (deriv f (G t)))] |
| 91 | · have hvector : deriv gamma t = deriv G t • L.symm (1, deriv f (G t)) := by |
| 92 | apply L.injective |
| 93 | simpa only [map_smul, L.apply_symm_apply] using htan |
| 94 | have hinner : inner ℝ (deriv gamma t) (deriv gamma t) = |
| 95 | deriv G t * inner ℝ (deriv gamma t) (L.symm (1, deriv f (G t))) := by |
| 96 | conv_lhs => rhs; rw [hvector] |
| 97 | rw [real_inner_smul_right] |
| 98 | have hself := real_inner_self_pos.mpr hregular |
| 99 | exact (mul_pos_iff_of_pos_left hd).mp (hinner ▸ hself) |
| 100 | |
| 101 | /-- A positive-projection arc supplies actual smooth graph coordinates and normal endpoint |
| 102 | inverse cuts. No cut or transversality certificate is an input. Source: |
| 103 | `proof-work/tasks/M64/reports/2026-09-24-arc-normal-cuts.md`. -/ |
| 104 | theorem m64Intrinsic_exists_arc_normal_graph |
| 105 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) |
| 106 | {a b : ℝ} (hab : a < b) {v : AnnulusCoordinates} |
| 107 | (hpos : ∀ t ∈ Icc a b, 0 < inner ℝ v (deriv gamma t)) : |
| 108 | ∃ (L : AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 109 | (G : OpenPartialHomeomorph ℝ ℝ) (f : ℝ → ℝ), |
| 110 | Icc a b ⊆ G.source ∧ StrictMonoOn G G.source ∧ |
| 111 | ContDiffOn ℝ ∞ G G.source ∧ ContDiffOn ℝ ∞ f G.target ∧ |
| 112 | (∀ t ∈ G.source, L (gamma t) = (G t, f (G t))) ∧ |
| 113 | G '' Icc a b = Icc (G a) (G b) ∧ |
| 114 | Icc (G a) (G b) ⊆ G.target ∧ |
| 115 | (∀ t ∈ Icc a b, 0 < (L (deriv gamma t)).1 ∧ |
| 116 | 0 < (L (quarterTurn (deriv gamma t))).2 - |
| 117 | deriv f (G t) * (L (quarterTurn (deriv gamma t))).1 ∧ |
| 118 | inner ℝ (deriv gamma t) (quarterTurn (deriv gamma t)) = 0 ∧ |
| 119 | 0 < inner ℝ (deriv gamma t) (L.symm (1, deriv f (G t)))) ∧ |
| 120 | Nonempty (TransverseGraphCuts f (G a) (G b) |
| 121 | (L (quarterTurn (deriv gamma a))).1 (L (quarterTurn (deriv gamma a))).2 |
| 122 | (L (quarterTurn (deriv gamma b))).1 (L (quarterTurn (deriv gamma b))).2) := by |
| 123 | obtain ⟨l, u, G, L, f, hla, hbu, hsource, hGval, hL, hmono, hG, |
| 124 | _, _, hf, hgraph, himage, htarget, _⟩ := |
| 125 | exists_graph_coordinates_of_positive_projection hg hab.le hpos |
| 126 | have hI : Icc a b ⊆ G.source := by |
| 127 | rw [hsource] |
| 128 | exact fun _ ht => ⟨hla.trans_le ht.1, ht.2.trans_lt hbu⟩ |
| 129 | have hmonoG : StrictMonoOn G G.source := by |
| 130 | intro x hx y hy hxy |
| 131 | simpa only [hGval] using hmono hx hy hxy |
| 132 | have htrans (t : ℝ) (ht : t ∈ Icc a b) : |
| 133 | 0 < (L (deriv gamma t)).1 ∧ |
| 134 | 0 < (L (quarterTurn (deriv gamma t))).2 - |
| 135 | deriv f (G t) * (L (quarterTurn (deriv gamma t))).1 ∧ |
| 136 | inner ℝ (deriv gamma t) (quarterTurn (deriv gamma t)) = 0 ∧ |
| 137 | 0 < inner ℝ (deriv gamma t) (L.symm (1, deriv f (G t))) := by |
| 138 | have hp : 0 < (L (deriv gamma t)).1 := by simpa only [hL] using hpos t ht |
| 139 | exact ⟨hp, m64Intrinsic_graph_normal_transverse hg L hL G hG hf hgraph (hI ht) hp⟩ |
| 140 | refine ⟨L, G, f, hI, hmonoG, hG, hf, hgraph, himage, htarget, htrans, ?_⟩ |
| 141 | have ha := hI (left_mem_Icc.mpr hab.le) |
| 142 | have hb := hI (right_mem_Icc.mpr hab.le) |
| 143 | exact exists_transverseGraphCuts G.open_target hf G.open_target hf |
| 144 | (hmonoG ha hb hab) (G.map_source ha) (G.map_source hb) |
| 145 | (htrans a (left_mem_Icc.mpr hab.le)).2.1 |
| 146 | (htrans b (right_mem_Icc.mpr hab.le)).2.1 |
| 147 | |
| 148 | /-- Every compact regular arc has finitely many actual graph pieces with the same physical |
| 149 | normal at every common endpoint. Source: |
| 150 | `proof-work/tasks/M64/reports/2026-09-24-arc-normal-cuts.md`. -/ |
| 151 | theorem m64Intrinsic_exists_arc_normal_cut_subdivision |
| 152 | {gamma : ℝ → AnnulusCoordinates} (hg : ContDiff ℝ ∞ gamma) |
| 153 | {a b : ℝ} (hab : a < b) (hregular : ∀ t ∈ Icc a b, deriv gamma t ≠ 0) : |
| 154 | ∃ (n : ℕ) (c : Fin (n + 1) → ℝ) |
| 155 | (L : Fin n → AnnulusCoordinates ≃L[ℝ] (ℝ × ℝ)) |
| 156 | (G : Fin n → OpenPartialHomeomorph ℝ ℝ) (f : Fin n → ℝ → ℝ), |
| 157 | 0 < n ∧ StrictMono c ∧ c 0 = a ∧ c (Fin.last n) = b ∧ |
| 158 | ∀ i : Fin n, |
| 159 | Icc (c i.castSucc) (c i.succ) ⊆ (G i).source ∧ |
| 160 | StrictMonoOn (G i) (G i).source ∧ |
| 161 | ContDiffOn ℝ ∞ (G i) (G i).source ∧ |
| 162 | ContDiffOn ℝ ∞ (f i) (G i).target ∧ |
| 163 | (∀ t ∈ (G i).source, L i (gamma t) = (G i t, f i (G i t))) ∧ |
| 164 | G i '' Icc (c i.castSucc) (c i.succ) = |
| 165 | Icc (G i (c i.castSucc)) (G i (c i.succ)) ∧ |
| 166 | Icc (G i (c i.castSucc)) (G i (c i.succ)) ⊆ (G i).target ∧ |
| 167 | (∀ t ∈ Icc (c i.castSucc) (c i.succ), |
| 168 | 0 < (L i (deriv gamma t)).1 ∧ |
| 169 | 0 < (L i (quarterTurn (deriv gamma t))).2 - |
| 170 | deriv (f i) (G i t) * (L i (quarterTurn (deriv gamma t))).1 ∧ |
| 171 | inner ℝ (deriv gamma t) (quarterTurn (deriv gamma t)) = 0 ∧ |
| 172 | 0 < inner ℝ (deriv gamma t) ((L i).symm (1, deriv (f i) (G i t)))) ∧ |
| 173 | Nonempty (TransverseGraphCuts (f i) (G i (c i.castSucc)) (G i (c i.succ)) |
| 174 | (L i (quarterTurn (deriv gamma (c i.castSucc)))).1 |
| 175 | (L i (quarterTurn (deriv gamma (c i.castSucc)))).2 |
| 176 | (L i (quarterTurn (deriv gamma (c i.succ)))).1 |
| 177 | (L i (quarterTurn (deriv gamma (c i.succ)))).2) := by |
| 178 | obtain ⟨n, c, v, hn, hc, hfirst, hlast, hv⟩ := |
| 179 | exists_finite_strictMono_projection_subdivision hg hab hregular |
| 180 | have hpieces (i : Fin n) := m64Intrinsic_exists_arc_normal_graph hg |
| 181 | (hc Fin.castSucc_lt_succ) (hv i).2.2.1 |
| 182 | choose L G f hpieces using hpieces |
| 183 | exact ⟨n, c, L, G, f, hn, hc, hfirst, hlast, hpieces⟩ |
| 184 | |
| 185 | end PoincareMT |