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.RicciFlow.Curvature.Calculus.Fields.FixedExtension |
| 2 | import PoincareLib.Geometry.RicciFlow.Curvature.Calculus.Tensors.TensorDerivativeClosure |
| 3 | import PoincareLib.Geometry.RicciFlow.Curvature.Estimates.ScalarTrace |
| 4 | import Mathlib.Geometry.Manifold.ContMDiff.Atlas |
| 5 | import Mathlib.Geometry.Manifold.MFDeriv.Atlas |
| 6 | import Mathlib.LinearAlgebra.BilinearForm.Properties |
| 7 | import Mathlib.LinearAlgebra.SesquilinearForm.Basic |
| 8 | |
| 9 | /-! Adapted from Mapher06/Poincare-MorganTian, `PoincareMT/Proofs/M04/TensorNullMinimum.lean`, |
| 10 | revision `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. See the curvature import record under |
| 11 | `references/ricci-flow/mapher/curvature/`. -/ |
| 12 | |
| 13 | /-! |
| 14 | # Local tensor tests at a null direction |
| 15 | |
| 16 | The local field is corrected in a finite frame so that its complete |
| 17 | covariant derivative vanishes at the selected point. |
| 18 | -/ |
| 19 | |
| 20 | set_option autoImplicit false |
| 21 | |
| 22 | open scoped Manifold ContDiff Bundle BigOperators |
| 23 | open Set Topology Filter |
| 24 | |
| 25 | universe u |
| 26 | |
| 27 | namespace PoincareMT.RicciFlowAnalysis |
| 28 | |
| 29 | variable {n : ℕ} {M : Type u} [TopologicalSpace M] |
| 30 | [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓡 n) ∞ M] |
| 31 | {g : RiemannianMetric n M} |
| 32 | |
| 33 | set_option maxHeartbeats 2400000 in |
| 34 | -- Constructing the corrected local field in bundle coordinates needs extra elaboration. |
| 35 | set_option backward.isDefEq.respectTransparency false in |
| 36 | theorem exists_local_field_connection_zero (D : LeviCivitaData g) |
| 37 | (x : M) (u : TangentSpace (𝓡 n) x) : |
| 38 | ∃ (U : Set M) (X : (y : M) → TangentSpace (𝓡 n) y), |
| 39 | IsOpen U ∧ x ∈ U ∧ |
| 40 | ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% X) U ∧ |
| 41 | X x = u ∧ D.connection X x = 0 := by |
| 42 | classical |
| 43 | let E := EuclideanSpace ℝ (Fin n) |
| 44 | let e := trivializationAt E (TangentSpace (𝓡 n) : M → Type _) x |
| 45 | let c := extChartAt (𝓡 n) x |
| 46 | let U := e.baseSet ∩ c.source |
| 47 | have hU : IsOpen U := e.open_baseSet.inter (isOpen_extChartAt_source x) |
| 48 | have hxe : x ∈ e.baseSet := FiberBundle.mem_baseSet_trivializationAt' x |
| 49 | have hxc : x ∈ c.source := mem_extChartAt_source x |
| 50 | have hx : x ∈ U := ⟨hxe, hxc⟩ |
| 51 | let V := FiberBundle.extend E u |
| 52 | have hV : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% V) U := |
| 53 | (contMDiffOn_extend_baseSet u).mono inter_subset_left |
| 54 | let L : TangentSpace (𝓡 n) x →L[ℝ] E := mfderiv (𝓡 n) 𝓘(ℝ, E) c x |
| 55 | have hL : L.IsInvertible := isInvertible_mfderiv_extChartAt hxc |
| 56 | let b := (EuclideanSpace.basisFun (Fin n) ℝ).toBasis |
| 57 | let A : E →L[ℝ] E := (e.continuousLinearMapAt ℝ x).comp |
| 58 | ((D.connection V x).comp L.inverse) |
| 59 | let C (i : Fin n) : E →L[ℝ] ℝ := (b.coord i).toContinuousLinearMap.comp A |
| 60 | let φ (i : Fin n) : M → ℝ := fun y ↦ C i (c y - c x) |
| 61 | let S (i : Fin n) := FiberBundle.extend E (e.symmL ℝ x (b i)) |
| 62 | have hS (i : Fin n) : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% (S i)) U := |
| 63 | (contMDiffOn_extend_baseSet (e.symmL ℝ x (b i))).mono inter_subset_left |
| 64 | have hc : ContMDiffOn (𝓡 n) 𝓘(ℝ, E) ∞ c U := by |
| 65 | apply ContMDiffOn.mono (t := U) ?_ inter_subset_right |
| 66 | simpa only [c, extChartAt_source] using! |
| 67 | (contMDiffOn_extChartAt (I := 𝓡 n) (x := x) (n := ∞)) |
| 68 | have hφ (i : Fin n) : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ (φ i) U := |
| 69 | (C i).contMDiff.comp_contMDiffOn (hc.sub contMDiffOn_const) |
| 70 | have hφzero (i : Fin n) : φ i x = 0 := by simp [φ] |
| 71 | have hcD : MDifferentiableAt (𝓡 n) 𝓘(ℝ, E) c x := |
| 72 | (hc.contMDiffAt (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 73 | have hφD (i : Fin n) : mvfderiv (𝓡 n) (φ i) x = (C i).comp L := by |
| 74 | have he : φ i = (fun y ↦ C i (c y)) - (fun _ ↦ C i (c x)) := by |
| 75 | funext y |
| 76 | exact map_sub (C i) (c y) (c x) |
| 77 | have hd : MDifferentiableAt (𝓡 n) 𝓘(ℝ, ℝ) (fun y ↦ C i (c y)) x := |
| 78 | (C i).differentiableAt.mdifferentiableAt.comp x hcD |
| 79 | ext a |
| 80 | rw [he, mvfderiv_sub hd mdifferentiableAt_const, mvfderiv_const, sub_zero] |
| 81 | change mvfderiv (𝓡 n) ((C i) ∘ c) x a = _ |
| 82 | rw [mvfderiv_comp_apply x (C i).differentiableAt.mdifferentiableAt hcD a] |
| 83 | simpa only [mvfderiv, mfderiv_eq_fderiv, ContinuousLinearMap.comp_apply, L] using! |
| 84 | congrArg (fun K : E →L[ℝ] ℝ ↦ K (L a)) ((C i).fderiv (x := c x)) |
| 85 | have hterm (i : Fin n) : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ |
| 86 | (T% (fun y ↦ φ i y • S i y)) U := (hφ i).smul_section (hS i) |
| 87 | have hsumSmooth (s : Finset (Fin n)) : ContMDiffOn (𝓡 n) |
| 88 | ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% (fun y ↦ ∑ i ∈ s, φ i y • S i y)) U := |
| 89 | ContMDiffOn.sum_section (fun i _ ↦ hterm i) |
| 90 | have htermD (i : Fin n) : |
| 91 | D.connection (fun y ↦ φ i y • S i y) x = |
| 92 | (mvfderiv (𝓡 n) (φ i) x).smulRight (S i x) := by |
| 93 | have hSi := ((hS i).contMDiffAt (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 94 | have hφi := ((hφ i).contMDiffAt (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 95 | change D.connection (φ i • S i) x = _ |
| 96 | rw [D.connection.isCovariantDerivativeOnUniv.leibniz hSi hφi, hφzero] |
| 97 | simp only [zero_smul, zero_add] |
| 98 | have hsumD (s : Finset (Fin n)) : |
| 99 | D.connection (fun y ↦ ∑ i ∈ s, φ i y • S i y) x = |
| 100 | ∑ i ∈ s, D.connection (fun y ↦ φ i y • S i y) x := by |
| 101 | induction s using Finset.induction_on with |
| 102 | | empty => |
| 103 | simpa only [Finset.sum_empty] using! D.connection.isCovariantDerivativeOnUniv.zero (x := x) |
| 104 | | @insert i s his ih => |
| 105 | have he : (fun y ↦ ∑ j ∈ insert i s, φ j y • S j y) = |
| 106 | (fun y ↦ φ i y • S i y) + (fun y ↦ ∑ j ∈ s, φ j y • S j y) := by |
| 107 | funext y |
| 108 | simp only [Finset.sum_insert his, Pi.add_apply] |
| 109 | have hiD := ((hterm i).contMDiffAt (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 110 | have hsD := ((hsumSmooth s).contMDiffAt (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 111 | rw [he, D.connection.isCovariantDerivativeOnUniv.add hiD hsD, ih, |
| 112 | Finset.sum_insert his] |
| 113 | let W := fun y ↦ ∑ i, φ i y • S i y |
| 114 | have hW := hsumSmooth Finset.univ |
| 115 | have hWx : W x = 0 := by simp only [W, hφzero, zero_smul, Finset.sum_const_zero] |
| 116 | have hWD : D.connection W x = D.connection V x := by |
| 117 | ext a |
| 118 | have hs := congrArg (fun K : TangentSpace (𝓡 n) x →L[ℝ] TangentSpace (𝓡 n) x ↦ K a) |
| 119 | (hsumD Finset.univ) |
| 120 | change D.connection W x a = _ at hs |
| 121 | rw [hs] |
| 122 | simp only [sum_apply, htermD, ContinuousLinearMap.smulRight_apply, hφD, |
| 123 | ContinuousLinearMap.comp_apply] |
| 124 | have hcoord (i : Fin n) : C i (L a) = |
| 125 | b.coord i (e.continuousLinearMapAt ℝ x (D.connection V x a)) := by |
| 126 | change b.coord i (e.continuousLinearMapAt ℝ x |
| 127 | (D.connection V x (L.inverse (L a)))) = _ |
| 128 | rw [show L.inverse (L a) = a from hL.inverse_apply_eq.mpr rfl] |
| 129 | simp only [hcoord, S, FiberBundle.extend_apply_self] |
| 130 | simp only [← map_smul] |
| 131 | rw [← map_sum] |
| 132 | change e.symmL ℝ x (∑ i, b.repr (e.continuousLinearMapAt ℝ x |
| 133 | (D.connection V x a)) i • b i) = _ |
| 134 | rw [b.sum_repr, e.symmL_continuousLinearMapAt hxe] |
| 135 | let X := V + (-1 : ℝ) • W |
| 136 | have hX : ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, E)) ∞ (T% X) U := |
| 137 | hV.add_section (hW.const_smul_section (a := (-1 : ℝ))) |
| 138 | refine ⟨U, X, hU, hx, hX, ?_, ?_⟩ |
| 139 | · simp only [X, Pi.add_apply, Pi.smul_apply, hWx, smul_zero, add_zero, V, |
| 140 | FiberBundle.extend_apply_self] |
| 141 | · have hVD := (hV.contMDiffAt (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 142 | have hW'D := ((hW.const_smul_section (a := (-1 : ℝ))).contMDiffAt |
| 143 | (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 144 | have hWD' := (hW.contMDiffAt (hU.mem_nhds hx)).mdifferentiableAt (by simp) |
| 145 | change D.connection (V + (-1 : ℝ) • W) x = 0 |
| 146 | rw [D.connection.isCovariantDerivativeOnUniv.add hVD hW'D, |
| 147 | D.connection.isCovariantDerivativeOnUniv.smul_const (-1) hWD', hWD] |
| 148 | simp |
| 149 | |
| 150 | set_option maxHeartbeats 4000000 in |
| 151 | -- The local-field expansion and null-vector cancellations need extra elaboration. |
| 152 | set_option backward.isDefEq.respectTransparency false in |
| 153 | theorem tensorLaplacian_nonneg_at_null (D : LeviCivitaData g) |
| 154 | {S : CovariantTensorEvaluation n M 2} (hS : IsSmoothCovariantTensor S) |
| 155 | (hsymm : ∀ (y : M) (a b : TangentSpace (𝓡 n) y), S y ![a, b] = S y ![b, a]) |
| 156 | {U : Set M} (hU : IsOpen U) {x : M} (hx : x ∈ U) |
| 157 | (hpos : ∀ (y : M), y ∈ U → ∀ a : TangentSpace (𝓡 n) y, 0 ≤ S y ![a, a]) |
| 158 | (u : TangentSpace (𝓡 n) x) (hnull : S x ![u, u] = 0) : |
| 159 | 0 ≤ D.tensorLaplacian S x ![u, u] := by |
| 160 | classical |
| 161 | obtain ⟨A, hA⟩ := hS.1 x |
| 162 | have hu0 {y : M} (a b c : TangentSpace (𝓡 n) y) : |
| 163 | Function.update ![a, b] 0 c = ![c, b] := by |
| 164 | funext i |
| 165 | fin_cases i <;> simp [Function.update] |
| 166 | have hu1 {y : M} (a b c : TangentSpace (𝓡 n) y) : |
| 167 | Function.update ![a, b] 1 c = ![a, c] := by |
| 168 | funext i |
| 169 | fin_cases i <;> simp [Function.update] |
| 170 | let B : LinearMap.BilinForm ℝ (TangentSpace (𝓡 n) x) := |
| 171 | { toFun := fun a ↦ A.toLinearMap ![a, 0] 1 |
| 172 | map_add' := by |
| 173 | intro a b |
| 174 | ext c |
| 175 | simpa only [LinearMap.add_apply, MultilinearMap.toLinearMap_apply, hu1, hu0] using |
| 176 | A.map_update_add ![0, c] 0 a b |
| 177 | map_smul' := by |
| 178 | intro s a |
| 179 | ext b |
| 180 | simpa only [LinearMap.smul_apply, RingHom.id_apply, |
| 181 | MultilinearMap.toLinearMap_apply, hu1, hu0] using |
| 182 | A.map_update_smul ![0, b] 0 s a } |
| 183 | have hB (a b : TangentSpace (𝓡 n) x) : B a b = S x ![a, b] := by |
| 184 | change A (Function.update ![a, 0] 1 b) = _ |
| 185 | rw [hu1] |
| 186 | exact (hA _).symm |
| 187 | have hBsymm : B.IsSymm := ⟨fun a b ↦ by simpa only [hB] using hsymm x a b⟩ |
| 188 | have hBu : B u = 0 := LinearMap.mem_ker.mp |
| 189 | ((B.apply_apply_same_eq_zero_iff (fun a ↦ by simpa only [hB] using hpos x hx a) |
| 190 | (LinearMap.BilinForm.isSymm_iff.mp hBsymm)).mp (by simpa only [hB] using hnull)) |
| 191 | have hkerL (a : TangentSpace (𝓡 n) x) : S x ![u, a] = 0 := by |
| 192 | rw [← hB, hBu] |
| 193 | rfl |
| 194 | have hkerR (a : TangentSpace (𝓡 n) x) : S x ![a, u] = 0 := |
| 195 | (hsymm x a u).trans (hkerL a) |
| 196 | obtain ⟨V, X, hV, hxV, hX, hXu, hDX⟩ := exists_local_field_connection_zero D x u |
| 197 | let e := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 198 | (TangentSpace (𝓡 n) : M → Type _) x |
| 199 | let O := (U ∩ V) ∩ e.baseSet |
| 200 | have hO : IsOpen O := (hU.inter hV).inter e.open_baseSet |
| 201 | have hxO : x ∈ O := ⟨⟨hx, hxV⟩, FiberBundle.mem_baseSet_trivializationAt' x⟩ |
| 202 | let Smooth (Z : (y : M) → TangentSpace (𝓡 n) y) := |
| 203 | ContMDiffOn (𝓡 n) ((𝓡 n).prod 𝓘(ℝ, EuclideanSpace ℝ (Fin n))) ∞ (T% Z) O |
| 204 | have hXO : Smooth X := hX.mono (fun _ hy ↦ hy.1.2) |
| 205 | have hE (a : TangentSpace (𝓡 n) x) : |
| 206 | Smooth (FiberBundle.extend (EuclideanSpace ℝ (Fin n)) a) := |
| 207 | (contMDiffOn_extend_baseSet a).mono inter_subset_right |
| 208 | have hCons {k : ℕ} {Z : (y : M) → TangentSpace (𝓡 n) y} |
| 209 | {W : Fin k → (y : M) → TangentSpace (𝓡 n) y} |
| 210 | (hZ : Smooth Z) (hW : ∀ i, Smooth (W i)) : |
| 211 | ∀ i, Smooth ((Fin.cons Z W : Fin (k + 1) → |
| 212 | (y : M) → TangentSpace (𝓡 n) y) i) := by |
| 213 | intro i |
| 214 | cases i using Fin.cases with |
| 215 | | zero => exact hZ |
| 216 | | succ i => exact hW i |
| 217 | have hTwo {Z W : (y : M) → TangentSpace (𝓡 n) y} |
| 218 | (hZ : Smooth Z) (hW : Smooth W) : |
| 219 | ∀ i : Fin 2, Smooth ((![Z, W] : Fin 2 → |
| 220 | (y : M) → TangentSpace (𝓡 n) y) i) := by |
| 221 | intro i |
| 222 | fin_cases i |
| 223 | · exact hZ |
| 224 | · exact hW |
| 225 | have hPoint {k : ℕ} (Z : (y : M) → TangentSpace (𝓡 n) y) |
| 226 | (W : Fin k → (y : M) → TangentSpace (𝓡 n) y) (y : M) : |
| 227 | (fun i ↦ (Fin.cons Z W : Fin (k + 1) → |
| 228 | (z : M) → TangentSpace (𝓡 n) z) i y) = Fin.cons (Z y) (fun i ↦ W i y) := by |
| 229 | funext i |
| 230 | cases i using Fin.cases <;> rfl |
| 231 | have hPointTwo (Z W : (y : M) → TangentSpace (𝓡 n) y) (y : M) : |
| 232 | (fun i ↦ (![Z, W] : Fin 2 → (z : M) → TangentSpace (𝓡 n) z) i y) = |
| 233 | ![Z y, W y] := by |
| 234 | funext i |
| 235 | fin_cases i <;> rfl |
| 236 | have hDiff {k : ℕ} {T : CovariantTensorEvaluation n M k} |
| 237 | (hT : IsSmoothCovariantTensor T) |
| 238 | {Z : (y : M) → TangentSpace (𝓡 n) y} |
| 239 | {W : Fin k → (y : M) → TangentSpace (𝓡 n) y} |
| 240 | (hZ : Smooth Z) (hW : ∀ i, Smooth (W i)) {y : M} (hy : y ∈ O) : |
| 241 | mvfderiv (𝓡 n) (fun z ↦ T z (fun i ↦ W i z)) y (Z y) = |
| 242 | D.covariantTensorDerivative T y (Fin.cons (Z y) (fun i ↦ W i y)) + |
| 243 | ∑ i, T y (Function.update (fun j ↦ W j y) i |
| 244 | (D.connection (W i) y (Z y))) := by |
| 245 | have he := covariantTensorDerivativeOnFields_eq D hT hO (hCons hZ hW) hy |
| 246 | rw [hPoint] at he |
| 247 | simp only [covariantTensorDerivativeOnFields, Fin.cons_zero, Fin.cons_succ] at he |
| 248 | exact sub_eq_iff_eq_add.mp he |
| 249 | have hzero {k : ℕ} {T : CovariantTensorEvaluation n M k} |
| 250 | (hT : IsSmoothCovariantTensor T) (v : Fin k → TangentSpace (𝓡 n) x) |
| 251 | (i : Fin k) (hi : v i = 0) : T x v = 0 := by |
| 252 | obtain ⟨Q, hQ⟩ := hT.1 x |
| 253 | rw [hQ] |
| 254 | exact Q.map_coord_zero i hi |
| 255 | let K := D.covariantTensorDerivative S |
| 256 | have hK : IsSmoothCovariantTensor K := isSmoothCovariantTensor_covariantTensorDerivative D hS |
| 257 | have hzK1 (a b : TangentSpace (𝓡 n) x) : K x ![a, 0, b] = 0 := |
| 258 | hzero hK _ 1 rfl |
| 259 | have hzK2 (a b : TangentSpace (𝓡 n) x) : K x ![a, b, 0] = 0 := |
| 260 | hzero hK _ 2 rfl |
| 261 | have hzS0 (a : TangentSpace (𝓡 n) x) : S x ![0, a] = 0 := hzero hS _ 0 rfl |
| 262 | have hzS1 (a : TangentSpace (𝓡 n) x) : S x ![a, 0] = 0 := hzero hS _ 1 rfl |
| 263 | let f := fun y ↦ S y ![X y, X y] |
| 264 | have hf : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ f O := by |
| 265 | simpa only [hPointTwo] using hS.2 O hO ![X, X] (hTwo hXO hXO) |
| 266 | have hfx : f x = 0 := by simpa only [f, hXu] using hnull |
| 267 | have hmin : IsLocalMin f x := by |
| 268 | filter_upwards [hO.mem_nhds hxO] with y hy |
| 269 | change f x ≤ f y |
| 270 | rw [hfx] |
| 271 | exact hpos y hy.1.1 (X y) |
| 272 | have hdfx (a : TangentSpace (𝓡 n) x) : |
| 273 | mvfderiv (𝓡 n) f x a = K x ![a, u, u] := by |
| 274 | have he := hDiff hS (hE a) (hTwo hXO hXO) hxO |
| 275 | simpa only [hPointTwo, Fin.sum_univ_succ, Fin.sum_univ_zero, Fin.cons_zero, |
| 276 | Fin.cons_succ, Matrix.cons_val_zero, Matrix.cons_val_succ, |
| 277 | show (Fin.succ 0 : Fin 2) = 1 from rfl, hu0, hu1, |
| 278 | hDX, zero_apply, hXu, FiberBundle.extend_apply_self, |
| 279 | hzS0, hzS1, add_zero, Matrix.Fin.cons_vecCons, K, f] using! he |
| 280 | have hsecond (a : TangentSpace (𝓡 n) x) : |
| 281 | 0 ≤ D.iteratedCovariantTensorDerivative S 2 x ![a, a, u, u] := by |
| 282 | let Y := FiberBundle.extend (EuclideanSpace ℝ (Fin n)) a |
| 283 | have hY : Smooth Y := hE a |
| 284 | let C := fun y ↦ D.connection X y (Y y) |
| 285 | have hC : Smooth C := by |
| 286 | intro y hy |
| 287 | apply ContMDiffAt.contMDiffWithinAt |
| 288 | apply contMDiffAt_section_of_metric_pairings g C |
| 289 | intro b |
| 290 | let q := trivializationAt (EuclideanSpace ℝ (Fin n)) |
| 291 | (TangentSpace (𝓡 n) : M → Type _) y |
| 292 | have hyq : y ∈ O ∩ q.baseSet := ⟨hy, FiberBundle.mem_baseSet_trivializationAt' y⟩ |
| 293 | exact (contMDiffOn_connection_pairing D (hO.inter q.open_baseSet) |
| 294 | (hY.mono inter_subset_left) (hXO.mono inter_subset_left) |
| 295 | ((contMDiffOn_extend_baseSet b).mono inter_subset_right)).contMDiffAt |
| 296 | ((hO.inter q.open_baseSet).mem_nhds hyq) |
| 297 | have hCx : C x = 0 := by simp only [C, hDX, zero_apply] |
| 298 | let p := fun y ↦ K y ![Y y, X y, X y] |
| 299 | let q := fun y ↦ S y ![C y, X y] |
| 300 | let r := fun y ↦ S y ![X y, C y] |
| 301 | have hp : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ p O := by |
| 302 | apply (hK.2 O hO (Fin.cons Y ![X, X]) (hCons hY (hTwo hXO hXO))).congr |
| 303 | intro y hy |
| 304 | apply congrArg (K y) |
| 305 | funext i |
| 306 | fin_cases i <;> rfl |
| 307 | have hq : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ q O := by |
| 308 | simpa only [hPointTwo] using hS.2 O hO ![C, X] (hTwo hC hXO) |
| 309 | have hr : ContMDiffOn (𝓡 n) 𝓘(ℝ, ℝ) ∞ r O := by |
| 310 | simpa only [hPointTwo] using hS.2 O hO ![X, C] (hTwo hXO hC) |
| 311 | have hfirst : (fun y ↦ mvfderiv (𝓡 n) f y (Y y)) =ᶠ[𝓝 x] (p + q + r) := by |
| 312 | filter_upwards [hO.mem_nhds hxO] with y hy |
| 313 | have he := hDiff hS hY (hTwo hXO hXO) hy |
| 314 | simpa only [hPointTwo, Fin.sum_univ_succ, Fin.sum_univ_zero, Fin.cons_zero, |
| 315 | Fin.cons_succ, Matrix.cons_val_zero, Matrix.cons_val_succ, |
| 316 | show (Fin.succ 0 : Fin 2) = 1 from rfl, hu0, hu1, Matrix.Fin.cons_vecCons, |
| 317 | add_zero, Pi.add_apply, add_assoc, K, C, f, p, q, r] using! he |
| 318 | have hdp : mvfderiv (𝓡 n) p x (Y x) = |
| 319 | D.covariantTensorDerivative K x ![Y x, Y x, u, u] + |
| 320 | K x ![D.connection Y x (Y x), u, u] := by |
| 321 | have he := hDiff hK hY (hCons hY (hTwo hXO hXO)) hxO |
| 322 | simp only [hPoint, hPointTwo, Fin.sum_univ_succ, Fin.sum_univ_zero, |
| 323 | Fin.cons_zero, Fin.cons_succ, Fin.update_cons_zero, ← Fin.cons_update] at he |
| 324 | simpa only [Matrix.cons_val_zero, Matrix.cons_val_succ, Matrix.cons_val_one, |
| 325 | show (Fin.succ 0 : Fin 2) = 1 from rfl, hu0, hu1, Matrix.Fin.cons_vecCons, |
| 326 | hDX, zero_apply, hXu, hzK1, hzK2, add_zero, zero_add, p] using! he |
| 327 | have hdq : mvfderiv (𝓡 n) q x (Y x) = 0 := by |
| 328 | have he := hDiff hS hY (hTwo hC hXO) hxO |
| 329 | simpa only [hPointTwo, Fin.sum_univ_succ, Fin.sum_univ_zero, Fin.cons_zero, |
| 330 | Fin.cons_succ, Matrix.cons_val_zero, Matrix.cons_val_succ, |
| 331 | show (Fin.succ 0 : Fin 2) = 1 from rfl, hu0, hu1, Matrix.Fin.cons_vecCons, |
| 332 | hCx, hXu, hDX, zero_apply, hzK1, hkerR, hzS0, add_zero, zero_add, q, K] using! he |
| 333 | have hdr : mvfderiv (𝓡 n) r x (Y x) = 0 := by |
| 334 | have he := hDiff hS hY (hTwo hXO hC) hxO |
| 335 | simpa only [hPointTwo, Fin.sum_univ_succ, Fin.sum_univ_zero, Fin.cons_zero, |
| 336 | Fin.cons_succ, Matrix.cons_val_zero, Matrix.cons_val_succ, |
| 337 | show (Fin.succ 0 : Fin 2) = 1 from rfl, hu0, hu1, Matrix.Fin.cons_vecCons, |
| 338 | hCx, hXu, hDX, zero_apply, hzK2, hkerL, hzS1, add_zero, zero_add, r, K] using! he |
| 339 | have hpD := (hp.contMDiffAt (hO.mem_nhds hxO)).mdifferentiableAt (by simp) |
| 340 | have hqD := (hq.contMDiffAt (hO.mem_nhds hxO)).mdifferentiableAt (by simp) |
| 341 | have hrD := (hr.contMDiffAt (hO.mem_nhds hxO)).mdifferentiableAt (by simp) |
| 342 | have hdd : mvfderiv (𝓡 n) (fun y ↦ mvfderiv (𝓡 n) f y (Y y)) x (Y x) = |
| 343 | D.covariantTensorDerivative K x ![Y x, Y x, u, u] + |
| 344 | K x ![D.connection Y x (Y x), u, u] := by |
| 345 | have he : mvfderiv (𝓡 n) (fun y ↦ mvfderiv (𝓡 n) f y (Y y)) x = |
| 346 | mvfderiv (𝓡 n) (p + q + r) x := hfirst.mfderiv_eq |
| 347 | rw [he, mvfderiv_add (hpD.add hqD) hrD, mvfderiv_add hpD hqD] |
| 348 | simp only [add_apply, hdp, hdq, hdr, add_zero] |
| 349 | have hh : D.hessian f x a a = D.iteratedCovariantTensorDerivative S 2 x ![a, a, u, u] := by |
| 350 | change mvfderiv (𝓡 n) (fun y ↦ mvfderiv (𝓡 n) f y (Y y)) x (Y x) - |
| 351 | mvfderiv (𝓡 n) f x (D.connection Y x (Y x)) = _ |
| 352 | rw [hdd, hdfx, add_sub_cancel_right] |
| 353 | simp only [Y, FiberBundle.extend_apply_self, |
| 354 | LeviCivitaData.iteratedCovariantTensorDerivative, K] |
| 355 | rw [← hh] |
| 356 | exact D.hessian_nonneg_of_isLocalMinAt (hf.contMDiffAt (hO.mem_nhds hxO)) hmin a |
| 357 | exact Finset.sum_nonneg fun i _ ↦ hsecond (g.orthonormalBasis x i) |
| 358 | |
| 359 | end PoincareMT.RicciFlowAnalysis |
| 360 |