import PoincareLib.Geometry.CurveShortening.Comparison.Compatibility.SourceNames import PoincareLib.Geometry.CurveShortening.Ramp.LocalFlow.Chart.HessianCoefficients import PoincareLib.Geometry.RicciFlow.Generalized.ReducedGeometry.SourceNames.ReducedLength /-! # Actual metric and Hessian along a smooth spatial map Spatial chart localization permits an arbitrary normed source dimension. Both actual evaluations retain joint smoothness through the closed flow interval. MT2007 Claim 19.1, p. 437; `2026-09-21-pullback-metric-hessian.md`. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open Set Filter open scoped Manifold ContDiff Topology universe u v namespace PoincareMT.M63 open Proofs.M09 variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] {V : Type v} [NormedAddCommGroup V] [NormedSpace โ„ V] local notation "E" => EuclideanSpace โ„ (Fin n) /-- The actual metric and covariant Hessian evaluated on the differential of an arbitrary smooth spatial map are jointly smooth through both time endpoints. MT2007 Claim 19.1, p. 437; pullback metric/Hessian derivation. -/ theorem flow_pullback_metric_hessian_contDiffOn {a b : โ„} (F : RicciFlow n M (Icc a b)) {U : Set V} (hU : IsOpen U) {ฯ : V โ†’ M} (hฯ : ContMDiffOn ๐“˜(โ„, V) (๐“ก n) โˆž ฯ U) {f : M โ†’ โ„} (hf : ContMDiff (๐“ก n) ๐“˜(โ„, โ„) โˆž f) : ContDiffOn โ„ โˆž (fun z : (โ„ ร— V) ร— V => (F.metric z.1.1).inner (ฯ z.1.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ z.1.2 z.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ z.1.2 z.2)) ((Icc a b ร—หข U) ร—หข univ) โˆง ContDiffOn โ„ โˆž (fun z : (โ„ ร— V) ร— V => (F.connection z.1.1).hessian f (ฯ z.1.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ z.1.2 z.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ z.1.2 z.2)) ((Icc a b ร—หข U) ร—หข univ) := by let S : Set ((โ„ ร— V) ร— V) := (Icc a b ร—หข U) ร—หข univ suffices hlocal : โˆ€ z โˆˆ S, ContDiffWithinAt โ„ โˆž (fun w : (โ„ ร— V) ร— V => (F.metric w.1.1).inner (ฯ w.1.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2)) S z โˆง ContDiffWithinAt โ„ โˆž (fun w : (โ„ ร— V) ร— V => (F.connection w.1.1).hessian f (ฯ w.1.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2)) S z from โŸจfun z hz => (hlocal z hz).1, fun z hz => (hlocal z hz).2โŸฉ intro z hz let p := ฯ z.1.2 let c := chartAt E p let O := U โˆฉ ฯ โปยน' c.source have hO : IsOpen O := hฯ.continuousOn.isOpen_inter_preimage hU c.open_source have hzO : z.1.2 โˆˆ O := โŸจhz.1.2, mem_chart_source E pโŸฉ let ฯˆ : V โ†’ E := c โˆ˜ ฯ have hฯˆ : ContDiffOn โ„ โˆž ฯˆ O := ((contMDiffOn_chart (I := ๐“ก n) (x := p)).comp (hฯ.mono inter_subset_left) (fun _ hx => hx.2)).contDiffOn have hDฯˆ := hฯˆ.fderiv_of_isOpen hO (m := โˆž) (by simp) have hderiv (x : V) (hx : x โˆˆ O) : fderiv โ„ ฯˆ x = (mfderiv (๐“ก n) (๐“ก n) c (ฯ x)).comp (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ x) := by rw [โ† mfderiv_eq_fderiv] exact mfderiv_comp x ((mdifferentiable_chart (I := ๐“ก n) p).mdifferentiableAt hx.2) ((hฯ.contMDiffAt (hU.mem_nhds hx.1)).mdifferentiableAt (by simp)) have hvec (x : V) (hx : x โˆˆ O) (v : V) : chartVectorField p (fderiv โ„ ฯˆ x v) (ฯ x) = mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ x v := by rw [hderiv x hx] exact chartVectorField_differential p (ฯ x) _ hx.2 let T : Set ((โ„ ร— V) ร— V) := (Icc a b ร—หข O) ร—หข univ let C : Set ((โ„ ร— E) ร— E) := (Icc a b ร—หข c.target) ร—หข univ let P : (โ„ ร— V) ร— V โ†’ (โ„ ร— E) ร— E := fun w => ((w.1.1, ฯˆ w.1.2), fderiv โ„ ฯˆ w.1.2 w.2) have hx : ContDiffOn โ„ โˆž (fun w : (โ„ ร— V) ร— V => w.1.2) T := contDiff_fst.snd.contDiffOn have hP : ContDiffOn โ„ โˆž P T := (contDiffOn_fst.fst.prodMk (hฯˆ.comp hx (fun _ hw => hw.1.2))).prodMk ((hDฯˆ.comp hx (fun _ hw => hw.1.2)).clm_apply contDiffOn_snd) have hPC : MapsTo P T C := fun w hw => โŸจโŸจhw.1.1, c.map_source hw.1.2.2โŸฉ, mem_univ _โŸฉ have hmetric : ContDiffOn โ„ โˆž (fun w : (โ„ ร— E) ร— E => (F.metric w.1.1).pullbackCoefficients c.symm w.1.2 w.2 w.2) C := (((chart_metric_coefficients_contDiffOn F p).comp contDiffOn_fst (fun _ hw => hw.1)).clm_apply contDiffOn_snd).clm_apply contDiffOn_snd have hm := hmetric.comp hP hPC have hh := (flow_hessian_chart_contDiffOn F hf p).comp hP hPC have hm' : ContDiffOn โ„ โˆž (fun w : (โ„ ร— V) ร— V => (F.metric w.1.1).inner (ฯ w.1.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2)) T := by apply hm.congr intro w hw change (F.metric w.1.1).inner (ฯ w.1.2) _ _ = (F.metric w.1.1).inner (c.symm (ฯˆ w.1.2)) (mfderiv (๐“ก n) (๐“ก n) c.symm (ฯˆ w.1.2) (fderiv โ„ ฯˆ w.1.2 w.2)) (mfderiv (๐“ก n) (๐“ก n) c.symm (ฯˆ w.1.2) (fderiv โ„ ฯˆ w.1.2 w.2)) erw [โ† chartVectorField_at_inverse p _ _ (c.map_source hw.1.2.2)] erw [show c.symm (ฯˆ w.1.2) = ฯ w.1.2 from c.left_inv hw.1.2.2, hvec w.1.2 hw.1.2 w.2] have hh' : ContDiffOn โ„ โˆž (fun w : (โ„ ร— V) ร— V => (F.connection w.1.1).hessian f (ฯ w.1.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2) (mfderiv ๐“˜(โ„, V) (๐“ก n) ฯ w.1.2 w.2)) T := by apply hh.congr intro w hw change (F.connection w.1.1).hessian f (ฯ w.1.2) _ _ = (F.connection w.1.1).hessian f (c.symm (ฯˆ w.1.2)) (chartVectorField p (fderiv โ„ ฯˆ w.1.2 w.2) (c.symm (ฯˆ w.1.2))) (chartVectorField p (fderiv โ„ ฯˆ w.1.2 w.2) (c.symm (ฯˆ w.1.2))) rw [show c.symm (ฯˆ w.1.2) = ฯ w.1.2 from c.left_inv hw.1.2.2, hvec w.1.2 hw.1.2 w.2] have hTS : T โˆˆ ๐“[S] z := by have hpre : {w : (โ„ ร— V) ร— V | w.1.2 โˆˆ O} โˆˆ ๐“ z := (continuous_fst.snd.continuousAt).preimage_mem_nhds (hO.mem_nhds hzO) filter_upwards [self_mem_nhdsWithin (s := S) (a := z), mem_nhdsWithin_of_mem_nhds hpre] with w hw hwo exact โŸจโŸจhw.1.1, hwoโŸฉ, mem_univ _โŸฉ exact โŸจ(hm' z โŸจโŸจhz.1.1, hzOโŸฉ, mem_univ _โŸฉ).mono_of_mem_nhdsWithin hTS, (hh' z โŸจโŸจhz.1.1, hzOโŸฉ, mem_univ _โŸฉ).mono_of_mem_nhdsWithin hTSโŸฉ end PoincareMT.M63