import PoincareLib.Geometry.Manifold.ContDiff.TimeDerivative import PoincareLib.Geometry.Riemannian.Tensor.Regularity set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open scoped Manifold ContDiff Bundle Topology BigOperators open Filter Set universe u namespace PoincareMT.RicciFlow open PoincareMT variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] lemma isSmoothCovariantTensor_timeDerivative_all {k : โ„•} {T W : โ„ โ†’ CovariantTensorEvaluation n M k} {t : โ„} (hT : โˆ€ s, IsSmoothCovariantTensor (T s)) (hreg : โˆ€ (y : M) (X : Fin k โ†’ (z : M) โ†’ TangentSpace (๐“ก n) z), (โˆ€ i, ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% (X i)) y) โ†’ ContMDiffAt (๐“˜(โ„, โ„).prod (๐“ก n)) ๐“˜(โ„, โ„) โˆž (fun p : โ„ ร— M => T p.1 p.2 (fun i => X i p.2)) (t, y)) (hW : โˆ€ (y : M) (z : Fin k โ†’ TangentSpace (๐“ก n) y), HasDerivAt (fun s => T s y z) (W t y z) t) : IsSmoothCovariantTensor (W t) := by constructor ยท intro x let A : MultilinearMap โ„ (fun _ : Fin k โ†ฆ TangentSpace (๐“ก n) x) โ„ := { toFun := W t x map_update_add' {hDecEq} := by intro v i p q have hEq : (fun s : โ„ => T s x (Function.update v i (p + q))) = (fun s : โ„ => T s x (Function.update v i p)) + (fun s : โ„ => T s x (Function.update v i q)) := by funext s obtain โŸจB, hBโŸฉ := (hT s).1 x change T s x (Function.update v i (p + q)) = T s x (Function.update v i p) + T s x (Function.update v i q) rw [hB, hB, hB, B.map_update_add] have hl := hW x (Function.update v i (p + q)) have hr := (hW x (Function.update v i p)).add (hW x (Function.update v i q)) have hr' := hr.congr_of_eventuallyEq (Eventually.of_forall (fun s => congrFun hEq s)) exact hl.unique hr' map_update_smul' {hDecEq} := by intro v i c p have hEq : (fun s : โ„ => T s x (Function.update v i (c โ€ข p))) = c โ€ข (fun s : โ„ => T s x (Function.update v i p)) := by funext s obtain โŸจB, hBโŸฉ := (hT s).1 x change T s x (Function.update v i (c โ€ข p)) = c * T s x (Function.update v i p) rw [hB, hB, B.map_update_smul] simp [smul_eq_mul] have hl := hW x (Function.update v i (c โ€ข p)) have hr := (hW x (Function.update v i p)).const_smul c have hr' := hr.congr_of_eventuallyEq (Eventually.of_forall (fun s => congrFun hEq s)) exact hl.unique hr' } exact โŸจA, fun v => rflโŸฉ ยท intro U hU X hX x hx have hXx (i : Fin k) : ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% (X i)) x := (hX i).contMDiffAt (hU.mem_nhds hx) have hsp := hreg x X hXx have hdfun : (fun y : M => deriv (fun s => T s y (fun i => X i y)) t) = (fun y => W t y (fun i => X i y)) := by funext y exact (hW y (fun i => X i y)).deriv have hcont := Poincare.Manifold.contMDiffAt_deriv_time hsp change ContMDiffAt (๐“˜(โ„, โ„).prod (๐“ก n)) ๐“˜(โ„, โ„) โˆž (fun p : โ„ ร— M => deriv (fun s => T s p.2 (fun i => X i p.2)) p.1) (t, x) at hcont have hcontx := hcont.comp x (contMDiffAt_const.prodMk contMDiffAt_id) change ContMDiffAt (๐“ก n) ๐“˜(โ„, โ„) โˆž (fun y => deriv (fun s => T s y (fun i => X i y)) t) x at hcontx rw [hdfun] at hcontx exact hcontx.contMDiffWithinAt lemma isSmoothCovariantTensor_timeDerivative {T W : โ„ โ†’ CovariantTensorEvaluation n M 2} {t : โ„} (hT : โˆ€ s, IsSmoothCovariantTensor (T s)) (hreg : โˆ€ (y : M) (X Y : (z : M) โ†’ TangentSpace (๐“ก n) z), ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% X) y โ†’ ContMDiffAt (๐“ก n) ((๐“ก n).prod ๐“˜(โ„, EuclideanSpace โ„ (Fin n))) โˆž (T% Y) y โ†’ ContMDiffAt (๐“˜(โ„, โ„).prod (๐“ก n)) ๐“˜(โ„, โ„) โˆž (fun p : โ„ ร— M => T p.1 p.2 ![X p.2, Y p.2]) (t, y)) (hW : โˆ€ (y : M) (z : Fin 2 โ†’ TangentSpace (๐“ก n) y), HasDerivAt (fun s => T s y z) (W t y z) t) : IsSmoothCovariantTensor (W t) := by apply isSmoothCovariantTensor_timeDerivative_all hT _ hW intro y X hX have h := hreg y (X 0) (X 1) (hX 0) (hX 1) convert h using 1 ext p congr 1 ext i; fin_cases i <;> rfl end PoincareMT.RicciFlow