English
If hc is a deriv within s of c at x and hu is a deriv within s of u at x, then the derivative within s of (c(y))(u(y)) is c'(u(x)) + c(x)(u'(x)).
Русский
Если у нас есть производная внутри множества s для c и u, то производная від (c(y))(u(y)) внутри s равна c'(u(x)) + c(x)·u'(x).
LaTeX
$$$HasDerivWithinAt\\left(c,c',s,x\\right) \\Rightarrow HasDerivWithinAt\\left(y \\mapsto (c(y))(u(y))\\right)\\left(c'(u(x)) + c(x)u'(x)\\right) s x$$$
Lean4
theorem derivWithin_clm_comp (hc : DifferentiableWithinAt 𝕜 c s x) (hd : DifferentiableWithinAt 𝕜 d s x) :
derivWithin (fun y => (c y).comp (d y)) s x = (derivWithin c s x).comp (d x) + (c x).comp (derivWithin d s x) :=
by
by_cases hsx : UniqueDiffWithinAt 𝕜 s x
· exact (hc.hasDerivWithinAt.clm_comp hd.hasDerivWithinAt).derivWithin hsx
· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]