import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Index.FixedChartIndexDensity import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Adapted.AdaptedFieldCoordinates /-! # Smooth index densities along actual smooth fields At each time, one fixed chart supplies a smooth representative on an open neighborhood. The selected chart need not vary continuously. -/ set_option autoImplicit false set_option maxSynthPendingDepth 3 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) set_option maxHeartbeats 1000000 in -- Model-space equalities are applied only after retaining the actual chart base equality. set_option backward.isDefEq.respectTransparency false in theorem pointwiseSecondVariationDensity_contDiffOn {J : Set ℝ} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T βŠ† J) (Ξ± : ℝ β†’ M) (A Y W : βˆ€ s, TangentSpace (𝓑 n) (Ξ± s)) (U : Set ℝ) (hU : IsOpen U) (htime : U βŠ† Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (hΞ± : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) ∞ Ξ± U) (hA : ContMDiffOn (π“˜(ℝ, ℝ)) ((𝓑 n).prod (𝓑 n)) ∞ (fun s ↦ (⟨α s, A s⟩ : TangentBundle (𝓑 n) M)) U) (hY : ContMDiffOn (π“˜(ℝ, ℝ)) ((𝓑 n).prod (𝓑 n)) ∞ (fun s ↦ (⟨α s, Y s⟩ : TangentBundle (𝓑 n) M)) U) (hW : ContMDiffOn (π“˜(ℝ, ℝ)) ((𝓑 n).prod (𝓑 n)) ∞ (fun s ↦ (⟨α s, W s⟩ : TangentBundle (𝓑 n) M)) U) : ContDiffOn ℝ ∞ (fun s ↦ pointwiseSecondVariationDensity F T (Ξ± s) s (A s) (Y s) (W s)) U := by intro t ht let p := Ξ± t let e := chartAt E p let V := U ∩ Ξ± ⁻¹' e.source have hV : IsOpen V := hΞ±.continuousOn.isOpen_inter_preimage hU e.open_source have htV : t ∈ V := ⟨ht, mem_chart_source E p⟩ let y : ℝ β†’ E := fun s ↦ e (Ξ± s) let a : ℝ β†’ E := fun s ↦ mfderiv (𝓑 n) (𝓑 n) e (Ξ± s) (A s) let v : ℝ β†’ E := fun s ↦ mfderiv (𝓑 n) (𝓑 n) e (Ξ± s) (Y s) let w : ℝ β†’ E := fun s ↦ mfderiv (𝓑 n) (𝓑 n) e (Ξ± s) (W s) have hy : ContDiffOn ℝ ∞ y V := (contMDiffOn_chart.comp (hΞ±.mono Set.inter_subset_left) (fun _ hs ↦ hs.2)).contDiffOn have ha := field_chart_coordinates_smooth p Ξ± A V (hA.mono Set.inter_subset_left) (fun _ hs ↦ hs.2) have hv := field_chart_coordinates_smooth p Ξ± Y V (hY.mono Set.inter_subset_left) (fun _ hs ↦ hs.2) have hw := field_chart_coordinates_smooth p Ξ± W V (hW.mono Set.inter_subset_left) (fun _ hs ↦ hs.2) let f : ℝ β†’ ℝ := fun s ↦ coordinateIndexDensity (squareChartMetric F T p) (squareChartScalar F T p) (s, y s) (a s) (v s) (w s) have hf : ContDiffOn ℝ ∞ f V := coordinateIndexDensity_contDiffOn (squareChartMetric F T p) (squareChartScalar F T p) (Set.Ioo (-Real.sqrt b) (Real.sqrt b) Γ—Λ’ e.target) (isOpen_Ioo.prod e.open_target) (squareChartMetric_smooth F T b hb hwindow p) (squareChartScalar_smooth F hM04 T b hb hwindow p) (fun z hz ΞΎ hΞΎ ↦ squareChartMetric_pos F T p z hz.2 ΞΎ hΞΎ) V (fun s ↦ (s, y s)) a v w (contDiffOn_id.prodMk hy) ha hv hw (fun s hs ↦ ⟨htime hs.1, e.map_source hs.2⟩) apply ((hf.contDiffAt (hV.mem_nhds htV)).congr_of_eventuallyEq ?_).contDiffWithinAt filter_upwards [hV.mem_nhds htV] with s hs have h := squareChartIndexDensity_on_target F hM04 T b hb hwindow p s (htime hs.1) (y s) (e.map_source hs.2) (a s) (v s) (w s) change f s = pointwiseSecondVariationDensity F T (e.symm (e (Ξ± s))) s (chartVectorField p (a s) (e.symm (e (Ξ± s)))) (chartVectorField p (v s) (e.symm (e (Ξ± s)))) (chartVectorField p (w s) (e.symm (e (Ξ± s)))) at h rw [e.left_inv hs.2, chartVectorField_differential p (Ξ± s) (A s) hs.2, chartVectorField_differential p (Ξ± s) (Y s) hs.2, chartVectorField_differential p (Ξ± s) (W s) hs.2] at h exact h.symm end PoincareMT.ReducedLength