doc-next-gen

Mathlib.Analysis.Calculus.Deriv.Comp

Module docstring

{"# One-dimensional derivatives of compositions of functions

In this file we prove the chain rule for the following cases:

  • HasDerivAt.comp etc: f : π•œ' β†’ π•œ' composed with g : π•œ β†’ π•œ';
  • HasDerivAt.scomp etc: f : π•œ' β†’ E composed with g : π•œ β†’ π•œ';
  • HasFDerivAt.comp_hasDerivAt etc: f : E β†’ F composed with g : π•œ β†’ E;

Here π•œ is the base normed field, E and F are normed spaces over π•œ and π•œ' is an algebra over π•œ (e.g., π•œ'=π•œ or π•œ=ℝ, π•œ'=β„‚).

We also give versions with the of_eq suffix, which require an equality proof instead of definitional equality of the different points used in the composition. These versions are often more flexible to use.

For a more detailed overview of one-dimensional derivatives in mathlib, see the module docstring of analysis/calculus/deriv/basic.

Keywords

derivative, chain rule ","### Derivative of the composition of a vector function and a scalar function

We use scomp in lemmas on composition of vector valued and scalar valued functions, and comp in lemmas on composition of scalar valued functions, in analogy for smul and mul (and also because the comp version with the shorter name will show up much more often in applications). The formula for the derivative involves smul in scomp lemmas, which can be reduced to usual multiplication in comp lemmas. ","### Derivative of the composition of a scalar and vector functions ","### Derivative of the composition of two scalar functions ","### Derivative of the composition of a function between vector spaces and a function on π•œ "}

HasDerivAtFilter.scomp theorem
(hg : HasDerivAtFilter g₁ g₁' (h x) L') (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') : HasDerivAtFilter (g₁ ∘ h) (h' β€’ g₁') x L
Full source
theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter g₁ g₁' (h x) L')
    (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
    HasDerivAtFilter (g₁ ∘ h) (h' β€’ g₁') x L := by
  simpa using ((hg.restrictScalars π•œ).comp x hh hL).hasDerivAtFilter
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions Along Filters
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g₁ : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g₁$ has derivative $g₁'$ at $h(x)$ along filter $L'$, 2. $h$ has derivative $h'$ at $x$ along filter $L$, 3. The function $h$ tends to $L'$ along $L$ (i.e., $\lim_{L} h \in L'$), then the composition $g₁ \circ h$ has derivative $h' \cdot g₁'$ at $x$ along $L$.
HasDerivAtFilter.scomp_of_eq theorem
(hg : HasDerivAtFilter g₁ g₁' y L') (hh : HasDerivAtFilter h h' x L) (hy : y = h x) (hL : Tendsto h L L') : HasDerivAtFilter (g₁ ∘ h) (h' β€’ g₁') x L
Full source
theorem HasDerivAtFilter.scomp_of_eq (hg : HasDerivAtFilter g₁ g₁' y L')
    (hh : HasDerivAtFilter h h' x L) (hy : y = h x) (hL : Tendsto h L L') :
    HasDerivAtFilter (g₁ ∘ h) (h' β€’ g₁') x L := by
  rw [hy] at hg; exact hg.scomp x hh hL
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions Along Filters with Explicit Equality
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g₁ : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g₁$ has derivative $g₁'$ at $y$ along filter $L'$, 2. $h$ has derivative $h'$ at $x$ along filter $L$, 3. $y = h(x)$, 4. The function $h$ tends to $L'$ along $L$ (i.e., $\lim_{L} h \in L'$), then the composition $g₁ \circ h$ has derivative $h' \cdot g₁'$ at $x$ along $L$.
HasDerivWithinAt.scomp_hasDerivAt theorem
(hg : HasDerivWithinAt g₁ g₁' s' (h x)) (hh : HasDerivAt h h' x) (hs : βˆ€ x, h x ∈ s') : HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x
Full source
theorem HasDerivWithinAt.scomp_hasDerivAt (hg : HasDerivWithinAt g₁ g₁' s' (h x))
    (hh : HasDerivAt h h' x) (hs : βˆ€ x, h x ∈ s') : HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x :=
  hg.scomp x hh <| tendsto_inf.2 ⟨hh.continuousAt, tendsto_principal.2 <| Eventually.of_forall hs⟩
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions with Domain Restriction
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g_1$ has derivative $g_1'$ at $h(x)$ within the set $s' \subseteq \mathbb{K}'$, 2. $h$ has derivative $h'$ at $x$, 3. For all $x$, $h(x) \in s'$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$.
HasDerivWithinAt.scomp_hasDerivAt_of_eq theorem
(hg : HasDerivWithinAt g₁ g₁' s' y) (hh : HasDerivAt h h' x) (hs : βˆ€ x, h x ∈ s') (hy : y = h x) : HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x
Full source
theorem HasDerivWithinAt.scomp_hasDerivAt_of_eq (hg : HasDerivWithinAt g₁ g₁' s' y)
    (hh : HasDerivAt h h' x) (hs : βˆ€ x, h x ∈ s') (hy : y = h x) :
    HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x := by
  rw [hy] at hg; exact hg.scomp_hasDerivAt x hh hs
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions with Explicit Equality Condition
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g_1$ has derivative $g_1'$ at $y$ within the set $s' \subseteq \mathbb{K}'$, 2. $h$ has derivative $h'$ at $x$, 3. For all $x$, $h(x) \in s'$, 4. $y = h(x)$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$.
HasDerivWithinAt.scomp theorem
(hg : HasDerivWithinAt g₁ g₁' t' (h x)) (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') : HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x
Full source
nonrec theorem HasDerivWithinAt.scomp (hg : HasDerivWithinAt g₁ g₁' t' (h x))
    (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') :
    HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x :=
  hg.scomp x hh <| hh.continuousWithinAt.tendsto_nhdsWithin hst
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions Within Sets
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g_1$ has derivative $g_1'$ at $h(x)$ within the set $t' \subseteq \mathbb{K}'$, 2. $h$ has derivative $h'$ at $x$ within the set $s \subseteq \mathbb{K}$, 3. $h$ maps $s$ into $t'$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$ within $s$.
HasDerivWithinAt.scomp_of_eq theorem
(hg : HasDerivWithinAt g₁ g₁' t' y) (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') (hy : y = h x) : HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x
Full source
theorem HasDerivWithinAt.scomp_of_eq (hg : HasDerivWithinAt g₁ g₁' t' y)
    (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') (hy : y = h x) :
    HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x := by
  rw [hy] at hg; exact hg.scomp x hh hst
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions Within Sets with Point Equality
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g_1$ has derivative $g_1'$ at $y$ within the set $t' \subseteq \mathbb{K}'$, 2. $h$ has derivative $h'$ at $x$ within the set $s \subseteq \mathbb{K}$, 3. $h$ maps $s$ into $t'$, 4. $y = h(x)$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$ within $s$.
HasDerivAt.scomp theorem
(hg : HasDerivAt g₁ g₁' (h x)) (hh : HasDerivAt h h' x) : HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x
Full source
/-- The chain rule. -/
nonrec theorem HasDerivAt.scomp (hg : HasDerivAt g₁ g₁' (h x)) (hh : HasDerivAt h h' x) :
    HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x :=
  hg.scomp x hh hh.continuousAt
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $\mathbb{K}'$ a normed algebra over $\mathbb{K}$, and $E$ a normed space over $\mathbb{K}$. Given functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $g_1$ has derivative $g_1'$ at $h(x)$, and 2. $h$ has derivative $h'$ at $x$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$.
HasDerivAt.scomp_of_eq theorem
(hg : HasDerivAt g₁ g₁' y) (hh : HasDerivAt h h' x) (hy : y = h x) : HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x
Full source
/-- The chain rule. -/
theorem HasDerivAt.scomp_of_eq
    (hg : HasDerivAt g₁ g₁' y) (hh : HasDerivAt h h' x) (hy : y = h x) :
    HasDerivAt (g₁ ∘ h) (h' β€’ g₁') x := by
  rw [hy] at hg; exact hg.scomp x hh
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions with Point Equality
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $\mathbb{K}'$ a normed algebra over $\mathbb{K}$, and $E$ a normed space over $\mathbb{K}$. Given functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $g_1$ has derivative $g_1'$ at $y$, and 2. $h$ has derivative $h'$ at $x$, with $y = h(x)$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$.
HasStrictDerivAt.scomp theorem
(hg : HasStrictDerivAt g₁ g₁' (h x)) (hh : HasStrictDerivAt h h' x) : HasStrictDerivAt (g₁ ∘ h) (h' β€’ g₁') x
Full source
theorem HasStrictDerivAt.scomp (hg : HasStrictDerivAt g₁ g₁' (h x)) (hh : HasStrictDerivAt h h' x) :
    HasStrictDerivAt (g₁ ∘ h) (h' β€’ g₁') x := by
  simpa using ((hg.restrictScalars π•œ).comp x hh).hasStrictDerivAt
Chain Rule for Strict Derivatives of Vector-Scalar Function Composition
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $\mathbb{K}'$ a normed algebra over $\mathbb{K}$, and $E$ a normed space over $\mathbb{K}$. Given functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$, if $g_1$ has strict derivative $g_1'$ at $h(x)$ and $h$ has strict derivative $h'$ at $x$, then the composition $g_1 \circ h$ has strict derivative $h' \cdot g_1'$ at $x$.
HasStrictDerivAt.scomp_of_eq theorem
(hg : HasStrictDerivAt g₁ g₁' y) (hh : HasStrictDerivAt h h' x) (hy : y = h x) : HasStrictDerivAt (g₁ ∘ h) (h' β€’ g₁') x
Full source
theorem HasStrictDerivAt.scomp_of_eq
    (hg : HasStrictDerivAt g₁ g₁' y) (hh : HasStrictDerivAt h h' x) (hy : y = h x) :
    HasStrictDerivAt (g₁ ∘ h) (h' β€’ g₁') x := by
  rw [hy] at hg; exact hg.scomp x hh
Chain Rule for Strict Derivatives of Vector-Scalar Function Composition with Point Equality
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $\mathbb{K}'$ a normed algebra over $\mathbb{K}$, and $E$ a normed space over $\mathbb{K}$. Given functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$, if $g_1$ has strict derivative $g_1'$ at $y$ and $h$ has strict derivative $h'$ at $x$, with $y = h(x)$, then the composition $g_1 \circ h$ has strict derivative $h' \cdot g_1'$ at $x$.
HasDerivAt.scomp_hasDerivWithinAt theorem
(hg : HasDerivAt g₁ g₁' (h x)) (hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x
Full source
theorem HasDerivAt.scomp_hasDerivWithinAt (hg : HasDerivAt g₁ g₁' (h x))
    (hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x :=
  HasDerivWithinAt.scomp x hg.hasDerivWithinAt hh (mapsTo_univ _ _)
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions with Restricted Differentiability
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g_1$ has derivative $g_1'$ at $h(x)$, 2. $h$ has derivative $h'$ at $x$ within the set $s \subseteq \mathbb{K}$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$ within $s$.
HasDerivAt.scomp_hasDerivWithinAt_of_eq theorem
(hg : HasDerivAt g₁ g₁' y) (hh : HasDerivWithinAt h h' s x) (hy : y = h x) : HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x
Full source
theorem HasDerivAt.scomp_hasDerivWithinAt_of_eq (hg : HasDerivAt g₁ g₁' y)
    (hh : HasDerivWithinAt h h' s x) (hy : y = h x) :
    HasDerivWithinAt (g₁ ∘ h) (h' β€’ g₁') s x := by
  rw [hy] at hg; exact hg.scomp_hasDerivWithinAt x hh
Chain Rule for Composition with Point Equality: $\text{derivWithin}\, (g_1 \circ h)\, s\, x = h' \cdot g_1'$ when $y = h(x)$
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Consider functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g_1$ has derivative $g_1'$ at $y$, 2. $h$ has derivative $h'$ at $x$ within the set $s \subseteq \mathbb{K}$, 3. $y = h(x)$, then the composition $g_1 \circ h$ has derivative $h' \cdot g_1'$ at $x$ within $s$.
derivWithin.scomp theorem
(hg : DifferentiableWithinAt π•œ' g₁ t' (h x)) (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s t') : derivWithin (g₁ ∘ h) s x = derivWithin h s x β€’ derivWithin g₁ t' (h x)
Full source
theorem derivWithin.scomp (hg : DifferentiableWithinAt π•œ' g₁ t' (h x))
    (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s t') :
    derivWithin (g₁ ∘ h) s x = derivWithin h s x β€’ derivWithin g₁ t' (h x) := by
  by_cases hsx : UniqueDiffWithinAt π•œ s x
  Β· exact (HasDerivWithinAt.scomp x hg.hasDerivWithinAt hh.hasDerivWithinAt hs).derivWithin hsx
  Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
Chain Rule for Differentiable Composition Within Sets: $\text{derivWithin}\, (g \circ h)\, s\, x = (\text{derivWithin}\, h\, s\, x) \cdot (\text{derivWithin}\, g\, t'\, (h x))$
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Consider functions $g_1 : \mathbb{K}' \to E$ (where $E$ is a normed space over $\mathbb{K}$) and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $g_1$ is differentiable at $h(x)$ within $t' \subseteq \mathbb{K}'$, 2. $h$ is differentiable at $x$ within $s \subseteq \mathbb{K}$, 3. $h$ maps $s$ into $t'$, then the derivative of the composition $g_1 \circ h$ at $x$ within $s$ is given by: \[ \text{derivWithin}\, (g_1 \circ h)\, s\, x = (\text{derivWithin}\, h\, s\, x) \cdot (\text{derivWithin}\, g_1\, t'\, (h x)) \]
derivWithin.scomp_of_eq theorem
(hg : DifferentiableWithinAt π•œ' g₁ t' y) (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s t') (hy : y = h x) : derivWithin (g₁ ∘ h) s x = derivWithin h s x β€’ derivWithin g₁ t' (h x)
Full source
theorem derivWithin.scomp_of_eq (hg : DifferentiableWithinAt π•œ' g₁ t' y)
    (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s t')
    (hy : y = h x) :
    derivWithin (g₁ ∘ h) s x = derivWithin h s x β€’ derivWithin g₁ t' (h x) := by
  rw [hy] at hg; exact derivWithin.scomp x hg hh hs
Chain Rule for Differentiable Composition Within Sets with Equality Condition
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ a normed algebra over $\mathbb{K}$, and let $E$ be a normed space over $\mathbb{K}$. Given functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$, suppose: 1. $g_1$ is differentiable at $y$ within $t' \subseteq \mathbb{K}'$, 2. $h$ is differentiable at $x$ within $s \subseteq \mathbb{K}$, 3. $h$ maps $s$ into $t'$, 4. $y = h(x)$. Then the derivative of the composition $g_1 \circ h$ at $x$ within $s$ is given by: \[ \text{derivWithin}\, (g_1 \circ h)\, s\, x = (\text{derivWithin}\, h\, s\, x) \cdot (\text{derivWithin}\, g_1\, t'\, y). \]
deriv.scomp theorem
(hg : DifferentiableAt π•œ' g₁ (h x)) (hh : DifferentiableAt π•œ h x) : deriv (g₁ ∘ h) x = deriv h x β€’ deriv g₁ (h x)
Full source
theorem deriv.scomp (hg : DifferentiableAt π•œ' g₁ (h x)) (hh : DifferentiableAt π•œ h x) :
    deriv (g₁ ∘ h) x = deriv h x β€’ deriv g₁ (h x) :=
  (HasDerivAt.scomp x hg.hasDerivAt hh.hasDerivAt).deriv
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $\mathbb{K}'$ a normed algebra over $\mathbb{K}$, and $E$ a normed space over $\mathbb{K}$. Given functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $g_1$ is differentiable at $h(x)$, and 2. $h$ is differentiable at $x$, then the derivative of the composition $g_1 \circ h$ at $x$ is given by: $$ \text{deriv}(g_1 \circ h)(x) = \text{deriv} h(x) \cdot \text{deriv} g_1(h(x)) $$
deriv.scomp_of_eq theorem
(hg : DifferentiableAt π•œ' g₁ y) (hh : DifferentiableAt π•œ h x) (hy : y = h x) : deriv (g₁ ∘ h) x = deriv h x β€’ deriv g₁ (h x)
Full source
theorem deriv.scomp_of_eq
    (hg : DifferentiableAt π•œ' g₁ y) (hh : DifferentiableAt π•œ h x) (hy : y = h x) :
    deriv (g₁ ∘ h) x = deriv h x β€’ deriv g₁ (h x) := by
  rw [hy] at hg; exact deriv.scomp x hg hh
Chain Rule for Composition of Vector-Valued and Scalar-Valued Functions with Point Equality
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $\mathbb{K}'$ a normed algebra over $\mathbb{K}$, and $E$ a normed space over $\mathbb{K}$. Given functions $g_1 : \mathbb{K}' \to E$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $g_1$ is differentiable at $y \in \mathbb{K}'$, 2. $h$ is differentiable at $x \in \mathbb{K}$, and 3. $y = h(x)$, then the derivative of the composition $g_1 \circ h$ at $x$ is given by: $$ \text{deriv}(g_1 \circ h)(x) = \text{deriv} h(x) \cdot \text{deriv} g_1(h(x)) $$
HasDerivAtFilter.comp_hasFDerivAtFilter theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) {L'' : Filter E} (hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' (f x) L') (hf : HasFDerivAtFilter f f' x L'') (hL : Tendsto f L'' L') : HasFDerivAtFilter (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x L''
Full source
theorem HasDerivAtFilter.comp_hasFDerivAtFilter {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) {L'' : Filter E}
    (hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' (f x) L') (hf : HasFDerivAtFilter f f' x L'')
    (hL : Tendsto f L'' L') : HasFDerivAtFilter (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x L'' := by
  convert (hhβ‚‚.restrictScalars π•œ).comp x hf hL
  ext x
  simp [mul_comm]
Chain Rule for Composition of Scalar and Vector Functions Along Filters
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Consider functions $f : E \to \mathbb{K}'$ and $h_2 : \mathbb{K}' \to \mathbb{K}'$. Suppose that at a point $x \in E$, the function $f$ has a FrΓ©chet derivative $f' : E \to \mathbb{K}'$ along a filter $L''$ on $E$, and $h_2$ has a derivative $h_2' \in \mathbb{K}'$ at $f(x)$ along a filter $L'$ on $\mathbb{K}'$. If $f$ tends to $f(x)$ along $L''$ with respect to $L'$, then the composition $h_2 \circ f$ has a FrΓ©chet derivative at $x$ along $L''$ given by the scalar multiplication $h_2' \cdot f'$.
HasDerivAtFilter.comp_hasFDerivAtFilter_of_eq theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) {L'' : Filter E} (hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' y L') (hf : HasFDerivAtFilter f f' x L'') (hL : Tendsto f L'' L') (hy : y = f x) : HasFDerivAtFilter (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x L''
Full source
theorem HasDerivAtFilter.comp_hasFDerivAtFilter_of_eq
    {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) {L'' : Filter E}
    (hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' y L') (hf : HasFDerivAtFilter f f' x L'')
    (hL : Tendsto f L'' L') (hy : y = f x) : HasFDerivAtFilter (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x L'' := by
  rw [hy] at hhβ‚‚; exact hhβ‚‚.comp_hasFDerivAtFilter x hf hL
Chain Rule for Composition of Scalar and Vector Functions Along Filters with Point Equality
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Consider functions $f : E \to \mathbb{K}'$ and $h_2 : \mathbb{K}' \to \mathbb{K}'$. Suppose that at a point $x \in E$, the function $f$ has a FrΓ©chet derivative $f' : E \to \mathbb{K}'$ along a filter $L''$ on $E$, and $h_2$ has a derivative $h_2' \in \mathbb{K}'$ at a point $y$ along a filter $L'$ on $\mathbb{K}'$. If $f$ tends to $y$ along $L''$ with respect to $L'$ and $y = f(x)$, then the composition $h_2 \circ f$ has a FrΓ©chet derivative at $x$ along $L''$ given by the scalar multiplication $h_2' \cdot f'$.
HasStrictDerivAt.comp_hasStrictFDerivAt theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) (hh : HasStrictDerivAt hβ‚‚ hβ‚‚' (f x)) (hf : HasStrictFDerivAt f f' x) : HasStrictFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x
Full source
theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x)
    (hh : HasStrictDerivAt hβ‚‚ hβ‚‚' (f x)) (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x := by
  rw [HasStrictDerivAt] at hh
  convert (hh.restrictScalars π•œ).comp x hf
  ext x
  simp [mul_comm]
Strict Chain Rule for Composition of Scalar and Vector Functions
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Let $f : E \to \mathbb{K}'$ be a function with strict FrΓ©chet derivative $f' : E \to L(E, \mathbb{K}')$ at a point $x \in E$, and let $h_2 : \mathbb{K}' \to \mathbb{K}'$ be a function with strict derivative $h_2' \in \mathbb{K}'$ at $f(x)$. Then the composition $h_2 \circ f : E \to \mathbb{K}'$ has strict FrΓ©chet derivative $h_2' \cdot f'$ at $x$.
HasStrictDerivAt.comp_hasStrictFDerivAt_of_eq theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) (hh : HasStrictDerivAt hβ‚‚ hβ‚‚' y) (hf : HasStrictFDerivAt f f' x) (hy : y = f x) : HasStrictFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x
Full source
theorem HasStrictDerivAt.comp_hasStrictFDerivAt_of_eq {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x)
    (hh : HasStrictDerivAt hβ‚‚ hβ‚‚' y) (hf : HasStrictFDerivAt f f' x) (hy : y = f x) :
    HasStrictFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x := by
  rw [hy] at hh; exact hh.comp_hasStrictFDerivAt x hf
Strict Chain Rule for Composition of Scalar and Vector Functions with Point Equality
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Let $f : E \to \mathbb{K}'$ be a function with strict FrΓ©chet derivative $f' : E \to L(E, \mathbb{K}')$ at a point $x \in E$, and let $h_2 : \mathbb{K}' \to \mathbb{K}'$ be a function with strict derivative $h_2' \in \mathbb{K}'$ at $y \in \mathbb{K}'$. If $y = f(x)$, then the composition $h_2 \circ f : E \to \mathbb{K}'$ has strict FrΓ©chet derivative $h_2' \cdot f'$ at $x$.
HasDerivAt.comp_hasFDerivAt theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) (hh : HasDerivAt hβ‚‚ hβ‚‚' (f x)) (hf : HasFDerivAt f f' x) : HasFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x
Full source
theorem HasDerivAt.comp_hasFDerivAt {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x)
    (hh : HasDerivAt hβ‚‚ hβ‚‚' (f x)) (hf : HasFDerivAt f f' x) : HasFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x :=
  hh.comp_hasFDerivAtFilter x hf hf.continuousAt
Chain Rule for Composition of Scalar and Vector Functions
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Suppose $f : E \to \mathbb{K}'$ has a FrΓ©chet derivative $f' : E \to \mathbb{K}'$ at a point $x \in E$, and $h_2 : \mathbb{K}' \to \mathbb{K}'$ has a derivative $h_2' \in \mathbb{K}'$ at $f(x)$. Then the composition $h_2 \circ f : E \to \mathbb{K}'$ has a FrΓ©chet derivative at $x$ given by $h_2' \cdot f'$.
HasDerivAt.comp_hasFDerivAt_of_eq theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x) (hh : HasDerivAt hβ‚‚ hβ‚‚' y) (hf : HasFDerivAt f f' x) (hy : y = f x) : HasFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x
Full source
theorem HasDerivAt.comp_hasFDerivAt_of_eq {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} (x)
    (hh : HasDerivAt hβ‚‚ hβ‚‚' y) (hf : HasFDerivAt f f' x) (hy : y = f x) :
    HasFDerivAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') x := by
  rw [hy] at hh; exact hh.comp_hasFDerivAt x hf
Chain Rule for Composition of Scalar and Vector Functions with Point Equality
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Consider functions $f : E \to \mathbb{K}'$ and $h_2 : \mathbb{K}' \to \mathbb{K}'$. If $h_2$ has derivative $h_2' \in \mathbb{K}'$ at a point $y \in \mathbb{K}'$, and $f$ has FrΓ©chet derivative $f' : E \to \mathbb{K}'$ at a point $x \in E$, with $y = f(x)$, then the composition $h_2 \circ f$ has FrΓ©chet derivative $h_2' \cdot f'$ at $x$.
HasDerivAt.comp_hasFDerivWithinAt theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s} (x) (hh : HasDerivAt hβ‚‚ hβ‚‚' (f x)) (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x
Full source
theorem HasDerivAt.comp_hasFDerivWithinAt {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s} (x)
    (hh : HasDerivAt hβ‚‚ hβ‚‚' (f x)) (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x :=
  hh.comp_hasFDerivAtFilter x hf hf.continuousWithinAt
Chain Rule for Composition of Scalar and Vector Functions Within a Set
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Consider functions $f : E \to \mathbb{K}'$ and $h_2 : \mathbb{K}' \to \mathbb{K}'$. If $h_2$ has derivative $h_2' \in \mathbb{K}'$ at $f(x)$, and $f$ has FrΓ©chet derivative $f' : E \to \mathbb{K}'$ at $x$ within a set $s \subseteq E$, then the composition $h_2 \circ f$ has FrΓ©chet derivative $h_2' \cdot f'$ at $x$ within $s$.
HasDerivAt.comp_hasFDerivWithinAt_of_eq theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s} (x) (hh : HasDerivAt hβ‚‚ hβ‚‚' y) (hf : HasFDerivWithinAt f f' s x) (hy : y = f x) : HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x
Full source
theorem HasDerivAt.comp_hasFDerivWithinAt_of_eq {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s} (x)
    (hh : HasDerivAt hβ‚‚ hβ‚‚' y) (hf : HasFDerivWithinAt f f' s x) (hy : y = f x) :
    HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x := by
  rw [hy] at hh; exact hh.comp_hasFDerivWithinAt x hf
Chain Rule for Composition of Scalar and Vector Functions Within a Set (Equality Version)
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Consider functions $f : E \to \mathbb{K}'$ and $h_2 : \mathbb{K}' \to \mathbb{K}'$. If: 1. $h_2$ has derivative $h_2' \in \mathbb{K}'$ at a point $y \in \mathbb{K}'$, 2. $f$ has FrΓ©chet derivative $f' : E \to \mathbb{K}'$ at $x \in E$ within a set $s \subseteq E$, 3. $y = f(x)$, then the composition $h_2 \circ f$ has FrΓ©chet derivative $h_2' \cdot f'$ at $x$ within $s$.
HasDerivWithinAt.comp_hasFDerivWithinAt theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s t} (x) (hh : HasDerivWithinAt hβ‚‚ hβ‚‚' t (f x)) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t) : HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x
Full source
theorem HasDerivWithinAt.comp_hasFDerivWithinAt {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s t} (x)
    (hh : HasDerivWithinAt hβ‚‚ hβ‚‚' t (f x)) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t) :
    HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x :=
  hh.comp_hasFDerivAtFilter x hf <| hf.continuousWithinAt.tendsto_nhdsWithin hst
Chain Rule for Composition of Vector and Scalar Functions Within Sets
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and $\mathbb{K}'$ a normed algebra over $\mathbb{K}$. Consider functions $f : E \to \mathbb{K}'$ and $h_2 : \mathbb{K}' \to \mathbb{K}'$. Suppose that at a point $x \in E$: 1. $h_2$ has derivative $h_2'$ within a set $t \subseteq \mathbb{K}'$ at $f(x)$, 2. $f$ has FrΓ©chet derivative $f'$ within a set $s \subseteq E$ at $x$, 3. $f$ maps $s$ into $t$. Then the composition $h_2 \circ f$ has FrΓ©chet derivative $h_2' \cdot f'$ within $s$ at $x$.
HasDerivWithinAt.comp_hasFDerivWithinAt_of_eq theorem
{f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s t} (x) (hh : HasDerivWithinAt hβ‚‚ hβ‚‚' t y) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) : HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x
Full source
theorem HasDerivWithinAt.comp_hasFDerivWithinAt_of_eq {f : E β†’ π•œ'} {f' : E β†’L[π•œ] π•œ'} {s t} (x)
    (hh : HasDerivWithinAt hβ‚‚ hβ‚‚' t y) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t)
    (hy : y = f x) :
    HasFDerivWithinAt (hβ‚‚ ∘ f) (hβ‚‚' β€’ f') s x := by
  rw [hy] at hh; exact hh.comp_hasFDerivWithinAt x hf hst
Chain Rule for Composition of Scalar and Vector Functions Within Sets (Equality Version)
Informal description
Let $E$ be a normed space over a normed field $\mathbb{K}$, and let $\mathbb{K}'$ be a normed algebra over $\mathbb{K}$. Consider functions $f : E \to \mathbb{K}'$ and $h_2 : \mathbb{K}' \to \mathbb{K}'$. If: 1. $h_2$ has derivative $h_2'$ within a set $t \subseteq \mathbb{K}'$ at a point $y \in \mathbb{K}'$, 2. $f$ has FrΓ©chet derivative $f'$ within a set $s \subseteq E$ at a point $x \in E$, 3. $f$ maps $s$ into $t$, 4. $y = f(x)$, then the composition $h_2 \circ f$ has FrΓ©chet derivative $h_2' \cdot f'$ at $x$ within $s$.
HasDerivAtFilter.comp theorem
(hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' (h x) L') (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') : HasDerivAtFilter (hβ‚‚ ∘ h) (hβ‚‚' * h') x L
Full source
theorem HasDerivAtFilter.comp (hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' (h x) L')
    (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
    HasDerivAtFilter (hβ‚‚ ∘ h) (hβ‚‚' * h') x L := by
  rw [mul_comm]
  exact hhβ‚‚.scomp x hh hL
Chain Rule for Composition of Scalar-Valued Functions Along Filters
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Consider functions $hβ‚‚ : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $hβ‚‚$ has derivative $hβ‚‚'$ at $h(x)$ along filter $L'$, 2. $h$ has derivative $h'$ at $x$ along filter $L$, 3. The function $h$ tends to $L'$ along $L$ (i.e., $\lim_{L} h \in L'$), then the composition $hβ‚‚ \circ h$ has derivative $hβ‚‚' \cdot h'$ at $x$ along $L$.
HasDerivAtFilter.comp_of_eq theorem
(hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' y L') (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') (hy : y = h x) : HasDerivAtFilter (hβ‚‚ ∘ h) (hβ‚‚' * h') x L
Full source
theorem HasDerivAtFilter.comp_of_eq (hhβ‚‚ : HasDerivAtFilter hβ‚‚ hβ‚‚' y L')
    (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') (hy : y = h x) :
    HasDerivAtFilter (hβ‚‚ ∘ h) (hβ‚‚' * h') x L := by
  rw [hy] at hhβ‚‚; exact hhβ‚‚.comp x hh hL
Chain Rule for Composition of Scalar-Valued Functions Along Filters with Explicit Point Equality
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Consider functions $hβ‚‚ : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $hβ‚‚$ has derivative $hβ‚‚'$ at $y$ along filter $L'$, 2. $h$ has derivative $h'$ at $x$ along filter $L$, 3. The function $h$ tends to $L'$ along $L$ (i.e., $\lim_{L} h \in L'$), 4. $y = h(x)$, then the composition $hβ‚‚ \circ h$ has derivative $hβ‚‚' \cdot h'$ at $x$ along $L$.
HasDerivWithinAt.comp theorem
(hhβ‚‚ : HasDerivWithinAt hβ‚‚ hβ‚‚' s' (h x)) (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') : HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x
Full source
theorem HasDerivWithinAt.comp (hhβ‚‚ : HasDerivWithinAt hβ‚‚ hβ‚‚' s' (h x))
    (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') :
    HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x := by
  rw [mul_comm]
  exact hhβ‚‚.scomp x hh hst
Chain Rule for Composition of Scalar-Valued Functions Within Sets
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Consider functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$. If: 1. $h_2$ has derivative $h_2'$ at $h(x)$ within the set $s' \subseteq \mathbb{K}'$, 2. $h$ has derivative $h'$ at $x$ within the set $s \subseteq \mathbb{K}$, 3. $h$ maps $s$ into $s'$, then the composition $h_2 \circ h$ has derivative $h_2' \cdot h'$ at $x$ within $s$.
HasDerivWithinAt.comp_of_eq theorem
(hhβ‚‚ : HasDerivWithinAt hβ‚‚ hβ‚‚' s' y) (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') (hy : y = h x) : HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x
Full source
theorem HasDerivWithinAt.comp_of_eq (hhβ‚‚ : HasDerivWithinAt hβ‚‚ hβ‚‚' s' y)
    (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') (hy : y = h x) :
    HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x := by
  rw [hy] at hhβ‚‚; exact hhβ‚‚.comp x hh hst
Chain Rule for Composition of Scalar-Valued Functions Within Sets with Point Equality
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Consider functions $f : \mathbb{K}' \to \mathbb{K}'$ and $g : \mathbb{K} \to \mathbb{K}'$. If: 1. $f$ has derivative $f'$ at $y$ within the set $s' \subseteq \mathbb{K}'$, 2. $g$ has derivative $g'$ at $x$ within the set $s \subseteq \mathbb{K}$, 3. $g$ maps $s$ into $s'$, 4. $y = g(x)$, then the composition $f \circ g$ has derivative $f' \cdot g'$ at $x$ within $s$.
HasDerivAt.comp theorem
(hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' (h x)) (hh : HasDerivAt h h' x) : HasDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x
Full source
/-- The chain rule.

Note that the function `hβ‚‚` is a function on an algebra. If you are looking for the chain rule
with `hβ‚‚` taking values in a vector space, use `HasDerivAt.scomp`. -/
nonrec theorem HasDerivAt.comp (hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' (h x)) (hh : HasDerivAt h h' x) :
    HasDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x :=
  hhβ‚‚.comp x hh hh.continuousAt
Chain Rule for Derivatives of Scalar Function Compositions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field and $\mathbb{K}'$ a normed algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $h_2$ has derivative $h_2'$ at $h(x)$, and 2. $h$ has derivative $h'$ at $x$, then the composition $h_2 \circ h$ has derivative $h_2' \cdot h'$ at $x$.
HasDerivAt.comp_of_eq theorem
(hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' y) (hh : HasDerivAt h h' x) (hy : y = h x) : HasDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x
Full source
/-- The chain rule.

Note that the function `hβ‚‚` is a function on an algebra. If you are looking for the chain rule
with `hβ‚‚` taking values in a vector space, use `HasDerivAt.scomp_of_eq`. -/
theorem HasDerivAt.comp_of_eq
    (hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' y) (hh : HasDerivAt h h' x) (hy : y = h x) :
    HasDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x := by
  rw [hy] at hhβ‚‚; exact hhβ‚‚.comp x hh
Chain Rule for Derivatives with Point Equality
Informal description
Let $\mathbb{K}$ be a nontrivially normed field and $\mathbb{K}'$ a normed algebra over $\mathbb{K}$. Given functions $f : \mathbb{K}' \to \mathbb{K}'$ and $g : \mathbb{K} \to \mathbb{K}'$, suppose: 1. $f$ has derivative $f'$ at $y$, 2. $g$ has derivative $g'$ at $x$, 3. $y = g(x)$. Then the composition $f \circ g$ has derivative $f' \cdot g'$ at $x$.
HasStrictDerivAt.comp theorem
(hhβ‚‚ : HasStrictDerivAt hβ‚‚ hβ‚‚' (h x)) (hh : HasStrictDerivAt h h' x) : HasStrictDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x
Full source
theorem HasStrictDerivAt.comp (hhβ‚‚ : HasStrictDerivAt hβ‚‚ hβ‚‚' (h x)) (hh : HasStrictDerivAt h h' x) :
    HasStrictDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x := by
  rw [mul_comm]
  exact hhβ‚‚.scomp x hh
Chain Rule for Strict Derivatives of Scalar Function Compositions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field and $\mathbb{K}'$ a normed algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$, if $h_2$ has strict derivative $h_2'$ at $h(x)$ and $h$ has strict derivative $h'$ at $x$, then the composition $h_2 \circ h$ has strict derivative $h_2' \cdot h'$ at $x$.
HasStrictDerivAt.comp_of_eq theorem
(hhβ‚‚ : HasStrictDerivAt hβ‚‚ hβ‚‚' y) (hh : HasStrictDerivAt h h' x) (hy : y = h x) : HasStrictDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x
Full source
theorem HasStrictDerivAt.comp_of_eq
    (hhβ‚‚ : HasStrictDerivAt hβ‚‚ hβ‚‚' y) (hh : HasStrictDerivAt h h' x) (hy : y = h x) :
    HasStrictDerivAt (hβ‚‚ ∘ h) (hβ‚‚' * h') x := by
  rw [hy] at hhβ‚‚; exact hhβ‚‚.comp x hh
Chain Rule for Strict Derivatives with Point Equality
Informal description
Let $\mathbb{K}$ be a nontrivially normed field and $\mathbb{K}'$ a normed algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$, suppose: 1. $h_2$ has strict derivative $h_2'$ at $y$, 2. $h$ has strict derivative $h'$ at $x$, 3. $y = h(x)$. Then the composition $h_2 \circ h$ has strict derivative $h_2' \cdot h'$ at $x$.
HasDerivAt.comp_hasDerivWithinAt theorem
(hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' (h x)) (hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x
Full source
theorem HasDerivAt.comp_hasDerivWithinAt (hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' (h x))
    (hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x :=
  hhβ‚‚.hasDerivWithinAt.comp x hh (mapsTo_univ _ _)
Chain Rule for Composition of Scalar-Valued Functions with Differentiability Within a Set
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $h_2$ has derivative $h_2'$ at $h(x)$, and 2. $h$ has derivative $h'$ at $x$ within the set $s \subseteq \mathbb{K}$, then the composition $h_2 \circ h$ has derivative $h_2' \cdot h'$ at $x$ within $s$.
HasDerivAt.comp_hasDerivWithinAt_of_eq theorem
(hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' y) (hh : HasDerivWithinAt h h' s x) (hy : y = h x) : HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x
Full source
theorem HasDerivAt.comp_hasDerivWithinAt_of_eq (hhβ‚‚ : HasDerivAt hβ‚‚ hβ‚‚' y)
    (hh : HasDerivWithinAt h h' s x) (hy : y = h x) :
    HasDerivWithinAt (hβ‚‚ ∘ h) (hβ‚‚' * h') s x := by
  rw [hy] at hhβ‚‚; exact hhβ‚‚.comp_hasDerivWithinAt x hh
Chain Rule for Composition with Point Equality
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$, suppose: 1. $h_2$ has derivative $h_2'$ at $y$, 2. $h$ has derivative $h'$ at $x$ within the set $s \subseteq \mathbb{K}$, 3. $y = h(x)$. Then the composition $h_2 \circ h$ has derivative $h_2' \cdot h'$ at $x$ within $s$.
derivWithin_comp theorem
(hhβ‚‚ : DifferentiableWithinAt π•œ' hβ‚‚ s' (h x)) (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s s') : derivWithin (hβ‚‚ ∘ h) s x = derivWithin hβ‚‚ s' (h x) * derivWithin h s x
Full source
theorem derivWithin_comp (hhβ‚‚ : DifferentiableWithinAt π•œ' hβ‚‚ s' (h x))
    (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s s') :
    derivWithin (hβ‚‚ ∘ h) s x = derivWithin hβ‚‚ s' (h x) * derivWithin h s x := by
  by_cases hsx : UniqueDiffWithinAt π•œ s x
  Β· exact (hhβ‚‚.hasDerivWithinAt.comp x hh.hasDerivWithinAt hs).derivWithin hsx
  Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
Chain Rule for Differentiable Compositions Within Sets
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $h_2$ is differentiable at $h(x)$ within $s' \subseteq \mathbb{K}'$, 2. $h$ is differentiable at $x$ within $s \subseteq \mathbb{K}$, 3. $h$ maps $s$ into $s'$, then the derivative of the composition $h_2 \circ h$ at $x$ within $s$ satisfies: \[ \frac{d}{dx}\Big|_{s} (h_2 \circ h)(x) = \left(\frac{d}{dy}\Big|_{s'} h_2(y)\right)\Big|_{y=h(x)} \cdot \frac{d}{dx}\Big|_{s} h(x). \]
derivWithin_comp_of_eq theorem
(hhβ‚‚ : DifferentiableWithinAt π•œ' hβ‚‚ s' y) (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s s') (hy : h x = y) : derivWithin (hβ‚‚ ∘ h) s x = derivWithin hβ‚‚ s' (h x) * derivWithin h s x
Full source
theorem derivWithin_comp_of_eq (hhβ‚‚ : DifferentiableWithinAt π•œ' hβ‚‚ s' y)
    (hh : DifferentiableWithinAt π•œ h s x) (hs : MapsTo h s s')
    (hy : h x = y) :
    derivWithin (hβ‚‚ ∘ h) s x = derivWithin hβ‚‚ s' (h x) * derivWithin h s x := by
  subst hy; exact derivWithin_comp x hhβ‚‚ hh hs
Chain Rule for Differentiable Compositions Within Sets with Point Equality
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be normed fields with $\mathbb{K}'$ being an algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ and $h : \mathbb{K} \to \mathbb{K}'$, if: 1. $h_2$ is differentiable at $y$ within $s' \subseteq \mathbb{K}'$, 2. $h$ is differentiable at $x$ within $s \subseteq \mathbb{K}$, 3. $h$ maps $s$ into $s'$, 4. $h(x) = y$, then the derivative of the composition $h_2 \circ h$ at $x$ within $s$ satisfies: \[ \frac{d}{dx}\Big|_{s} (h_2 \circ h)(x) = \left(\frac{d}{dy}\Big|_{s'} h_2(y)\right) \cdot \frac{d}{dx}\Big|_{s} h(x). \]
deriv_comp theorem
(hhβ‚‚ : DifferentiableAt π•œ' hβ‚‚ (h x)) (hh : DifferentiableAt π•œ h x) : deriv (hβ‚‚ ∘ h) x = deriv hβ‚‚ (h x) * deriv h x
Full source
theorem deriv_comp (hhβ‚‚ : DifferentiableAt π•œ' hβ‚‚ (h x)) (hh : DifferentiableAt π•œ h x) :
    deriv (hβ‚‚ ∘ h) x = deriv hβ‚‚ (h x) * deriv h x :=
  (hhβ‚‚.hasDerivAt.comp x hh.hasDerivAt).deriv
Chain Rule for Differentiable Scalar Function Compositions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field and $\mathbb{K}'$ a normed algebra over $\mathbb{K}$. Given differentiable functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ at $h(x)$ and $h : \mathbb{K} \to \mathbb{K}'$ at $x$, the derivative of their composition $h_2 \circ h$ at $x$ satisfies: \[ \frac{d}{dx}(h_2 \circ h)(x) = h_2'(h(x)) \cdot h'(x) \] where $h_2'$ and $h'$ are the derivatives of $h_2$ and $h$ respectively.
deriv_comp_of_eq theorem
(hhβ‚‚ : DifferentiableAt π•œ' hβ‚‚ y) (hh : DifferentiableAt π•œ h x) (hy : h x = y) : deriv (hβ‚‚ ∘ h) x = deriv hβ‚‚ (h x) * deriv h x
Full source
theorem deriv_comp_of_eq (hhβ‚‚ : DifferentiableAt π•œ' hβ‚‚ y) (hh : DifferentiableAt π•œ h x)
    (hy : h x = y) :
    deriv (hβ‚‚ ∘ h) x = deriv hβ‚‚ (h x) * deriv h x := by
  subst hy; exact deriv_comp x hhβ‚‚ hh
Chain Rule for Differentiable Compositions with Point Equality
Informal description
Let $\mathbb{K}$ be a nontrivially normed field and $\mathbb{K}'$ a normed algebra over $\mathbb{K}$. Given functions $h_2 : \mathbb{K}' \to \mathbb{K}'$ differentiable at $y$ and $h : \mathbb{K} \to \mathbb{K}'$ differentiable at $x$, with $h(x) = y$, the derivative of their composition satisfies: \[ \frac{d}{dx}(h_2 \circ h)(x) = h_2'(y) \cdot h'(x) \] where $h_2'$ and $h'$ are the derivatives of $h_2$ and $h$ respectively.
HasDerivAtFilter.iterate theorem
{f : π•œ β†’ π•œ} {f' : π•œ} (hf : HasDerivAtFilter f f' x L) (hL : Tendsto f L L) (hx : f x = x) (n : β„•) : HasDerivAtFilter f^[n] (f' ^ n) x L
Full source
protected nonrec theorem HasDerivAtFilter.iterate {f : π•œ β†’ π•œ} {f' : π•œ}
    (hf : HasDerivAtFilter f f' x L) (hL : Tendsto f L L) (hx : f x = x) (n : β„•) :
    HasDerivAtFilter f^[n] (f' ^ n) x L := by
  have := hf.iterate hL hx n
  rwa [ContinuousLinearMap.smulRight_one_pow] at this
Derivative of Iterated Function Along a Filter: $(f^{[n]})' = (f')^n$ at Fixed Point
Informal description
Let $f : \mathbb{K} \to \mathbb{K}$ be a function with derivative $f'$ at $x$ along the filter $L$, and suppose $f$ maps $L$ to itself and $f(x) = x$. Then for any natural number $n$, the $n$-th iterate $f^{[n]}$ has derivative $(f')^n$ at $x$ along $L$.
HasDerivAt.iterate theorem
{f : π•œ β†’ π•œ} {f' : π•œ} (hf : HasDerivAt f f' x) (hx : f x = x) (n : β„•) : HasDerivAt f^[n] (f' ^ n) x
Full source
protected nonrec theorem HasDerivAt.iterate {f : π•œ β†’ π•œ} {f' : π•œ} (hf : HasDerivAt f f' x)
    (hx : f x = x) (n : β„•) : HasDerivAt f^[n] (f' ^ n) x :=
  hf.iterate _ (have := hf.tendsto_nhds le_rfl; by rwa [hx] at this) hx n
Derivative of Iterated Function at Fixed Point: $(f^{[n]})'(x) = (f'(x))^n$
Informal description
Let $f : \mathbb{K} \to \mathbb{K}$ be a function differentiable at $x \in \mathbb{K}$ with derivative $f'$, and suppose $f(x) = x$. Then for any natural number $n$, the $n$-th iterate $f^{[n]}$ is differentiable at $x$ with derivative $(f')^n$.
HasDerivWithinAt.iterate theorem
{f : π•œ β†’ π•œ} {f' : π•œ} (hf : HasDerivWithinAt f f' s x) (hx : f x = x) (hs : MapsTo f s s) (n : β„•) : HasDerivWithinAt f^[n] (f' ^ n) s x
Full source
protected theorem HasDerivWithinAt.iterate {f : π•œ β†’ π•œ} {f' : π•œ} (hf : HasDerivWithinAt f f' s x)
    (hx : f x = x) (hs : MapsTo f s s) (n : β„•) : HasDerivWithinAt f^[n] (f' ^ n) s x := by
  have := HasFDerivWithinAt.iterate hf hx hs n
  rwa [ContinuousLinearMap.smulRight_one_pow] at this
Derivative of the $n$-th iterate of a function at a fixed point within a set
Informal description
Let $f : \mathbb{K} \to \mathbb{K}$ be a function differentiable at $x$ within a set $s \subseteq \mathbb{K}$ with derivative $f'$, and suppose $f(x) = x$ and $f$ maps $s$ into itself. Then for any natural number $n$, the $n$-th iterate $f^{[n]}$ is differentiable at $x$ within $s$ with derivative $(f')^n$.
HasStrictDerivAt.iterate theorem
{f : π•œ β†’ π•œ} {f' : π•œ} (hf : HasStrictDerivAt f f' x) (hx : f x = x) (n : β„•) : HasStrictDerivAt f^[n] (f' ^ n) x
Full source
protected nonrec theorem HasStrictDerivAt.iterate {f : π•œ β†’ π•œ} {f' : π•œ}
    (hf : HasStrictDerivAt f f' x) (hx : f x = x) (n : β„•) :
    HasStrictDerivAt f^[n] (f' ^ n) x := by
  have := hf.iterate hx n
  rwa [ContinuousLinearMap.smulRight_one_pow] at this
Strict derivative of iterated function at fixed point: $(f^{[n]})'(x) = (f'(x))^n$
Informal description
Let $f : \mathbb{K} \to \mathbb{K}$ be a function that has strict derivative $f'$ at point $x$, and suppose $f(x) = x$. Then for any natural number $n$, the $n$-th iterate $f^{[n]}$ has strict derivative $(f')^n$ at $x$.
HasFDerivWithinAt.comp_hasDerivWithinAt theorem
{t : Set F} (hl : HasFDerivWithinAt l l' t (f x)) (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) : HasDerivWithinAt (l ∘ f) (l' f') s x
Full source
/-- The composition `l ∘ f` where `l : F β†’ E` and `f : π•œ β†’ F`, has a derivative within a set
equal to the FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithinAt l l' t (f x))
    (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) :
    HasDerivWithinAt (l ∘ f) (l' f') s x := by
  simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (· ∘ ·)] using
    (hl.comp x hf.hasFDerivWithinAt hst).hasDerivWithinAt
Chain Rule for Composition of FrΓ©chet Differentiable and Scalar Differentiable Functions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $F$ and $E$ be normed spaces over $\mathbb{K}$, $s \subseteq \mathbb{K}$ and $t \subseteq F$ be subsets, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ has derivative $f'$ at $x$ within $s$, 2. $l : F \to E$ has FrΓ©chet derivative $l'$ at $f(x)$ within $t$, 3. $f$ maps $s$ into $t$. Then the composition $l \circ f : \mathbb{K} \to E$ has derivative $l'(f')$ at $x$ within $s$.
HasFDerivWithinAt.comp_hasDerivWithinAt_of_eq theorem
{t : Set F} (hl : HasFDerivWithinAt l l' t y) (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) : HasDerivWithinAt (l ∘ f) (l' f') s x
Full source
/-- The composition `l ∘ f` where `l : F β†’ E` and `f : π•œ β†’ F`, has a derivative within a set
equal to the FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivWithinAt.comp_hasDerivWithinAt_of_eq {t : Set F}
    (hl : HasFDerivWithinAt l l' t y)
    (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) :
    HasDerivWithinAt (l ∘ f) (l' f') s x := by
  rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf hst
Chain Rule for Composition with Point Equality Condition
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $F$ and $E$ be normed spaces over $\mathbb{K}$, $s \subseteq \mathbb{K}$ and $t \subseteq F$ be subsets, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ has derivative $f'$ at $x$ within $s$, 2. $l : F \to E$ has FrΓ©chet derivative $l'$ at $y$ within $t$, 3. $f$ maps $s$ into $t$, 4. $y = f(x)$. Then the composition $l \circ f : \mathbb{K} \to E$ has derivative $l'(f')$ at $x$ within $s$.
HasFDerivAt.comp_hasDerivWithinAt theorem
(hl : HasFDerivAt l l' (f x)) (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l ∘ f) (l' f') s x
Full source
theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x))
    (hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l ∘ f) (l' f') s x :=
  hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf (mapsTo_univ _ _)
Chain Rule for Composition of FrΓ©chet Differentiable and Scalar Differentiable Functions (Within a Subset)
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, $s \subseteq \mathbb{K}$ be a subset, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ has derivative $f'$ at $x$ within $s$, 2. $l : F \to E$ has FrΓ©chet derivative $l'$ at $f(x)$. Then the composition $l \circ f : \mathbb{K} \to E$ has derivative $l'(f')$ at $x$ within $s$.
HasFDerivAt.comp_hasDerivWithinAt_of_eq theorem
(hl : HasFDerivAt l l' y) (hf : HasDerivWithinAt f f' s x) (hy : y = f x) : HasDerivWithinAt (l ∘ f) (l' f') s x
Full source
theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y)
    (hf : HasDerivWithinAt f f' s x) (hy : y = f x) :
    HasDerivWithinAt (l ∘ f) (l' f') s x := by
  rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf
Chain Rule for Composition with Point Equality Condition (Within a Subset)
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, $s \subseteq \mathbb{K}$ be a subset, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ has derivative $f'$ at $x$ within $s$, 2. $l : F \to E$ has FrΓ©chet derivative $l'$ at $y$, 3. $y = f(x)$. Then the composition $l \circ f : \mathbb{K} \to E$ has derivative $l'(f')$ at $x$ within $s$.
HasFDerivAt.comp_hasDerivAt theorem
(hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) : HasDerivAt (l ∘ f) (l' f') x
Full source
/-- The composition `l ∘ f` where `l : F β†’ E` and `f : π•œ β†’ F`, has a derivative equal to the
FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) :
    HasDerivAt (l ∘ f) (l' f') x :=
  hasDerivWithinAt_univ.mp <| hl.comp_hasDerivWithinAt x hf.hasDerivWithinAt
Chain Rule for Composition of FrΓ©chet Differentiable and Scalar Differentiable Functions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ has derivative $f'$ at $x$, 2. $l : F \to E$ has FrΓ©chet derivative $l'$ at $f(x)$. Then the composition $l \circ f : \mathbb{K} \to E$ has derivative $l'(f')$ at $x$.
HasFDerivAt.comp_hasDerivAt_of_eq theorem
(hl : HasFDerivAt l l' y) (hf : HasDerivAt f f' x) (hy : y = f x) : HasDerivAt (l ∘ f) (l' f') x
Full source
/-- The composition `l ∘ f` where `l : F β†’ E` and `f : π•œ β†’ F`, has a derivative equal to the
FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivAt.comp_hasDerivAt_of_eq
    (hl : HasFDerivAt l l' y) (hf : HasDerivAt f f' x) (hy : y = f x) :
    HasDerivAt (l ∘ f) (l' f') x := by
  rw [hy] at hl; exact hl.comp_hasDerivAt x hf
Chain Rule for Composition with Point Equality Condition: $(l \circ f)'(x) = l'(f(x)) \cdot f'(x)$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ has derivative $f'$ at $x$, 2. $l : F \to E$ has FrΓ©chet derivative $l'$ at $y$, 3. $y = f(x)$. Then the composition $l \circ f : \mathbb{K} \to E$ has derivative $l'(f')$ at $x$.
HasStrictFDerivAt.comp_hasStrictDerivAt theorem
(hl : HasStrictFDerivAt l l' (f x)) (hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l ∘ f) (l' f') x
Full source
theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x))
    (hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l ∘ f) (l' f') x := by
  simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (· ∘ ·)] using
    (hl.comp x hf.hasStrictFDerivAt).hasStrictDerivAt
Chain Rule for Strict Derivatives: $(l \circ f)'(x) = l'(f(x)) \cdot f'(x)$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$. Suppose $f : \mathbb{K} \to E$ has a strict derivative $f' \in E$ at $x \in \mathbb{K}$, and $l : E \to F$ has a strict FrΓ©chet derivative $l' : E \to F$ at $f(x)$. Then the composition $l \circ f : \mathbb{K} \to F$ has a strict derivative at $x$ given by $l'(f') \in F$.
HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq theorem
(hl : HasStrictFDerivAt l l' y) (hf : HasStrictDerivAt f f' x) (hy : y = f x) : HasStrictDerivAt (l ∘ f) (l' f') x
Full source
theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l l' y)
    (hf : HasStrictDerivAt f f' x) (hy : y = f x) :
    HasStrictDerivAt (l ∘ f) (l' f') x := by
  rw [hy] at hl; exact hl.comp_hasStrictDerivAt x hf
Chain Rule for Strict Derivatives with Equality Condition: $(l \circ f)'(x) = l'(f(x)) \cdot f'(x)$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$. Suppose $f : \mathbb{K} \to E$ has a strict derivative $f' \in E$ at $x \in \mathbb{K}$, and $l : E \to F$ has a strict FrΓ©chet derivative $l' : E \to F$ at $y \in E$. If $y = f(x)$, then the composition $l \circ f : \mathbb{K} \to F$ has a strict derivative at $x$ given by $l'(f') \in F$.
fderivWithin_comp_derivWithin theorem
{t : Set F} (hl : DifferentiableWithinAt π•œ l t (f x)) (hf : DifferentiableWithinAt π•œ f s x) (hs : MapsTo f s t) : derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x) : F β†’ E) (derivWithin f s x)
Full source
theorem fderivWithin_comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt π•œ l t (f x))
    (hf : DifferentiableWithinAt π•œ f s x) (hs : MapsTo f s t) :
    derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x) : F β†’ E) (derivWithin f s x) := by
  by_cases hsx : UniqueDiffWithinAt π•œ s x
  Β· exact (hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hsx
  Β· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
Chain Rule for Derivatives within Sets: $\text{derivWithin}\, (l \circ f)\, s\, x = \text{fderivWithin}\, l\, t\, (f x) \left(\text{derivWithin}\, f\, s\, x\right)$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, $s \subseteq \mathbb{K}$ and $t \subseteq F$ be subsets, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ is differentiable at $x$ within $s$, 2. $l : F \to E$ is differentiable at $f(x)$ within $t$, 3. $f$ maps $s$ into $t$. Then the derivative of the composition $l \circ f$ at $x$ within $s$ is given by: \[ \text{derivWithin}\, (l \circ f)\, s\, x = \text{fderivWithin}\, l\, t\, (f x) \left(\text{derivWithin}\, f\, s\, x\right). \]
fderivWithin_comp_derivWithin_of_eq theorem
{t : Set F} (hl : DifferentiableWithinAt π•œ l t y) (hf : DifferentiableWithinAt π•œ f s x) (hs : MapsTo f s t) (hy : y = f x) : derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x) : F β†’ E) (derivWithin f s x)
Full source
theorem fderivWithin_comp_derivWithin_of_eq {t : Set F} (hl : DifferentiableWithinAt π•œ l t y)
    (hf : DifferentiableWithinAt π•œ f s x) (hs : MapsTo f s t) (hy : y = f x) :
    derivWithin (l ∘ f) s x = (fderivWithin π•œ l t (f x) : F β†’ E) (derivWithin f s x) := by
  rw [hy] at hl; exact fderivWithin_comp_derivWithin x hl hf hs
Chain Rule for Derivatives within Sets with Equality Condition: $\text{derivWithin}\, (l \circ f)\, s\, x = \text{fderivWithin}\, l\, t\, (f x) \left(\text{derivWithin}\, f\, s\, x\right)$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, $s \subseteq \mathbb{K}$ and $t \subseteq F$ be subsets, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ is differentiable at $x$ within $s$, 2. $l : F \to E$ is differentiable at $y$ within $t$, 3. $f$ maps $s$ into $t$, 4. $y = f(x)$. Then the derivative of the composition $l \circ f$ at $x$ within $s$ is given by: \[ \text{derivWithin}\, (l \circ f)\, s\, x = \text{fderivWithin}\, l\, t\, (f x) \left(\text{derivWithin}\, f\, s\, x\right). \]
fderiv_comp_deriv theorem
(hl : DifferentiableAt π•œ l (f x)) (hf : DifferentiableAt π•œ f x) : deriv (l ∘ f) x = (fderiv π•œ l (f x) : F β†’ E) (deriv f x)
Full source
theorem fderiv_comp_deriv (hl : DifferentiableAt π•œ l (f x)) (hf : DifferentiableAt π•œ f x) :
    deriv (l ∘ f) x = (fderiv π•œ l (f x) : F β†’ E) (deriv f x) :=
  (hl.hasFDerivAt.comp_hasDerivAt x hf.hasDerivAt).deriv
Chain Rule for Composition of Differentiable Functions: $\text{deriv}\, (l \circ f)\, x = \text{fderiv}\, l\, (f x) \left(\text{deriv}\, f\, x\right)$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ is differentiable at $x$, 2. $l : F \to E$ is differentiable at $f(x)$. Then the derivative of the composition $l \circ f$ at $x$ is given by: \[ \text{deriv}\, (l \circ f)\, x = \text{fderiv}\, l\, (f x) \left(\text{deriv}\, f\, x\right). \]
fderiv_comp_deriv_of_eq theorem
(hl : DifferentiableAt π•œ l y) (hf : DifferentiableAt π•œ f x) (hy : y = f x) : deriv (l ∘ f) x = (fderiv π•œ l (f x) : F β†’ E) (deriv f x)
Full source
theorem fderiv_comp_deriv_of_eq (hl : DifferentiableAt π•œ l y) (hf : DifferentiableAt π•œ f x)
    (hy : y = f x) :
    deriv (l ∘ f) x = (fderiv π•œ l (f x) : F β†’ E) (deriv f x) := by
  rw [hy] at hl; exact fderiv_comp_deriv x hl hf
Chain Rule for Composition with Equality Condition: $\text{deriv}\, (l \circ f)\, x = \text{fderiv}\, l\, (f x) \left(\text{deriv}\, f\, x\right)$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $x \in \mathbb{K}$. Suppose: 1. $f : \mathbb{K} \to F$ is differentiable at $x$, 2. $l : F \to E$ is differentiable at $y$, 3. $y = f(x)$. Then the derivative of the composition $l \circ f$ at $x$ is given by: \[ \text{deriv}\, (l \circ f)\, x = \text{fderiv}\, l\, (f x) \left(\text{deriv}\, f\, x\right). \]