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.AnnularEvolution.Modulus.PeriodicHarmonicMinimum |
| 2 | import PoincareLib.Geometry.CurveShortening.Comparison.AnnularEvolution.Periodic.HarmonicTransport |
| 3 | |
| 4 | /-! |
| 5 | # Weighted modulus equation across the periodic seam |
| 6 | |
| 7 | The weighted Hessian equation extends from the open fundamental rectangle |
| 8 | through its angular seam by continuity. Literal period then transports it |
| 9 | to the covering strip. No smoothness at the radial boundary is needed. |
| 10 | |
| 11 | Morgan--Tian context: Lemma 19.15 and its annular area-to-energy construction, printed pp. |
| 12 | 447-449. |
| 13 | -/ |
| 14 | |
| 15 | set_option autoImplicit false |
| 16 | set_option backward.isDefEq.respectTransparency false |
| 17 | |
| 18 | open Set Filter InnerProductSpace |
| 19 | open scoped Topology ContDiff |
| 20 | |
| 21 | namespace PoincareMT |
| 22 | |
| 23 | private theorem modulus_integer_translate {f : LoopPlane → ℝ} |
| 24 | (hperiod : ∀ x s, f (annulusPoint (x + curvePeriod) s) = |
| 25 | f (annulusPoint x s)) |
| 26 | (z : ℤ) (p : LoopPlane) : |
| 27 | f (annulusPoint (z • curvePeriod) 0 + p) = f p := by |
| 28 | have hp : annulusPoint (p 0) (p 1) = p := by |
| 29 | ext i |
| 30 | fin_cases i <;> rfl |
| 31 | have hshift : annulusPoint (z • curvePeriod) 0 + p = |
| 32 | annulusPoint (p 0 + z • curvePeriod) (p 1) := by |
| 33 | ext i |
| 34 | fin_cases i <;> simp [annulusPoint, add_comm] |
| 35 | have hper : Function.Periodic (fun x => f (annulusPoint x (p 1))) curvePeriod := |
| 36 | fun x => hperiod x (p 1) |
| 37 | rw [hshift] |
| 38 | exact (hper.zsmul z (p 0)).trans (congrArg f hp) |
| 39 | |
| 40 | private theorem modulus_translated_point {f : LoopPlane → ℝ} |
| 41 | (hperiod : ∀ x s, f (annulusPoint (x + curvePeriod) s) = |
| 42 | f (annulusPoint x s)) |
| 43 | (p : LoopPlane) (hs : p 1 ∈ Icc (0 : ℝ) 1) : |
| 44 | ∃ T q : LoopPlane, q ∈ m64AnnulusDomain ∧ q 0 < curvePeriod ∧ |
| 45 | q 1 = p 1 ∧ T + p = q ∧ ∀ r : LoopPlane, f (T + r) = f r := by |
| 46 | have hP : 0 < curvePeriod := by unfold curvePeriod; positivity |
| 47 | let z := -toIcoDiv hP 0 (p 0) |
| 48 | let T := annulusPoint (z • curvePeriod) 0 |
| 49 | let q := annulusPoint (toIcoMod hP 0 (p 0)) (p 1) |
| 50 | have hx := toIcoMod_mem_Ico' hP (p 0) |
| 51 | refine ⟨T, q, ⟨hx.1, hx.2.le, hs.1, hs.2⟩, hx.2, rfl, ?_, |
| 52 | modulus_integer_translate hperiod z⟩ |
| 53 | ext i |
| 54 | fin_cases i <;> |
| 55 | simp [T, q, z, annulusPoint, toIcoMod, neg_smul, sub_eq_add_neg, add_comm] |
| 56 | |
| 57 | private theorem modulus_horizontal_hasDerivAt (s x : ℝ) : |
| 58 | HasDerivAt (fun y => annulusPoint y s) |
| 59 | (EuclideanSpace.single (0 : Fin 2) 1) x := by |
| 60 | have heq : (fun y => annulusPoint y s) = fun y => |
| 61 | annulusPoint 0 s + y • EuclideanSpace.single (0 : Fin 2) 1 := by |
| 62 | funext y |
| 63 | ext i |
| 64 | fin_cases i <;> simp [annulusPoint] |
| 65 | rw [heq] |
| 66 | simpa only [one_smul, id_eq] using |
| 67 | ((hasDerivAt_id x).smul_const (EuclideanSpace.single (0 : Fin 2) 1)).const_add |
| 68 | (annulusPoint 0 s) |
| 69 | |
| 70 | private theorem modulus_operator_translate (r : ℝ) (f : LoopPlane → ℝ) |
| 71 | (T p : LoopPlane) : |
| 72 | (r * fderiv ℝ (fderiv ℝ (fun q => f (T + q))) p |
| 73 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 74 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 75 | r⁻¹ * fderiv ℝ (fderiv ℝ (fun q => f (T + q))) p |
| 76 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 77 | (EuclideanSpace.single (1 : Fin 2) 1)) = |
| 78 | (r * fderiv ℝ (fderiv ℝ f) (T + p) |
| 79 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 80 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 81 | r⁻¹ * fderiv ℝ (fderiv ℝ f) (T + p) |
| 82 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 83 | (EuclideanSpace.single (1 : Fin 2) 1)) := by |
| 84 | have h00 : fderiv ℝ (fderiv ℝ (fun q => f (T + q))) p |
| 85 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 86 | (EuclideanSpace.single (0 : Fin 2) 1) = |
| 87 | fderiv ℝ (fderiv ℝ f) (T + p) |
| 88 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 89 | (EuclideanSpace.single (0 : Fin 2) 1) := by |
| 90 | have hcomp := iteratedFDeriv_comp_add_left (𝕜 := ℝ) (f := f) 2 T p |
| 91 | have hcomp' := congrArg |
| 92 | (fun H : ContinuousMultilinearMap ℝ (fun _ : Fin 2 => LoopPlane) ℝ => |
| 93 | H ![EuclideanSpace.single (0 : Fin 2) 1, |
| 94 | EuclideanSpace.single (0 : Fin 2) 1]) hcomp |
| 95 | simpa only [iteratedFDeriv_two_apply, Matrix.cons_val_zero, |
| 96 | Matrix.cons_val_one, Matrix.cons_val_fin_one] using hcomp' |
| 97 | have h11 : fderiv ℝ (fderiv ℝ (fun q => f (T + q))) p |
| 98 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 99 | (EuclideanSpace.single (1 : Fin 2) 1) = |
| 100 | fderiv ℝ (fderiv ℝ f) (T + p) |
| 101 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 102 | (EuclideanSpace.single (1 : Fin 2) 1) := by |
| 103 | have hcomp := iteratedFDeriv_comp_add_left (𝕜 := ℝ) (f := f) 2 T p |
| 104 | have hcomp' := congrArg |
| 105 | (fun H : ContinuousMultilinearMap ℝ (fun _ : Fin 2 => LoopPlane) ℝ => |
| 106 | H ![EuclideanSpace.single (1 : Fin 2) 1, |
| 107 | EuclideanSpace.single (1 : Fin 2) 1]) hcomp |
| 108 | simpa only [iteratedFDeriv_two_apply, Matrix.cons_val_zero, |
| 109 | Matrix.cons_val_one, Matrix.cons_val_fin_one] using hcomp' |
| 110 | rw [h00, h11] |
| 111 | |
| 112 | /-- The actual weighted modulus equation on the interior extends through the periodic seam |
| 113 | and to every point of the covering strip. Source: Morgan--Tian (2007), Lemma 19.15 and |
| 114 | Corollary 19.16, pp. 447-449; project derivation |
| 115 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 116 | theorem m64PeriodicModulus_equation_on_strip_of_open_regularity |
| 117 | {r : ℝ} {f : LoopPlane → ℝ} |
| 118 | (hreg : ContDiffOn ℝ ∞ f m64AnnulusOpenStrip) |
| 119 | (hperiod : ∀ x s, f (annulusPoint (x + curvePeriod) s) = |
| 120 | f (annulusPoint x s)) |
| 121 | (heq : ∀ p ∈ m64AnnulusInterior, |
| 122 | r * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (0 : Fin 2) 1) |
| 123 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 124 | r⁻¹ * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (1 : Fin 2) 1) |
| 125 | (EuclideanSpace.single (1 : Fin 2) 1) = 0) : |
| 126 | ∀ p ∈ m64AnnulusOpenStrip, |
| 127 | r * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (0 : Fin 2) 1) |
| 128 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 129 | r⁻¹ * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (1 : Fin 2) 1) |
| 130 | (EuclideanSpace.single (1 : Fin 2) 1) = 0 := by |
| 131 | intro p hp |
| 132 | obtain ⟨T, q, hq, hq0lt, hq1, hpoint, hfun⟩ := modulus_translated_point hperiod p |
| 133 | ⟨hp.1.le, hp.2.le⟩ |
| 134 | have htranslate := modulus_operator_translate r f T p |
| 135 | have hfun' : (fun z => f (T + z)) = f := funext hfun |
| 136 | have htranslate' := congrArg (fun g : LoopPlane → ℝ => |
| 137 | r * fderiv ℝ (fderiv ℝ g) p (EuclideanSpace.single (0 : Fin 2) 1) |
| 138 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 139 | r⁻¹ * fderiv ℝ (fderiv ℝ g) p (EuclideanSpace.single (1 : Fin 2) 1) |
| 140 | (EuclideanSpace.single (1 : Fin 2) 1)) hfun' |
| 141 | have hp_eq := htranslate'.symm.trans htranslate |
| 142 | rw [hpoint] at hp_eq |
| 143 | by_cases hq0 : q 0 = 0 |
| 144 | · let e0 : LoopPlane := EuclideanSpace.single (0 : Fin 2) 1 |
| 145 | let s : ℝ := q 1 |
| 146 | have hs0 : 0 < s := by simpa [s, hq1] using hp.1 |
| 147 | have hs1 : s < 1 := by simpa [s, hq1] using hp.2 |
| 148 | have hpath : HasDerivAt (fun t : ℝ => q + t • e0) e0 0 := by |
| 149 | simpa only [one_smul, id_eq] using |
| 150 | ((hasDerivAt_id (0 : ℝ)).smul_const e0).const_add q |
| 151 | have hqs : q ∈ m64AnnulusOpenStrip := by |
| 152 | change 0 < q 1 ∧ q 1 < 1 |
| 153 | rw [hq1] |
| 154 | exact hp |
| 155 | have h3 : ContDiffAt ℝ 3 f q := |
| 156 | (hreg.contDiffAt (isOpen_m64AnnulusOpenStrip.mem_nhds hqs)).of_le (by norm_cast) |
| 157 | have hd := h3.differentiableAt_iteratedFDeriv (m := 2) (by norm_num) |
| 158 | have h00 := (hd.continuousMultilinear_apply_const |
| 159 | ![EuclideanSpace.single (0 : Fin 2) 1, |
| 160 | EuclideanSpace.single (0 : Fin 2) 1]).continuousAt |
| 161 | have h11 := (hd.continuousMultilinear_apply_const |
| 162 | ![EuclideanSpace.single (1 : Fin 2) 1, |
| 163 | EuclideanSpace.single (1 : Fin 2) 1]).continuousAt |
| 164 | have hOp := (h00.const_mul r).add (h11.const_mul r⁻¹) |
| 165 | have hpath_lim : Tendsto (fun t : ℝ => q + t • e0) (𝓝 (0 : ℝ)) (𝓝 q) := by |
| 166 | simpa only [zero_smul, add_zero] using hpath.continuousAt.tendsto |
| 167 | have hlim := hOp.tendsto.comp hpath_lim |
| 168 | have hlim' : Tendsto (fun t : ℝ => |
| 169 | r * fderiv ℝ (fderiv ℝ f) (q + t • e0) |
| 170 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 171 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 172 | r⁻¹ * fderiv ℝ (fderiv ℝ f) (q + t • e0) |
| 173 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 174 | (EuclideanSpace.single (1 : Fin 2) 1)) (𝓝 (0 : ℝ)) |
| 175 | (𝓝 (r * fderiv ℝ (fderiv ℝ f) q |
| 176 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 177 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 178 | r⁻¹ * fderiv ℝ (fderiv ℝ f) q |
| 179 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 180 | (EuclideanSpace.single (1 : Fin 2) 1))) := by |
| 181 | simpa only [iteratedFDeriv_two_apply, Matrix.cons_val_zero, |
| 182 | Matrix.cons_val_one, Matrix.cons_val_fin_one, Function.comp_def, |
| 183 | Pi.add_apply] using hlim |
| 184 | have hpath_eq (t : ℝ) : q + t • e0 = annulusPoint t s := by |
| 185 | ext i |
| 186 | fin_cases i <;> simp [e0, s, hq0, annulusPoint] |
| 187 | have hP : 0 < curvePeriod := by unfold curvePeriod; positivity |
| 188 | have hev : ∀ᶠ t in 𝓝[>] (0 : ℝ), |
| 189 | r * fderiv ℝ (fderiv ℝ f) (q + t • e0) |
| 190 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 191 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 192 | r⁻¹ * fderiv ℝ (fderiv ℝ f) (q + t • e0) |
| 193 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 194 | (EuclideanSpace.single (1 : Fin 2) 1) = 0 := by |
| 195 | filter_upwards [self_mem_nhdsWithin, |
| 196 | mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hP)] with t ht0 htP |
| 197 | rw [hpath_eq t] |
| 198 | apply heq |
| 199 | simpa [m64AnnulusInterior, Set.mem_pi, Fin.forall_fin_two, and_assoc, |
| 200 | annulusPoint] using (show 0 < t ∧ t < curvePeriod ∧ 0 < s ∧ s < 1 from |
| 201 | ⟨ht0, htP, hs0, hs1⟩) |
| 202 | have hlimWithin := hlim'.mono_left |
| 203 | (nhdsWithin_le_nhds (a := (0 : ℝ)) (s := Ioi (0 : ℝ))) |
| 204 | have hzero : Tendsto (fun _ : ℝ => (0 : ℝ)) (𝓝[>] (0 : ℝ)) (𝓝 0) := |
| 205 | tendsto_const_nhds |
| 206 | have hev' : (fun _ : ℝ => (0 : ℝ)) =ᶠ[𝓝[>] (0 : ℝ)] (fun t => |
| 207 | r * fderiv ℝ (fderiv ℝ f) (q + t • e0) |
| 208 | (EuclideanSpace.single (0 : Fin 2) 1) |
| 209 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 210 | r⁻¹ * fderiv ℝ (fderiv ℝ f) (q + t • e0) |
| 211 | (EuclideanSpace.single (1 : Fin 2) 1) |
| 212 | (EuclideanSpace.single (1 : Fin 2) 1)) := |
| 213 | hev.mono fun t ht => ht.symm |
| 214 | have hzero' := Filter.Tendsto.congr' hev' hzero |
| 215 | have hvalue := tendsto_nhds_unique hzero' hlimWithin |
| 216 | exact hp_eq.trans hvalue.symm |
| 217 | · have hqint : q ∈ m64AnnulusInterior := by |
| 218 | simp only [m64AnnulusInterior, Set.mem_preimage, Set.mem_pi, Set.mem_univ, |
| 219 | Set.mem_Ioo] |
| 220 | intro i hi |
| 221 | fin_cases i |
| 222 | · exact ⟨lt_of_le_of_ne hq.1 (Ne.symm hq0), hq0lt⟩ |
| 223 | · exact ⟨by simpa [hq1] using hp.1, by simpa [hq1] using hp.2⟩ |
| 224 | exact hp_eq.trans (heq q hqint) |
| 225 | |
| 226 | /-- Compatibility wrapper for callers smooth near the closed rectangle. Source: Morgan--Tian |
| 227 | (2007), Lemma 19.15 and Corollary 19.16, pp. 447-449; project derivation |
| 228 | `proof-work/tasks/M64/reports/2026-09-27-annulus-energy-and-finite-variation-derivation.md`. -/ |
| 229 | theorem m64PeriodicModulus_equation_on_strip |
| 230 | {r : ℝ} {f : LoopPlane → ℝ} |
| 231 | (hreg : ∀ p ∈ m64AnnulusDomain, ContDiffAt ℝ ∞ f p) |
| 232 | (hperiod : ∀ x s, f (annulusPoint (x + curvePeriod) s) = |
| 233 | f (annulusPoint x s)) |
| 234 | (heq : ∀ p ∈ m64AnnulusInterior, |
| 235 | r * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (0 : Fin 2) 1) |
| 236 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 237 | r⁻¹ * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (1 : Fin 2) 1) |
| 238 | (EuclideanSpace.single (1 : Fin 2) 1) = 0) : |
| 239 | ∀ p ∈ m64AnnulusOpenStrip, |
| 240 | r * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (0 : Fin 2) 1) |
| 241 | (EuclideanSpace.single (0 : Fin 2) 1) + |
| 242 | r⁻¹ * fderiv ℝ (fderiv ℝ f) p (EuclideanSpace.single (1 : Fin 2) 1) |
| 243 | (EuclideanSpace.single (1 : Fin 2) 1) = 0 := |
| 244 | m64PeriodicModulus_equation_on_strip_of_open_regularity |
| 245 | (fun _ hp => (m64PeriodicScalar_contDiffAt_of_fundamental hreg hperiod |
| 246 | ⟨hp.1.le, hp.2.le⟩).contDiffWithinAt) hperiod heq |
| 247 | |
| 248 | end PoincareMT |