import PoincareLib.Geometry.RicciFlow.Compactness.Embedding.SpatialRegularity import PoincareLib.Geometry.Riemannian.Metric.Pullback /-! # Local regularity of the frozen coordinate coefficients Coordinate inverses and embedding slices are used only at interior points of their smooth domains. All derivatives are derivatives of the frozen functions. -/ set_option autoImplicit false open Set Filter open scoped Manifold ContDiff Bundle Topology namespace PoincareMT namespace RicciFlow variable {n : โ„•} {M : Type*} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] {J : Set โ„} /-- Joint smoothness of metric coefficients along a smooth spacetime map. -/ theorem contDiffAt_family_pullback_inner (F : RicciFlow n M J) {f : โ„ ร— EuclideanSpace โ„ (Fin n) โ†’ M} {p : โ„ ร— EuclideanSpace โ„ (Fin n)} (hJ : J โˆˆ ๐“ p.1) (hf : ContMDiffAt ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) (๐“ก n) โˆž f p) (v w : โ„ ร— EuclideanSpace โ„ (Fin n)) : ContDiffAt โ„ โˆž (fun z => (F.metric z.1).inner (f z) (mfderiv ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) (๐“ก n) f z v) (mfderiv ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) (๐“ก n) f z w)) p := by have hdom : J ร—หข (univ : Set M) โˆˆ ๐“ (p.1, f p) := prod_mem_nhds hJ (Filter.univ_mem) have hfst : ContMDiffAt ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) ๐“˜(โ„, โ„) โˆž (fun z : โ„ ร— EuclideanSpace โ„ (Fin n) => z.1) p := contDiffAt_fst.contMDiffAt have hg := (F.smooth.contMDiffAt hdom).comp p (hfst.prodMk hf) have h := hg.clm_bundle_applyโ‚‚ (Fโ‚ƒ := โ„) (Eโ‚ƒ := Bundle.Trivial M โ„) (RiemannianMetric.contMDiffAt_mfderiv_const_vector hf v) (RiemannianMetric.contMDiffAt_mfderiv_const_vector hf w) have hh := (Bundle.contMDiffAt_totalSpace.mp h).2 simp at hh convert! contMDiffAt_iff_contDiffAt.mp hh using 1 end RicciFlow namespace FlowCarrier /-- A fixed metric has smooth chart coefficients on the chart target. -/ theorem contDiffAt_coordinateCoefficient_metric {n : โ„•} (C : FlowCarrier n) (g : C.metric) (q : C.carrier) (a b : Fin n) (t : โ„) (y : EuclideanSpace โ„ (Fin n)) (hy : letI : TopologicalSpace C.carrier := C.topologicalSpace letI : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace y โˆˆ (extChartAt (๐“ก n) q).target) : ContDiffAt โ„ โˆž (fun z => C.coordinateCoefficient q (fun _ x v w => C.metricInner g x v w) a b (t, z)) y := by let : TopologicalSpace C.carrier := C.topologicalSpace let : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace let : IsManifold (๐“ก n) โˆž C.carrier := C.isManifold have hc := (contMDiffWithinAt_extChartAt_symm_target (n := โˆž) q hy).contMDiffAt (extChartAt_target_mem_nhds' hy) exact g.contDiffAt_pullback_inner hc (EuclideanSpace.basisFun (Fin n) โ„ a) (EuclideanSpace.basisFun (Fin n) โ„ b) /-- The frozen coordinate matrix of a metric is nonsingular on the chart target, since the chart derivative is invertible. -/ theorem coordinateCoefficient_metric_det_ne_zero {n : โ„•} (C : FlowCarrier n) (g : C.metric) (q : C.carrier) (p : โ„ ร— EuclideanSpace โ„ (Fin n)) (hp : letI : TopologicalSpace C.carrier := C.topologicalSpace letI : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace p.2 โˆˆ (extChartAt (๐“ก n) q).target) : (Matrix.of (fun a b : Fin n => C.coordinateCoefficient q (fun _ x v w => C.metricInner g x v w) a b p)).det โ‰  0 := by let : TopologicalSpace C.carrier := C.topologicalSpace let : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace let : IsManifold (๐“ก n) โˆž C.carrier := C.isManifold have hi : (mfderiv (๐“ก n) (๐“ก n) (extChartAt (๐“ก n) q).symm p.2).IsInvertible := by simpa only [ModelWithCorners.range_eq_univ, mfderivWithin_univ] using isInvertible_mfderivWithin_extChartAt_symm hp exact g.pullback_gram_det_ne_zero ((extChartAt (๐“ก n) q).symm p.2) (mfderiv (๐“ก n) (๐“ก n) (extChartAt (๐“ก n) q).symm p.2).toLinearMap hi.injective end FlowCarrier namespace BasedFlow /-- The frozen coefficients of a limit flow are jointly smooth in interior spacetime charts. -/ theorem contDiffAt_coordinateCoefficient_metric {n : โ„•} {T' T : โ„} {C : FlowCarrier n} (F : BasedFlow n T' T C) (q : C.carrier) (a b : Fin n) (p : โ„ ร— EuclideanSpace โ„ (Fin n)) (ht : p.1 โˆˆ Ioo T' T) (hp : letI : TopologicalSpace C.carrier := C.topologicalSpace letI : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace p.2 โˆˆ (extChartAt (๐“ก n) q).target) : ContDiffAt โ„ โˆž (C.coordinateCoefficient q (fun t x v w => C.metricInner (F.metricAt t) x v w) a b) p := by let : TopologicalSpace C.carrier := C.topologicalSpace let : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace let : IsManifold (๐“ก n) โˆž C.carrier := C.isManifold let c := extChartAt (๐“ก n) q let f : โ„ ร— EuclideanSpace โ„ (Fin n) โ†’ C.carrier := fun z => c.symm z.2 have hf {z : โ„ ร— EuclideanSpace โ„ (Fin n)} (hz : z.2 โˆˆ c.target) : ContMDiffAt ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) (๐“ก n) โˆž f z := by have hc := (contMDiffWithinAt_extChartAt_symm_target (n := โˆž) q hz).contMDiffAt (extChartAt_target_mem_nhds' hz) exact hc.comp z contDiffAt_snd.contMDiffAt apply (F.flow.contDiffAt_family_pullback_inner (isOpen_Ioo.mem_nhds ht) (hf hp) (0, EuclideanSpace.basisFun (Fin n) โ„ a) (0, EuclideanSpace.basisFun (Fin n) โ„ b)).congr_of_eventuallyEq filter_upwards [continuousAt_snd.preimage_mem_nhds (extChartAt_target_mem_nhds' hp)] with z hz have ha := RiemannianMetric.mfderiv_slice_apply ((hf hz).mdifferentiableAt (by simp)) (EuclideanSpace.basisFun (Fin n) โ„ a) have hb := RiemannianMetric.mfderiv_slice_apply ((hf hz).mdifferentiableAt (by simp)) (EuclideanSpace.basisFun (Fin n) โ„ b) rw [โ† ha, โ† hb] rfl end BasedFlow namespace SmoothSpacetimeEmbedding /-- The frozen pullback coefficient is jointly smooth at every interior chart point of an open spatial stage. -/ theorem contDiffAt_coordinateCoefficient_pullback {n : โ„•} {T' T : โ„} {C D : FlowCarrier n} {F : BasedFlow n T' T C} {G : BasedFlow n T' T D} {U : Set C.carrier} (e : SmoothSpacetimeEmbedding F G (Ioo T' T ร—หข U)) (hU : @IsOpen C.carrier C.topologicalSpace U) (q : C.carrier) (a b : Fin n) (p : โ„ ร— EuclideanSpace โ„ (Fin n)) (ht : p.1 โˆˆ Ioo T' T) (hp : letI : TopologicalSpace C.carrier := C.topologicalSpace letI : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace p.2 โˆˆ (extChartAt (๐“ก n) q).target โˆง (extChartAt (๐“ก n) q).symm p.2 โˆˆ U) : ContDiffAt โ„ โˆž (C.coordinateCoefficient q (pullbackInnerValue F G e) a b) p := by let : TopologicalSpace C.carrier := C.topologicalSpace let : ChartedSpace (EuclideanSpace โ„ (Fin n)) C.carrier := C.chartedSpace let : IsManifold (๐“ก n) โˆž C.carrier := C.isManifold let : TopologicalSpace D.carrier := D.topologicalSpace let : ChartedSpace (EuclideanSpace โ„ (Fin n)) D.carrier := D.chartedSpace let : IsManifold (๐“ก n) โˆž D.carrier := D.isManifold let c := extChartAt (๐“ก n) q let f : โ„ ร— EuclideanSpace โ„ (Fin n) โ†’ D.carrier := fun z => (e.toFun (z.1, c.symm z.2)).2 have hc {y : EuclideanSpace โ„ (Fin n)} (hy : y โˆˆ c.target) : ContMDiffAt (๐“ก n) (๐“ก n) โˆž c.symm y := (contMDiffWithinAt_extChartAt_symm_target (n := โˆž) q hy).contMDiffAt (extChartAt_target_mem_nhds' hy) have hf {z : โ„ ร— EuclideanSpace โ„ (Fin n)} (hz : z.1 โˆˆ Ioo T' T โˆง z.2 โˆˆ c.target โˆง c.symm z.2 โˆˆ U) : ContMDiffAt ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) (๐“ก n) โˆž f z := by have hfst : ContMDiffAt ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) ๐“˜(โ„, โ„) โˆž (fun z : โ„ ร— EuclideanSpace โ„ (Fin n) => z.1) z := contDiffAt_fst.contMDiffAt have hsnd : ContMDiffAt ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) (๐“ก n) โˆž (fun z : โ„ ร— EuclideanSpace โ„ (Fin n) => z.2) z := contDiffAt_snd.contMDiffAt exact ((e.smooth_on.contMDiffAt ((isOpen_Ioo.prod hU).mem_nhds โŸจhz.1, hz.2.2โŸฉ)).comp z (hfst.prodMk ((hc hz.2.1).comp z hsnd))).snd have hd {z : โ„ ร— EuclideanSpace โ„ (Fin n)} (hz : z.1 โˆˆ Ioo T' T โˆง z.2 โˆˆ c.target โˆง c.symm z.2 โˆˆ U) (v : EuclideanSpace โ„ (Fin n)) : mfderiv ๐“˜(โ„, โ„ ร— EuclideanSpace โ„ (Fin n)) (๐“ก n) f z (0, v) = mfderiv (๐“ก n) (๐“ก n) (fun x => (e.toFun (z.1, x)).2) (c.symm z.2) (mfderiv (๐“ก n) (๐“ก n) c.symm z.2 v) := by rw [โ† RiemannianMetric.mfderiv_slice_apply ((hf hz).mdifferentiableAt (by simp))] exact congrArg (fun A => A v) (mfderiv_comp z.2 ((e.spatialMap_contMDiffAt hU hz.1 hz.2.2).mdifferentiableAt (by simp)) ((hc hz.2.1).mdifferentiableAt (by simp))) have hnhds : โˆ€แถ  z : โ„ ร— EuclideanSpace โ„ (Fin n) in ๐“ p, z.1 โˆˆ Ioo T' T โˆง z.2 โˆˆ c.target โˆง c.symm z.2 โˆˆ U := by have hโ‚ := continuousAt_fst.preimage_mem_nhds (isOpen_Ioo.mem_nhds ht) have hโ‚‚ := continuousAt_snd.preimage_mem_nhds (extChartAt_target_mem_nhds' hp.1) have hโ‚ƒ := ((hc hp.1).continuousAt.comp continuousAt_snd).preimage_mem_nhds (hU.mem_nhds hp.2) exact Filter.inter_mem hโ‚ (Filter.inter_mem hโ‚‚ hโ‚ƒ) apply (G.flow.contDiffAt_family_pullback_inner (isOpen_Ioo.mem_nhds ht) (hf โŸจht, hpโŸฉ) (0, EuclideanSpace.basisFun (Fin n) โ„ a) (0, EuclideanSpace.basisFun (Fin n) โ„ b)).congr_of_eventuallyEq filter_upwards [hnhds] with z hz dsimp [FlowCarrier.coordinateCoefficient, pullbackInnerValue] rw [hd hz, hd hz] rfl end SmoothSpacetimeEmbedding end PoincareMT