lemmasquareQuotient_hasFDerivAt {u : Space d →ℝ} {e x : Space d}
(hu : DifferentiableAtℝ u x) (ht : 0 < inner ℝ x e) :
HasFDerivAt (squareQuotient u e)
((inner ℝ x e)⁻¹ • ((2*u x) • fderiv ℝ u x)-
(u x^2/(inner ℝ x e)^2) • innerSL ℝ e) x :=by
proof · 17
lines
havehi : HasFDerivAt (funy : Space d => inner ℝ y e) (innerSL ℝ e) x :=by
convert! (innerSL ℝ e).hasFDerivAt (x:=x) using1
funext y
exact (real_inner_comm y e).symm
have hh := (hu.hasFDerivAt.pow 2).mul ((hasDerivAt_inv ht.ne').comp_hasFDerivAt x hi)
havehe : (squareQuotient u e) =ᶠ[𝓝 x] (fun y=>u y^2/inner ℝ y e) :=by
filter_upwards [(continuous_id.inner continuous_const).continuousAt.preimage_mem_nhds
(Ioi_mem_nhds ht)] with y hy
change 0 < inner ℝ y e at hy
simp only [squareQuotient,ite_eq_left hy]
simp only [Function.comp_apply] at hh
convert! hh.congr_of_eventuallyEq he using1
ext v
simp only [sub_apply,smul_apply,smul_eq_mul,innerSL_apply_apply,add_apply,
Nat.cast_ofNat,pow_one,Nat.reduceSub,nsmul_eq_mul]
field_simp
ring
lemmapotential_gradient (x : Space d) :
gradient (potential : Space d →ℝ) x = -rawKernel x • x :=by
proof · 8
lines
apply ext_inner_right ℝ
intro e
rw [inner_gradient_left,real_inner_smul_left]
have hh := radial_directional (contDiff_profile.differentiable (by simp)) x e
rw [show (funy : Space d=>profile (‖y‖^2))=potential from rfl] at hh
rw [hh]
simp only [rawKernel,kernelProfile]
ring
lemmaweightedQuotient_directional {u : Space d →ℝ} {e x : Space d}
(hu : DifferentiableAtℝ u x) (ht : 0 < inner ℝ x e) (he : ‖e‖=1) :
inner ℝ (gradient (fun y=>potential y*squareQuotient u e y) x) e =
-rawKernel x*u x^2 + potential x*(
2*(u x/inner ℝ x e)*inner ℝ (gradient u x) e-(u x/inner ℝ x e)^2) :=by
proof · 11
lines
have hφ := (contDiff_potential.differentiable (by simp) x).hasFDerivAt
have hq := squareQuotient_hasFDerivAt hu ht
have hp := hφ.mul hq
change HasFDerivAt (fun y=>potential y*squareQuotient u e y) _ x at hp
rw [inner_gradient_left,hp.fderiv]
simp only [add_apply,smul_apply,smul_eq_mul,sub_apply,innerSL_apply_apply]
simp only [← inner_gradient_left,potential_gradient,real_inner_smul_left,
real_inner_self_eq_norm_sq,he]
simp only [squareQuotient,ite_eq_left ht,one_pow,mul_one]
field_simp
ring