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.Compatibility.SourceNames |
| 2 | import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.C2.TraceEmbeddedCalculus |
| 3 | import PoincareLib.Geometry.CurveShortening.Ramp.CurveEstimates.Smooth.Relabeling |
| 4 | |
| 5 | /-! |
| 6 | # Actual spatial derivatives of pushed curvature jets |
| 7 | |
| 8 | The actual covariant recurrence and the embedding product rules give |
| 9 | first derivatives and second derivative bounds in a fixed target. |
| 10 | MT2007 Claim 19.1, p. 437, Lemma 19.24, pp. 454-455; |
| 11 | `2026-09-22-embedded-curvature-jet-spatial-derivatives.md`. |
| 12 | -/ |
| 13 | |
| 14 | set_option autoImplicit false |
| 15 | set_option backward.isDefEq.respectTransparency false |
| 16 | |
| 17 | open Set Bundle Manifold |
| 18 | open scoped Manifold ContDiff Bundle BigOperators |
| 19 | |
| 20 | universe u v |
| 21 | |
| 22 | namespace PoincareMT.M63 |
| 23 | |
| 24 | open M62 |
| 25 | |
| 26 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 27 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 28 | [T2Space M] {ι : Type v} [Fintype ι] {a b : ℝ} |
| 29 | |
| 30 | local notation "W" => EuclideanSpace ℝ ι |
| 31 | |
| 32 | /-- Every actual pushed curvature jet has its genuine spatial derivative, |
| 33 | with the Hessian in the velocity slot. MT2007 Lemma 19.24, pp. 454-455; |
| 34 | pushed-jet spatial derivation, statement 1. -/ |
| 35 | theorem hasDerivAt_embeddedCurvatureJet_spatial |
| 36 | (F : RicciFlow n M (Icc a b)) (c : ℝ → ℝ → M) |
| 37 | (hc : M62ShrinkingCurve F c) {e : M → W} |
| 38 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) (i : ℕ) |
| 39 | {t : ℝ} (ht : t ∈ Ioo a b) (x : ℝ) : |
| 40 | let de : TangentSpace (𝓡 n) (c x t) →L[ℝ] W := |
| 41 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) |
| 42 | HasDerivAt (fun y => (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c y t) |
| 43 | (m63CurvatureJet F c i t y) : W)) |
| 44 | (curveSpeed F c t x • (de (m63CurvatureJet F c (i + 1) t x) + |
| 45 | coordinateHessian (F.connection t) e (c x t) |
| 46 | (spatialUnitTangent F c t x) (m63CurvatureJet F c i t x))) x := by |
| 47 | classical |
| 48 | dsimp only |
| 49 | let p := c x t |
| 50 | let D := F.connection t |
| 51 | let v := curveSpeed F c t x |
| 52 | let S := spatialUnitTangent F c t x |
| 53 | let J := m63CurvatureJet F c i t x |
| 54 | let J1 := m63CurvatureJet F c (i + 1) t x |
| 55 | let de : TangentSpace (𝓡 n) p →L[ℝ] W := mfderiv (𝓡 n) 𝓘(ℝ, W) e p |
| 56 | have hv : v ≠ 0 := (speed_pos F c hc (Ioo_subset_Icc_self ht) x).ne' |
| 57 | have hX : curveVelocity (fun y => c y t) x = v • S := by |
| 58 | dsimp only [S, spatialUnitTangent] |
| 59 | rw [smul_smul, mul_inv_cancel₀ hv, one_smul] |
| 60 | have hDX : rampHorizontalCovariantDerivative D (fun y => c y t) |
| 61 | (fun y => m63CurvatureJet F c i t y) x = v • J1 := by |
| 62 | change _ = v • (v⁻¹ • _) |
| 63 | rw [smul_smul, mul_inv_cancel₀ hv, one_smul] |
| 64 | have hE : coordinateHessian D e p (v • S) J = v • coordinateHessian D e p S J := by |
| 65 | ext k |
| 66 | have hf : ContMDiff (𝓡 n) 𝓘(ℝ, ℝ) ∞ (fun q => e q k) := |
| 67 | (EuclideanSpace.proj k).contDiff.contMDiff.comp he |
| 68 | obtain ⟨L, hL⟩ := (M04.isSmoothCovariantTensor_hessian D hf).1 p |
| 69 | have hu (Y : TangentSpace (𝓡 n) p) : Function.update ![S, J] 0 Y = ![Y, J] := by |
| 70 | ext j |
| 71 | fin_cases j <;> simp [Function.update] |
| 72 | change D.hessian (fun q => e q k) p (v • S) J = |
| 73 | v * D.hessian (fun q => e q k) p S J |
| 74 | simpa [hu, ← hL, smul_eq_mul] using L.map_update_smul ![S, J] 0 v S |
| 75 | have hopen : IsOpen (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := isOpen_univ.prod isOpen_Ioo |
| 76 | have hmem : (x, t) ∈ (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := ⟨mem_univ _, ht⟩ |
| 77 | have hcurve : ContMDiffAt 𝓘(ℝ, ℝ) (𝓡 n) ∞ (fun y => c y t) x := |
| 78 | (hc.joint_smooth.contMDiffAt (hopen.mem_nhds hmem)).comp x |
| 79 | (contDiffAt_id.prodMk contDiffAt_const).contMDiffAt |
| 80 | have hd := hasDerivAt_embedding_pushforward D he hcurve |
| 81 | (fun y => m63CurvatureJet F c i t y) (curvatureJet_mdifferentiable F c hc ht i x) |
| 82 | change HasDerivAt (fun y => (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c y t) |
| 83 | (m63CurvatureJet F c i t y) : W)) |
| 84 | (coordinateHessian D e p (curveVelocity (fun y => c y t) x) J + |
| 85 | de (rampHorizontalCovariantDerivative D (fun y => c y t) |
| 86 | (fun y => m63CurvatureJet F c i t y) x)) x at hd |
| 87 | rw [hX, hDX, hE, map_smul] at hd |
| 88 | convert! hd using 1 |
| 89 | dsimp only [v, D, p, S, J, J1, de] |
| 90 | simp only [smul_add] |
| 91 | ext k |
| 92 | simp only [PiLp.add_apply, PiLp.smul_apply, smul_eq_mul] |
| 93 | ring |
| 94 | |
| 95 | /-- The ordinary second derivative of each actual pushed curvature jet |
| 96 | is bounded by three consecutive actual jet norms. MT2007 Lemma 19.24, |
| 97 | pp. 454-455; pushed-jet spatial derivation, statement 2. -/ |
| 98 | theorem embeddedCurvatureJet_second_spatial_derivative_bound |
| 99 | (F : RicciFlow n M (Icc a b)) (c : ℝ → ℝ → M) |
| 100 | (hc : M62ShrinkingCurve F c) {e : M → W} |
| 101 | (he : ContMDiff (𝓡 n) 𝓘(ℝ, W) ∞ e) (i : ℕ) |
| 102 | {t : ℝ} (ht : t ∈ Ioo a b) (x : ℝ) |
| 103 | {E1 E2 E3 : ℝ} (_hE1 : 0 ≤ E1) (_hE2 : 0 ≤ E2) (_hE3 : 0 ≤ E3) |
| 104 | (hde : ∀ V : TangentSpace (𝓡 n) (c x t), |
| 105 | Norm.norm (E := W) (mfderiv (𝓡 n) 𝓘(ℝ, W) e (c x t) V) ≤ |
| 106 | E1 * (F.metric t).tangentNorm (c x t) V) |
| 107 | (hE : ∀ V Z : TangentSpace (𝓡 n) (c x t), |
| 108 | ‖coordinateHessian (F.connection t) e (c x t) V Z‖ ≤ |
| 109 | E2 * (F.metric t).tangentNorm (c x t) V * (F.metric t).tangentNorm (c x t) Z) |
| 110 | (hT : ∀ V Y Z : TangentSpace (𝓡 n) (c x t), |
| 111 | ‖WithLp.toLp 2 (fun k : ι => (F.connection t).covariantTensorDerivative |
| 112 | (fun q w => (F.connection t).hessian (fun z => e z k) q (w 0) (w 1)) |
| 113 | (c x t) ![V, Y, Z])‖ ≤ |
| 114 | E3 * (F.metric t).tangentNorm (c x t) V * (F.metric t).tangentNorm (c x t) Y * |
| 115 | (F.metric t).tangentNorm (c x t) Z) : |
| 116 | let eta : ℝ → W := fun y => |
| 117 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c y t) (m63CurvatureJet F c i t y) |
| 118 | let v := curveSpeed F c t x |
| 119 | let k := m62Curvature F c t x |
| 120 | let hj := fun j => (F.metric t).tangentNorm (c x t) (m63CurvatureJet F c j t x) |
| 121 | ‖deriv (deriv eta) x‖ ≤ |
| 122 | |deriv (curveSpeed F c t) x| * (E2 * hj i + E1 * hj (i + 1)) + |
| 123 | v ^ 2 * (E3 * hj i + E2 * k * hj i + 2 * E2 * hj (i + 1) + |
| 124 | E1 * hj (i + 2)) := by |
| 125 | classical |
| 126 | dsimp only |
| 127 | let D := F.connection t |
| 128 | let p := c x t |
| 129 | let v := curveSpeed F c t x |
| 130 | let vx := deriv (curveSpeed F c t) x |
| 131 | let S := spatialUnitTangent F c t |
| 132 | let H := m62CurvatureVector F c t |
| 133 | let J := m63CurvatureJet F c i t |
| 134 | let J1 := m63CurvatureJet F c (i + 1) t |
| 135 | let J2 := m63CurvatureJet F c (i + 2) t x |
| 136 | let de (y : ℝ) : TangentSpace (𝓡 n) (c y t) →L[ℝ] W := |
| 137 | mfderiv (𝓡 n) 𝓘(ℝ, W) e (c y t) |
| 138 | let E (y : ℝ) := coordinateHessian D e (c y t) |
| 139 | let T : ι → CovariantTensorEvaluation n M 2 := |
| 140 | fun k q w => D.hessian (fun z => e z k) q (w 0) (w 1) |
| 141 | let T0 := WithLp.toLp 2 (fun k => D.covariantTensorDerivative (T k) p ![S x, S x, J x]) |
| 142 | let eta : ℝ → W := fun y => de y (J y) |
| 143 | let C : ℝ → W := fun y => de y (J1 y) + E y (S y) (J y) |
| 144 | let C2 := de x J2 + (2 : ℝ) • E x (S x) (J1 x) + E x (H x) (J x) + T0 |
| 145 | let hj := fun j => (F.metric t).tangentNorm p (m63CurvatureJet F c j t x) |
| 146 | let k := m62Curvature F c t x |
| 147 | have hv : v ≠ 0 := (speed_pos F c hc (Ioo_subset_Icc_self ht) x).ne' |
| 148 | have hX : curveVelocity (fun y => c y t) x = v • S x := by |
| 149 | dsimp only [S, spatialUnitTangent] |
| 150 | rw [smul_smul, mul_inv_cancel₀ hv, one_smul] |
| 151 | have hDS : rampHorizontalCovariantDerivative D (fun y => c y t) S x = v • H x := by |
| 152 | dsimp only [H, m62CurvatureVector, m62SpatialDerivative] |
| 153 | rw [smul_smul, mul_inv_cancel₀ hv, one_smul] |
| 154 | have hDJ : rampHorizontalCovariantDerivative D (fun y => c y t) J x = v • J1 x := by |
| 155 | change _ = v • (v⁻¹ • _) |
| 156 | rw [smul_smul, mul_inv_cancel₀ hv, one_smul] |
| 157 | have hTensor (j : ι) : IsSmoothCovariantTensor (T j) := |
| 158 | M04.isSmoothCovariantTensor_hessian D ((EuclideanSpace.proj j).contDiff.contMDiff.comp he) |
| 159 | have hEleft (Y Z : TangentSpace (𝓡 n) p) : E x (v • Y) Z = v • E x Y Z := by |
| 160 | ext j |
| 161 | obtain ⟨L, hL⟩ := (hTensor j).1 p |
| 162 | have hu (A : TangentSpace (𝓡 n) p) : Function.update ![Y, Z] 0 A = ![A, Z] := by |
| 163 | ext q |
| 164 | fin_cases q <;> simp [Function.update] |
| 165 | change T j p ![v • Y, Z] = v * T j p ![Y, Z] |
| 166 | simpa only [hu, ← hL, smul_eq_mul] using L.map_update_smul ![Y, Z] 0 v Y |
| 167 | have hEright (Y Z : TangentSpace (𝓡 n) p) : E x Y (v • Z) = v • E x Y Z := by |
| 168 | ext j |
| 169 | obtain ⟨L, hL⟩ := (hTensor j).1 p |
| 170 | have hu (A : TangentSpace (𝓡 n) p) : Function.update ![Y, Z] 1 A = ![Y, A] := by |
| 171 | ext q |
| 172 | fin_cases q <;> simp [Function.update] |
| 173 | change T j p ![Y, v • Z] = v * T j p ![Y, Z] |
| 174 | simpa only [hu, ← hL, smul_eq_mul] using L.map_update_smul ![Y, Z] 1 v Z |
| 175 | have hT0 : WithLp.toLp 2 (fun j => D.covariantTensorDerivative (T j) p |
| 176 | ![v • S x, S x, J x]) = v • T0 := by |
| 177 | ext j |
| 178 | obtain ⟨L, hL⟩ := |
| 179 | (M04.isSmoothCovariantTensor_covariantTensorDerivative D (hTensor j)).1 p |
| 180 | have hu (A : TangentSpace (𝓡 n) p) : Function.update ![S x, S x, J x] 0 A = |
| 181 | ![A, S x, J x] := by |
| 182 | ext q |
| 183 | fin_cases q <;> simp [Function.update] |
| 184 | change D.covariantTensorDerivative (T j) p ![v • S x, S x, J x] = |
| 185 | v * D.covariantTensorDerivative (T j) p ![S x, S x, J x] |
| 186 | simpa only [hu, ← hL, smul_eq_mul] using L.map_update_smul ![S x, S x, J x] 0 v (S x) |
| 187 | have hopen : IsOpen (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := isOpen_univ.prod isOpen_Ioo |
| 188 | have hmem : (x, t) ∈ (univ ×ˢ Ioo a b : Set (ℝ × ℝ)) := ⟨mem_univ _, ht⟩ |
| 189 | have hcurve : ContMDiffAt 𝓘(ℝ, ℝ) (𝓡 n) ∞ (fun y => c y t) x := |
| 190 | (hc.joint_smooth.contMDiffAt (hopen.mem_nhds hmem)).comp x |
| 191 | (contDiffAt_id.prodMk contDiffAt_const).contMDiffAt |
| 192 | have hJ1 := hasDerivAt_embeddedCurvatureJet_spatial F c hc he (i + 1) ht x |
| 193 | change HasDerivAt (fun y => de y (J1 y)) |
| 194 | (v • (de x J2 + E x (S x) (J1 x))) x at hJ1 |
| 195 | have hEder := hasDerivAt_coordinateHessian_pullback D he hcurve S J |
| 196 | (unitTangent_mdifferentiable F c hc ht x) |
| 197 | (curvatureJet_mdifferentiable F c hc ht i x) |
| 198 | change HasDerivAt (fun y => E y (S y) (J y)) |
| 199 | (WithLp.toLp 2 (fun j => D.covariantTensorDerivative (T j) p |
| 200 | ![curveVelocity (fun y => c y t) x, S x, J x]) + |
| 201 | E x (rampHorizontalCovariantDerivative D (fun y => c y t) S x) (J x) + |
| 202 | E x (S x) (rampHorizontalCovariantDerivative D (fun y => c y t) J x)) x at hEder |
| 203 | rw [hX, hDS, hDJ, hT0, hEleft, hEright] at hEder |
| 204 | have hC : HasDerivAt C (v • C2) x := by |
| 205 | apply (hJ1.add hEder).congr_deriv |
| 206 | dsimp only [C2] |
| 207 | simp only [smul_add, smul_smul] |
| 208 | ext j |
| 209 | simp only [PiLp.add_apply, PiLp.smul_apply, smul_eq_mul] |
| 210 | ring |
| 211 | have hspeed : ContDiff ℝ ∞ (curveSpeed F c t) := |
| 212 | (speed_joint_contDiffOn F c hc).comp_contDiff |
| 213 | (contDiff_id.prodMk contDiff_const) (fun _ => ⟨mem_univ _, ht⟩) |
| 214 | have hfirst : deriv eta = fun y => curveSpeed F c t y • C y := by |
| 215 | funext y |
| 216 | exact (hasDerivAt_embeddedCurvatureJet_spatial F c hc he i ht y).deriv |
| 217 | have hsecond : deriv (deriv eta) x = v ^ 2 • C2 + vx • C x := by |
| 218 | rw [hfirst] |
| 219 | have hd := ((hspeed.differentiable (by simp) x).hasDerivAt).fun_smul hC |
| 220 | simpa only [Pi.smul_apply, v, vx, smul_smul, pow_two] using hd.deriv |
| 221 | have hS : (F.metric t).tangentNorm p (S x) = 1 := |
| 222 | unitTangent_norm F c hc (Ioo_subset_Icc_self ht) x |
| 223 | have hH : (F.metric t).tangentNorm p (H x) = k := rfl |
| 224 | have hEJ : ‖E x (S x) (J x)‖ ≤ E2 * hj i := by |
| 225 | have hh := hE (S x) (J x) |
| 226 | change ‖E x (S x) (J x)‖ ≤ E2 * (F.metric t).tangentNorm p (S x) * hj i at hh |
| 227 | simpa only [hS, mul_one] using hh |
| 228 | have hEJ1 : ‖E x (S x) (J1 x)‖ ≤ E2 * hj (i + 1) := by |
| 229 | have hh := hE (S x) (J1 x) |
| 230 | change ‖E x (S x) (J1 x)‖ ≤ |
| 231 | E2 * (F.metric t).tangentNorm p (S x) * hj (i + 1) at hh |
| 232 | simpa only [hS, mul_one] using hh |
| 233 | have hEHJ : ‖E x (H x) (J x)‖ ≤ E2 * k * hj i := by |
| 234 | have hh := hE (H x) (J x) |
| 235 | change ‖E x (H x) (J x)‖ ≤ E2 * (F.metric t).tangentNorm p (H x) * hj i at hh |
| 236 | simpa only [hH] using hh |
| 237 | have hTbound : ‖T0‖ ≤ E3 * hj i := by |
| 238 | have hh := hT (S x) (S x) (J x) |
| 239 | change ‖T0‖ ≤ E3 * (F.metric t).tangentNorm p (S x) * |
| 240 | (F.metric t).tangentNorm p (S x) * hj i at hh |
| 241 | simpa only [hS, mul_one] using hh |
| 242 | have hCbound : ‖C x‖ ≤ E2 * hj i + E1 * hj (i + 1) := by |
| 243 | calc |
| 244 | ‖C x‖ ≤ ‖de x (J1 x)‖ + ‖E x (S x) (J x)‖ := norm_add_le _ _ |
| 245 | _ ≤ E1 * hj (i + 1) + E2 * hj i := add_le_add (hde (J1 x)) hEJ |
| 246 | _ = _ := add_comm _ _ |
| 247 | have htwo : ‖(2 : ℝ) • E x (S x) (J1 x)‖ ≤ 2 * E2 * hj (i + 1) := by |
| 248 | rw [norm_smul, Real.norm_eq_abs, abs_of_pos (by norm_num : (0 : ℝ) < 2)] |
| 249 | simpa only [mul_assoc] using |
| 250 | mul_le_mul_of_nonneg_left hEJ1 (by norm_num : (0 : ℝ) ≤ 2) |
| 251 | have hC2bound : ‖C2‖ ≤ |
| 252 | E3 * hj i + E2 * k * hj i + 2 * E2 * hj (i + 1) + E1 * hj (i + 2) := by |
| 253 | have hnorm : ‖C2‖ ≤ |
| 254 | ‖de x J2‖ + ‖(2 : ℝ) • E x (S x) (J1 x)‖ + ‖E x (H x) (J x)‖ + ‖T0‖ := |
| 255 | (norm_add_le _ _).trans (add_le_add |
| 256 | ((norm_add_le _ _).trans (add_le_add (norm_add_le _ _) (le_refl _))) (le_refl _)) |
| 257 | have hsum := hnorm.trans (add_le_add (add_le_add (add_le_add (hde J2) htwo) hEHJ) hTbound) |
| 258 | change ‖C2‖ ≤ E1 * hj (i + 2) + 2 * E2 * hj (i + 1) + E2 * k * hj i + E3 * hj i at hsum |
| 259 | linarith only [hsum] |
| 260 | change ‖deriv (deriv eta) x‖ ≤ |vx| * (E2 * hj i + E1 * hj (i + 1)) + |
| 261 | v ^ 2 * (E3 * hj i + E2 * k * hj i + 2 * E2 * hj (i + 1) + E1 * hj (i + 2)) |
| 262 | rw [hsecond] |
| 263 | calc |
| 264 | ‖v ^ 2 • C2 + vx • C x‖ ≤ ‖v ^ 2 • C2‖ + ‖vx • C x‖ := norm_add_le _ _ |
| 265 | _ = v ^ 2 * ‖C2‖ + |vx| * ‖C x‖ := by |
| 266 | rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, |
| 267 | abs_of_nonneg (sq_nonneg v)] |
| 268 | _ ≤ v ^ 2 * (E3 * hj i + E2 * k * hj i + 2 * E2 * hj (i + 1) + E1 * hj (i + 2)) + |
| 269 | |vx| * (E2 * hj i + E1 * hj (i + 1)) := |
| 270 | add_le_add (mul_le_mul_of_nonneg_left hC2bound (sq_nonneg v)) |
| 271 | (mul_le_mul_of_nonneg_left hCbound (abs_nonneg vx)) |
| 272 | _ = _ := add_comm _ _ |
| 273 | |
| 274 | end PoincareMT.M63 |