import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.ChartConnection import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.SmoothEndpointExtension import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiPhase /-! Adapted from Mapher `PoincareMT/Proofs/M08/JacobiClosedCoordinates.lean` at `f927d9e1f0810042766d3b5f64d3f4da02ee93cc`. -/ set_option autoImplicit false set_option backward.isDefEq.respectTransparency false noncomputable section open Set Filter Topology open scoped Manifold ContDiff Bundle universe u namespace PoincareMT.LGeometry variable {n : β„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace ℝ (Fin n)) M] [IsManifold (𝓑 n) ∞ M] theorem exists_closedChartSectionExtension {a b : ℝ} (hab : a < b) (x : M) (Ξ± : ℝ β†’ M) (c : ℝ β†’ EuclideanSpace ℝ (Fin n)) (hc : ContDiffOn ℝ ∞ c (Icc a b)) (hsrc : MapsTo Ξ± (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (Y : βˆ€ s, TangentSpace (𝓑 n) (Ξ± s)) (hY : βˆ€ s ∈ Icc a b, chartFrame x (c s) (Ξ± s) = Y s) : Nonempty (ParametricAlongCurveExtensionOn (Icc a b) Ξ± Y) := by obtain ⟨g, hg, hgc⟩ := exists_smooth_extension_Icc hab c hc exact ⟨chartSectionExtension isOpen_univ (subset_univ _) x Ξ± g hg.contDiffOn hsrc Y (fun s hs ↦ by rw [hgc hs]; exact hY s hs)⟩ theorem closedChartField_contMDiffOn {C : Set ℝ} (x : M) (Ξ± : ℝ β†’ M) (c : ℝ β†’ EuclideanSpace ℝ (Fin n)) (hΞ± : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) ∞ Ξ± C) (hc : ContDiffOn ℝ ∞ c C) (hsrc : MapsTo Ξ± C (chartAt (EuclideanSpace ℝ (Fin n)) x).source) : ContMDiffOn (π“˜(ℝ, ℝ)) ((𝓑 n).prod (𝓑 n)) ∞ (fun s ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) (Ξ± s) (chartFrame x (c s) (Ξ± s))) C := by let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n)) x apply (e.contMDiffOn_symm.comp (hΞ±.prodMk hc.contMDiffOn) (fun s hs ↦ e.mem_target.mpr (hsrc hs))).congr intro s hs rw [show chartFrame x (c s) (Ξ± s) = e.symm (Ξ± s) (c s) from Bundle.Trivialization.symmL_apply e (hsrc hs) (c s)] exact e.mk_symm (hsrc hs) (c s) set_option maxHeartbeats 1000000 in theorem pullbackCovariantDerivative_closedChart_formula {J S : Set ℝ} (F : RicciFlow n M J) (T : ℝ) {a b : ℝ} (hab : a < b) (hCS : Icc a b βŠ† S) (htime : βˆ€ s ∈ S, T - s ^ 2 ∈ J) (x : M) (Ξ± : ℝ β†’ M) (c : ℝ β†’ EuclideanSpace ℝ (Fin n)) (hc : ContDiffOn ℝ ∞ c (Icc a b)) (hsrc : MapsTo Ξ± (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (Y : βˆ€ r, TangentSpace (𝓑 n) (Ξ± r)) (hY : βˆ€ r ∈ Icc a b, chartFrame x (c r) (Ξ± r) = Y r) (E : ParametricAlongCurveExtensionOn (Icc a b) Ξ± Y) {s : ℝ} (hs : s ∈ Icc a b) (dc : EuclideanSpace ℝ (Fin n)) (hdc : HasDerivWithinAt c dc (Icc a b) s) (hΞ± : MDifferentiableAt (π“˜(ℝ, ℝ)) (𝓑 n) Ξ± s) : pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) Ξ± Y (Icc a b) E s = chartFrame x (dc + closedChartChristoffel F T x S (s, extChartAt (𝓑 n) x (Ξ± s)) (deriv ((extChartAt (𝓑 n) x) ∘ Ξ±) s) (c s)) (Ξ± s) := by obtain ⟨g, hg, hgc⟩ := exists_smooth_extension_Icc hab c hc have hgd : deriv g s = dc := by have hd : HasDerivWithinAt g (deriv g s) (Icc a b) s := ((hg.differentiable (by simp)) s).hasDerivAt.hasDerivWithinAt exact UniqueDiffWithinAt.eq_deriv _ (uniqueDiffOn_Icc hab s hs) (hd.congr_of_mem (fun r hr ↦ (hgc hr).symm) hs) hdc have hfield : βˆ€ r ∈ Icc a b, chartFrame x (g r) (Ξ± r) = Y r := by intro r hr rw [hgc hr] exact hY r hr rw [pullbackCovariantDerivative_chart_formula F (fun r ↦ T - r ^ 2) isOpen_univ (subset_univ _) x Ξ± g hg.contDiffOn hsrc Y hfield E hs (uniqueDiffOn_Icc hab s hs) hΞ±, hgd, hgc hs, closedChartChristoffel_connection F T htime (hsrc hs) (hCS hs)] exact ((trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n)) x).symmL ℝ (Ξ± s)).map_add _ _ |>.symm local instance closedJacobiDualGroup : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup local instance closedJacobiDualSpace : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace local instance closedJacobiBilinGroup : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) β†’L[ℝ] EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup local instance closedJacobiBilinSpace : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) β†’L[ℝ] EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace set_option maxHeartbeats 1000000 in theorem covariantPhase_pullback_pair {J S : Set ℝ} (F : RicciFlow n M J) (T : ℝ) {a b : ℝ} (hab : a < b) (hCS : Icc a b βŠ† S) (htime : βˆ€ s ∈ S, T - s ^ 2 ∈ J) (x : M) (Ξ± : ℝ β†’ M) (hsrc : MapsTo Ξ± (Icc a b) (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (B : ℝ β†’ (EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) β†’L[ℝ] EuclideanSpace ℝ (Fin n)) (C : ℝ β†’ EuclideanSpace ℝ (Fin n) β†’L[ℝ] EuclideanSpace ℝ (Fin n)) (V H : ℝ β†’ EuclideanSpace ℝ (Fin n) β†’L[ℝ] EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) (z : ℝ β†’ EuclideanSpace ℝ (Fin n) Γ— EuclideanSpace ℝ (Fin n)) (hz : ContDiffOn ℝ ∞ z (Icc a b)) (EY : ParametricAlongCurveExtensionOn (Icc a b) Ξ± (fun r ↦ chartFrame x (z r).1 (Ξ± r))) (EP : ParametricAlongCurveExtensionOn (Icc a b) Ξ± (fun r ↦ chartFrame x (z r).2 (Ξ± r))) {s : ℝ} (hs : s ∈ Icc a b) (hΞ“ : βˆ€ v, C s v = closedChartChristoffel F T x S (s, extChartAt (𝓑 n) x (Ξ± s)) (deriv ((extChartAt (𝓑 n) x) ∘ Ξ±) s) v) (hd : HasDerivWithinAt z (covariantLinearPhaseOperator (B s) (C s) (V s) (H s) (z s)) (Icc a b) s) (hΞ± : MDifferentiableAt (π“˜(ℝ, ℝ)) (𝓑 n) Ξ± s) : pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) Ξ± (fun r ↦ chartFrame x (z r).1 (Ξ± r)) (Icc a b) EY s = chartFrame x (z s).2 (Ξ± s) ∧ pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) Ξ± (fun r ↦ chartFrame x (z r).2 (Ξ± r)) (Icc a b) EP s = chartFrame x (B s (V s (z s).1 - H s (z s).2)) (Ξ± s) := by have hdy : HasDerivWithinAt (fun r ↦ (z r).1) ((z s).2 - C s (z s).1) (Icc a b) s := hd.fst have hdp : HasDerivWithinAt (fun r ↦ (z r).2) (B s (V s (z s).1 - H s (z s).2) - C s (z s).2) (Icc a b) s := hd.snd constructor Β· rw [pullbackCovariantDerivative_closedChart_formula F T hab hCS htime x Ξ± (fun r ↦ (z r).1) hz.fst hsrc _ (fun _ _ ↦ rfl) EY hs _ hdy hΞ±, ← hΞ“ (z s).1, sub_add_cancel] Β· rw [pullbackCovariantDerivative_closedChart_formula F T hab hCS htime x Ξ± (fun r ↦ (z r).2) hz.snd hsrc _ (fun _ _ ↦ rfl) EP hs _ hdp hΞ±, ← hΞ“ (z s).2, sub_add_cancel] end PoincareMT.LGeometry