import PoincareLib.Geometry.RicciFlow.Soliton.TwoDimensional.Compact.Gradient import PoincareLib.Geometry.Riemannian.ScalarOperators.Hessian.Pullback /-! # Pulling back a twice differentiable soliton potential The Hessian naturality proof needs only a continuously differentiable gradient, so it applies to the frozen `C2` soliton potential. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open scoped Manifold ContDiff Bundle Topology open Bundle Filter VectorField namespace PoincareMT.LeviCivitaData universe u v variable {n : โ„•} {M : Type u} {N : Type v} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] [TopologicalSpace N] [ChartedSpace (EuclideanSpace โ„ (Fin n)) N] [IsManifold (๐“ก n) โˆž N] {g : RiemannianMetric n M} {h : RiemannianMetric n N} {f : M โ†’ N} {x : M} {u : N โ†’ โ„} theorem hessian_comp_of_metric_pullback_of_C2 (D : LeviCivitaData g) (D' : LeviCivitaData h) (hf : ContMDiffAt (๐“ก n) (๐“ก n) โˆž f x) (hinv : โˆ€แถ  y in ๐“ x, (mfderiv (๐“ก n) (๐“ก n) f y).IsInvertible) (hmetric : โˆ€แถ  y in ๐“ x, โˆ€ a b : TangentSpace (๐“ก n) y, g.inner y a b = h.inner (f y) (mfderiv (๐“ก n) (๐“ก n) f y a) (mfderiv (๐“ก n) (๐“ก n) f y b)) (hu : ContMDiffAt (๐“ก n) ๐“˜(โ„, โ„) 2 u (f x)) (v w : TangentSpace (๐“ก n) x) : D.hessian (u โˆ˜ f) x v w = D'.hessian u (f x) (mfderiv (๐“ก n) (๐“ก n) f x v) (mfderiv (๐“ก n) (๐“ก n) f x w) := by have hf1 := (contMDiffAt_iff_contMDiffAt_nhds (by simp : (1 : โ„•โˆžฯ‰) โ‰  โˆž)).mp (hf.of_le (by norm_cast : (1 : โ„•โˆžฯ‰) โ‰ค โˆž)) have hu1 := (contMDiffAt_iff_contMDiffAt_nhds (by simp : (1 : โ„•โˆžฯ‰) โ‰  โˆž)).mp (hu.of_le (by norm_num : (1 : โ„•โˆžฯ‰) โ‰ค 2)) have hgrad : D.gradient (u โˆ˜ f) =แถ [๐“ x] mpullback (๐“ก n) (๐“ก n) f (D'.gradient u) := by filter_upwards [hf1, hf.continuousAt.eventually hu1, hinv, hmetric] with y hfy huy hiy hmy exact D.gradient_comp_eq_mpullback D' (hfy.mdifferentiableAt (by simp)) (huy.mdifferentiableAt (by simp)) hiy hmy have hcomp := hu.comp x (hf.of_le (by norm_cast : (2 : โ„•โˆžฯ‰) โ‰ค โˆž)) have hsource := (D.contMDiffAt_one_gradient_of_C2 hcomp).mdifferentiableAt (by norm_num) have hpull : MDifferentiableAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) (T% (mpullback (๐“ก n) (๐“ก n) f (D'.gradient u))) x := by apply hsource.congr_of_eventuallyEq filter_upwards [hgrad] with y hy simp only [โ† hy] have hc := D.connection.isCovariantDerivativeOnUniv.congr_of_eventuallyEq hsource hpull (by simp) hgrad rw [D.hessian_eq_inner_connection_gradient_of_C2 hcomp, D'.hessian_eq_inner_connection_gradient_of_C2 hu, congrArg (fun L โ†ฆ L v) hc, D.connection_mpullback_of_metric_pullback D' hf hinv hmetric ((D'.contMDiffAt_one_gradient_of_C2 hu).mdifferentiableAt (by norm_num)), hmetric.self_of_nhds] simp only [hinv.self_of_nhds.self_apply_inverse] end PoincareMT.LeviCivitaData