import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.Index.WeightedJacobiIdentities import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiAlongPair import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Jacobi.JacobiClosedCoordinates import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.VariationMetricPair import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Regularity.ChartEulerEquation /-! Adapted from Mapher `PoincareMT/Proofs/M08/JacobiAlongCoefficients.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] local instance jacobiAlongDualGroup : NormedAddCommGroup (EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„) := ContinuousLinearMap.toNormedAddCommGroup local instance jacobiAlongDualSpace : NormedSpace โ„ (EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„) := ContinuousLinearMap.toNormedSpace local instance jacobiAlongBilinGroup : NormedAddCommGroup (EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„) := ContinuousLinearMap.toNormedAddCommGroup local instance jacobiAlongBilinSpace : NormedSpace โ„ (EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„) := ContinuousLinearMap.toNormedSpace local instance jacobiAlongEndGroup : NormedAddCommGroup (EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n)) := ContinuousLinearMap.toNormedAddCommGroup local instance jacobiAlongEndSpace : NormedSpace โ„ (EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n)) := ContinuousLinearMap.toNormedSpace local instance jacobiAlongConnectionGroup : NormedAddCommGroup (EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n)) := ContinuousLinearMap.toNormedAddCommGroup local instance jacobiAlongConnectionSpace : NormedSpace โ„ (EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n)) := ContinuousLinearMap.toNormedSpace def jacobiAlongSharp {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (x : M) (ฮฑ : โ„ โ†’ M) (s : โ„) : (EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„) โ†’L[โ„] EuclideanSpace โ„ (Fin n) := chartMetricDualInverse F T x (s, extChartAt (๐“ก n) x (ฮฑ s)) def jacobiAlongConnection {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (x : M) (S : Set โ„) (ฮฑ : โ„ โ†’ M) (s : โ„) : EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n) := closedChartConnection F T x S (s, extChartAt (๐“ก n) x (ฮฑ s)) (deriv ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ) s) def jacobiAlongPotential {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (x : M) (S : Set โ„) (ฮฑ : โ„ โ†’ M) (s : โ„) : EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„ := closedChartJacobiPotential F T x S (s, extChartAt (๐“ก n) x (ฮฑ s)) (deriv ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ) s) def jacobiAlongMetricTime {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (x : M) (S : Set โ„) (ฮฑ : โ„ โ†’ M) (s : โ„) : EuclideanSpace โ„ (Fin n) โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†’L[โ„] โ„ := timeWithinFDeriv S (extChartAt (๐“ก n) x).target (chartActionMetric F T x) (s, extChartAt (๐“ก n) x (ฮฑ s)) def jacobiAlongPhase {J : Set โ„} (F : RicciFlow n M J) (T : โ„) (x : M) (S : Set โ„) (ฮฑ : โ„ โ†’ M) (s : โ„) : (EuclideanSpace โ„ (Fin n) ร— EuclideanSpace โ„ (Fin n)) โ†’L[โ„] EuclideanSpace โ„ (Fin n) ร— EuclideanSpace โ„ (Fin n) := covariantLinearPhaseOperator (jacobiAlongSharp F T x ฮฑ s) (jacobiAlongConnection F T x S ฮฑ s) (jacobiAlongPotential F T x S ฮฑ s) (jacobiAlongMetricTime F T x S ฮฑ s) set_option maxHeartbeats 4000000 in theorem jacobiAlongCoefficients_contDiffOn {J S U C : Set โ„} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T : โ„) (x : M) (ฮฑ : โ„ โ†’ M) (hS : UniqueDiffOn โ„ S) (htime : โˆ€ s โˆˆ S, T - s ^ 2 โˆˆ J) (hCS : C โІ S) (hU : IsOpen U) (hCU : C โІ U) (hฮฑ : ContMDiffOn (๐“˜(โ„, โ„)) (๐“ก n) โˆž ฮฑ U) (hsrc : MapsTo ฮฑ C (chartAt (EuclideanSpace โ„ (Fin n)) x).source) : ContDiffOn โ„ โˆž (jacobiAlongSharp F T x ฮฑ) C โˆง ContDiffOn โ„ โˆž (jacobiAlongConnection F T x S ฮฑ) C โˆง ContDiffOn โ„ โˆž (jacobiAlongPotential F T x S ฮฑ) C โˆง ContDiffOn โ„ โˆž (jacobiAlongMetricTime F T x S ฮฑ) C := by let V := U โˆฉ ฮฑ โปยน' (chartAt (EuclideanSpace โ„ (Fin n)) x).source have hV : IsOpen V := hฮฑ.continuousOn.isOpen_inter_preimage hU (chartAt (EuclideanSpace โ„ (Fin n)) x).open_source have hCV : C โІ V := fun s hs โ†ฆ โŸจhCU hs, hsrc hsโŸฉ have hqV := chart_curve_contDiffOn x ฮฑ (hฮฑ.mono inter_subset_left) (show MapsTo ฮฑ V (chartAt (EuclideanSpace โ„ (Fin n)) x).source from fun _ hs โ†ฆ hs.2) have hq : ContDiffOn โ„ โˆž ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ) C := hqV.mono hCV have hA : ContDiffOn โ„ โˆž (deriv ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ)) C := (hqV.deriv_of_isOpen hV (by simp)).mono hCV have hpoint : ContDiffOn โ„ โˆž (fun s โ†ฆ (s, extChartAt (๐“ก n) x (ฮฑ s))) C := contDiffOn_id.prodMk hq have hmap : MapsTo (fun s โ†ฆ (s, extChartAt (๐“ก n) x (ฮฑ s))) C (S ร—หข (extChartAt (๐“ก n) x).target) := by intro s hs exact โŸจhCS hs, (extChartAt (๐“ก n) x).map_source (by simpa only [extChartAt_source] using hsrc hs)โŸฉ have hpointA : ContDiffOn โ„ โˆž (fun s โ†ฆ ((s, extChartAt (๐“ก n) x (ฮฑ s)), deriv ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ) s)) C := hpoint.prodMk hA have hmapA : MapsTo (fun s โ†ฆ ((s, extChartAt (๐“ก n) x (ฮฑ s)), deriv ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ) s)) C ((S ร—หข (extChartAt (๐“ก n) x).target) ร—หข univ) := fun s hs โ†ฆ โŸจhmap hs, mem_univ _โŸฉ have hB := (chartMetricDualInverse_contDiffOn F T x htime).comp hpoint hmap have hฮ“ := ((closedChartConnection_contDiffOn F T x hS htime).comp hpoint hmap).clm_apply hA have hVโ‚€ := closedChartJacobiPotential_contDiffOn F hM04 T x hS htime have hV := hVโ‚€.comp hpointA hmapA have hH := (timeWithinFDeriv_contDiffOn hS (isOpen_extChartAt_target (I := ๐“ก n) x) (chartActionMetric F T x) (chartActionMetric_closed_contDiffOn F T x htime)).comp hpoint hmap exact โŸจhB, hฮ“, hV, hHโŸฉ theorem chartFrame_curveVelocityWithin {C : Set โ„} {ฮฑ : โ„ โ†’ M} {x : M} {s : โ„} (hx : ฮฑ s โˆˆ (chartAt (EuclideanSpace โ„ (Fin n)) x).source) (hC : UniqueDiffWithinAt โ„ C s) (hฮฑ : MDifferentiableAt (๐“˜(โ„, โ„)) (๐“ก n) ฮฑ s) : chartFrame x (deriv ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ) s) (ฮฑ s) = curveVelocityWithin (n := n) ฮฑ C s := by rw [chartFrame_curveVelocity hx hฮฑ] unfold curveVelocityWithin curveVelocity rw [mfderivWithin_eq_mfderiv hC.uniqueMDiffWithinAt hฮฑ] set_option maxHeartbeats 1800000 in theorem jacobiPairResidual_chart {J : Set โ„} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T : โ„) {A B : โ„} (hAB : A < B) (htime : โˆ€ s โˆˆ Icc A B, T - s ^ 2 โˆˆ J) (x : M) (ฮฑ : โ„ โ†’ M) {s : โ„} (hs : s โˆˆ Icc A B) (hx : ฮฑ s โˆˆ (chartAt (EuclideanSpace โ„ (Fin n)) x).source) (hฮฑ : MDifferentiableAt (๐“˜(โ„, โ„)) (๐“ก n) ฮฑ s) (y p dp w : EuclideanSpace โ„ (Fin n)) : jacobiPairResidual F T ฮฑ (Icc A B) s (chartFrame x y (ฮฑ s)) (chartFrame x p (ฮฑ s)) (chartFrame x dp (ฮฑ s)) (chartFrame x w (ฮฑ s)) = chartActionMetric F T x (s, extChartAt (๐“ก n) x (ฮฑ s)) dp w - jacobiAlongPotential F T x (Icc A B) ฮฑ s y w + jacobiAlongMetricTime F T x (Icc A B) ฮฑ s p w := by have hq : extChartAt (๐“ก n) x (ฮฑ s) โˆˆ (extChartAt (๐“ก n) x).target := (extChartAt (๐“ก n) x).map_source (by simpa only [extChartAt_source] using hx) have hpotential := closedChartJacobiPotential_identification F hM04 T (uniqueDiffOn_Icc hAB) htime hx hs (mem_closure_interior_Icc_prod hAB (isOpen_extChartAt_target (I := ๐“ก n) x) hs hq) (deriv ((extChartAt (๐“ก n) x) โˆ˜ ฮฑ) s) y w have hmetric : jacobiAlongMetricTime F T x (Icc A B) ฮฑ s p w = 4 * s * (F.connection (T - s ^ 2)).ricci (ฮฑ s) (chartFrame x p (ฮฑ s)) (chartFrame x w (ฮฑ s)) := by unfold jacobiAlongMetricTime rw [chartActionMetric_timeWithin F hM04 T x (uniqueDiffOn_Icc hAB) htime hs hq] simp only [smul_apply, smul_eq_mul, chartRicciForm_at hM04 _ hx] unfold jacobiPairResidual jacobiAlongPotential rw [โ† chartFrame_curveVelocityWithin hx (uniqueDiffOn_Icc hAB s hs) hฮฑ, chartActionMetric_apply F T hx s dp w, hpotential, hmetric] ring end PoincareMT.LGeometry