import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Tensor.LocalHessianTrace import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.CoordinateCompatibility import Mathlib.Analysis.Calculus.FDeriv.Symmetric /-! # Symmetry of the actual Hessian under local smoothness The scalar second derivative and the connection correction are both identified in the same centered chart before their symmetries are used. -/ set_option autoImplicit false set_option maxSynthPendingDepth 3 open scoped Manifold ContDiff Bundle Topology open Filter universe u namespace PoincareMT.ReducedLength variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] local notation "E" => EuclideanSpace โ„ (Fin n) set_option backward.isDefEq.respectTransparency false in theorem squareTime_hessian_symmetric_local {J : Set โ„} (F : RicciFlow n M J) (T b : โ„) (hb : 0 < b) (hwindow : Set.Icc (T - b) T โІ J) (p : M) (s : โ„) (hs : s โˆˆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (f : M โ†’ โ„) (O : Set M) (hO : IsOpen O) (hpO : p โˆˆ O) (hf : ContMDiffOn (๐“ก n) (๐“˜(โ„, โ„)) โˆž f O) (v w : TangentSpace (๐“ก n) p) : (F.connection (T - s ^ 2)).hessian f p v w = (F.connection (T - s ^ 2)).hessian f p w v := by let e := chartAt E p let ฯ† : E โ†’ โ„ := fun y โ†ฆ f (e.symm y) let V := e.target โˆฉ e.symm โปยน' O have he : ContMDiffOn (๐“ก n) (๐“ก n) โˆž e.symm e.target := contMDiffOn_chart_symm have hV : IsOpen V := he.continuousOn.isOpen_inter_preimage e.open_target hO have hy : e p โˆˆ V := โŸจe.map_source (mem_chart_source E p), by change e.symm (e p) โˆˆ O rwa [e.left_inv (mem_chart_source E p)]โŸฉ have hฯ† : ContDiffAt โ„ โˆž ฯ† (e p) := ((hf.comp (he.mono Set.inter_subset_left) (fun y hy โ†ฆ hy.2)).contDiffOn).contDiffAt (hV.mem_nhds hy) have hD := ((hฯ†.fderiv_right (m := โˆž) (by simp)).differentiableAt (by simp)) have hd (u z : E) : fderiv โ„ (fun y โ†ฆ fderiv โ„ ฯ† y z) (e p) u = fderiv โ„ (fderiv โ„ ฯ†) (e p) u z := by have h := hD.hasFDerivAt.clm_apply (hasFDerivAt_const z (e p)) simpa using congrArg (fun L : E โ†’L[โ„] โ„ โ†ฆ L u) h.fderiv have hG : DifferentiableAt โ„ (squareChartMetric F T p) (s, e p) := ((squareChartMetric_smooth F T b hb hwindow p).contDiffAt ((isOpen_Ioo.prod e.open_target).mem_nhds โŸจhs, e.map_source (mem_chart_source E p)โŸฉ)).differentiableAt (by simp) have hconn := coordinateConnection_symm (squareChartMetric F T p) (s, e p) hG (Filter.Eventually.of_forall fun z โ†ฆ squareChartMetric_symm F T p z) v w rw [hessian_centeredCoordinates_local (F.connection (T - s ^ 2)) f p O hO hpO hf v w, hessian_centeredCoordinates_local (F.connection (T - s ^ 2)) f p O hO hpO hf w v] change fderiv โ„ (fun y โ†ฆ fderiv โ„ ฯ† y w) (e p) v - _ = fderiv โ„ (fun y โ†ฆ fderiv โ„ ฯ† y v) (e p) w - _ rw [hd v w, hd w v, โ† squareChartConnection_at_center F T b hb hwindow p s hs v w, โ† squareChartConnection_at_center F T b hb hwindow p s hs w v, hconn] congr 1 have htwo : (2 : โ„•โˆžฯ‰) โ‰ค โˆž := ENat.natCast_le_of_coe_top_le_withTop le_rfl 2 exact hฯ†.isSymmSndFDerivAt (by simpa using htwo) v w end PoincareMT.ReducedLength