import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Coordinates.ChartEulerCoefficients import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Variation.Extension.BackwardEulerTransport import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Minimization.Charts.ChartStationarity /-! Adapted from Mapher `PoincareMT/Proofs/M08/EulerMomentum.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 scalar_graph_hasDerivAt (H : ℝ Γ— M β†’ ℝ) {Ξ± : ℝ β†’ M} {s : ℝ} (hH : MDifferentiableAt ((π“˜(ℝ, ℝ)).prod (𝓑 n)) (π“˜(ℝ, ℝ)) H (s, Ξ± s)) (hΞ± : MDifferentiableAt (π“˜(ℝ, ℝ)) (𝓑 n) Ξ± s) : HasDerivAt (fun r ↦ H (r, Ξ± r)) (deriv (fun r ↦ H (r, Ξ± s)) s + mvfderiv (𝓑 n) (fun y ↦ H (s, y)) (Ξ± s) (curveVelocity (n := n) Ξ± s)) s := by have hgraph := mdifferentiableAt_id.prodMk hΞ± have hcomp := (hH.comp s hgraph).differentiableAt.hasDerivAt have h := mfderiv_comp_apply s hH hgraph (1 : ℝ) rw [mfderiv_prodMk mdifferentiableAt_id hΞ±, mfderiv_id] at h change mfderiv (π“˜(ℝ, ℝ)) (π“˜(ℝ, ℝ)) (fun r ↦ H (r, Ξ± r)) s 1 = mfderiv ((π“˜(ℝ, ℝ)).prod (𝓑 n)) (π“˜(ℝ, ℝ)) H (s, Ξ± s) (1, curveVelocity (n := n) Ξ± s) at h rw [mfderiv_prod_eq_add_apply hH] at h have hscalar (f : ℝ β†’ ℝ) : mfderiv (π“˜(ℝ, ℝ)) (π“˜(ℝ, ℝ)) f s 1 = deriv f s := by have hf := congrArg (fun A : ℝ β†’L[ℝ] ℝ ↦ A 1) (mfderiv_eq_fderiv (π•œ := ℝ) (f := f) (x := s)) exact hf.trans fderiv_apply_one_eq_deriv dsimp only [Prod.fst, Prod.snd] at h rw [hscalar, hscalar] at h convert hcomp using 1 <;> first | rfl | exact h.symm section Bilinear variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] noncomputable local instance eulerMomentumInstance1 : NormedAddCommGroup (E β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup noncomputable local instance eulerMomentumInstance2 : NormedSpace ℝ (E β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace noncomputable local instance eulerMomentumInstance3 : NormedAddCommGroup (E β†’L[ℝ] E β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup noncomputable local instance eulerMomentumInstance4 : NormedSpace ℝ (E β†’L[ℝ] E β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace theorem bilinear_moving_vector_hasDerivAt {G : ℝ β†’ E β†’L[ℝ] E β†’L[ℝ] ℝ} {v : ℝ β†’ E} {s d : ℝ} {a : E} (w : E) (hG : DifferentiableAt ℝ G s) (hv : HasDerivAt v a s) (hfixed : HasDerivAt (fun r ↦ G r (v s) w) d s) : HasDerivAt (fun r ↦ G r (v r) w) (d + G s a w) s := by have h₁ := (hG.hasDerivAt.clm_apply (hasDerivAt_const s (v s))).clm_apply (hasDerivAt_const s w) have hd : deriv G s (v s) w = d := by simpa only [map_zero, add_zero] using h₁.unique hfixed have hβ‚‚ := (hG.hasDerivAt.clm_apply hv).clm_apply (hasDerivAt_const s w) simpa only [ContinuousLinearMap.add_apply, map_zero, add_zero, hd] using hβ‚‚ end Bilinear noncomputable local instance eulerMomentumInstance5 : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup noncomputable local instance eulerMomentumInstance6 : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace noncomputable local instance eulerMomentumInstance7 : NormedAddCommGroup (EuclideanSpace ℝ (Fin n) β†’L[ℝ] EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedAddCommGroup noncomputable local instance eulerMomentumInstance8 : NormedSpace ℝ (EuclideanSpace ℝ (Fin n) β†’L[ℝ] EuclideanSpace ℝ (Fin n) β†’L[ℝ] ℝ) := ContinuousLinearMap.toNormedSpace theorem parametricExtension_chart_contMDiffAt {I : Set ℝ} {Ξ± : ℝ β†’ M} {Y : βˆ€ s, TangentSpace (𝓑 n) (Ξ± s)} (E : ParametricAlongCurveExtensionOn I Ξ± Y) {x y : M} {s : ℝ} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (hE : (s, y) ∈ E.domain) : ContMDiffAt ((π“˜(ℝ, ℝ)).prod (𝓑 n)) (𝓑 n) ∞ (fun z : ℝ Γ— M ↦ (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n)) x).continuousLinearMapAt ℝ z.2 (E.extension z.1 z.2)) (s, y) := by let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n)) x have h := (e.contMDiffAt_iff (xβ‚€ := (s, y)) (f := fun z : ℝ Γ— M ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) z.2 (E.extension z.1 z.2)) (e.mem_source.mpr hy)).mp ((E.smooth _ hE).contMDiffAt (E.open_domain.mem_nhds hE)) apply h.2.congr_of_eventuallyEq filter_upwards [continuous_snd.continuousAt (e.open_baseSet.mem_nhds hy)] with z hz exact e.continuousLinearMapAt_apply_of_mem ℝ hz _ set_option synthInstance.maxHeartbeats 200000 in theorem parametricExtension_metric_pair_contMDiffAt {J I : Set ℝ} (F : RicciFlow n M J) (T : ℝ) {Ξ± : ℝ β†’ M} {Y : βˆ€ s, TangentSpace (𝓑 n) (Ξ± s)} (E : ParametricAlongCurveExtensionOn I Ξ± Y) {x y : M} {s : ℝ} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (hE : (s, y) ∈ E.domain) (ht : T - s ^ 2 ∈ interior J) (w : EuclideanSpace ℝ (Fin n)) : ContMDiffAt ((π“˜(ℝ, ℝ)).prod (𝓑 n)) (π“˜(ℝ, ℝ)) ∞ (fun z : ℝ Γ— M ↦ (F.metric (T - z.1 ^ 2)).inner z.2 (E.extension z.1 z.2) (chartFrame x w z.2)) (s, y) := by have hmap : ContMDiffAt ((π“˜(ℝ, ℝ)).prod (𝓑 n)) ((π“˜(ℝ, ℝ)).prod (𝓑 n)) ∞ (fun z : ℝ Γ— M ↦ (T - z.1 ^ 2, z.2)) (s, y) := (contMDiffAt_const.sub (contMDiffAt_fst.pow 2)).prodMk contMDiffAt_snd have hmetric := ((F.smooth (T - s ^ 2, y) ⟨interior_subset ht, mem_univ y⟩).contMDiffAt (prod_mem_nhds (mem_interior_iff_mem_nhds.mp ht) univ_mem)).comp (s, y) hmap have hfield := (E.smooth (s, y) hE).contMDiffAt (E.open_domain.mem_nhds hE) have hframe : ContMDiffAt ((π“˜(ℝ, ℝ)).prod (𝓑 n)) ((𝓑 n).prod (𝓑 n)) ∞ (fun z : ℝ Γ— M ↦ Bundle.TotalSpace.mk' (EuclideanSpace ℝ (Fin n)) z.2 (chartFrame x w z.2)) (s, y) := ((chartFrame_contMDiffOn x w y hy).contMDiffAt ((chartAt (EuclideanSpace ℝ (Fin n)) x).open_source.mem_nhds hy)).comp (s, y) contMDiffAt_snd have h : ContMDiffAt ((π“˜(ℝ, ℝ)).prod (𝓑 n)) ((𝓑 n).prod (π“˜(ℝ, ℝ))) ∞ (fun z : ℝ Γ— M ↦ Bundle.TotalSpace.mk' ℝ (E := Bundle.Trivial M ℝ) z.2 ((F.metric (T - z.1 ^ 2)).inner z.2 (E.extension z.1 z.2) (chartFrame x w z.2))) (s, y) := by apply ContMDiffAt.clm_bundle_applyβ‚‚ (F₁ := EuclideanSpace ℝ (Fin n)) (Fβ‚‚ := EuclideanSpace ℝ (Fin n)) Β· exact hmetric Β· exact hfield Β· exact hframe simpa only [Bundle.Trivial.fiberBundle_trivializationAt', Bundle.Trivial.trivialization_apply] using (Bundle.contMDiffAt_totalSpace.mp h).2 theorem parametricExtension_metric_pair_time {J I : Set ℝ} (F : RicciFlow n M J) (T : ℝ) {Ξ± : ℝ β†’ M} {Y : βˆ€ s, TangentSpace (𝓑 n) (Ξ± s)} (E : ParametricAlongCurveExtensionOn I Ξ± Y) {x y : M} {s : ℝ} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (hE : (s, y) ∈ E.domain) (ht : T - s ^ 2 ∈ interior J) (w : EuclideanSpace ℝ (Fin n)) : HasDerivAt (fun r ↦ (F.metric (T - r ^ 2)).inner y (E.extension r y) (chartFrame x w y)) (4 * s * (F.connection (T - s ^ 2)).ricci y (E.extension s y) (chartFrame x w y) + (F.metric (T - s ^ 2)).inner y (deriv (fun r ↦ E.extension r y) s) (chartFrame x w y)) s := by let : NormedAddCommGroup (TangentSpace (𝓑 n) y) := inferInstanceAs (NormedAddCommGroup (EuclideanSpace ℝ (Fin n))) let : NormedSpace ℝ (TangentSpace (𝓑 n) y) := inferInstanceAs (NormedSpace ℝ (EuclideanSpace ℝ (Fin n))) let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n)) x let v := fun r ↦ e.continuousLinearMapAt ℝ y (E.extension r y) let a := e.continuousLinearMapAt ℝ y (deriv (fun r ↦ E.extension r y) s) have hv : HasDerivAt v a s := (e.continuousLinearMapAt ℝ y).hasFDerivAt.comp_hasDerivAt s (parametricExtension_differentiableAt_time E hE).hasDerivAt have hy' : y ∈ (extChartAt (𝓑 n) x).source := by simpa only [extChartAt_source] using hy have hdom : (s, extChartAt (𝓑 n) x y) ∈ chartActionDomain F T x := ⟨ht, (extChartAt (𝓑 n) x).map_source hy'⟩ have hG : DifferentiableAt ℝ (chartActionMetric F T x) (s, extChartAt (𝓑 n) x y) := (((chartActionMetric_contDiffOn F T x) _ hdom).contDiffAt ((chartActionDomain_open F T x).mem_nhds hdom)).differentiableAt (by simp) have hGt := hG.comp (f := fun r : ℝ ↦ (r, extChartAt (𝓑 n) x y)) s (differentiableAt_id.prodMk (differentiableAt_const _)) have hfixed := chartActionMetric_time_derivative F T hy ht (v s) w have h := bilinear_moving_vector_hasDerivAt w hGt hv hfixed have heq (r : ℝ) : chartFrame x (v r) y = E.extension r y := e.symmL_continuousLinearMapAt hy _ have hea : chartFrame x a y = deriv (fun r ↦ E.extension r y) s := e.symmL_continuousLinearMapAt hy _ simpa only [Function.comp_apply, chartActionMetric_apply F T hy, heq, hea] using h theorem chartFrame_connection_cross (g : RiemannianMetric n M) (D : LeviCivitaData g) {x y : M} (hy : y ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (v w : EuclideanSpace ℝ (Fin n)) : g.inner y (chartFrame x v y) (D.connection (chartFrame x w) y (chartFrame x v y)) = mvfderiv (𝓑 n) (fun p ↦ g.inner p (chartFrame x v p) (chartFrame x v p)) y (chartFrame x w y) / 2 := by letI : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨g.toRiemannianMetric⟩ have hdiff (z : EuclideanSpace ℝ (Fin n)) := ((chartFrame_contMDiffOn x z y hy).contMDiffAt ((chartAt (EuclideanSpace ℝ (Fin n)) x).open_source.mem_nhds hy)).mdifferentiableAt (by simp) have hcross : D.connection (chartFrame x w) y (chartFrame x v y) = D.connection (chartFrame x v) y (chartFrame x w y) := by have h := D.connection.torsion_eq_zero_iff.mp D.torsion_eq_zero (hdiff v) (hdiff w) rw [chartFrame_mlieBracket hy v w] at h exact sub_eq_zero.mp h have h := D.metricCompatible.mvfderiv_inner_eq (chartFrame x w) (hdiff v) (hdiff v) change mvfderiv (𝓑 n) (fun p ↦ g.inner p (chartFrame x v p) (chartFrame x v p)) y (chartFrame x w y) = g.inner y (D.connection (chartFrame x v) y (chartFrame x w y)) (chartFrame x v y) + g.inner y (chartFrame x v y) (D.connection (chartFrame x v) y (chartFrame x w y)) at h rw [g.symm y (D.connection (chartFrame x v) y (chartFrame x w y)) (chartFrame x v y)] at h rw [hcross] linarith set_option maxHeartbeats 800000 in theorem parametricExtension_metric_pair_graph {J I : Set ℝ} (F : RicciFlow n M J) (T : ℝ) (hI : IsOpen I) {Ξ± : ℝ β†’ M} (E : ParametricAlongCurveExtensionOn I Ξ± (curveVelocityWithin (n := n) Ξ± I)) {x : M} {s : ℝ} (hs : s ∈ I) (hy : Ξ± s ∈ (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (hΞ± : MDifferentiableAt (π“˜(ℝ, ℝ)) (𝓑 n) Ξ± s) (ht : T - s ^ 2 ∈ interior J) (w : EuclideanSpace ℝ (Fin n)) : HasDerivAt (fun r ↦ (F.metric (T - r ^ 2)).inner (Ξ± r) (E.extension r (Ξ± r)) (chartFrame x w (Ξ± r))) ((F.metric (T - s ^ 2)).inner (Ξ± s) (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) Ξ± (curveVelocityWithin (n := n) Ξ± I) I E s) (chartFrame x w (Ξ± s)) + 4 * s * (F.connection (T - s ^ 2)).ricci (Ξ± s) (curveVelocityWithin (n := n) Ξ± I s) (chartFrame x w (Ξ± s)) + spatialFDeriv (chartActionMetric F T x) (s, extChartAt (𝓑 n) x (Ξ± s)) w (deriv ((extChartAt (𝓑 n) x) ∘ Ξ±) s) (deriv ((extChartAt (𝓑 n) x) ∘ Ξ±) s) / 2) s := by let g := F.metric (T - s ^ 2) let D := F.connection (T - s ^ 2) letI : Bundle.RiemannianBundle (TangentSpace (𝓑 n) : M β†’ Type _) := ⟨g.toRiemannianMetric⟩ let v := deriv ((extChartAt (𝓑 n) x) ∘ Ξ±) s have hvel : chartFrame x v (Ξ± s) = curveVelocityWithin (n := n) Ξ± I s := by rw [show curveVelocityWithin (n := n) Ξ± I s = curveVelocity (n := n) Ξ± s by simp only [curveVelocityWithin, curveVelocity, mfderivWithin_of_mem_nhds (hI.mem_nhds hs)]] unfold v chartFrame rw [chart_deriv_eq_velocity hy hΞ±] exact Bundle.Trivialization.symmL_continuousLinearMapAt (trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n)) x) hy _ have hvel' : curveVelocity (n := n) Ξ± s = chartFrame x v (Ξ± s) := by rw [hvel] simp only [curveVelocityWithin, curveVelocity, mfderivWithin_of_mem_nhds (hI.mem_nhds hs)] have hE := (parametricExtension_contMDiffAt_space E (E.graph_mem s hs)).mdifferentiableAt (by simp) have hw := ((chartFrame_contMDiffOn x w (Ξ± s) hy).contMDiffAt ((chartAt (EuclideanSpace ℝ (Fin n)) x).open_source.mem_nhds hy)).mdifferentiableAt (by simp) have hspace := D.metricCompatible.mvfderiv_inner_eq (chartFrame x v) hE hw change mvfderiv (𝓑 n) (fun y ↦ g.inner y (E.extension s y) (chartFrame x w y)) (Ξ± s) (chartFrame x v (Ξ± s)) = g.inner (Ξ± s) (D.connection (E.extension s) (Ξ± s) (chartFrame x v (Ξ± s))) (chartFrame x w (Ξ± s)) + g.inner (Ξ± s) (E.extension s (Ξ± s)) (D.connection (chartFrame x w) (Ξ± s) (chartFrame x v (Ξ± s))) at hspace rw [E.agrees s hs, ← hvel, chartFrame_connection_cross g D hy v w, ← chartActionMetric_spatial_apply F T hy ht w v v] at hspace have htime := parametricExtension_metric_pair_time F T E hy (E.graph_mem s hs) ht w have h := scalar_graph_hasDerivAt _ ((parametricExtension_metric_pair_contMDiffAt F T E hy (E.graph_mem s hs) ht w).mdifferentiableAt (by simp)) hΞ± rw [htime.deriv, hvel', hspace, E.agrees s hs, hvel] at h convert h using 1 unfold pullbackCovariantDerivative simp only [map_add, ContinuousLinearMap.add_apply] ring set_option maxHeartbeats 1000000 in theorem regularized_equation_chart_momentum {J I : Set ℝ} (F : RicciFlow n M J) (hM04 : RicciFlowCurvatureTheory.{u}) (T : ℝ) (hI : IsOpen I) (x : M) (Ξ± : ℝ β†’ M) (hΞ± : ContMDiffOn (π“˜(ℝ, ℝ)) (𝓑 n) 1 Ξ± I) (hsrc : MapsTo Ξ± I (chartAt (EuclideanSpace ℝ (Fin n)) x).source) (E : ParametricAlongCurveExtensionOn I Ξ± (curveVelocityWithin (n := n) Ξ± I)) {s : ℝ} (hs : s ∈ I) (ht : T - s ^ 2 ∈ interior J) (heuler : regularizedLGeodesicEquation F T Ξ± I E s) : HasDerivAt (fun r ↦ chartMomentumVector (chartActionMetric F T x (r, extChartAt (𝓑 n) x (Ξ± r))) (deriv ((extChartAt (𝓑 n) x) ∘ Ξ±) r)) (chartForceVector (spatialFDeriv (chartActionMetric F T x) (s, extChartAt (𝓑 n) x (Ξ± s))) (spatialFDeriv (chartActionPotential F T x) (s, extChartAt (𝓑 n) x (Ξ± s))) (deriv ((extChartAt (𝓑 n) x) ∘ Ξ±) s)) s := by let e := trivializationAt (EuclideanSpace ℝ (Fin n)) (TangentSpace (𝓑 n)) x let u := (extChartAt (𝓑 n) x) ∘ Ξ± let q := deriv u let c := fun r ↦ e.continuousLinearMapAt ℝ (Ξ± r) (E.extension r (Ξ± r)) let G := fun r ↦ chartActionMetric F T x (r, u r) let P := fun r ↦ chartMomentumVector (G r) (q r) let Q := chartForceVector (spatialFDeriv (chartActionMetric F T x) (s, u s)) (spatialFDeriv (chartActionPotential F T x) (s, u s)) (q s) have hΞ±d (r : ℝ) (hr : r ∈ I) : MDifferentiableAt (π“˜(ℝ, ℝ)) (𝓑 n) Ξ± r := ((hΞ± r hr).contMDiffAt (hI.mem_nhds hr)).mdifferentiableAt one_ne_zero have hud : DifferentiableAt ℝ u s := (((contMDiffAt_extChartAt' (I := 𝓑 n) (n := ∞) (hsrc hs)).mdifferentiableAt (by simp)).comp s (hΞ±d s hs)).differentiableAt have hq (r : ℝ) (hr : r ∈ I) : q r = c r := by dsimp only [q, u, c] rw [E.agrees r hr] simp only [curveVelocityWithin, mfderivWithin_of_mem_nhds (hI.mem_nhds hr)] exact chart_deriv_eq_velocity (hsrc hr) (hΞ±d r hr) have hcoord := (parametricExtension_chart_contMDiffAt E (hsrc hs) (E.graph_mem s hs)).mdifferentiableAt (by simp) have hcd : DifferentiableAt ℝ c s := by have h := hcoord.comp (f := fun r : ℝ ↦ (r, Ξ± r)) s (mdifferentiableAt_id.prodMk (hΞ±d s hs)) exact h.differentiableAt have hdom : (s, u s) ∈ chartActionDomain F T x := by refine ⟨ht, (extChartAt (𝓑 n) x).map_source ?_⟩ simpa only [extChartAt_source] using hsrc hs have hGbase : DifferentiableAt ℝ (chartActionMetric F T x) (s, u s) := (((chartActionMetric_contDiffOn F T x) _ hdom).contDiffAt ((chartActionDomain_open F T x).mem_nhds hdom)).differentiableAt (by simp) have hGd : DifferentiableAt ℝ G s := by have h := hGbase.comp (f := fun r : ℝ ↦ (r, u r)) s (differentiableAt_id.prodMk hud) exact h have hPc : DifferentiableAt ℝ (fun r ↦ chartMomentumVector (G r) (c r)) s := (InnerProductSpace.toDual ℝ (EuclideanSpace ℝ (Fin n))).symm.toContinuousLinearEquiv.differentiableAt.comp s (hGd.clm_apply hcd) have hPd : DifferentiableAt ℝ P s := hPc.congr_of_eventuallyEq (by filter_upwards [hI.mem_nhds hs] with r hr exact congrArg (chartMomentumVector (G r)) (hq r hr)) have hderiv : deriv P s = Q := by apply ext_inner_left ℝ intro w have hpair := (innerSL ℝ w).hasFDerivAt.comp_hasDerivAt s hPd.hasDerivAt have hgraph := parametricExtension_metric_pair_graph F T hI E hs (hsrc hs) (hΞ±d s hs) ht w have hnear : (fun r ↦ inner ℝ w (P r)) =αΆ [𝓝 s] (fun r ↦ (F.metric (T - r ^ 2)).inner (Ξ± r) (E.extension r (Ξ± r)) (chartFrame x w (Ξ± r))) := by filter_upwards [hI.mem_nhds hs] with r hr dsimp only [P, G, u, Function.comp_apply] rw [chartMomentumVector_inner, chartActionMetric_apply F T (hsrc hr), hq r hr] dsimp only [c, chartFrame] rw [e.symmL_continuousLinearMapAt (hsrc hr)] have hQ : (F.metric (T - s ^ 2)).inner (Ξ± s) (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) Ξ± (curveVelocityWithin (n := n) Ξ± I) I E s) (chartFrame x w (Ξ± s)) + 4 * s * (F.connection (T - s ^ 2)).ricci (Ξ± s) (curveVelocityWithin (n := n) Ξ± I s) (chartFrame x w (Ξ± s)) + spatialFDeriv (chartActionMetric F T x) (s, u s) w (q s) (q s) / 2 = inner ℝ w Q := by have heq := heuler (chartFrame x w (Ξ± s)) change regularizedEulerResidual F T Ξ± I E s (chartFrame x w (Ξ± s)) = 0 at heq unfold regularizedEulerResidual scalarCurvatureDifferential at heq dsimp only [Q, u, Function.comp_apply] rw [chartForceVector_inner, chartActionPotential_spatial_apply F hM04 T (hsrc hs) ht] linarith change HasDerivAt _ ((F.metric (T - s ^ 2)).inner (Ξ± s) (pullbackCovariantDerivative F (fun r ↦ T - r ^ 2) Ξ± (curveVelocityWithin (n := n) Ξ± I) I E s) (chartFrame x w (Ξ± s)) + 4 * s * (F.connection (T - s ^ 2)).ricci (Ξ± s) (curveVelocityWithin (n := n) Ξ± I s) (chartFrame x w (Ξ± s)) + spatialFDeriv (chartActionMetric F T x) (s, u s) w (q s) (q s) / 2) s at hgraph rw [hQ] at hgraph exact hpair.unique (hgraph.congr_of_eventuallyEq hnear) have h := hPd.hasDerivAt rw [hderiv] at h exact h end PoincareMT.LGeometry