import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Measure.Chart.ChartDensitySmooth import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Jacobian.GramNormalization import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Exponential.Jacobian.JacobianEvolution import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedVolume.Metric.Trace.MetricTrace /-! # Directional derivative of the genuine chart Gram density One frozen source equivalence makes the central Gram matrix the identity. The already established normalized determinant derivative then gives half the metric trace, including dimension zero. -/ set_option autoImplicit false open Set Filter open scoped Manifold ContDiff Bundle Topology BigOperators universe u namespace PoincareMT.ReducedVolume variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] set_option backward.isDefEq.respectTransparency false in set_option synthInstance.maxHeartbeats 80000 in -- The matrix and nested continuous-linear-map norm instances require a larger search budget. /-- Differentiating the actual Gram density gives half the metric derivative trace. -/ theorem pullbackJacobian_fderiv_eq (g : RiemannianMetric n M) {f : EuclideanSpace โ„ (Fin n) โ†’ M} {y : EuclideanSpace โ„ (Fin n)} (hB : ContDiffAt โ„ 1 (pullbackMetricForm g f) y) (hD : Function.Injective (mfderiv (๐“ก n) (๐“ก n) f y)) (C : EuclideanSpace โ„ (Fin n) โ‰ƒL[โ„] EuclideanSpace โ„ (Fin n)) (hC : โˆ€ v, mfderiv (๐“ก n) (๐“ก n) f y (C v) = metricCoordinates g (f y) v) (w : EuclideanSpace โ„ (Fin n)) : fderiv โ„ (pullbackJacobian g f) y w = pullbackJacobian g f y * ((โˆ‘ i : Fin n, fderiv โ„ (pullbackMetricForm g f) y w (C (EuclideanSpace.basisFun (Fin n) โ„ i)) (C (EuclideanSpace.basisFun (Fin n) โ„ i))) / 2) := by let ฮฒ := fun i : Fin n โ†ฆ C (EuclideanSpace.basisFun (Fin n) โ„ i) let A := fun s : โ„ โ†ฆ (fun i j : Fin n โ†ฆ pullbackMetricForm g f (y + s โ€ข w) (ฮฒ i) (ฮฒ j)) let Q : Matrix (Fin n) (Fin n) โ„ := fun i j โ†ฆ fderiv โ„ (pullbackMetricForm g f) y w (ฮฒ i) (ฮฒ j) let J := fun s : โ„ โ†ฆ pullbackJacobian g f (y + s โ€ข w) have hline : HasDerivAt (fun s : โ„ โ†ฆ y + s โ€ข w) w 0 := by simpa using ((hasDerivAt_id (0 : โ„)).smul_const w).const_add y have hBD := (hB.differentiableAt one_ne_zero).hasFDerivAt.comp_hasDerivAt_of_eq 0 hline (by simp) have hA : HasDerivAt A Q 0 := by apply hasDerivAt_pi.mpr intro i apply hasDerivAt_pi.mpr intro j simpa only [Function.comp_def, map_zero, add_zero, zero_add] using (hBD.clm_apply (hasDerivAt_const 0 (ฮฒ i))).clm_apply (hasDerivAt_const 0 (ฮฒ j)) have hAt : A 0 = (1 : Matrix (Fin n) (Fin n) โ„) := by ext i j dsimp only [A] rw [zero_smul, add_zero] change g.inner (f y) (mfderiv (๐“ก n) (๐“ก n) f y (C (EuclideanSpace.basisFun (Fin n) โ„ i))) (mfderiv (๐“ก n) (๐“ก n) f y (C (EuclideanSpace.basisFun (Fin n) โ„ j))) = _ rw [hC, hC, metricCoordinates_basis_inner, Matrix.one_apply] have hscale : (fun s โ†ฆ C.toLinearMap.normDet * J s) =แถ [๐“ 0] (fun s โ†ฆ Real.sqrt (Matrix.det (A s))) := by apply Eventually.of_forall intro s convert (sqrt_det_pullbackMetric_change_source g f (y + s โ€ข w) C.toLinearMap).symm using 1 ยท exact mul_comm _ _ ยท rfl have hJ := hasDerivAt_jacobian_of_scaled_normalized_gram (source_normalization_normDet_pos C).ne' hscale hA hAt have hactual := ((pullbackJacobian_contDiffAt_of_form g hB hD).differentiableAt one_ne_zero).hasFDerivAt.comp_hasDerivAt_of_eq 0 hline (by simp) have heq := hactual.unique hJ simpa only [J, zero_smul, add_zero, Matrix.trace, Matrix.diag, Q, ฮฒ] using heq end PoincareMT.ReducedVolume