import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Hessian.HessianTensorial import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Coordinates.PreferredMetric /-! # The actual Hessian in one fixed chart Morgan-Tian Lemma 7.15 through Claim 7.18, pp. 157-160. The field extension remains based at the same chart center while the evaluation point varies. Tensoriality identifies the resulting expression with the frozen pointwise Hessian. -/ set_option autoImplicit false open Set Filter Bundle open scoped Manifold ContDiff Topology universe u namespace PoincareMT.ReducedVolume variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] set_option backward.isDefEq.respectTransparency false in /-- The fixed coordinate extension is smooth at every point of that chart's source. -/ theorem preferredField_contMDiffAt_of_mem (qโ‚€ : M) (v : TangentSpace (๐“ก n) qโ‚€) {q : M} (hq : q โˆˆ (chartAt (EuclideanSpace โ„ (Fin n)) qโ‚€).source) : ContMDiffAt (๐“ก n) (๐“ก n).tangent โˆž (fun x โ†ฆ (โŸจx, FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v xโŸฉ : TangentBundle (๐“ก n) M)) q := by let tr := trivializationAt (EuclideanSpace โ„ (Fin n)) (TangentSpace (๐“ก n)) qโ‚€ let v' : EuclideanSpace โ„ (Fin n) := v rw [tr.contMDiffAt_section_iff hq] have hc : ContMDiffAt (๐“ก n) (๐“ก n) โˆž (fun _ : M โ†ฆ v') q := contMDiffAt_const apply hc.congr_of_eventuallyEq filter_upwards [tr.open_baseSet.mem_nhds hq] with x hx rw [โ† tr.continuousLinearMapAt_apply_of_mem โ„ hx] exact preferredField_coordinates qโ‚€ v hx set_option backward.isDefEq.respectTransparency false in /-- Differentiating twice on a fixed coordinate field gives the actual coordinate Hessian. -/ theorem fixedChart_second_scalar_derivative {f : M โ†’ โ„} (qโ‚€ : M) {q : M} (hq : q โˆˆ (chartAt (EuclideanSpace โ„ (Fin n)) qโ‚€).source) (hf : ContMDiffAt (๐“ก n) (๐“˜(โ„, โ„)) 2 f q) (v : TangentSpace (๐“ก n) qโ‚€) : mvfderiv (๐“ก n) (fun x โ†ฆ mvfderiv (๐“ก n) f x (FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v x)) q (FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v q) = fderiv โ„ (fderiv โ„ (f โˆ˜ (extChartAt (๐“ก n) qโ‚€).symm)) (extChartAt (๐“ก n) qโ‚€ q) v v := by let e := extChartAt (๐“ก n) qโ‚€ let l := f โˆ˜ e.symm let v' : EuclideanSpace โ„ (Fin n) := v have hqe : q โˆˆ e.source := by simpa only [e, extChartAt_source] using hq have hi : ContMDiffAt (๐“ก n) (๐“ก n) 2 e.symm (e q) := (contMDiffOn_extChartAt_symm qโ‚€).contMDiffAt ((isOpen_extChartAt_target (I := ๐“ก n) qโ‚€).mem_nhds (e.map_source hqe)) have hfl : ContDiffAt โ„ 2 l (e q) := by have hf' : ContMDiffAt (๐“ก n) (๐“˜(โ„, โ„)) 2 f (e.symm (e q)) := by simpa only [e.left_inv hqe] using hf exact (hf'.comp (e q) hi).contDiffAt have hDl := (hfl.fderiv_right (m := 1) (by norm_num)).differentiableAt one_ne_zero let K := fun y โ†ฆ fderiv โ„ l y v' have hK : DifferentiableAt โ„ K (e q) := hDl.clm_apply (differentiableAt_const v') have heq : (fun x โ†ฆ mvfderiv (๐“ก n) f x (FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v x)) =แถ [๐“ q] K โˆ˜ e := by filter_upwards [(contMDiffAt_iff_contMDiffAt_nhds (by norm_num)).mp hf, (chartAt (EuclideanSpace โ„ (Fin n)) qโ‚€).open_source.mem_nhds hq] with x hx hchart exact (preferredField_scalar_derivative qโ‚€ v hchart (hx.mdifferentiableAt two_ne_zero)).symm rw [mvfderiv_eq_of_eventuallyEq heq] have hchain := mfderiv_comp_apply q hK.mdifferentiableAt (mdifferentiableAt_extChartAt (I := ๐“ก n) hq) (FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v q) have hcoords : mfderiv (๐“ก n) (๐“ก n) e q (FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v q) = (v : EuclideanSpace โ„ (Fin n)) := by change (mfderiv (๐“ก n) (๐“ก n) (extChartAt (๐“ก n) qโ‚€) q) (FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v q) = _ simpa only [TangentBundle.continuousLinearMapAt_trivializationAt hq] using! preferredField_coordinates qโ‚€ v hq rw [hcoords, mfderiv_eq_fderiv] at hchain change mvfderiv (๐“ก n) (K โˆ˜ e) q (FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v q) = fderiv โ„ K (e q) v at hchain rw [hchain] have hEval := hDl.hasFDerivAt.clm_apply (hasFDerivAt_const v' (e q)) have hEq := congrArg (fun D : EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„ โ†ฆ D v') hEval.fderiv simpa only [ContinuousLinearMap.comp_zero, zero_add, ContinuousLinearMap.flip_apply, K, l] using hEq /-- The connection term relates the frozen Hessian to the fixed-chart second derivative. -/ theorem fixedChart_hessian_formula (g : RiemannianMetric n M) (D : LeviCivitaData g) {f : M โ†’ โ„} (qโ‚€ : M) {q : M} (hq : q โˆˆ (chartAt (EuclideanSpace โ„ (Fin n)) qโ‚€).source) (hf : ContMDiffAt (๐“ก n) (๐“˜(โ„, โ„)) 2 f q) (v : TangentSpace (๐“ก n) qโ‚€) : let X := FiberBundle.extend (EuclideanSpace โ„ (Fin n)) v fderiv โ„ (fderiv โ„ (f โˆ˜ (extChartAt (๐“ก n) qโ‚€).symm)) (extChartAt (๐“ก n) qโ‚€ q) v v = D.hessian f q (X q) (X q) + mvfderiv (๐“ก n) f q (D.connection X q (X q)) := by dsimp only rw [hessian_eq_of_extension g D hf _ ((preferredField_contMDiffAt_of_mem qโ‚€ v hq).mdifferentiableAt (by simp)), fixedChart_second_scalar_derivative qโ‚€ hq hf v] ring end PoincareMT.ReducedVolume