import PoincareLib.Geometry.RicciFlow.Harnack.Matrix.Positivity.SpatialContact import PoincareLib.Geometry.Riemannian.Tensor.MaximumPrinciple.Transport.Jets /-! # Geometric spatial contact for tensor matrices Radial parallel fields identify the scalar derivatives of tensor-matrix coefficients with their covariant derivatives. Tensor entries may have different ranks, as in Hamilton's curvature, mixed, and two-tensor block. The first derivatives of the test direction remain freely prescribed. This is the spatial contact calculation supporting Chow et al., Part II, Theorem 15.16 and Section 15.4.5. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false open scoped Manifold ContDiff Bundle Topology BigOperators open Matrix Filter universe u namespace Poincare.RicciFlow.Harnack open PoincareMT variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] {g : RiemannianMetric n M} /-- With zero first covariant jets, a tensor coefficient has its actual covariant derivative as its scalar directional derivative. -/ lemma covariantTensorDerivative_eq_mvfderiv_of_zero_jets (D : LeviCivitaData g) {k : โ„•} {T : CovariantTensorEvaluation n M k} (hT : IsSmoothCovariantTensor T) (E : Fin k โ†’ (y : M) โ†’ TangentSpace (๐“ก n) y) (x : M) (hE : โˆ€ i, ContMDiffAt (๐“ก n) ((๐“ก n).prod (๐“ก n)) โˆž (T% (E i)) x) (hfirst : โˆ€ i a, D.connection (E i) x a = 0) (a : TangentSpace (๐“ก n) x) : D.covariantTensorDerivative T x (Fin.cons a (fun i => E i x)) = mvfderiv (๐“ก n) (fun y => T y (fun i => E i y)) x a := by obtain โŸจB, hBโŸฉ := hT.1 x rw [D.covariantTensorDerivative_on_fields hT E x (fun i => (hE i).mdifferentiableAt (by simp)) a] simp only [hfirst, hB, B.map_update_zero, Finset.sum_const_zero, sub_zero] /-- A positive semidefinite matrix of geometric tensor coefficients has the spatial null-contact inequality with arbitrary prescribed gradients of the test direction. Each matrix entry can have its own tensor rank, but all entries use the same local input family, encoded by `s`. The radial fields and their vanishing covariant jets are constructed in the proof. -/ theorem tensor_matrix_diffusion_nonneg_at_null [T2Space M] {I J : Type} [Fintype I] (D : LeviCivitaData g) (k : I โ†’ I โ†’ โ„•) (T : (i j : I) โ†’ CovariantTensorEvaluation n M (k i j)) (hT : โˆ€ i j, IsSmoothCovariantTensor (T i j)) (s : (i j : I) โ†’ Fin (k i j) โ†’ J) (x : M) (v : J โ†’ TangentSpace (๐“ก n) x) (hpos : โˆ€แถ  y in ๐“ x, โˆ€ e : J โ†’ TangentSpace (๐“ก n) y, Matrix.PosSemidef (fun i j => T i j y (fun l => e (s i j l)))) (z : I โ†’ โ„) (hnull : z โฌแตฅ ((fun i j => T i j x (fun l => v (s i j l))) *แตฅ z) = 0) (V : I โ†’ TangentSpace (๐“ก n) x) : 0 โ‰ค (โˆ‘ i, โˆ‘ j, z i * D.tensorLaplacian (T i j) x (fun l => v (s i j l)) * z j) + 4 * (โˆ‘ i, โˆ‘ j, z i * D.covariantTensorDerivative (T i j) x (Fin.cons (V j) (fun l => v (s i j l)))) + 2 * (โˆ‘ i, โˆ‘ j, T i j x (fun l => v (s i j l)) * g.inner x (V i) (V j)) := by classical choose r Y hr hrU hY hinit hparallel hfirst hsecond using fun j => D.exists_radialParallelField x (v j) let E := fun j => LeviCivitaData.fieldFromCenteredCoordinates x (Y j) let A : M โ†’ Matrix I I โ„ := fun y i j => T i j y (fun l => E (s i j l) y) have hE (j : J) (y : M) (hy : y โˆˆ (extChartAt (๐“ก n) x).source) : ContMDiffAt (๐“ก n) ((๐“ก n).prod (๐“ก n)) โˆž (T% (E j)) y := LeviCivitaData.contMDiffAt_fieldFromCenteredCoordinates x (hY j).contDiffAt hy have hA (i j : I) : ContMDiffOn (๐“ก n) ๐“˜(โ„, โ„) โˆž (fun y => A y i j) (extChartAt (๐“ก n) x).source := (hT i j).2 _ (isOpen_extChartAt_source x) _ (fun l y hy => (hE (s i j l) y hy).contMDiffWithinAt) have hpositive : โˆ€แถ  y in ๐“ x, (A y).PosSemidef := by filter_upwards [hpos] with y hy exact hy (fun j => E j y) have hvalue (i j : I) : A x i j = T i j x (fun l => v (s i j l)) := by simp only [A, E, hinit] have hnullA : z โฌแตฅ (A x *แตฅ z) = 0 := by simpa only [dotProduct, mulVec, hvalue] using hnull have hlap (i j : I) : D.laplacian (fun y => A y i j) x = D.tensorLaplacian (T i j) x (fun l => v (s i j l)) := by have h := D.tensorLaplacian_eq_laplacian_of_zero_jets (hT i j) (fun l => E (s i j l)) x (fun l => hE (s i j l) x (mem_extChartAt_source x)) (fun l => hfirst (s i j l)) (fun l => hsecond (s i j l)) simpa only [E, hinit] using h.symm have hder (i j : I) (a : TangentSpace (๐“ก n) x) : mvfderiv (๐“ก n) (fun y => A y i j) x a = D.covariantTensorDerivative (T i j) x (Fin.cons a (fun l => v (s i j l))) := by have h := covariantTensorDerivative_eq_mvfderiv_of_zero_jets D (hT i j) (fun l => E (s i j l)) x (fun l => hE (s i j l) x (mem_extChartAt_source x)) (fun l => hfirst (s i j l)) a simpa only [E, hinit] using h.symm have h := quadratic_diffusion_nonneg_of_prescribed_gradients D (isOpen_extChartAt_source x) hA (mem_extChartAt_source x) hpositive z hnullA V have hright (i j : I) : g.inner x (V i) (D.gradient (fun y => A y i j) x) = D.covariantTensorDerivative (T i j) x (Fin.cons (V i) (fun l => v (s i j l))) := by rw [g.symm, D.inner_gradient, hder] simp only [hlap, D.inner_gradient, hder, hright, hvalue, Finset.sum_add_distrib] at h have hsym (i j : I) (a : TangentSpace (๐“ก n) x) : D.covariantTensorDerivative (T i j) x (Fin.cons a (fun l => v (s i j l))) = D.covariantTensorDerivative (T j i) x (Fin.cons a (fun l => v (s j i l))) := by rw [โ† hder, โ† hder] have heq : (fun y => A y i j) =แถ [๐“ x] (fun y => A y j i) := by filter_upwards [hpositive] with y hy simpa only [star_trivial] using hy.1.apply j i rw [Poincare.mvfderiv_eq_of_eventuallyEq heq] have hswap : (โˆ‘ i, โˆ‘ j, z j * D.covariantTensorDerivative (T i j) x (Fin.cons (V i) (fun l => v (s i j l)))) = โˆ‘ i, โˆ‘ j, z i * D.covariantTensorDerivative (T i j) x (Fin.cons (V j) (fun l => v (s i j l))) := by rw [Finset.sum_comm] simp_rw [hsym] rw [hswap] at h linarith only [h] end Poincare.RicciFlow.Harnack