import PoincareLib.Geometry.RicciFlow.ReducedGeometry.LGeometry.Basic import Mathlib.Geometry.Manifold.MFDeriv.FDeriv /-! # Actual curve velocities under germ equality and parameter changes Each formula evaluates the manifold derivative at the real unit vector, so the identities can be used directly by the chart perturbation producer. -/ set_option autoImplicit false set_option maxSynthPendingDepth 3 set_option maxHeartbeats 800000 open scoped Manifold ContDiff Bundle Topology universe u v namespace PoincareMT.ReducedLengthMinimum.Variation.Geometry variable {n : โ„•} {M : Type u} [TopologicalSpace M] [ChartedSpace (EuclideanSpace โ„ (Fin n)) M] [IsManifold (๐“ก n) โˆž M] set_option backward.isDefEq.respectTransparency false in theorem curveVelocity_congr_of_eventuallyEq {ฮณ ฮด : โ„ โ†’ M} {t : โ„} (heq : ฮณ =แถ [nhds t] ฮด) : (curveVelocity (n := n) ฮณ t : EuclideanSpace โ„ (Fin n)) = curveVelocity (n := n) ฮด t := by have hd := heq.mfderiv_eq (I := ๐“˜(โ„, โ„)) (I' := ๐“ก n) exact congrArg (fun L : โ„ โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†ฆ L 1) hd set_option backward.isDefEq.respectTransparency false in theorem curveVelocity_comp_initial_line {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] (f : E โ†’ M) (Z W : E) (hf : MDifferentiableAt (๐“˜(โ„, E)) (๐“ก n) f Z) : (curveVelocity (n := n) (fun r : โ„ โ†ฆ f (Z + r โ€ข W)) 0 : EuclideanSpace โ„ (Fin n)) = mfderiv (๐“˜(โ„, E)) (๐“ก n) f Z W := by have hline : HasDerivAt (fun r : โ„ โ†ฆ Z + r โ€ข W) W 0 := by have hsmul : HasDerivAt (fun r : โ„ โ†ฆ r โ€ข W) W 0 := by simpa only [id_eq, one_smul] using (hasDerivAt_id (0 : โ„)).smul_const W exact hsmul.const_add Z have hvalue : (mfderiv (๐“˜(โ„, โ„)) (๐“˜(โ„, E)) (fun r : โ„ โ†ฆ Z + r โ€ข W) 0) 1 = W := by exact (congrArg (fun L : โ„ โ†’L[โ„] E โ†ฆ L 1) (mfderiv_eq_fderiv (f := fun r : โ„ โ†ฆ Z + r โ€ข W) (x := 0))).trans ((congrArg (fun L : โ„ โ†’L[โ„] E โ†ฆ L 1) hline.hasFDerivAt.fderiv).trans (ContinuousLinearMap.toSpanSingleton_apply_one โ„ W)) have hf' : MDifferentiableAt (๐“˜(โ„, E)) (๐“ก n) f (Z + (0 : โ„) โ€ข W) := by simpa only [zero_smul, add_zero] using hf have hcomp := congrArg (fun L : โ„ โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†ฆ L 1) (mfderiv_comp (f := fun r : โ„ โ†ฆ Z + r โ€ข W) (g := f) 0 hf' hline.hasFDerivAt.hasMFDerivAt.mdifferentiableAt) have hresult := hcomp.trans (congrArg (fun v : E โ†ฆ mfderiv (๐“˜(โ„, E)) (๐“ก n) f (Z + (0 : โ„) โ€ข W) v) hvalue) have hpoint := congrArg (fun L : E โ†’L[โ„] EuclideanSpace โ„ (Fin n) โ†ฆ L W) (mfderiv_congr_point (I := ๐“˜(โ„, E)) (I' := ๐“ก n) (f := f) (show Z + (0 : โ„) โ€ข W = Z by simp)) exact hresult.trans hpoint set_option backward.isDefEq.respectTransparency false in theorem curveVelocity_comp_square (ฮฑ : โ„ โ†’ M) (s : โ„) (hฮฑ : MDifferentiableAt (๐“˜(โ„, โ„)) (๐“ก n) ฮฑ (s ^ 2)) : curveVelocity (n := n) (fun r โ†ฆ ฮฑ (r ^ 2)) s = (2 * s) โ€ข curveVelocity (n := n) ฮฑ (s ^ 2) := by have hsq : HasDerivAt (fun r : โ„ โ†ฆ r ^ 2) (2 * s) s := by simpa using hasDerivAt_pow 2 s have hvalue : (mfderiv (๐“˜(โ„, โ„)) (๐“˜(โ„, โ„)) (fun r : โ„ โ†ฆ r ^ 2) s) 1 = 2 * s := by exact (congrArg (fun L : โ„ โ†’L[โ„] โ„ โ†ฆ L 1) (mfderiv_eq_fderiv (f := fun r : โ„ โ†ฆ r ^ 2) (x := s))).trans ((congrArg (fun L : โ„ โ†’L[โ„] โ„ โ†ฆ L 1) hsq.hasFDerivAt.fderiv).trans (ContinuousLinearMap.toSpanSingleton_apply_one โ„ (2 * s))) let L : โ„ โ†’L[โ„] TangentSpace (๐“ก n) (ฮฑ (s ^ 2)) := mfderiv (๐“˜(โ„, โ„)) (๐“ก n) ฮฑ (s ^ 2) have hcomp := congrArg (fun A : โ„ โ†’L[โ„] TangentSpace (๐“ก n) (ฮฑ (s ^ 2)) โ†ฆ A 1) (mfderiv_comp (f := fun r : โ„ โ†ฆ r ^ 2) (g := ฮฑ) s hฮฑ hsq.hasFDerivAt.hasMFDerivAt.mdifferentiableAt) have hlin : L (2 * s) = (2 * s) โ€ข L 1 := by simpa only [smul_eq_mul, mul_one] using L.map_smul (2 * s) (1 : โ„) exact hcomp.trans ((congrArg L hvalue).trans hlin) end PoincareMT.ReducedLengthMinimum.Variation.Geometry