import PoincareLib.Geometry.RicciFlow.ReducedGeometry.ReducedLength.Variation.Adapted.LocalAdaptedEquation /-! # Smooth local adapted fields Locality supports gluing. Compact restriction constructs a genuine extension and recovers its actual equation, also at nondegenerate interval endpoints. -/ set_option autoImplicit false 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] structure IsAdaptedFieldOn {J : Set ℝ} (F : RicciFlow n M J) (T : ℝ) (Ξ³ : ℝ β†’ M) (P : βˆ€ t, TangentSpace (𝓑 n) (Ξ³ t)) (U : Set ℝ) : Prop where smooth : ContMDiffOn (π“˜(ℝ, ℝ)) ((𝓑 n).prod (𝓑 n)) ∞ (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓑 n) M)) U equation : βˆ€ s ∈ U, LocalAdaptedEquation F T Ξ³ P s theorem IsAdaptedFieldOn.mono {J : Set ℝ} {F : RicciFlow n M J} {T : ℝ} {Ξ³ : ℝ β†’ M} {P : βˆ€ t, TangentSpace (𝓑 n) (Ξ³ t)} {U V : Set ℝ} (h : IsAdaptedFieldOn F T Ξ³ P U) (hVU : V βŠ† U) : IsAdaptedFieldOn F T Ξ³ P V := ⟨h.smooth.mono hVU, fun s hs ↦ h.equation s (hVU hs)⟩ theorem IsAdaptedFieldOn.congr {J : Set ℝ} {F : RicciFlow n M J} {T : ℝ} {Ξ³ : ℝ β†’ M} {P Q : βˆ€ t, TangentSpace (𝓑 n) (Ξ³ t)} {U : Set ℝ} (h : IsAdaptedFieldOn F T Ξ³ P U) (hU : IsOpen U) (heq : βˆ€ t ∈ U, P t = Q t) : IsAdaptedFieldOn F T Ξ³ Q U := by refine ⟨h.smooth.congr (fun t ht ↦ ?_), ?_⟩ Β· rw [heq t ht] Β· intro s hs apply (h.equation s hs).congr filter_upwards [hU.mem_nhds hs] with t ht using heq t ht theorem IsAdaptedFieldOn.of_locally {J : Set ℝ} {F : RicciFlow n M J} {T : ℝ} {Ξ³ : ℝ β†’ M} {P : βˆ€ t, TangentSpace (𝓑 n) (Ξ³ t)} {U : Set ℝ} (h : βˆ€ s ∈ U, βˆƒ (Q : βˆ€ t, TangentSpace (𝓑 n) (Ξ³ t)) (V : Set ℝ), IsOpen V ∧ s ∈ V ∧ IsAdaptedFieldOn F T Ξ³ Q V ∧ βˆ€αΆ  t in 𝓝 s, P t = Q t) : IsAdaptedFieldOn F T Ξ³ P U := by have hp : βˆ€ s ∈ U, ContMDiffAt (π“˜(ℝ, ℝ)) ((𝓑 n).prod (𝓑 n)) ∞ (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓑 n) M)) s ∧ LocalAdaptedEquation F T Ξ³ P s := by intro s hs obtain ⟨Q, V, hV, hsV, hQ, heq⟩ := h s hs have he : (fun t ↦ (⟨γ t, P t⟩ : TangentBundle (𝓑 n) M)) =αΆ [𝓝 s] (fun t ↦ (⟨γ t, Q t⟩ : TangentBundle (𝓑 n) M)) := by filter_upwards [heq] with t ht rw [ht] exact ⟨(hQ.smooth.contMDiffAt (hV.mem_nhds hsV)).congr_of_eventuallyEq he, (hQ.equation s hsV).congr (heq.mono (fun _ ht ↦ ht.symm))⟩ exact ⟨fun s hs ↦ (hp s hs).1.contMDiffWithinAt, fun s hs ↦ (hp s hs).2⟩ theorem exists_uniform_local_isAdaptedFieldOn {J : Set ℝ} (F : RicciFlow n M J) (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T βŠ† J) (Ξ³ : ℝ β†’ M) (U : Set ℝ) (hU : IsOpen U) (htime : U βŠ† Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (hΞ³ : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) ∞ Ξ³ U) (s0 : ℝ) (hs0 : s0 ∈ U) : βˆƒ (W : Set ℝ) (d : ℝ), IsOpen W ∧ s0 ∈ W ∧ W βŠ† U ∧ 0 < d ∧ βˆ€ t0 ∈ W, βˆ€ v0 : TangentSpace (𝓑 n) (Ξ³ t0), βˆƒ P : βˆ€ t, TangentSpace (𝓑 n) (Ξ³ t), Set.Ioo (t0 - d) (t0 + d) βŠ† U ∧ P t0 = v0 ∧ IsAdaptedFieldOn F T Ξ³ P (Set.Ioo (t0 - d) (t0 + d)) := by obtain ⟨W, d, hW, hsW, hWU, hd, hsolve⟩ := exists_uniform_local_adapted_field F T b hb hwindow Ξ³ U hU htime hΞ³ s0 hs0 refine ⟨W, d, hW, hsW, hWU, hd, ?_⟩ intro t0 ht0 v0 obtain ⟨P, hIU, hP0, hP, H, heq⟩ := hsolve t0 ht0 v0 refine ⟨P, hIU, hP0, hP, ?_⟩ intro s hs exact localAdaptedEquation_of_pullback F T b hb hwindow Ξ³ P _ _ H isOpen_Ioo (hΞ³.mono hIU) hP s hs hs (isOpen_Ioo.uniqueDiffOn s hs) (htime (hIU hs)) (heq s hs) theorem IsAdaptedFieldOn.exists_extension_compact {J : Set ℝ} (F : RicciFlow n M J) (T b : ℝ) (hb : 0 < b) (hwindow : Set.Icc (T - b) T βŠ† J) (Ξ³ : ℝ β†’ M) (P : βˆ€ t, TangentSpace (𝓑 n) (Ξ³ t)) (U K : Set ℝ) (hU : IsOpen U) (hKU : K βŠ† U) (hK : IsCompact K) (hKd : UniqueDiffOn ℝ K) (htime : K βŠ† Set.Ioo (-Real.sqrt b) (Real.sqrt b)) (hΞ³ : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) ∞ Ξ³ U) (hP : IsAdaptedFieldOn F T Ξ³ P U) : βˆƒ H : ParametricAlongCurveExtensionOn (n := n) K Ξ³ P, βˆ€ s ∈ K, βˆ€ w : TangentSpace (𝓑 n) (Ξ³ s), (F.metric (T - s ^ 2)).inner (Ξ³ s) (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) Ξ³ P K H s) w = -(2 * s) * (F.connection (T - s ^ 2)).ricci (Ξ³ s) (P s) w := by obtain ⟨H⟩ := nonempty_parametricFieldExtensionOn_compact Ξ³ P U K hU hKU hK hΞ³ hP.smooth refine ⟨H, ?_⟩ intro s hs w exact pullback_adapted_of_localAdaptedEquation F T b hb hwindow Ξ³ P K U H hU hΞ³ hP.smooth s hs (hKU hs) (hKd s hs) (htime hs) (hP.equation s (hKU hs)) w end PoincareMT.ReducedLength