import PoincareLib.Geometry.RicciFlow.Curvature.Calculus import PoincareLib.Geometry.RicciFlow.Connection.Regularity import PoincareLib.Geometry.Manifold.ContDiff.TimeDerivative import PoincareLib.Geometry.RicciFlow.Curvature.Theory import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace import Mathlib.Geometry.Manifold.Algebra.Structures /-! Joint spacetime regularity of Ricci evaluated on smooth local fields. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open scoped Manifold ContDiff Bundle Topology open Bundle Filter Set universe u namespace PoincareMT.RicciFlow variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] {J : Set โ„} /-- The Ricci tensor evaluated on locally smooth spatial fields is smooth on spacetime. The time derivative is supplied by the Ricci-flow equation. Since the equation is stated with a within derivative, the interior-time hypothesis is used to obtain an ordinary derivative before applying the mixed-derivative regularity bridge. -/ theorem contMDiffAt_ricci_fields (F : RicciFlow n M J) {t : โ„} (ht : t โˆˆ interior J) {x : M} {X Y : (y : M) โ†’ TangentSpace (๐“ก n) y} (hX : ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% X) x) (hY : ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% Y) x) : ContMDiffAt (๐“˜(โ„, โ„).prod (๐“ก n)) ๐“˜(โ„, โ„) โˆž (fun p : โ„ ร— M => (F.connection p.1).ricci p.2 (X p.2) (Y p.2)) (t, x) := by have hmetric := F.contMDiffAt_inner_fields ht hX hY have hderiv := Poincare.Manifold.contMDiffAt_deriv_time hmetric have heq : (fun p : โ„ ร— M => deriv (fun s => (F.metric s).inner p.2 (X p.2) (Y p.2)) p.1) =แถ [๐“ (t, x)] (fun p : โ„ ร— M => -2 * (F.connection p.1).ricci p.2 (X p.2) (Y p.2)) := by have htime : โˆ€แถ  s in ๐“ t, s โˆˆ interior J := isOpen_interior.mem_nhds ht have hprod : โˆ€แถ  p : โ„ ร— M in ๐“ (t, x), p.1 โˆˆ interior J := by filter_upwards [(continuousAt_fst : ContinuousAt Prod.fst (t, x)).eventually htime] with p hp exact hp filter_upwards [hprod] with p hp exact (F.equation p.1 (interior_subset hp) p.2 (X p.2) (Y p.2)).hasDerivAt (mem_interior_iff_mem_nhds.mp hp) |>.deriv have heq' : (fun p : โ„ ร— M => deriv (fun s => (F.metric (s, p.2).1).inner (s, p.2).2 (X (s, p.2).2) (Y (s, p.2).2)) p.1) =แถ [๐“ (t, x)] (fun p : โ„ ร— M => -2 * (F.connection p.1).ricci p.2 (X p.2) (Y p.2)) := by simpa only [Prod.fst, Prod.snd] using heq have hderiv' := hderiv.congr_of_eventuallyEq heq'.symm have hscale := hderiv'.div_const (-2 : โ„) convert hscale using 1 <;> ext p <;> ring /- The curvature-theory Ricci evolution can be differentiated in a spatial direction after the preceding spacetime regularity bridge. -/ theorem hasDerivAt_mvfderiv_ricci_fields (hC : RicciFlowCurvatureCalculus.{u}) (F : RicciFlow n M J) {t : โ„} (ht : t โˆˆ interior J) {x : M} {X Y : (y : M) โ†’ TangentSpace (๐“ก n) y} (hX : ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% X) x) (hY : ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% Y) x) (v : TangentSpace (๐“ก n) x) : HasDerivAt (fun s => mvfderiv (๐“ก n) (fun y => (F.connection s).ricci y (X y) (Y y)) x v) (mvfderiv (๐“ก n) (fun y => (F.connection t).tensorLaplacian (F.connection t).ricciEvaluation y ![X y, Y y] + (F.connection t).ricciReaction y (X y) (Y y)) x v) t := by apply Poincare.Manifold.hasDerivAt_mvfderiv_time (contMDiffAt_ricci_fields F ht hX hY) ยท intro y exact (hC.ricci_evolution n M J F t (interior_subset ht) y (X y) (Y y)).hasDerivAt (mem_interior_iff_mem_nhds.mp ht) end PoincareMT.RicciFlow