import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.SquareChartMetric import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Fields.ChartVectorField import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Coordinates.CoordinatePhase import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Prod import Mathlib.Analysis.Calculus.FDeriv.CompCLM /-! # Coordinate derivatives identify the geometric regularized force Spatial derivatives of the pulled-back metric give the selected connection through Koszul. Its time derivative is the actual `4s Ric` term, including at square-root time zero. -/ set_option autoImplicit false set_option maxSynthPendingDepth 3 -- The metric evaluations contain nested bundle and operator instances. set_option maxHeartbeats 800000 open scoped Manifold ContDiff Bundle Topology open Filter universe u namespace PoincareMT.ReducedLength variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] local notation "E" => EuclideanSpace โ„ (Fin n) theorem chartMetricPairing_smooth (g : RiemannianMetric n M) (p : M) (u v : E) : ContMDiffOn (๐“ก n) (๐“˜(โ„, โ„)) โˆž (fun x โ†ฆ g.inner x (chartVectorField p u x) (chartVectorField p v x)) (chartAt E p).source := by have heval := g.contMDiff.contMDiffOn.clm_bundle_applyโ‚‚ (chartVectorField_smooth p u) (chartVectorField_smooth p v) intro x hx exact (Bundle.contMDiffWithinAt_totalSpace.mp (heval x hx)).2 theorem squareChartMetric_space_pairing {J : Set โ„} (F : RicciFlow n M J) (T b : โ„) (hb : 0 < b) (hwindow : Set.Icc (T - b) T โІ J) (p : M) (s : โ„) (hs : s โˆˆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (y u v w : E) (hy : y โˆˆ (chartAt E p).target) : fderiv โ„ (squareChartMetric F T p) (s, y) (0, w) u v = mvfderiv (๐“ก n) (fun x โ†ฆ (F.metric (T - s ^ 2)).inner x (chartVectorField p u x) (chartVectorField p v x)) ((chartAt E p).symm y) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y w) := by let f : M โ†’ โ„ := fun x โ†ฆ (F.metric (T - s ^ 2)).inner x (chartVectorField p u x) (chartVectorField p v x) have hf : MDifferentiableAt (๐“ก n) (๐“˜(โ„, โ„)) f ((chartAt E p).symm y) := ((chartMetricPairing_smooth (F.metric (T - s ^ 2)) p u v).contMDiffAt ((chartAt E p).open_source.mem_nhds ((chartAt E p).map_target hy))).mdifferentiableAt (by simp) have hchain := mvfderiv_chartVectorField p f y w hy hf rw [chartVectorField_at_inverse p w y hy] at hchain have heq : (fun z : E โ†ฆ f ((chartAt E p).symm z)) =แถ [๐“ y] (fun z โ†ฆ squareChartMetric F T p (s, z) u v) := by filter_upwards [(chartAt E p).open_target.mem_nhds hy] with z hz dsimp [f] rw [chartVectorField_at_inverse p u z hz, chartVectorField_at_inverse p v z hz] rfl rw [heq.fderiv_eq] at hchain have hG : DifferentiableAt โ„ (squareChartMetric F T p) (s, y) := ((squareChartMetric_smooth F T b hb hwindow p).contDiffAt ((isOpen_Ioo.prod (chartAt E p).open_target).mem_nhds โŸจhs, hyโŸฉ)).differentiableAt (by simp) have hslice := hG.hasFDerivAt.comp y ((hasFDerivAt_const s y).prodMk (hasFDerivAt_id y)) have heval := (hslice.clm_apply (hasFDerivAt_const u y)).clm_apply (hasFDerivAt_const v y) have hcoord : fderiv โ„ (fun z โ†ฆ squareChartMetric F T p (s, z) u v) y w = fderiv โ„ (squareChartMetric F T p) (s, y) (0, w) u v := by simpa [Function.comp_def] using congrArg (fun L : E โ†’L[โ„] โ„ โ†ฆ L w) heval.fderiv exact hcoord.symm.trans hchain.symm theorem squareChartMetric_time_pairing {J : Set โ„} (F : RicciFlow n M J) (T b : โ„) (hb : 0 < b) (hwindow : Set.Icc (T - b) T โІ J) (p : M) (s : โ„) (hs : s โˆˆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (y u v : E) (hy : y โˆˆ (chartAt E p).target) : fderiv โ„ (squareChartMetric F T p) (s, y) (1, 0) u v = 4 * s * (F.connection (T - s ^ 2)).ricci ((chartAt E p).symm y) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y u) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y v) := by have hG : DifferentiableAt โ„ (squareChartMetric F T p) (s, y) := ((squareChartMetric_smooth F T b hb hwindow p).contDiffAt ((isOpen_Ioo.prod (chartAt E p).open_target).mem_nhds โŸจhs, hyโŸฉ)).differentiableAt (by simp) have hslice := hG.hasFDerivAt.comp_hasDerivAt s ((hasDerivAt_id s).prodMk (hasDerivAt_const s y)) have heval := (hslice.clm_apply (hasDerivAt_const s u)).clm_apply (hasDerivAt_const s v) have hmetric := squareChartMetric_hasDerivAt F T b hb hwindow p s hs y u v simpa using heval.unique hmetric set_option backward.isDefEq.respectTransparency false in theorem squareChartScalar_space_pairing {J : Set โ„} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T b : โ„) (hb : 0 < b) (hwindow : Set.Icc (T - b) T โІ J) (p : M) (s : โ„) (hs : s โˆˆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (y w : E) (hy : y โˆˆ (chartAt E p).target) : fderiv โ„ (squareChartScalar F T p) (s, y) (0, w) = mvfderiv (๐“ก n) (fun x โ†ฆ (F.connection (T - s ^ 2)).scalarCurvature x) ((chartAt E p).symm y) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y w) := by have hf : ContMDiff (๐“ก n) (๐“˜(โ„, โ„)) โˆž (fun x : M โ†ฆ (F.connection (T - s ^ 2)).scalarCurvature x) := by have hbase : ContMDiff (๐“ก n) ((๐“˜(โ„, โ„)).prod (๐“ก n)) โˆž (fun x : M โ†ฆ (s, x)) := contMDiff_const.prodMk contMDiff_id have hbaseOn : ContMDiffOn (๐“ก n) ((๐“˜(โ„, โ„)).prod (๐“ก n)) โˆž (fun x : M โ†ฆ (s, x)) Set.univ := hbase.contMDiffOn have h := (squareTime_scalar_smooth F hM04 T b hb hwindow).comp hbaseOn (fun x _ โ†ฆ โŸจhs, Set.mem_univ xโŸฉ) exact contMDiffOn_univ.mp h have hchain := mvfderiv_chartVectorField p (fun x โ†ฆ (F.connection (T - s ^ 2)).scalarCurvature x) y w hy ((hf _).mdifferentiableAt (by simp)) rw [chartVectorField_at_inverse p w y hy] at hchain have hR : DifferentiableAt โ„ (squareChartScalar F T p) (s, y) := ((squareChartScalar_smooth F hM04 T b hb hwindow p).contDiffAt ((isOpen_Ioo.prod (chartAt E p).open_target).mem_nhds โŸจhs, hyโŸฉ)).differentiableAt (by simp) have hslice := hR.hasFDerivAt.comp y ((hasFDerivAt_const s y).prodMk (hasFDerivAt_id y)) have hcoord : fderiv โ„ (fun z โ†ฆ squareChartScalar F T p (s, z)) y w = fderiv โ„ (squareChartScalar F T p) (s, y) (0, w) := by simpa [Function.comp_def] using congrArg (fun L : E โ†’L[โ„] โ„ โ†ฆ L w) hslice.fderiv exact hcoord.symm.trans hchain.symm set_option backward.isDefEq.respectTransparency false in theorem regularizedCoordinatePhase_geometric_pairing {J : Set โ„} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T b : โ„) (hb : 0 < b) (hwindow : Set.Icc (T - b) T โІ J) (p : M) (s : โ„) (hs : s โˆˆ Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (y v w : E) (hy : y โˆˆ (chartAt E p).target) : (F.metric (T - s ^ 2)).inner ((chartAt E p).symm y) ((mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y) (regularizedCoordinatePhase (squareChartMetric F T p) (squareChartScalar F T p) (s, (y, v))).2 + (F.connection (T - s ^ 2)).connection (chartVectorField p v) ((chartAt E p).symm y) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y v)) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y w) - 2 * s ^ 2 * mvfderiv (๐“ก n) (fun x โ†ฆ (F.connection (T - s ^ 2)).scalarCurvature x) ((chartAt E p).symm y) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y w) + 4 * s * (F.connection (T - s ^ 2)).ricci ((chartAt E p).symm y) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y v) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y w) = 0 := by have hphase := regularizedCoordinatePhase_pairing (squareChartMetric F T p) (squareChartScalar F T p) (s, y) (fun a ha โ†ฆ squareChartMetric_pos F T p (s, y) hy a ha) v w rw [squareChartMetric_time_pairing F T b hb hwindow p s hs y v w hy, squareChartScalar_space_pairing F hM04 T b hb hwindow p s hs y w hy] at hphase have hkoszul := chartVectorField_diagonal_koszul (F.connection (T - s ^ 2)) p v w ((chartAt E p).symm y) ((chartAt E p).map_target hy) rw [chartVectorField_at_inverse p v y hy, chartVectorField_at_inverse p w y hy] at hkoszul rw [โ† squareChartMetric_space_pairing F T b hb hwindow p s hs y v w v hy, โ† squareChartMetric_space_pairing F T b hb hwindow p s hs y v v w hy] at hkoszul change (F.metric (T - s ^ 2)).inner ((chartAt E p).symm y) ((mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y) (regularizedCoordinatePhase (squareChartMetric F T p) (squareChartScalar F T p) (s, (y, v))).2) (mfderiv (๐“ก n) (๐“ก n) (chartAt E p).symm y w) = _ at hphase rw [map_add, ContinuousLinearMap.add_apply] linarith end PoincareMT.ReducedLength