import PoincareLib.Geometry.RicciFlow.Tensor.TimeDerivative /-! # Time differentiation at arbitrary covariant order The time derivative of a covariant derivative has one connection-variation term in every tensor slot. In particular, this applies to Hamilton's three-tensor before taking its divergence in the two-tensor evolution. -/ 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 variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] {J : Set ℝ} private lemma contDiffAt_clm_of_apply {E G : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup G] [NormedSpace ℝ G] [FiniteDimensional ℝ E] {f : ℝ β†’ E β†’L[ℝ] G} {t : ℝ} (hf : βˆ€ v, ContDiffAt ℝ ∞ (fun s => f s v) t) : ContDiffAt ℝ ∞ f t := by let d := Module.finrank ℝ E have hd : d = Module.finrank ℝ (Fin d β†’ ℝ) := (Module.finrank_fin_fun ℝ).symm let e₁ : E ≃L[ℝ] (Fin d β†’ ℝ) := ContinuousLinearEquiv.ofFinrankEq hd let eβ‚‚ := (e₁.arrowCongr (1 : G ≃L[ℝ] G)).trans (ContinuousLinearEquiv.piRing (Fin d)) rw [← Function.id_comp f, ← eβ‚‚.symm_comp_self] exact eβ‚‚.symm.contDiff.contDiffAt.comp t (contDiffAt_pi.mpr fun i => hf _) /-- Differentiate an arbitrary tensor evaluation with one moving input. -/ lemma hasDerivAt_covariantTensorEvaluation_update (F : RicciFlow n M J) {k : β„•} {T W : ℝ β†’ CovariantTensorEvaluation n M k} {t : ℝ} {x : M} (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) (v : Fin k β†’ TangentSpace (𝓑 n) x) (i : Fin k) {V : ℝ β†’ TangentSpace (𝓑 n) x} {V' : TangentSpace (𝓑 n) x} (hV : HasDerivAt V V' t) : letI : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨(F.metric t).toRiemannianMetric⟩ HasDerivAt (fun s => T s x (Function.update v i (V s))) (W t x (Function.update v i (V t)) + T t x (Function.update v i V')) t := by classical let : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨(F.metric t).toRiemannianMetric⟩ let : FiniteDimensional ℝ (TangentSpace (𝓑 n) x) := VectorBundle.finiteDimensional ℝ (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n) : M β†’ Type _) x choose B hB using fun s => (hT s).1 x let L : ℝ β†’ TangentSpace (𝓑 n) x β†’L[ℝ] ℝ := fun s => ((B s).toLinearMap v i).toContinuousLinearMap have hL (s : ℝ) (q : TangentSpace (𝓑 n) x) : L s q = T s x (Function.update v i q) := (hB s _).symm have hLs : ContDiffAt ℝ ∞ L t := by apply contDiffAt_clm_of_apply intro q let X := fun j => FiberBundle.extend (EuclideanSpace ℝ (Fin n)) (Function.update v i q j) have hX (j : Fin k) := FiberBundle.contMDiffAt_extend (𝓑 n) (EuclideanSpace ℝ (Fin n)) (k := ∞) (Function.update v i q j) have h := ((hreg x X hX).comp t (contMDiffAt_id.prodMk contMDiffAt_const)).contDiffAt simpa only [Function.comp_def, id_eq, X, FiberBundle.extend_apply_self, hL] using h have hLd := (hLs.differentiableAt (by simp)).hasDerivAt have hfixed := hLd.clm_apply (hasDerivAt_const t (V t)) have hcoef : (deriv L t) (V t) = W t x (Function.update v i (V t)) := by simpa only [map_zero, add_zero] using hfixed.unique ((hW x (Function.update v i (V t))).congr_of_eventuallyEq (Eventually.of_forall fun s => hL s (V t))) simpa only [hL, hcoef, add_comm] using hLd.clm_apply hV /-- Time differentiation of the canonical covariant derivative, at every tensor order, including the variation of each covariant input. -/ lemma hasDerivAt_covariantTensorDerivative_time_all (F : RicciFlow n M J) {k : β„•} {T W : ℝ β†’ CovariantTensorEvaluation n M k} {t : ℝ} (ht : t ∈ interior J) (x : M) (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) (u : TangentSpace (𝓑 n) x) (v : Fin k β†’ TangentSpace (𝓑 n) x) : letI : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨(F.metric t).toRiemannianMetric⟩ let A := fun z : TangentSpace (𝓑 n) x => deriv (fun s => (F.connection s).connection (FiberBundle.extend (EuclideanSpace ℝ (Fin n)) z) x) t HasDerivAt (fun s => (F.connection s).covariantTensorDerivative (T s) x (Fin.cons u v)) ((F.connection t).covariantTensorDerivative (W t) x (Fin.cons u v) - βˆ‘ i, T t x (Function.update v i (A (v i) u))) t := by let : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨(F.metric t).toRiemannianMetric⟩ let X := fun i => FiberBundle.extend (EuclideanSpace ℝ (Fin n)) (v i) have hX (i : Fin k) := FiberBundle.contMDiffAt_extend (𝓑 n) (EuclideanSpace ℝ (Fin n)) (k := ∞) (v i) have hconn (i : Fin k) := ((F.contDiffAt_connection ht (hX i)).differentiableAt (by simp)).hasDerivAt have hconnU (i : Fin k) := (hconn i).clm_apply (hasDerivAt_const t u) simp only [map_zero, add_zero] at hconnU have hraw := Poincare.Manifold.hasDerivAt_mvfderiv_time (hreg x X hX) (fun y => hW y (fun i => X i y)) u have hslot (i : Fin k) := F.hasDerivAt_covariantTensorEvaluation_update hT hreg hW v i (hconnU i) have hsum := HasDerivAt.sum (u := Finset.univ) fun i _ => hslot i have h := hraw.sub hsum convert h using 1 <;> try rfl Β· funext s simp only [LeviCivitaData.covariantTensorDerivative, Fin.cons_zero, Fin.cons_succ, Pi.sub_apply, Finset.sum_apply, X] Β· simp only [LeviCivitaData.covariantTensorDerivative, Fin.cons_zero, Fin.cons_succ, Finset.sum_add_distrib, sub_sub, X] end PoincareMT.RicciFlow