doc-next-gen

Mathlib.Analysis.Calculus.ContDiff.Basic

Module docstring

{"# Higher differentiability of composition

We prove that the composition of C^n functions is C^n. We also expand the API around C^n functions.

Main results

  • ContDiff.comp states that the composition of two C^n functions is C^n.

Similar results are given for C^n functions on domains.

Notations

We use the notation E [Γ—n]β†’L[π•œ] F for the space of continuous multilinear maps on E^n with values in F. This is the space in which the n-th derivative of a function from E to F lives.

In this file, we denote (⊀ : β„•βˆž) : WithTop β„•βˆž with ∞ and ⊀ : WithTop β„•βˆž with Ο‰.

Tags

derivative, differentiability, higher derivative, C^n, multilinear, Taylor series, formal series ","### Constants ","### Smoothness of linear functions ","### The Cartesian product of two C^n functions is C^n. ","### Composition of C^n functions

We show that the composition of C^n functions is C^n. One way to do this would be to use the following simple inductive proof. Assume it is done for n. Then, to check it for n+1, one needs to check that the derivative of g ∘ f is C^n, i.e., that Dg(f x) ⬝ Df(x) is C^n. The term Dg (f x) is the composition of two C^n functions, so it is C^n by the inductive assumption. The term Df(x) is also C^n. Then, the matrix multiplication is the application of a bilinear map (which is C^∞, and therefore C^n) to x ↦ (Dg(f x), Df x). As the composition of two C^n maps, it is again C^n, and we are done.

There are two difficulties in this proof.

The first one is that it is an induction over all Banach spaces. In Lean, this is only possible if they belong to a fixed universe. One could formalize this by first proving the statement in this case, and then extending the result to general universes by embedding all the spaces we consider in a common universe through ULift.

The second one is that it does not work cleanly for analytic maps: for this case, we need to exhibit a whole sequence of derivatives which are all analytic, not just finitely many of them, so an induction is never enough at a finite step.

Both these difficulties can be overcome with some cost. However, we choose a different path: we write down an explicit formula for the n-th derivative of g ∘ f in terms of derivatives of g and f (this is the formula of Faa-Di Bruno) and use this formula to get a suitable Taylor expansion for g ∘ f. Writing down the formula of Faa-Di Bruno is not easy as the formula is quite intricate, but it is also useful for other purposes and once available it makes the proof here essentially trivial. ","### Smoothness of projections ","### Bundled derivatives are smooth ","### One dimension

All results up to now have been expressed in terms of the general FrΓ©chet derivative fderiv. For maps defined on the field, the one-dimensional derivative deriv is often easier to use. In this paragraph, we reformulate some higher smoothness results in terms of deriv. "}

iteratedFDerivWithin_succ_const theorem
(n : β„•) (c : F) : iteratedFDerivWithin π•œ (n + 1) (fun _ : E ↦ c) s = 0
Full source
theorem iteratedFDerivWithin_succ_const (n : β„•) (c : F) :
    iteratedFDerivWithin π•œ (n + 1) (fun _ : E ↦ c) s = 0 := by
  induction n  with
  | zero =>
    ext1
    simp [iteratedFDerivWithin_succ_eq_comp_left, iteratedFDerivWithin_zero_eq_comp, comp_def]
  | succ n IH =>
    rw [iteratedFDerivWithin_succ_eq_comp_left, IH]
    simp only [Pi.zero_def, comp_def, fderivWithin_const, map_zero]
Vanishing of Higher Derivatives for Constant Functions
Informal description
For any natural number $n$ and constant $c$ in a normed space $F$, the $(n+1)$-th iterated FrΓ©chet derivative within a set $s$ of the constant function $x \mapsto c$ is identically zero.
iteratedFDerivWithin_zero_fun theorem
{i : β„•} : iteratedFDerivWithin π•œ i (fun _ : E ↦ (0 : F)) s = 0
Full source
@[simp]
theorem iteratedFDerivWithin_zero_fun {i : β„•} :
    iteratedFDerivWithin π•œ i (fun _ : E ↦ (0 : F)) s = 0 := by
  cases i with
  | zero => ext; simp
  | succ i => apply iteratedFDerivWithin_succ_const
Vanishing of Higher Derivatives for the Zero Function
Informal description
For any natural number $i$, the $i$-th iterated FrΓ©chet derivative within a set $s$ of the zero function $x \mapsto 0$ (where $0$ is the zero vector in a normed space $F$) is identically zero.
iteratedFDeriv_zero_fun theorem
{n : β„•} : (iteratedFDeriv π•œ n fun _ : E ↦ (0 : F)) = 0
Full source
@[simp]
theorem iteratedFDeriv_zero_fun {n : β„•} : (iteratedFDeriv π•œ n fun _ : E ↦ (0 : F)) = 0 :=
  funext fun x ↦ by simp only [← iteratedFDerivWithin_univ, iteratedFDerivWithin_zero_fun]
Vanishing of Higher Derivatives for the Zero Function
Informal description
For any natural number $n$, the $n$-th iterated FrΓ©chet derivative of the zero function $x \mapsto 0$ (where $0$ is the zero vector in a normed space $F$) is identically zero.
contDiff_zero_fun theorem
: ContDiff π•œ n fun _ : E => (0 : F)
Full source
theorem contDiff_zero_fun : ContDiff π•œ n fun _ : E => (0 : F) :=
  analyticOnNhd_const.contDiff
Zero Function is $C^n$ Smooth
Informal description
For any extended natural number $n$ and any normed spaces $E$ and $F$ over a nontrivially normed field $\mathbb{K}$, the zero function $f : E \to F$ defined by $f(x) = 0$ is continuously differentiable of order $n$ (i.e., $C^n$).
contDiff_const theorem
{c : F} : ContDiff π•œ n fun _ : E => c
Full source
/-- Constants are `C^∞`. -/
theorem contDiff_const {c : F} : ContDiff π•œ n fun _ : E => c :=
  analyticOnNhd_const.contDiff
Constant Functions are $C^n$ Smooth
Informal description
For any constant function $f : E \to F$ defined by $f(x) = c$ where $c$ is an element of a normed space $F$ over a nontrivially normed field $\mathbb{K}$, and for any extended natural number $n$, the function $f$ is continuously differentiable of order $n$ (i.e., $C^n$).
contDiffOn_const theorem
{c : F} {s : Set E} : ContDiffOn π•œ n (fun _ : E => c) s
Full source
theorem contDiffOn_const {c : F} {s : Set E} : ContDiffOn π•œ n (fun _ : E => c) s :=
  contDiff_const.contDiffOn
Constant Functions are $C^n$ Smooth on Subsets
Informal description
For any constant function $f : E \to F$ defined by $f(x) = c$ where $c$ is an element of a normed space $F$ over a nontrivially normed field $\mathbb{K}$, and for any extended natural number $n$, the function $f$ is continuously differentiable of order $n$ (i.e., $C^n$) on any subset $s \subseteq E$.
contDiffAt_const theorem
{c : F} : ContDiffAt π•œ n (fun _ : E => c) x
Full source
theorem contDiffAt_const {c : F} : ContDiffAt π•œ n (fun _ : E => c) x :=
  contDiff_const.contDiffAt
Pointwise $C^n$ Smoothness of Constant Functions
Informal description
For any constant function $f : E \to F$ defined by $f(x) = c$ where $c$ is an element of a normed space $F$ over a nontrivially normed field $\mathbb{K}$, and for any extended natural number $n$, the function $f$ is continuously differentiable of order $n$ (i.e., $C^n$) at every point $x \in E$.
contDiffWithinAt_const theorem
{c : F} : ContDiffWithinAt π•œ n (fun _ : E => c) s x
Full source
theorem contDiffWithinAt_const {c : F} : ContDiffWithinAt π•œ n (fun _ : E => c) s x :=
  contDiffAt_const.contDiffWithinAt
$C^n$ Smoothness of Constant Functions Within Subsets at Points
Informal description
For any constant function $f : E \to F$ defined by $f(x) = c$ where $c \in F$, and for any extended natural number $n$, the function $f$ is continuously differentiable of order $n$ (i.e., $C^n$) within any subset $s \subseteq E$ at any point $x \in E$.
contDiff_of_subsingleton theorem
[Subsingleton F] : ContDiff π•œ n f
Full source
@[nontriviality]
theorem contDiff_of_subsingleton [Subsingleton F] : ContDiff π•œ n f := by
  rw [Subsingleton.elim f fun _ => 0]; exact contDiff_const
Subsingleton Codomain Implies $C^n$ Smoothness
Informal description
If the codomain $F$ is a subsingleton (i.e., has at most one element), then any function $f : E \to F$ is continuously differentiable of order $n$ (i.e., $C^n$) over the field $\mathbb{K}$.
contDiffAt_of_subsingleton theorem
[Subsingleton F] : ContDiffAt π•œ n f x
Full source
@[nontriviality]
theorem contDiffAt_of_subsingleton [Subsingleton F] : ContDiffAt π•œ n f x := by
  rw [Subsingleton.elim f fun _ => 0]; exact contDiffAt_const
$C^n$ Differentiability for Functions with Subsingleton Codomain
Informal description
If the codomain $F$ is a subsingleton (i.e., has at most one element), then any function $f : E \to F$ is $C^n$ differentiable at every point $x \in E$ over the field $\mathbb{K}$.
contDiffWithinAt_of_subsingleton theorem
[Subsingleton F] : ContDiffWithinAt π•œ n f s x
Full source
@[nontriviality]
theorem contDiffWithinAt_of_subsingleton [Subsingleton F] : ContDiffWithinAt π•œ n f s x := by
  rw [Subsingleton.elim f fun _ => 0]; exact contDiffWithinAt_const
$C^n$ Differentiability of Functions with Subsingleton Codomain Within Subsets at Points
Informal description
If the codomain $F$ is a subsingleton (i.e., has at most one element), then any function $f : E \to F$ is $C^n$ differentiable within any subset $s \subseteq E$ at any point $x \in E$ over the field $\mathbb{K}$.
contDiffOn_of_subsingleton theorem
[Subsingleton F] : ContDiffOn π•œ n f s
Full source
@[nontriviality]
theorem contDiffOn_of_subsingleton [Subsingleton F] : ContDiffOn π•œ n f s := by
  rw [Subsingleton.elim f fun _ => 0]; exact contDiffOn_const
Subsingleton Codomain Implies $C^n$ Differentiability on Any Subset
Informal description
If the codomain $F$ is a subsingleton (i.e., has at most one element), then any function $f : E \to F$ is $C^n$ differentiable on any subset $s \subseteq E$ for any extended natural number $n$.
iteratedFDerivWithin_const_of_ne theorem
{n : β„•} (hn : n β‰  0) (c : F) (s : Set E) : iteratedFDerivWithin π•œ n (fun _ : E ↦ c) s = 0
Full source
theorem iteratedFDerivWithin_const_of_ne {n : β„•} (hn : n β‰  0) (c : F) (s : Set E) :
    iteratedFDerivWithin π•œ n (fun _ : E ↦ c) s = 0 := by
  cases n with
  | zero => contradiction
  | succ n => exact iteratedFDerivWithin_succ_const n c
Vanishing of Higher Derivatives for Constant Functions on Subsets
Informal description
For any natural number $n \neq 0$, constant $c$ in a normed space $F$, and subset $s$ of a normed space $E$, the $n$-th iterated FrΓ©chet derivative within $s$ of the constant function $x \mapsto c$ is identically zero.
iteratedFDeriv_const_of_ne theorem
{n : β„•} (hn : n β‰  0) (c : F) : (iteratedFDeriv π•œ n fun _ : E ↦ c) = 0
Full source
theorem iteratedFDeriv_const_of_ne {n : β„•} (hn : n β‰  0) (c : F) :
    (iteratedFDeriv π•œ n fun _ : E ↦ c) = 0 := by
  simp only [← iteratedFDerivWithin_univ, iteratedFDerivWithin_const_of_ne hn]
Vanishing of Higher Derivatives for Constant Functions
Informal description
For any natural number $n \neq 0$ and constant $c$ in a normed space $F$, the $n$-th iterated FrΓ©chet derivative of the constant function $x \mapsto c$ on a normed space $E$ is identically zero.
iteratedFDeriv_succ_const theorem
(n : β„•) (c : F) : (iteratedFDeriv π•œ (n + 1) fun _ : E ↦ c) = 0
Full source
theorem iteratedFDeriv_succ_const (n : β„•) (c : F) :
    (iteratedFDeriv π•œ (n + 1) fun _ : E ↦ c) = 0 :=
  iteratedFDeriv_const_of_ne (by simp) _
Vanishing of Higher Derivatives for Constant Functions (Succesor Case)
Informal description
For any natural number $n$ and constant $c$ in a normed space $F$, the $(n+1)$-th iterated FrΓ©chet derivative of the constant function $x \mapsto c$ on a normed space $E$ is identically zero.
contDiffWithinAt_singleton theorem
: ContDiffWithinAt π•œ n f { x } x
Full source
theorem contDiffWithinAt_singleton : ContDiffWithinAt π•œ n f {x} x :=
  (contDiffWithinAt_const (c := f x)).congr (by simp) rfl
$C^n$ Differentiability at a Point in Singleton Set
Informal description
For any function $f : E \to F$ between normed spaces over a nontrivially normed field $\mathbb{K}$, any extended natural number $n$, and any point $x \in E$, the function $f$ is $C^n$ within the singleton set $\{x\}$ at the point $x$.
IsBoundedLinearMap.contDiff theorem
(hf : IsBoundedLinearMap π•œ f) : ContDiff π•œ n f
Full source
/-- Unbundled bounded linear functions are `C^n`. -/
theorem IsBoundedLinearMap.contDiff (hf : IsBoundedLinearMap π•œ f) : ContDiff π•œ n f :=
  (ContinuousLinearMap.analyticOnNhd hf.toContinuousLinearMap univ).contDiff
Bounded linear maps are \( C^n \) functions
Informal description
Let \( E \) and \( F \) be normed vector spaces over a nontrivially normed field \( \mathbb{K} \), and let \( f : E \to F \) be a bounded linear map. Then \( f \) is continuously differentiable of order \( n \) (i.e., \( C^n \)) for any extended natural number \( n \).
ContinuousLinearMap.contDiff theorem
(f : E β†’L[π•œ] F) : ContDiff π•œ n f
Full source
theorem ContinuousLinearMap.contDiff (f : E β†’L[π•œ] F) : ContDiff π•œ n f :=
  f.isBoundedLinearMap.contDiff
Continuous linear maps are \( C^n \) functions
Informal description
Let \( E \) and \( F \) be normed vector spaces over a nontrivially normed field \( \mathbb{K} \). For any continuous linear map \( f : E \to F \) and any extended natural number \( n \), the function \( f \) is continuously differentiable of order \( n \) (i.e., \( C^n \)).
ContinuousLinearEquiv.contDiff theorem
(f : E ≃L[π•œ] F) : ContDiff π•œ n f
Full source
theorem ContinuousLinearEquiv.contDiff (f : E ≃L[π•œ] F) : ContDiff π•œ n f :=
  (f : E β†’L[π•œ] F).contDiff
Continuous Linear Equivalences are \( C^n \) Functions
Informal description
Let \( E \) and \( F \) be normed vector spaces over a nontrivially normed field \( \mathbb{K} \). For any continuous linear equivalence \( f : E \simeq_{L[\mathbb{K}]} F \) and any extended natural number \( n \), the function \( f \) is continuously differentiable of order \( n \) (i.e., \( C^n \)).
LinearIsometry.contDiff theorem
(f : E β†’β‚—α΅’[π•œ] F) : ContDiff π•œ n f
Full source
theorem LinearIsometry.contDiff (f : E β†’β‚—α΅’[π•œ] F) : ContDiff π•œ n f :=
  f.toContinuousLinearMap.contDiff
Linear Isometries are \( C^n \) Functions
Informal description
Let \( E \) and \( F \) be normed vector spaces over a nontrivially normed field \( \mathbb{K} \). For any linear isometry \( f : E \to F \) and any extended natural number \( n \), the function \( f \) is continuously differentiable of order \( n \) (i.e., \( C^n \)).
LinearIsometryEquiv.contDiff theorem
(f : E ≃ₗᡒ[π•œ] F) : ContDiff π•œ n f
Full source
theorem LinearIsometryEquiv.contDiff (f : E ≃ₗᡒ[π•œ] F) : ContDiff π•œ n f :=
  (f : E β†’L[π•œ] F).contDiff
Linear Isometric Equivalences are $C^n$ Functions
Informal description
Let $E$ and $F$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$. For any linear isometric equivalence $f : E \simeq_{\mathbb{K}} F$ and any extended natural number $n \in \mathbb{N}_\infty$, the function $f$ is continuously differentiable of order $n$ (i.e., $C^n$).
contDiff_id theorem
: ContDiff π•œ n (id : E β†’ E)
Full source
/-- The identity is `C^n`. -/
theorem contDiff_id : ContDiff π•œ n (id : E β†’ E) :=
  IsBoundedLinearMap.id.contDiff
Identity Function is $C^n$
Informal description
The identity function $\operatorname{id} \colon E \to E$ on a normed vector space $E$ over a nontrivially normed field $\mathbb{K}$ is continuously differentiable of order $n$ (i.e., $C^n$) for any extended natural number $n \in \mathbb{N}_\infty$.
contDiffWithinAt_id theorem
{s x} : ContDiffWithinAt π•œ n (id : E β†’ E) s x
Full source
theorem contDiffWithinAt_id {s x} : ContDiffWithinAt π•œ n (id : E β†’ E) s x :=
  contDiff_id.contDiffWithinAt
Identity Function is Locally $C^n$ Within Any Set
Informal description
For any subset $s \subseteq E$ and any point $x \in E$, the identity function $\operatorname{id} \colon E \to E$ is $C^n$ within $s$ at $x$. In other words, the identity map is continuously differentiable of order $n$ within any set at any point.
contDiffAt_id theorem
{x} : ContDiffAt π•œ n (id : E β†’ E) x
Full source
theorem contDiffAt_id {x} : ContDiffAt π•œ n (id : E β†’ E) x :=
  contDiff_id.contDiffAt
Pointwise $C^n$ Smoothness of the Identity Function
Informal description
For any extended natural number $n \in \mathbb{N}_\infty$, the identity function $\operatorname{id} \colon E \to E$ on a normed vector space $E$ over a nontrivially normed field $\mathbb{K}$ is $C^n$ at every point $x \in E$.
contDiffOn_id theorem
{s} : ContDiffOn π•œ n (id : E β†’ E) s
Full source
theorem contDiffOn_id {s} : ContDiffOn π•œ n (id : E β†’ E) s :=
  contDiff_id.contDiffOn
Identity Function is $C^n$ on Any Subset
Informal description
For any subset $s$ of a normed vector space $E$ over a nontrivially normed field $\mathbb{K}$, the identity function $\operatorname{id} \colon E \to E$ is continuously differentiable of order $n$ (i.e., $C^n$) on $s$, for any extended natural number $n \in \mathbb{N}_\infty$.
IsBoundedBilinearMap.contDiff theorem
(hb : IsBoundedBilinearMap π•œ b) : ContDiff π•œ n b
Full source
/-- Bilinear functions are `C^n`. -/
theorem IsBoundedBilinearMap.contDiff (hb : IsBoundedBilinearMap π•œ b) : ContDiff π•œ n b :=
  (hb.toContinuousLinearMap.analyticOnNhd_bilinear _).contDiff
Bounded Bilinear Maps are $C^n$ Smooth
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. If $b \colon E \times F \to G$ is a bounded bilinear map, then $b$ is continuously differentiable of order $n$ (i.e., $C^n$) for any extended natural number $n \in \mathbb{N}_\infty$.
HasFTaylorSeriesUpToOn.continuousLinearMap_comp theorem
{n : WithTop β„•βˆž} (g : F β†’L[π•œ] G) (hf : HasFTaylorSeriesUpToOn n f p s) : HasFTaylorSeriesUpToOn n (g ∘ f) (fun x k => g.compContinuousMultilinearMap (p x k)) s
Full source
/-- If `f` admits a Taylor series `p` in a set `s`, and `g` is linear, then `g ∘ f` admits a Taylor
series whose `k`-th term is given by `g ∘ (p k)`. -/
theorem HasFTaylorSeriesUpToOn.continuousLinearMap_comp {n : WithTop β„•βˆž} (g : F β†’L[π•œ] G)
    (hf : HasFTaylorSeriesUpToOn n f p s) :
    HasFTaylorSeriesUpToOn n (g ∘ f) (fun x k => g.compContinuousMultilinearMap (p x k)) s where
  zero_eq x hx := congr_arg g (hf.zero_eq x hx)
  fderivWithin m hm x hx := (ContinuousLinearMap.compContinuousMultilinearMapL π•œ
    (fun _ : Fin m => E) F G g).hasFDerivAt.comp_hasFDerivWithinAt x (hf.fderivWithin m hm x hx)
  cont m hm := (ContinuousLinearMap.compContinuousMultilinearMapL π•œ
    (fun _ : Fin m => E) F G g).continuous.comp_continuousOn (hf.cont m hm)
Composition with Linear Map Preserves Taylor Series Expansion
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Let $f \colon E \to F$ have a Taylor series expansion up to order $n$ on a set $s \subseteq E$, represented by the family of continuous multilinear maps $p(x,k) \colon E^{k} \to F$ for each $x \in s$ and $k \in \mathbb{N}$. If $g \colon F \to G$ is a continuous $\mathbb{K}$-linear map, then the composition $g \circ f \colon E \to G$ has a Taylor series expansion up to order $n$ on $s$, where the $k$-th term at $x \in s$ is given by the composition $g \circ p(x,k) \colon E^{k} \to G$.
ContDiffWithinAt.continuousLinearMap_comp theorem
(g : F β†’L[π•œ] G) (hf : ContDiffWithinAt π•œ n f s x) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
/-- Composition by continuous linear maps on the left preserves `C^n` functions in a domain
at a point. -/
theorem ContDiffWithinAt.continuousLinearMap_comp (g : F β†’L[π•œ] G)
    (hf : ContDiffWithinAt π•œ n f s x) : ContDiffWithinAt π•œ n (g ∘ f) s x := by
  match n with
  | Ο‰ =>
    obtain ⟨u, hu, p, hp, h'p⟩ := hf
    refine ⟨u, hu, _, hp.continuousLinearMap_comp g, fun i ↦ ?_⟩
    change AnalyticOn π•œ
      (fun x ↦ (ContinuousLinearMap.compContinuousMultilinearMapL π•œ
      (fun _ : Fin i ↦ E) F G g) (p x i)) u
    apply AnalyticOnNhd.comp_analyticOn _ (h'p i) (Set.mapsTo_univ _ _)
    exact ContinuousLinearMap.analyticOnNhd _ _
  | (n : β„•βˆž) =>
    intro m hm
    rcases hf m hm with ⟨u, hu, p, hp⟩
    exact ⟨u, hu, _, hp.continuousLinearMap_comp g⟩
Preservation of $C^n$ Differentiability Under Left Composition with Continuous Linear Maps
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given a continuous $\mathbb{K}$-linear map $g : F \to G$ and a function $f : E \to F$ that is $C^n$ within a set $s \subseteq E$ at a point $x \in E$, the composition $g \circ f$ is also $C^n$ within $s$ at $x$.
ContDiffAt.continuousLinearMap_comp theorem
(g : F β†’L[π•œ] G) (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (g ∘ f) x
Full source
/-- Composition by continuous linear maps on the left preserves `C^n` functions in a domain
at a point. -/
theorem ContDiffAt.continuousLinearMap_comp (g : F β†’L[π•œ] G) (hf : ContDiffAt π•œ n f x) :
    ContDiffAt π•œ n (g ∘ f) x :=
  ContDiffWithinAt.continuousLinearMap_comp g hf
Preservation of $C^n$ Differentiability at a Point Under Left Composition with Continuous Linear Maps
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given a continuous $\mathbb{K}$-linear map $g : F \to G$ and a function $f : E \to F$ that is $C^n$ at a point $x \in E$, the composition $g \circ f$ is also $C^n$ at $x$.
ContDiffOn.continuousLinearMap_comp theorem
(g : F β†’L[π•œ] G) (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (g ∘ f) s
Full source
/-- Composition by continuous linear maps on the left preserves `C^n` functions on domains. -/
theorem ContDiffOn.continuousLinearMap_comp (g : F β†’L[π•œ] G) (hf : ContDiffOn π•œ n f s) :
    ContDiffOn π•œ n (g ∘ f) s := fun x hx => (hf x hx).continuousLinearMap_comp g
Preservation of $C^n$ Differentiability on Sets Under Left Composition with Continuous Linear Maps
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given a continuous $\mathbb{K}$-linear map $g : F \to G$ and a function $f : E \to F$ that is $C^n$ on a set $s \subseteq E$, the composition $g \circ f$ is also $C^n$ on $s$.
ContDiff.continuousLinearMap_comp theorem
{f : E β†’ F} (g : F β†’L[π•œ] G) (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x => g (f x)
Full source
/-- Composition by continuous linear maps on the left preserves `C^n` functions. -/
theorem ContDiff.continuousLinearMap_comp {f : E β†’ F} (g : F β†’L[π•œ] G) (hf : ContDiff π•œ n f) :
    ContDiff π•œ n fun x => g (f x) :=
  contDiffOn_univ.1 <| ContDiffOn.continuousLinearMap_comp _ (contDiffOn_univ.2 hf)
Preservation of $C^n$ Differentiability Under Left Composition with Continuous Linear Maps
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given a continuous $\mathbb{K}$-linear map $g : F \to G$ and a function $f : E \to F$ that is $C^n$ (continuously differentiable of order $n$), the composition $g \circ f$ is also $C^n$.
ContinuousLinearMap.iteratedFDerivWithin_comp_left theorem
{f : E β†’ F} (g : F β†’L[π•œ] G) (hf : ContDiffWithinAt π•œ n f s x) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) {i : β„•} (hi : i ≀ n) : iteratedFDerivWithin π•œ i (g ∘ f) s x = g.compContinuousMultilinearMap (iteratedFDerivWithin π•œ i f s x)
Full source
/-- The iterated derivative within a set of the composition with a linear map on the left is
obtained by applying the linear map to the iterated derivative. -/
theorem ContinuousLinearMap.iteratedFDerivWithin_comp_left {f : E β†’ F} (g : F β†’L[π•œ] G)
    (hf : ContDiffWithinAt π•œ n f s x) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) {i : β„•} (hi : i ≀ n) :
    iteratedFDerivWithin π•œ i (g ∘ f) s x =
      g.compContinuousMultilinearMap (iteratedFDerivWithin π•œ i f s x) := by
  rcases hf.contDiffOn' hi (by simp) with ⟨U, hU, hxU, hfU⟩
  rw [← iteratedFDerivWithin_inter_open hU hxU, ← iteratedFDerivWithin_inter_open (f := f) hU hxU]
  rw [insert_eq_of_mem hx] at hfU
  exact .symm <| (hfU.ftaylorSeriesWithin (hs.inter hU)).continuousLinearMap_comp g
    |>.eq_iteratedFDerivWithin_of_uniqueDiffOn le_rfl (hs.inter hU) ⟨hx, hxU⟩
Iterated FrΓ©chet Derivative of Composition with a Continuous Linear Map on the Left
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a function that is $C^n$ within a set $s \subseteq E$ at a point $x \in s$. Suppose $s$ has the property of unique differentiability on $\mathbb{K}$ and $x \in s$. For any continuous $\mathbb{K}$-linear map $g : F \to G$ and any natural number $i \leq n$, the $i$-th iterated FrΓ©chet derivative within $s$ of the composition $g \circ f$ at $x$ is equal to the composition of $g$ with the $i$-th iterated FrΓ©chet derivative within $s$ of $f$ at $x$. In symbols: $$ D^i_s (g \circ f)(x) = g \circ D^i_s f(x), $$ where $D^i_s$ denotes the $i$-th iterated FrΓ©chet derivative within $s$.
ContinuousLinearMap.iteratedFDeriv_comp_left theorem
{f : E β†’ F} (g : F β†’L[π•œ] G) (hf : ContDiffAt π•œ n f x) {i : β„•} (hi : i ≀ n) : iteratedFDeriv π•œ i (g ∘ f) x = g.compContinuousMultilinearMap (iteratedFDeriv π•œ i f x)
Full source
/-- The iterated derivative of the composition with a linear map on the left is
obtained by applying the linear map to the iterated derivative. -/
theorem ContinuousLinearMap.iteratedFDeriv_comp_left {f : E β†’ F} (g : F β†’L[π•œ] G)
    (hf : ContDiffAt π•œ n f x) {i : β„•} (hi : i ≀ n) :
    iteratedFDeriv π•œ i (g ∘ f) x = g.compContinuousMultilinearMap (iteratedFDeriv π•œ i f x) := by
  simp only [← iteratedFDerivWithin_univ]
  exact g.iteratedFDerivWithin_comp_left hf.contDiffWithinAt uniqueDiffOn_univ (mem_univ x) hi
Iterated FrΓ©chet Derivative of Composition with a Continuous Linear Map: $D^i(g \circ f)(x) = g \circ D^i f(x)$
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a function that is $C^n$ at a point $x \in E$. For any continuous $\mathbb{K}$-linear map $g : F \to G$ and any natural number $i \leq n$, the $i$-th iterated FrΓ©chet derivative of the composition $g \circ f$ at $x$ is equal to the composition of $g$ with the $i$-th iterated FrΓ©chet derivative of $f$ at $x$. In symbols: $$ D^i (g \circ f)(x) = g \circ D^i f(x), $$ where $D^i$ denotes the $i$-th iterated FrΓ©chet derivative.
ContinuousLinearEquiv.iteratedFDerivWithin_comp_left theorem
(g : F ≃L[π•œ] G) (f : E β†’ F) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) (i : β„•) : iteratedFDerivWithin π•œ i (g ∘ f) s x = (g : F β†’L[π•œ] G).compContinuousMultilinearMap (iteratedFDerivWithin π•œ i f s x)
Full source
/-- The iterated derivative within a set of the composition with a linear equiv on the left is
obtained by applying the linear equiv to the iterated derivative. This is true without
differentiability assumptions. -/
theorem ContinuousLinearEquiv.iteratedFDerivWithin_comp_left (g : F ≃L[π•œ] G) (f : E β†’ F)
    (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) (i : β„•) :
    iteratedFDerivWithin π•œ i (g ∘ f) s x =
      (g : F β†’L[π•œ] G).compContinuousMultilinearMap (iteratedFDerivWithin π•œ i f s x) := by
  induction' i with i IH generalizing x
  Β· ext1 m
    simp only [iteratedFDerivWithin_zero_apply, comp_apply,
      ContinuousLinearMap.compContinuousMultilinearMap_coe, coe_coe]
  Β· ext1 m
    rw [iteratedFDerivWithin_succ_apply_left]
    have Z : fderivWithin π•œ (iteratedFDerivWithin π•œ i (g ∘ f) s) s x =
        fderivWithin π•œ (g.continuousMultilinearMapCongrRight (fun _ : Fin i => E) ∘
          iteratedFDerivWithin π•œ i f s) s x :=
      fderivWithin_congr' (@IH) hx
    simp_rw [Z]
    rw [(g.continuousMultilinearMapCongrRight fun _ : Fin i => E).comp_fderivWithin (hs x hx)]
    simp only [ContinuousLinearMap.coe_comp', ContinuousLinearEquiv.coe_coe, comp_apply,
      ContinuousLinearEquiv.continuousMultilinearMapCongrRight_apply,
      ContinuousLinearMap.compContinuousMultilinearMap_coe, EmbeddingLike.apply_eq_iff_eq]
    rw [iteratedFDerivWithin_succ_apply_left]
Iterated FrΓ©chet Derivative of Composition with a Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a field $\mathbb{K}$, and let $g : F \simeq_{\mathbb{K}} G$ be a continuous linear equivalence. For a function $f : E \to F$, a set $s \subseteq E$ with unique differentiability on $\mathbb{K}$, and a point $x \in s$, the $i$-th iterated FrΓ©chet derivative within $s$ of the composition $g \circ f$ at $x$ is equal to the composition of $g$ (as a continuous linear map) with the $i$-th iterated FrΓ©chet derivative within $s$ of $f$ at $x$. In symbols: $$ D^i_s (g \circ f)(x) = g \circ D^i_s f(x), $$ where $D^i_s$ denotes the $i$-th iterated FrΓ©chet derivative within $s$.
LinearIsometry.norm_iteratedFDerivWithin_comp_left theorem
{f : E β†’ F} (g : F β†’β‚—α΅’[π•œ] G) (hf : ContDiffWithinAt π•œ n f s x) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) {i : β„•} (hi : i ≀ n) : β€–iteratedFDerivWithin π•œ i (g ∘ f) s xβ€– = β€–iteratedFDerivWithin π•œ i f s xβ€–
Full source
/-- Composition with a linear isometry on the left preserves the norm of the iterated
derivative within a set. -/
theorem LinearIsometry.norm_iteratedFDerivWithin_comp_left {f : E β†’ F} (g : F β†’β‚—α΅’[π•œ] G)
    (hf : ContDiffWithinAt π•œ n f s x) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) {i : β„•} (hi : i ≀ n) :
    β€–iteratedFDerivWithin π•œ i (g ∘ f) s xβ€– = β€–iteratedFDerivWithin π•œ i f s xβ€– := by
  have :
    iteratedFDerivWithin π•œ i (g ∘ f) s x =
      g.toContinuousLinearMap.compContinuousMultilinearMap (iteratedFDerivWithin π•œ i f s x) :=
    g.toContinuousLinearMap.iteratedFDerivWithin_comp_left hf hs hx hi
  rw [this]
  apply LinearIsometry.norm_compContinuousMultilinearMap
Norm Preservation of Iterated FrΓ©chet Derivatives under Composition with a Linear Isometry
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a function that is $C^n$ within a set $s \subseteq E$ at a point $x \in s$. Suppose $s$ has the property of unique differentiability on $\mathbb{K}$ and $x \in s$. For any linear isometry $g : F \to G$ and any natural number $i \leq n$, the norm of the $i$-th iterated FrΓ©chet derivative within $s$ of the composition $g \circ f$ at $x$ is equal to the norm of the $i$-th iterated FrΓ©chet derivative within $s$ of $f$ at $x$. In symbols: $$ \|D^i_s (g \circ f)(x)\| = \|D^i_s f(x)\|, $$ where $D^i_s$ denotes the $i$-th iterated FrΓ©chet derivative within $s$.
LinearIsometry.norm_iteratedFDeriv_comp_left theorem
{f : E β†’ F} (g : F β†’β‚—α΅’[π•œ] G) (hf : ContDiffAt π•œ n f x) {i : β„•} (hi : i ≀ n) : β€–iteratedFDeriv π•œ i (g ∘ f) xβ€– = β€–iteratedFDeriv π•œ i f xβ€–
Full source
/-- Composition with a linear isometry on the left preserves the norm of the iterated
derivative. -/
theorem LinearIsometry.norm_iteratedFDeriv_comp_left {f : E β†’ F} (g : F β†’β‚—α΅’[π•œ] G)
    (hf : ContDiffAt π•œ n f x) {i : β„•} (hi : i ≀ n) :
    β€–iteratedFDeriv π•œ i (g ∘ f) xβ€– = β€–iteratedFDeriv π•œ i f xβ€– := by
  simp only [← iteratedFDerivWithin_univ]
  exact g.norm_iteratedFDerivWithin_comp_left hf.contDiffWithinAt uniqueDiffOn_univ (mem_univ x) hi
Norm Preservation of Iterated FrΓ©chet Derivatives under Composition with a Linear Isometry
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a function that is $C^n$ at a point $x \in E$. For any linear isometry $g : F \to G$ and any natural number $i \leq n$, the norm of the $i$-th iterated FrΓ©chet derivative of the composition $g \circ f$ at $x$ is equal to the norm of the $i$-th iterated FrΓ©chet derivative of $f$ at $x$. In symbols: $$ \|D^i (g \circ f)(x)\| = \|D^i f(x)\|, $$ where $D^i$ denotes the $i$-th iterated FrΓ©chet derivative.
LinearIsometryEquiv.norm_iteratedFDerivWithin_comp_left theorem
(g : F ≃ₗᡒ[π•œ] G) (f : E β†’ F) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) (i : β„•) : β€–iteratedFDerivWithin π•œ i (g ∘ f) s xβ€– = β€–iteratedFDerivWithin π•œ i f s xβ€–
Full source
/-- Composition with a linear isometry equiv on the left preserves the norm of the iterated
derivative within a set. -/
theorem LinearIsometryEquiv.norm_iteratedFDerivWithin_comp_left (g : F ≃ₗᡒ[π•œ] G) (f : E β†’ F)
    (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) (i : β„•) :
    β€–iteratedFDerivWithin π•œ i (g ∘ f) s xβ€– = β€–iteratedFDerivWithin π•œ i f s xβ€– := by
  have :
    iteratedFDerivWithin π•œ i (g ∘ f) s x =
      (g : F β†’L[π•œ] G).compContinuousMultilinearMap (iteratedFDerivWithin π•œ i f s x) :=
    g.toContinuousLinearEquiv.iteratedFDerivWithin_comp_left f hs hx i
  rw [this]
  apply LinearIsometry.norm_compContinuousMultilinearMap g.toLinearIsometry
Norm Preservation of Iterated FrΓ©chet Derivatives under Composition with a Linear Isometric Equivalence
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $g : F \simeq_{\mathbb{K}} G$ be a linear isometric equivalence. For any function $f : E \to F$, a set $s \subseteq E$ with unique differentiability on $\mathbb{K}$, and a point $x \in s$, the norm of the $i$-th iterated FrΓ©chet derivative within $s$ of the composition $g \circ f$ at $x$ is equal to the norm of the $i$-th iterated FrΓ©chet derivative within $s$ of $f$ at $x$. In symbols: $$ \|D^i_s (g \circ f)(x)\| = \|D^i_s f(x)\|, $$ where $D^i_s$ denotes the $i$-th iterated FrΓ©chet derivative within $s$.
LinearIsometryEquiv.norm_iteratedFDeriv_comp_left theorem
(g : F ≃ₗᡒ[π•œ] G) (f : E β†’ F) (x : E) (i : β„•) : β€–iteratedFDeriv π•œ i (g ∘ f) xβ€– = β€–iteratedFDeriv π•œ i f xβ€–
Full source
/-- Composition with a linear isometry equiv on the left preserves the norm of the iterated
derivative. -/
theorem LinearIsometryEquiv.norm_iteratedFDeriv_comp_left (g : F ≃ₗᡒ[π•œ] G) (f : E β†’ F) (x : E)
    (i : β„•) : β€–iteratedFDeriv π•œ i (g ∘ f) xβ€– = β€–iteratedFDeriv π•œ i f xβ€– := by
  rw [← iteratedFDerivWithin_univ, ← iteratedFDerivWithin_univ]
  apply g.norm_iteratedFDerivWithin_comp_left f uniqueDiffOn_univ (mem_univ x) i
Norm Preservation of Iterated FrΓ©chet Derivatives under Composition with a Linear Isometric Equivalence
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $g : F \simeq_{\mathbb{K}} G$ be a linear isometric equivalence. For any function $f : E \to F$ and a point $x \in E$, the norm of the $i$-th iterated FrΓ©chet derivative of the composition $g \circ f$ at $x$ is equal to the norm of the $i$-th iterated FrΓ©chet derivative of $f$ at $x$. In symbols: $$ \|D^i (g \circ f)(x)\| = \|D^i f(x)\|, $$ where $D^i$ denotes the $i$-th iterated FrΓ©chet derivative.
ContinuousLinearEquiv.comp_contDiffWithinAt_iff theorem
(e : F ≃L[π•œ] G) : ContDiffWithinAt π•œ n (e ∘ f) s x ↔ ContDiffWithinAt π•œ n f s x
Full source
/-- Composition by continuous linear equivs on the left respects higher differentiability at a
point in a domain. -/
theorem ContinuousLinearEquiv.comp_contDiffWithinAt_iff (e : F ≃L[π•œ] G) :
    ContDiffWithinAtContDiffWithinAt π•œ n (e ∘ f) s x ↔ ContDiffWithinAt π•œ n f s x :=
  ⟨fun H => by
    simpa only [Function.comp_def, e.symm.coe_coe, e.symm_apply_apply] using
      H.continuousLinearMap_comp (e.symm : G β†’L[π•œ] F),
    fun H => H.continuousLinearMap_comp (e : F β†’L[π•œ] G)⟩
Equivalence of $C^n$ Differentiability Under Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $e : F \simeq_{\mathbb{K}} G$ be a continuous linear equivalence. For a function $f : E \to F$, a set $s \subseteq E$, and a point $x \in E$, the composition $e \circ f$ is $C^n$ within $s$ at $x$ if and only if $f$ is $C^n$ within $s$ at $x$.
ContinuousLinearEquiv.comp_contDiffAt_iff theorem
(e : F ≃L[π•œ] G) : ContDiffAt π•œ n (e ∘ f) x ↔ ContDiffAt π•œ n f x
Full source
/-- Composition by continuous linear equivs on the left respects higher differentiability at a
point. -/
theorem ContinuousLinearEquiv.comp_contDiffAt_iff (e : F ≃L[π•œ] G) :
    ContDiffAtContDiffAt π•œ n (e ∘ f) x ↔ ContDiffAt π•œ n f x := by
  simp only [← contDiffWithinAt_univ, e.comp_contDiffWithinAt_iff]
Equivalence of $C^n$ Differentiability at a Point Under Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $e : F \simeq_{\mathbb{K}} G$ be a continuous linear equivalence. For a function $f : E \to F$ and a point $x \in E$, the composition $e \circ f$ is $C^n$ at $x$ if and only if $f$ is $C^n$ at $x$.
ContinuousLinearEquiv.comp_contDiffOn_iff theorem
(e : F ≃L[π•œ] G) : ContDiffOn π•œ n (e ∘ f) s ↔ ContDiffOn π•œ n f s
Full source
/-- Composition by continuous linear equivs on the left respects higher differentiability on
domains. -/
theorem ContinuousLinearEquiv.comp_contDiffOn_iff (e : F ≃L[π•œ] G) :
    ContDiffOnContDiffOn π•œ n (e ∘ f) s ↔ ContDiffOn π•œ n f s := by
  simp [ContDiffOn, e.comp_contDiffWithinAt_iff]
Equivalence of $C^n$ Differentiability Under Left Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $e : F \simeq_{\mathbb{K}} G$ be a continuous linear equivalence. For a function $f : E \to F$ and a set $s \subseteq E$, the composition $e \circ f$ is $C^n$ on $s$ if and only if $f$ is $C^n$ on $s$.
ContinuousLinearEquiv.comp_contDiff_iff theorem
(e : F ≃L[π•œ] G) : ContDiff π•œ n (e ∘ f) ↔ ContDiff π•œ n f
Full source
/-- Composition by continuous linear equivs on the left respects higher differentiability. -/
theorem ContinuousLinearEquiv.comp_contDiff_iff (e : F ≃L[π•œ] G) :
    ContDiffContDiff π•œ n (e ∘ f) ↔ ContDiff π•œ n f := by
  simp only [← contDiffOn_univ, e.comp_contDiffOn_iff]
Equivalence of $C^n$ Differentiability Under Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $e : F \simeq_{\mathbb{K}} G$ be a continuous linear equivalence. For a function $f : E \to F$, the composition $e \circ f$ is $C^n$ on $E$ if and only if $f$ is $C^n$ on $E$.
HasFTaylorSeriesUpToOn.compContinuousLinearMap theorem
(hf : HasFTaylorSeriesUpToOn n f p s) (g : G β†’L[π•œ] E) : HasFTaylorSeriesUpToOn n (f ∘ g) (fun x k => (p (g x) k).compContinuousLinearMap fun _ => g) (g ⁻¹' s)
Full source
/-- If `f` admits a Taylor series `p` in a set `s`, and `g` is linear, then `f ∘ g` admits a Taylor
series in `g ⁻¹' s`, whose `k`-th term is given by `p k (g v₁, ..., g vβ‚–)` . -/
theorem HasFTaylorSeriesUpToOn.compContinuousLinearMap
    (hf : HasFTaylorSeriesUpToOn n f p s) (g : G β†’L[π•œ] E) :
    HasFTaylorSeriesUpToOn n (f ∘ g) (fun x k => (p (g x) k).compContinuousLinearMap fun _ => g)
      (g ⁻¹' s) := by
  let A : βˆ€ m : β„•, (E[Γ—m]β†’L[π•œ] F) β†’ G[Γ—m]β†’L[π•œ] F := fun m h => h.compContinuousLinearMap fun _ => g
  have hA : βˆ€ m, IsBoundedLinearMap π•œ (A m) := fun m =>
    isBoundedLinearMap_continuousMultilinearMap_comp_linear g
  constructor
  Β· intro x hx
    simp only [(hf.zero_eq (g x) hx).symm, Function.comp_apply]
    change (p (g x) 0 fun _ : Fin 0 => g 0) = p (g x) 0 0
    rw [ContinuousLinearMap.map_zero]
    rfl
  Β· intro m hm x hx
    convert (hA m).hasFDerivAt.comp_hasFDerivWithinAt x
        ((hf.fderivWithin m hm (g x) hx).comp x g.hasFDerivWithinAt (Subset.refl _))
    ext y v
    change p (g x) (Nat.succ m) (g ∘ cons y v) = p (g x) m.succ (cons (g y) (g ∘ v))
    rw [comp_cons]
  Β· intro m hm
    exact (hA m).continuous.comp_continuousOn <| (hf.cont m hm).comp g.continuous.continuousOn <|
      Subset.refl _
Taylor Series of Composition with Continuous Linear Map: $f \circ g$ on $g^{-1}(s)$
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a normed field $\mathbb{K}$. Suppose $f : E \to F$ admits a Taylor series expansion $p$ up to order $n$ on a subset $s \subseteq E$, and let $g : G \to E$ be a continuous linear map. Then the composition $f \circ g : G \to F$ admits a Taylor series expansion up to order $n$ on the preimage $g^{-1}(s) \subseteq G$, where the $k$-th term of the Taylor series at $x \in G$ is given by the composition of the $k$-th term of $p$ at $g(x)$ with the $k$-fold product of $g$.
ContDiffWithinAt.comp_continuousLinearMap theorem
{x : G} (g : G β†’L[π•œ] E) (hf : ContDiffWithinAt π•œ n f s (g x)) : ContDiffWithinAt π•œ n (f ∘ g) (g ⁻¹' s) x
Full source
/-- Composition by continuous linear maps on the right preserves `C^n` functions at a point on
a domain. -/
theorem ContDiffWithinAt.comp_continuousLinearMap {x : G} (g : G β†’L[π•œ] E)
    (hf : ContDiffWithinAt π•œ n f s (g x)) : ContDiffWithinAt π•œ n (f ∘ g) (g ⁻¹' s) x := by
  match n with
  | Ο‰ =>
    obtain ⟨u, hu, p, hp, h'p⟩ := hf
    refine ⟨g ⁻¹' u, ?_, _, hp.compContinuousLinearMap g, ?_⟩
    Β· refine g.continuous.continuousWithinAt.tendsto_nhdsWithin ?_ hu
      exact (mapsTo_singleton.2 <| mem_singleton _).union_union (mapsTo_preimage _ _)
    Β· intro i
      change AnalyticOn π•œ (fun x ↦
        ContinuousMultilinearMap.compContinuousLinearMapL (fun _ ↦ g) (p (g x) i)) (⇑g ⁻¹' u)
      apply AnalyticOn.comp _ _ (Set.mapsTo_univ _ _)
      Β· exact ContinuousLinearEquiv.analyticOn _ _
      Β· exact (h'p i).comp (g.analyticOn _) (mapsTo_preimage _ _)
  | (n : β„•βˆž) =>
    intro m hm
    rcases hf m hm with ⟨u, hu, p, hp⟩
    refine ⟨g ⁻¹' u, ?_, _, hp.compContinuousLinearMap g⟩
    refine g.continuous.continuousWithinAt.tendsto_nhdsWithin ?_ hu
    exact (mapsTo_singleton.2 <| mem_singleton _).union_union (mapsTo_preimage _ _)
$C^n$ Differentiability of Composition with Continuous Linear Map on Preimage
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a normed field $\mathbb{K}$, and let $f : E \to F$ be a function. Suppose that: 1. $f$ is $C^n$ within a set $s \subseteq E$ at a point $g(x) \in E$, where $g : G \to E$ is a continuous linear map and $x \in G$. 2. The preimage $g^{-1}(s) \subseteq G$ is well-defined. Then the composition $f \circ g : G \to F$ is $C^n$ within $g^{-1}(s)$ at $x$.
ContDiffOn.comp_continuousLinearMap theorem
(hf : ContDiffOn π•œ n f s) (g : G β†’L[π•œ] E) : ContDiffOn π•œ n (f ∘ g) (g ⁻¹' s)
Full source
/-- Composition by continuous linear maps on the right preserves `C^n` functions on domains. -/
theorem ContDiffOn.comp_continuousLinearMap (hf : ContDiffOn π•œ n f s) (g : G β†’L[π•œ] E) :
    ContDiffOn π•œ n (f ∘ g) (g ⁻¹' s) := fun x hx => (hf (g x) hx).comp_continuousLinearMap g
Preservation of $C^n$ Differentiability under Composition with Continuous Linear Maps
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$. Let $f : E \to F$ be a function that is $C^n$ on a set $s \subseteq E$, and let $g : G \to E$ be a continuous linear map. Then the composition $f \circ g : G \to F$ is $C^n$ on the preimage $g^{-1}(s) \subseteq G$.
ContDiff.comp_continuousLinearMap theorem
{f : E β†’ F} {g : G β†’L[π•œ] E} (hf : ContDiff π•œ n f) : ContDiff π•œ n (f ∘ g)
Full source
/-- Composition by continuous linear maps on the right preserves `C^n` functions. -/
theorem ContDiff.comp_continuousLinearMap {f : E β†’ F} {g : G β†’L[π•œ] E} (hf : ContDiff π•œ n f) :
    ContDiff π•œ n (f ∘ g) :=
  contDiffOn_univ.1 <| ContDiffOn.comp_continuousLinearMap (contDiffOn_univ.2 hf) _
Preservation of $C^n$ Differentiability under Composition with Continuous Linear Maps
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$. If $f : E \to F$ is a $C^n$ function and $g : G \to E$ is a continuous linear map, then the composition $f \circ g : G \to F$ is also $C^n$.
ContinuousLinearMap.iteratedFDerivWithin_comp_right theorem
{f : E β†’ F} (g : G β†’L[π•œ] E) (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s) (h's : UniqueDiffOn π•œ (g ⁻¹' s)) {x : G} (hx : g x ∈ s) {i : β„•} (hi : i ≀ n) : iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s) x = (iteratedFDerivWithin π•œ i f s (g x)).compContinuousLinearMap fun _ => g
Full source
/-- The iterated derivative within a set of the composition with a linear map on the right is
obtained by composing the iterated derivative with the linear map. -/
theorem ContinuousLinearMap.iteratedFDerivWithin_comp_right {f : E β†’ F} (g : G β†’L[π•œ] E)
    (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s) (h's : UniqueDiffOn π•œ (g ⁻¹' s)) {x : G}
    (hx : g x ∈ s) {i : β„•} (hi : i ≀ n) :
    iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s) x =
      (iteratedFDerivWithin π•œ i f s (g x)).compContinuousLinearMap fun _ => g :=
  ((((hf.of_le hi).ftaylorSeriesWithin hs).compContinuousLinearMap
    g).eq_iteratedFDerivWithin_of_uniqueDiffOn le_rfl h's hx).symm
Iterated FrΓ©chet Derivative of Composition with Continuous Linear Map on Preimage Sets
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $g : G \to_{\text{CL}} E$ be a continuous linear map. Suppose $f : E \to F$ is $C^n$ on a set $s \subseteq E$ (i.e., $f$ is $n$-times continuously differentiable on $s$), and both $s$ and its preimage $g^{-1}(s)$ have the property of unique differentiability. Then for any $x \in G$ with $g(x) \in s$ and any natural number $i \leq n$, the $i$-th iterated FrΓ©chet derivative of $f \circ g$ within $g^{-1}(s)$ at $x$ is equal to the composition of the $i$-th iterated FrΓ©chet derivative of $f$ within $s$ at $g(x)$ with the $i$-fold product of $g$. In symbols: $$ D^i(f \circ g)\big|_{g^{-1}(s)}(x) = D^i f\big|_s(g(x)) \circ (\underbrace{g, \dots, g}_{i \text{ times}}) $$
ContinuousLinearEquiv.iteratedFDerivWithin_comp_right theorem
(g : G ≃L[π•œ] E) (f : E β†’ F) (hs : UniqueDiffOn π•œ s) {x : G} (hx : g x ∈ s) (i : β„•) : iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s) x = (iteratedFDerivWithin π•œ i f s (g x)).compContinuousLinearMap fun _ => g
Full source
/-- The iterated derivative within a set of the composition with a linear equiv on the right is
obtained by composing the iterated derivative with the linear equiv. -/
theorem ContinuousLinearEquiv.iteratedFDerivWithin_comp_right (g : G ≃L[π•œ] E) (f : E β†’ F)
    (hs : UniqueDiffOn π•œ s) {x : G} (hx : g x ∈ s) (i : β„•) :
    iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s) x =
      (iteratedFDerivWithin π•œ i f s (g x)).compContinuousLinearMap fun _ => g := by
  induction' i with i IH generalizing x
  Β· ext1
    simp only [iteratedFDerivWithin_zero_apply, comp_apply,
     ContinuousMultilinearMap.compContinuousLinearMap_apply]
  Β· ext1 m
    simp only [ContinuousMultilinearMap.compContinuousLinearMap_apply,
      ContinuousLinearEquiv.coe_coe, iteratedFDerivWithin_succ_apply_left]
    have : fderivWithin π•œ (iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s)) (g ⁻¹' s) x =
        fderivWithin π•œ
          (ContinuousLinearEquiv.continuousMultilinearMapCongrLeftContinuousLinearEquiv.continuousMultilinearMapCongrLeft _ (fun _x : Fin i => g) ∘
            (iteratedFDerivWithin π•œ i f s ∘ g)) (g ⁻¹' s) x :=
      fderivWithin_congr' (@IH) hx
    rw [this, ContinuousLinearEquiv.comp_fderivWithin _ (g.uniqueDiffOn_preimage_iff.2 hs x hx)]
    simp only [ContinuousLinearMap.coe_comp', ContinuousLinearEquiv.coe_coe, comp_apply,
      ContinuousLinearEquiv.continuousMultilinearMapCongrLeft_apply,
      ContinuousMultilinearMap.compContinuousLinearMap_apply]
    rw [ContinuousLinearEquiv.comp_right_fderivWithin _ (g.uniqueDiffOn_preimage_iff.2 hs x hx),
      ContinuousLinearMap.coe_comp', coe_coe, comp_apply, tail_def, tail_def]
Iterated FrΓ©chet Derivative of Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $g : G \simeqL[\mathbb{K}] E$ be a continuous linear equivalence. For a function $f : E \to F$ and a set $s \subseteq E$ with unique differentiability on $\mathbb{K}$, the $i$-th iterated FrΓ©chet derivative of $f \circ g$ within the preimage $g^{-1}(s)$ at a point $x \in G$ with $g(x) \in s$ is equal to the composition of the $i$-th iterated FrΓ©chet derivative of $f$ within $s$ at $g(x)$ with the continuous linear map $g$ in each argument. In symbols: $$ D^i(f \circ g)\big|_{g^{-1}(s)}(x) = D^i f\big|_s(g(x)) \circ (\underbrace{g, \dots, g}_{i \text{ times}}) $$
ContinuousLinearMap.iteratedFDeriv_comp_right theorem
(g : G β†’L[π•œ] E) {f : E β†’ F} (hf : ContDiff π•œ n f) (x : G) {i : β„•} (hi : i ≀ n) : iteratedFDeriv π•œ i (f ∘ g) x = (iteratedFDeriv π•œ i f (g x)).compContinuousLinearMap fun _ => g
Full source
/-- The iterated derivative of the composition with a linear map on the right is
obtained by composing the iterated derivative with the linear map. -/
theorem ContinuousLinearMap.iteratedFDeriv_comp_right (g : G β†’L[π•œ] E) {f : E β†’ F}
    (hf : ContDiff π•œ n f) (x : G) {i : β„•} (hi : i ≀ n) :
    iteratedFDeriv π•œ i (f ∘ g) x =
      (iteratedFDeriv π•œ i f (g x)).compContinuousLinearMap fun _ => g := by
  simp only [← iteratedFDerivWithin_univ]
  exact g.iteratedFDerivWithin_comp_right hf.contDiffOn uniqueDiffOn_univ uniqueDiffOn_univ
      (mem_univ _) hi
Iterated FrΓ©chet Derivative of Composition with Continuous Linear Map
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $g : G \to E$ be a continuous linear map. If $f : E \to F$ is $n$-times continuously differentiable on $E$ (i.e., $f$ is $C^n$), then for any $x \in G$ and any natural number $i \leq n$, the $i$-th iterated FrΓ©chet derivative of $f \circ g$ at $x$ is equal to the composition of the $i$-th iterated FrΓ©chet derivative of $f$ at $g(x)$ with the $i$-fold product of $g$. In symbols: $$ D^i(f \circ g)(x) = D^i f(g(x)) \circ (\underbrace{g, \dots, g}_{i \text{ times}}) $$
LinearIsometryEquiv.norm_iteratedFDerivWithin_comp_right theorem
(g : G ≃ₗᡒ[π•œ] E) (f : E β†’ F) (hs : UniqueDiffOn π•œ s) {x : G} (hx : g x ∈ s) (i : β„•) : β€–iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s) xβ€– = β€–iteratedFDerivWithin π•œ i f s (g x)β€–
Full source
/-- Composition with a linear isometry on the right preserves the norm of the iterated derivative
within a set. -/
theorem LinearIsometryEquiv.norm_iteratedFDerivWithin_comp_right (g : G ≃ₗᡒ[π•œ] E) (f : E β†’ F)
    (hs : UniqueDiffOn π•œ s) {x : G} (hx : g x ∈ s) (i : β„•) :
    β€–iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s) xβ€– = β€–iteratedFDerivWithin π•œ i f s (g x)β€– := by
  have : iteratedFDerivWithin π•œ i (f ∘ g) (g ⁻¹' s) x =
      (iteratedFDerivWithin π•œ i f s (g x)).compContinuousLinearMap fun _ => g :=
    g.toContinuousLinearEquiv.iteratedFDerivWithin_comp_right f hs hx i
  rw [this, ContinuousMultilinearMap.norm_compContinuous_linearIsometryEquiv]
Norm Preservation of Iterated FrΓ©chet Derivatives under Composition with Linear Isometric Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $g : G \simeq_{\mathbb{K}} E$ be a linear isometric equivalence. For a function $f : E \to F$ and a set $s \subseteq E$ with unique differentiability on $\mathbb{K}$, the norm of the $i$-th iterated FrΓ©chet derivative of $f \circ g$ within the preimage $g^{-1}(s)$ at a point $x \in G$ with $g(x) \in s$ is equal to the norm of the $i$-th iterated FrΓ©chet derivative of $f$ within $s$ at $g(x)$. In symbols: $$ \|D^i(f \circ g)\big|_{g^{-1}(s)}(x)\| = \|D^i f\big|_s(g(x))\| $$
LinearIsometryEquiv.norm_iteratedFDeriv_comp_right theorem
(g : G ≃ₗᡒ[π•œ] E) (f : E β†’ F) (x : G) (i : β„•) : β€–iteratedFDeriv π•œ i (f ∘ g) xβ€– = β€–iteratedFDeriv π•œ i f (g x)β€–
Full source
/-- Composition with a linear isometry on the right preserves the norm of the iterated derivative
within a set. -/
theorem LinearIsometryEquiv.norm_iteratedFDeriv_comp_right (g : G ≃ₗᡒ[π•œ] E) (f : E β†’ F) (x : G)
    (i : β„•) : β€–iteratedFDeriv π•œ i (f ∘ g) xβ€– = β€–iteratedFDeriv π•œ i f (g x)β€– := by
  simp only [← iteratedFDerivWithin_univ]
  apply g.norm_iteratedFDerivWithin_comp_right f uniqueDiffOn_univ (mem_univ (g x)) i
Norm Equality of Iterated FrΓ©chet Derivatives under Composition with Linear Isometric Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $g : G \simeq_{\mathbb{K}} E$ be a linear isometric equivalence. For any function $f : E \to F$, point $x \in G$, and natural number $i$, the norm of the $i$-th iterated FrΓ©chet derivative of $f \circ g$ at $x$ is equal to the norm of the $i$-th iterated FrΓ©chet derivative of $f$ at $g(x)$. In symbols: $$ \|D^i(f \circ g)(x)\| = \|D^i f(g(x))\| $$
ContinuousLinearEquiv.contDiffWithinAt_comp_iff theorem
(e : G ≃L[π•œ] E) : ContDiffWithinAt π•œ n (f ∘ e) (e ⁻¹' s) (e.symm x) ↔ ContDiffWithinAt π•œ n f s x
Full source
/-- Composition by continuous linear equivs on the right respects higher differentiability at a
point in a domain. -/
theorem ContinuousLinearEquiv.contDiffWithinAt_comp_iff (e : G ≃L[π•œ] E) :
    ContDiffWithinAtContDiffWithinAt π•œ n (f ∘ e) (e ⁻¹' s) (e.symm x) ↔ ContDiffWithinAt π•œ n f s x := by
  constructor
  Β· intro H
    simpa [← preimage_comp, Function.comp_def] using H.comp_continuousLinearMap (e.symm : E β†’L[π•œ] G)
  Β· intro H
    rw [← e.apply_symm_apply x, ← e.coe_coe] at H
    exact H.comp_continuousLinearMap _
Equivalence of $C^n$ Differentiability under Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $e : G \simeqL[\mathbb{K}] E$ be a continuous linear equivalence. For a function $f : E \to F$, a set $s \subseteq E$, and a point $x \in E$, the composition $f \circ e$ is $C^n$ within the preimage $e^{-1}(s)$ at the point $e^{-1}(x)$ if and only if $f$ is $C^n$ within $s$ at $x$.
ContinuousLinearEquiv.contDiffAt_comp_iff theorem
(e : G ≃L[π•œ] E) : ContDiffAt π•œ n (f ∘ e) (e.symm x) ↔ ContDiffAt π•œ n f x
Full source
/-- Composition by continuous linear equivs on the right respects higher differentiability at a
point. -/
theorem ContinuousLinearEquiv.contDiffAt_comp_iff (e : G ≃L[π•œ] E) :
    ContDiffAtContDiffAt π•œ n (f ∘ e) (e.symm x) ↔ ContDiffAt π•œ n f x := by
  rw [← contDiffWithinAt_univ, ← contDiffWithinAt_univ, ← preimage_univ]
  exact e.contDiffWithinAt_comp_iff
Equivalence of $C^n$ Differentiability at a Point under Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $e : G \simeqL[\mathbb{K}] E$ be a continuous linear equivalence. For a function $f : E \to F$ and a point $x \in E$, the composition $f \circ e$ is $C^n$ at the point $e^{-1}(x)$ if and only if $f$ is $C^n$ at $x$.
ContinuousLinearEquiv.contDiffOn_comp_iff theorem
(e : G ≃L[π•œ] E) : ContDiffOn π•œ n (f ∘ e) (e ⁻¹' s) ↔ ContDiffOn π•œ n f s
Full source
/-- Composition by continuous linear equivs on the right respects higher differentiability on
domains. -/
theorem ContinuousLinearEquiv.contDiffOn_comp_iff (e : G ≃L[π•œ] E) :
    ContDiffOnContDiffOn π•œ n (f ∘ e) (e ⁻¹' s) ↔ ContDiffOn π•œ n f s :=
  ⟨fun H => by simpa [Function.comp_def] using H.comp_continuousLinearMap (e.symm : E β†’L[π•œ] G),
    fun H => H.comp_continuousLinearMap (e : G β†’L[π•œ] E)⟩
Equivalence of $C^n$ Differentiability under Composition with Continuous Linear Equivalence on Sets
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $e : G \simeqL[\mathbb{K}] E$ be a continuous linear equivalence. For a function $f : E \to F$ and a set $s \subseteq E$, the composition $f \circ e$ is $C^n$ on the preimage $e^{-1}(s)$ if and only if $f$ is $C^n$ on $s$.
ContinuousLinearEquiv.contDiff_comp_iff theorem
(e : G ≃L[π•œ] E) : ContDiff π•œ n (f ∘ e) ↔ ContDiff π•œ n f
Full source
/-- Composition by continuous linear equivs on the right respects higher differentiability. -/
theorem ContinuousLinearEquiv.contDiff_comp_iff (e : G ≃L[π•œ] E) :
    ContDiffContDiff π•œ n (f ∘ e) ↔ ContDiff π•œ n f := by
  rw [← contDiffOn_univ, ← contDiffOn_univ, ← preimage_univ]
  exact e.contDiffOn_comp_iff
Equivalence of $C^n$ Differentiability under Composition with Continuous Linear Equivalence
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$, and let $e : G \simeqL[\mathbb{K}] E$ be a continuous linear equivalence. For a function $f : E \to F$, the composition $f \circ e$ is $C^n$ on $G$ if and only if $f$ is $C^n$ on $E$.
HasFTaylorSeriesUpToOn.prodMk theorem
{n : WithTop β„•βˆž} (hf : HasFTaylorSeriesUpToOn n f p s) {g : E β†’ G} {q : E β†’ FormalMultilinearSeries π•œ E G} (hg : HasFTaylorSeriesUpToOn n g q s) : HasFTaylorSeriesUpToOn n (fun y => (f y, g y)) (fun y k => (p y k).prod (q y k)) s
Full source
/-- If two functions `f` and `g` admit Taylor series `p` and `q` in a set `s`, then the cartesian
product of `f` and `g` admits the cartesian product of `p` and `q` as a Taylor series. -/
theorem HasFTaylorSeriesUpToOn.prodMk {n : WithTop β„•βˆž}
    (hf : HasFTaylorSeriesUpToOn n f p s) {g : E β†’ G}
    {q : E β†’ FormalMultilinearSeries π•œ E G} (hg : HasFTaylorSeriesUpToOn n g q s) :
    HasFTaylorSeriesUpToOn n (fun y => (f y, g y)) (fun y k => (p y k).prod (q y k)) s := by
  set L := fun m => ContinuousMultilinearMap.prodL π•œ (fun _ : Fin m => E) F G
  constructor
  Β· intro x hx; rw [← hf.zero_eq x hx, ← hg.zero_eq x hx]; rfl
  Β· intro m hm x hx
    convert (L m).hasFDerivAt.comp_hasFDerivWithinAt x
        ((hf.fderivWithin m hm x hx).prodMk (hg.fderivWithin m hm x hx))
  Β· intro m hm
    exact (L m).continuous.comp_continuousOn ((hf.cont m hm).prodMk (hg.cont m hm))
Product of Functions Admits Product Taylor Series
Informal description
Let $E$, $F$, and $G$ be normed spaces over a field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Suppose $f \colon E \to F$ and $g \colon E \to G$ admit Taylor series expansions $p$ and $q$ up to order $n$ on $s$, respectively. Then the product function $(f, g) \colon E \to F \times G$ defined by $y \mapsto (f(y), g(y))$ admits the product Taylor series $(p, q)$ up to order $n$ on $s$, where for each $y \in E$ and each order $k$, the $k$-th term of the product Taylor series is the product $(p(y, k), q(y, k))$ of the $k$-th terms of $p$ and $q$.
ContDiffWithinAt.prodMk theorem
{s : Set E} {f : E β†’ F} {g : E β†’ G} (hf : ContDiffWithinAt π•œ n f s x) (hg : ContDiffWithinAt π•œ n g s x) : ContDiffWithinAt π•œ n (fun x : E => (f x, g x)) s x
Full source
/-- The cartesian product of `C^n` functions at a point in a domain is `C^n`. -/
theorem ContDiffWithinAt.prodMk {s : Set E} {f : E β†’ F} {g : E β†’ G}
    (hf : ContDiffWithinAt π•œ n f s x) (hg : ContDiffWithinAt π•œ n g s x) :
    ContDiffWithinAt π•œ n (fun x : E => (f x, g x)) s x := by
  match n with
  | Ο‰ =>
    obtain ⟨u, hu, p, hp, h'p⟩ := hf
    obtain ⟨v, hv, q, hq, h'q⟩ := hg
    refine ⟨u ∩ v, Filter.inter_mem hu hv, _,
      (hp.mono inter_subset_left).prodMk (hq.mono inter_subset_right), fun i ↦ ?_⟩
    change AnalyticOn π•œ (fun x ↦ ContinuousMultilinearMap.prodL _ _ _ _ (p x i, q x i)) (u ∩ v)
    apply (LinearIsometryEquiv.analyticOnNhd _ _).comp_analyticOn _ (Set.mapsTo_univ _ _)
    exact ((h'p i).mono inter_subset_left).prod ((h'q i).mono inter_subset_right)
  | (n : β„•βˆž) =>
    intro m hm
    rcases hf m hm with ⟨u, hu, p, hp⟩
    rcases hg m hm with ⟨v, hv, q, hq⟩
    exact ⟨u ∩ v, Filter.inter_mem hu hv, _,
      (hp.mono inter_subset_left).prodMk (hq.mono inter_subset_right)⟩
Product of $C^n$ Functions is $C^n$ at a Point Within a Set
Informal description
Let $E$, $F$, and $G$ be normed spaces over a field $\mathbb{K}$, and let $s \subseteq E$ be a subset. For functions $f \colon E \to F$ and $g \colon E \to G$ that are $C^n$ within $s$ at a point $x \in E$, the product function $x \mapsto (f(x), g(x))$ is also $C^n$ within $s$ at $x$.
ContDiffOn.prodMk theorem
{s : Set E} {f : E β†’ F} {g : E β†’ G} (hf : ContDiffOn π•œ n f s) (hg : ContDiffOn π•œ n g s) : ContDiffOn π•œ n (fun x : E => (f x, g x)) s
Full source
/-- The cartesian product of `C^n` functions on domains is `C^n`. -/
theorem ContDiffOn.prodMk {s : Set E} {f : E β†’ F} {g : E β†’ G} (hf : ContDiffOn π•œ n f s)
    (hg : ContDiffOn π•œ n g s) : ContDiffOn π•œ n (fun x : E => (f x, g x)) s := fun x hx =>
  (hf x hx).prodMk (hg x hx)
Product of $C^n$ Functions on a Set is $C^n$
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. For functions $f \colon E \to F$ and $g \colon E \to G$ that are $C^n$ on $s$, the product function $x \mapsto (f(x), g(x))$ is also $C^n$ on $s$.
ContDiffAt.prodMk theorem
{f : E β†’ F} {g : E β†’ G} (hf : ContDiffAt π•œ n f x) (hg : ContDiffAt π•œ n g x) : ContDiffAt π•œ n (fun x : E => (f x, g x)) x
Full source
/-- The cartesian product of `C^n` functions at a point is `C^n`. -/
theorem ContDiffAt.prodMk {f : E β†’ F} {g : E β†’ G} (hf : ContDiffAt π•œ n f x)
    (hg : ContDiffAt π•œ n g x) : ContDiffAt π•œ n (fun x : E => (f x, g x)) x :=
  contDiffWithinAt_univ.1 <| hf.contDiffWithinAt.prodMk hg.contDiffWithinAt
Product of $C^n$ Functions is $C^n$ at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. For functions $f \colon E \to F$ and $g \colon E \to G$ that are $C^n$ at a point $x \in E$, the product function $x \mapsto (f(x), g(x))$ is also $C^n$ at $x$.
ContDiff.prodMk theorem
{f : E β†’ F} {g : E β†’ G} (hf : ContDiff π•œ n f) (hg : ContDiff π•œ n g) : ContDiff π•œ n fun x : E => (f x, g x)
Full source
/-- The cartesian product of `C^n` functions is `C^n`. -/
theorem ContDiff.prodMk {f : E β†’ F} {g : E β†’ G} (hf : ContDiff π•œ n f) (hg : ContDiff π•œ n g) :
    ContDiff π•œ n fun x : E => (f x, g x) :=
  contDiffOn_univ.1 <| hf.contDiffOn.prodMk hg.contDiffOn
Product of $C^n$ Functions is $C^n$
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given two functions $f \colon E \to F$ and $g \colon E \to G$ that are $C^n$ (continuously differentiable of order $n$) on $E$, the product function $x \mapsto (f(x), g(x))$ is also $C^n$ on $E$.
ContDiffWithinAt.comp theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E) (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) (st : MapsTo f s t) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`. -/
theorem ContDiffWithinAt.comp {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E)
    (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) (st : MapsTo f s t) :
    ContDiffWithinAt π•œ n (g ∘ f) s x := by
  match n with
  | Ο‰ =>
    have h'f : ContDiffWithinAt π•œ Ο‰ f s x := hf
    obtain ⟨u, hu, p, hp, h'p⟩ := h'f
    obtain ⟨v, hv, q, hq, h'q⟩ := hg
    let w := insertinsert x s ∩ (u ∩ f ⁻¹' v)
    have wv : w βŠ† f ⁻¹' v := fun y hy => hy.2.2
    have wu : w βŠ† u := fun y hy => hy.2.1
    refine ⟨w, ?_, fun y ↦ (q (f y)).taylorComp (p y), hq.comp (hp.mono wu) wv, ?_⟩
    Β· apply inter_mem self_mem_nhdsWithin (inter_mem hu ?_)
      apply (continuousWithinAt_insert_self.2 hf.continuousWithinAt).preimage_mem_nhdsWithin'
      apply nhdsWithin_mono _ _ hv
      simp only [image_insert_eq]
      apply insert_subset_insert
      exact image_subset_iff.mpr st
    Β· have : AnalyticOn π•œ f w := by
        have : AnalyticOn π•œ (fun y ↦ (continuousMultilinearCurryFin0 π•œ E F).symm (f y)) w :=
          ((h'p 0).mono wu).congr  fun y hy ↦ (hp.zero_eq' (wu hy)).symm
        have : AnalyticOn π•œ (fun y ↦ (continuousMultilinearCurryFin0 π•œ E F)
            ((continuousMultilinearCurryFin0 π•œ E F).symm (f y))) w :=
          AnalyticOnNhd.comp_analyticOn (LinearIsometryEquiv.analyticOnNhd _ _ ) this
          (mapsTo_univ _ _)
        simpa using this
      exact analyticOn_taylorComp h'q (fun n ↦ (h'p n).mono wu) this wv
  | (n : β„•βˆž) =>
    intro m hm
    rcases hf m hm with ⟨u, hu, p, hp⟩
    rcases hg m hm with ⟨v, hv, q, hq⟩
    let w := insertinsert x s ∩ (u ∩ f ⁻¹' v)
    have wv : w βŠ† f ⁻¹' v := fun y hy => hy.2.2
    have wu : w βŠ† u := fun y hy => hy.2.1
    refine ⟨w, ?_, fun y ↦ (q (f y)).taylorComp (p y), hq.comp (hp.mono wu) wv⟩
    apply inter_mem self_mem_nhdsWithin (inter_mem hu ?_)
    apply (continuousWithinAt_insert_self.2 hf.continuousWithinAt).preimage_mem_nhdsWithin'
    apply nhdsWithin_mono _ _ hv
    simp only [image_insert_eq]
    apply insert_subset_insert
    exact image_subset_iff.mpr st
$C^n$ Differentiability of Composition within Subsets at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $f(x)$, 2. $f$ is $C^n$ within $s$ at $x$, and 3. $f$ maps $s$ into $t$ (i.e., $f(s) \subseteq t$), then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffOn.comp theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (hg : ContDiffOn π•œ n g t) (hf : ContDiffOn π•œ n f s) (st : MapsTo f s t) : ContDiffOn π•œ n (g ∘ f) s
Full source
/-- The composition of `C^n` functions on domains is `C^n`. -/
theorem ContDiffOn.comp {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (hg : ContDiffOn π•œ n g t)
    (hf : ContDiffOn π•œ n f s) (st : MapsTo f s t) : ContDiffOn π•œ n (g ∘ f) s :=
  fun x hx ↦ ContDiffWithinAt.comp x (hg (f x) (st hx)) (hf x hx) st
$C^n$ Differentiability of Function Composition on Subsets
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ on $t$, 2. $f$ is $C^n$ on $s$, and 3. $f$ maps $s$ into $t$ (i.e., $f(s) \subseteq t$), then the composition $g \circ f$ is $C^n$ on $s$.
ContDiffOn.comp_inter theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (hg : ContDiffOn π•œ n g t) (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (g ∘ f) (s ∩ f ⁻¹' t)
Full source
/-- The composition of `C^n` functions on domains is `C^n`. -/
theorem ContDiffOn.comp_inter
    {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (hg : ContDiffOn π•œ n g t)
    (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (g ∘ f) (s ∩ f ⁻¹' t) :=
  hg.comp (hf.mono inter_subset_left) inter_subset_right
$C^n$ Differentiability of Composition on Intersection with Preimage
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ on $t$, and 2. $f$ is $C^n$ on $s$, then the composition $g \circ f$ is $C^n$ on the intersection $s \cap f^{-1}(t)$.
ContDiff.comp_contDiffOn theorem
{s : Set E} {g : F β†’ G} {f : E β†’ F} (hg : ContDiff π•œ n g) (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (g ∘ f) s
Full source
/-- The composition of a `C^n` function on a domain with a `C^n` function is `C^n`. -/
theorem ContDiff.comp_contDiffOn {s : Set E} {g : F β†’ G} {f : E β†’ F} (hg : ContDiff π•œ n g)
    (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (g ∘ f) s :=
  (contDiffOn_univ.2 hg).comp hf (mapsTo_univ _ _)
Composition of a \( C^n \) function with a \( C^n \) function on a subset is \( C^n \) on that subset
Informal description
Let \( E \), \( F \), and \( G \) be normed spaces over a nontrivially normed field \( \mathbb{K} \), and let \( s \subseteq E \) be a subset. Given functions \( f : E \to F \) and \( g : F \to G \), and an extended natural number \( n \in \mathbb{N}_\infty \), if: 1. \( g \) is \( C^n \) on \( F \), and 2. \( f \) is \( C^n \) on \( s \), then the composition \( g \circ f \) is \( C^n \) on \( s \).
ContDiffOn.comp_contDiff theorem
{s : Set F} {g : F β†’ G} {f : E β†’ F} (hg : ContDiffOn π•œ n g s) (hf : ContDiff π•œ n f) (hs : βˆ€ x, f x ∈ s) : ContDiff π•œ n (g ∘ f)
Full source
theorem ContDiffOn.comp_contDiff {s : Set F} {g : F β†’ G} {f : E β†’ F} (hg : ContDiffOn π•œ n g s)
    (hf : ContDiff π•œ n f) (hs : βˆ€ x, f x ∈ s) : ContDiff π•œ n (g ∘ f) := by
  rw [← contDiffOn_univ] at *
  exact hg.comp hf fun x _ => hs x
$C^n$ Differentiability of Composition with Globally $C^n$ Function
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq F$ be a subset. Given functions $f : E \to F$ and $g : F \to G$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ on $s$, 2. $f$ is $C^n$ on $E$, and 3. $f$ maps $E$ into $s$ (i.e., $f(E) \subseteq s$), then the composition $g \circ f$ is $C^n$ on $E$.
ContDiffOn.image_comp_contDiff theorem
{s : Set E} {g : F β†’ G} {f : E β†’ F} (hg : ContDiffOn π•œ n g (f '' s)) (hf : ContDiff π•œ n f) : ContDiffOn π•œ n (g ∘ f) s
Full source
theorem ContDiffOn.image_comp_contDiff {s : Set E} {g : F β†’ G} {f : E β†’ F}
    (hg : ContDiffOn π•œ n g (f '' s)) (hf : ContDiff π•œ n f) : ContDiffOn π•œ n (g ∘ f) s :=
  hg.comp hf.contDiffOn (s.mapsTo_image f)
$C^n$ Differentiability of Composition via Image Condition
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given functions $f : E \to F$ and $g : F \to G$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ on the image $f(s) \subseteq F$, and 2. $f$ is $C^n$ on $E$, then the composition $g \circ f$ is $C^n$ on $s$.
ContDiff.comp theorem
{g : F β†’ G} {f : E β†’ F} (hg : ContDiff π•œ n g) (hf : ContDiff π•œ n f) : ContDiff π•œ n (g ∘ f)
Full source
/-- The composition of `C^n` functions is `C^n`. -/
theorem ContDiff.comp {g : F β†’ G} {f : E β†’ F} (hg : ContDiff π•œ n g) (hf : ContDiff π•œ n f) :
    ContDiff π•œ n (g ∘ f) :=
  contDiffOn_univ.1 <| ContDiffOn.comp (contDiffOn_univ.2 hg) (contDiffOn_univ.2 hf) (subset_univ _)
Composition of $C^n$ functions is $C^n$
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \to F$ and $g : F \to G$, and an extended natural number $n \in \mathbb{N}_\infty$, if both $f$ and $g$ are $C^n$ functions, then their composition $g \circ f$ is also $C^n$.
ContDiffWithinAt.comp_of_eq theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F} (x : E) (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x) (st : MapsTo f s t) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`. -/
theorem ContDiffWithinAt.comp_of_eq {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F} (x : E)
    (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x) (st : MapsTo f s t)
    (hy : f x = y) :
    ContDiffWithinAt π•œ n (g ∘ f) s x := by
  subst hy; exact hg.comp x hf st
$C^n$ Differentiability of Composition at Points with Matching Values
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $y \in F$, 2. $f$ is $C^n$ within $s$ at $x$, 3. $f$ maps $s$ into $t$ (i.e., $f(s) \subseteq t$), and 4. $f(x) = y$, then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffWithinAt.comp_of_mem_nhdsWithin_image theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E) (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) (hs : t ∈ 𝓝[f '' s] f x) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`,
  with a weaker condition on `s` and `t`. -/
theorem ContDiffWithinAt.comp_of_mem_nhdsWithin_image
    {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E)
    (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x)
    (hs : t ∈ 𝓝[f '' s] f x) : ContDiffWithinAt π•œ n (g ∘ f) s x :=
  (hg.mono_of_mem_nhdsWithin hs).comp x hf (subset_preimage_image f s)
$C^n$ Differentiability of Composition under Neighborhood Condition on Image
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $f(x)$, 2. $f$ is $C^n$ within $s$ at $x$, and 3. $t$ is a neighborhood of $f(x)$ within the image $f(s)$, then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffWithinAt.comp_of_mem_nhdsWithin_image_of_eq theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F} (x : E) (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x) (hs : t ∈ 𝓝[f '' s] f x) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`,
  with a weaker condition on `s` and `t`. -/
theorem ContDiffWithinAt.comp_of_mem_nhdsWithin_image_of_eq
    {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F} (x : E)
    (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x)
    (hs : t ∈ 𝓝[f '' s] f x) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) s x := by
  subst hy; exact hg.comp_of_mem_nhdsWithin_image x hf hs
$C^n$ Differentiability of Composition under Neighborhood Condition and Value Matching
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $y \in F$, 2. $f$ is $C^n$ within $s$ at $x$, 3. $t$ is a neighborhood of $f(x)$ within the image $f(s)$, and 4. $f(x) = y$, then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffWithinAt.comp_inter theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E) (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) : ContDiffWithinAt π•œ n (g ∘ f) (s ∩ f ⁻¹' t) x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`. -/
theorem ContDiffWithinAt.comp_inter {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E)
    (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) :
    ContDiffWithinAt π•œ n (g ∘ f) (s ∩ f ⁻¹' t) x :=
  hg.comp x (hf.mono inter_subset_left) inter_subset_right
$C^n$ Differentiability of Composition on Intersection with Preimage
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $f(x)$, and 2. $f$ is $C^n$ within $s$ at $x$, then the composition $g \circ f$ is $C^n$ within $s \cap f^{-1}(t)$ at $x$.
ContDiffWithinAt.comp_inter_of_eq theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F} (x : E) (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) (s ∩ f ⁻¹' t) x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`. -/
theorem ContDiffWithinAt.comp_inter_of_eq {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F}
    (x : E) (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x) (hy : f x = y) :
    ContDiffWithinAt π•œ n (g ∘ f) (s ∩ f ⁻¹' t) x := by
  subst hy; exact hg.comp_inter x hf
$C^n$ Differentiability of Composition on Intersection with Preimage at Equal Points
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $y$, 2. $f$ is $C^n$ within $s$ at $x$, and 3. $f(x) = y$, then the composition $g \circ f$ is $C^n$ within $s \cap f^{-1}(t)$ at $x$.
ContDiffWithinAt.comp_of_preimage_mem_nhdsWithin theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E) (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) (hs : f ⁻¹' t ∈ 𝓝[s] x) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`,
  with a weaker condition on `s` and `t`. -/
theorem ContDiffWithinAt.comp_of_preimage_mem_nhdsWithin
    {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} (x : E)
    (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x)
    (hs : f ⁻¹' tf ⁻¹' t ∈ 𝓝[s] x) : ContDiffWithinAt π•œ n (g ∘ f) s x :=
  (hg.comp_inter x hf).mono_of_mem_nhdsWithin (inter_mem self_mem_nhdsWithin hs)
$C^n$ Differentiability of Composition with Neighborhood Condition
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $f(x)$, 2. $f$ is $C^n$ within $s$ at $x$, and 3. The preimage $f^{-1}(t)$ is a neighborhood of $x$ within $s$, then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffWithinAt.comp_of_preimage_mem_nhdsWithin_of_eq theorem
{s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F} (x : E) (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x) (hs : f ⁻¹' t ∈ 𝓝[s] x) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
/-- The composition of `C^n` functions at points in domains is `C^n`,
  with a weaker condition on `s` and `t`. -/
theorem ContDiffWithinAt.comp_of_preimage_mem_nhdsWithin_of_eq
    {s : Set E} {t : Set F} {g : F β†’ G} {f : E β†’ F} {y : F} (x : E)
    (hg : ContDiffWithinAt π•œ n g t y) (hf : ContDiffWithinAt π•œ n f s x)
    (hs : f ⁻¹' tf ⁻¹' t ∈ 𝓝[s] x) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) s x := by
  subst hy; exact hg.comp_of_preimage_mem_nhdsWithin x hf hs
$C^n$ Differentiability of Composition with Neighborhood and Point Equality Conditions
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ within $t$ at $y$, 2. $f$ is $C^n$ within $s$ at $x$, 3. The preimage $f^{-1}(t)$ is a neighborhood of $x$ within $s$, and 4. $f(x) = y$, then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffAt.comp_contDiffWithinAt theorem
(x : E) (hg : ContDiffAt π•œ n g (f x)) (hf : ContDiffWithinAt π•œ n f s x) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
theorem ContDiffAt.comp_contDiffWithinAt (x : E) (hg : ContDiffAt π•œ n g (f x))
    (hf : ContDiffWithinAt π•œ n f s x) : ContDiffWithinAt π•œ n (g ∘ f) s x :=
  hg.comp x hf (mapsTo_univ _ _)
$C^n$ Differentiability of Composition at a Point within a Subset
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ at $f(x)$, and 2. $f$ is $C^n$ within $s$ at $x$, then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffAt.comp_contDiffWithinAt_of_eq theorem
{y : F} (x : E) (hg : ContDiffAt π•œ n g y) (hf : ContDiffWithinAt π•œ n f s x) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) s x
Full source
theorem ContDiffAt.comp_contDiffWithinAt_of_eq {y : F} (x : E) (hg : ContDiffAt π•œ n g y)
    (hf : ContDiffWithinAt π•œ n f s x) (hy : f x = y) : ContDiffWithinAt π•œ n (g ∘ f) s x := by
  subst hy; exact hg.comp_contDiffWithinAt x hf
$C^n$ Differentiability of Composition at a Point within a Subset with Point Equality
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ at a point $y \in F$, 2. $f$ is $C^n$ within $s$ at $x$, and 3. $f(x) = y$, then the composition $g \circ f$ is $C^n$ within $s$ at $x$.
ContDiffAt.comp theorem
(x : E) (hg : ContDiffAt π•œ n g (f x)) (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (g ∘ f) x
Full source
/-- The composition of `C^n` functions at points is `C^n`. -/
nonrec theorem ContDiffAt.comp (x : E) (hg : ContDiffAt π•œ n g (f x)) (hf : ContDiffAt π•œ n f x) :
    ContDiffAt π•œ n (g ∘ f) x :=
  hg.comp x hf (mapsTo_univ _ _)
$C^n$ Differentiability of Composition at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ at $f(x)$, and 2. $f$ is $C^n$ at $x$, then the composition $g \circ f$ is $C^n$ at $x$.
ContDiff.comp_contDiffWithinAt theorem
{g : F β†’ G} {f : E β†’ F} (h : ContDiff π•œ n g) (hf : ContDiffWithinAt π•œ n f t x) : ContDiffWithinAt π•œ n (g ∘ f) t x
Full source
theorem ContDiff.comp_contDiffWithinAt {g : F β†’ G} {f : E β†’ F} (h : ContDiff π•œ n g)
    (hf : ContDiffWithinAt π•œ n f t x) : ContDiffWithinAt π•œ n (g ∘ f) t x :=
  haveI : ContDiffWithinAt π•œ n g univ (f x) := h.contDiffAt.contDiffWithinAt
  this.comp x hf (subset_univ _)
$C^n$ Differentiability of Composition with Global and Local Regularity
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ (continuously differentiable of order $n$), and 2. $f$ is $C^n$ within a set $t \subseteq E$ at $x$, then the composition $g \circ f$ is $C^n$ within $t$ at $x$.
ContDiff.comp_contDiffAt theorem
{g : F β†’ G} {f : E β†’ F} (x : E) (hg : ContDiff π•œ n g) (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (g ∘ f) x
Full source
theorem ContDiff.comp_contDiffAt {g : F β†’ G} {f : E β†’ F} (x : E) (hg : ContDiff π•œ n g)
    (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (g ∘ f) x :=
  hg.comp_contDiffWithinAt hf
$C^n$ Differentiability of Composition at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \to F$ and $g : F \to G$, a point $x \in E$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ (continuously differentiable of order $n$), and 2. $f$ is $C^n$ at $x$, then the composition $g \circ f$ is $C^n$ at $x$.
iteratedFDerivWithin_comp_of_eventually_mem theorem
{t : Set F} (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) (ht : UniqueDiffOn π•œ t) (hs : UniqueDiffOn π•œ s) (hxs : x ∈ s) (hst : βˆ€αΆ  y in 𝓝[s] x, f y ∈ t) {i : β„•} (hi : i ≀ n) : iteratedFDerivWithin π•œ i (g ∘ f) s x = (ftaylorSeriesWithin π•œ g t (f x)).taylorComp (ftaylorSeriesWithin π•œ f s x) i
Full source
theorem iteratedFDerivWithin_comp_of_eventually_mem {t : Set F}
    (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x)
    (ht : UniqueDiffOn π•œ t) (hs : UniqueDiffOn π•œ s) (hxs : x ∈ s) (hst : βˆ€αΆ  y in 𝓝[s] x, f y ∈ t)
    {i : β„•} (hi : i ≀ n) :
    iteratedFDerivWithin π•œ i (g ∘ f) s x =
      (ftaylorSeriesWithin π•œ g t (f x)).taylorComp (ftaylorSeriesWithin π•œ f s x) i := by
  obtain ⟨u, hxu, huo, hfu, hgu⟩ : βˆƒ u, x ∈ u ∧ IsOpen u ∧
      HasFTaylorSeriesUpToOn i f (ftaylorSeriesWithin π•œ f s) (s ∩ u) ∧
      HasFTaylorSeriesUpToOn i g (ftaylorSeriesWithin π•œ g t) (f '' (s ∩ u)) := by
    have hxt : f x ∈ t := hst.self_of_nhdsWithin hxs
    have hf_tendsto : Tendsto f (𝓝[s] x) (𝓝[t] (f x)) :=
      tendsto_nhdsWithin_iff.mpr ⟨hf.continuousWithinAt, hst⟩
    have H₁ : βˆ€αΆ  u in (𝓝[s] x).smallSets,
        HasFTaylorSeriesUpToOn i f (ftaylorSeriesWithin π•œ f s) u :=
      hf.eventually_hasFTaylorSeriesUpToOn hs hxs hi
    have Hβ‚‚ : βˆ€αΆ  u in (𝓝[s] x).smallSets,
        HasFTaylorSeriesUpToOn i g (ftaylorSeriesWithin π•œ g t) (f '' u) :=
      hf_tendsto.image_smallSets.eventually (hg.eventually_hasFTaylorSeriesUpToOn ht hxt hi)
    rcases (nhdsWithin_basis_open _ _).smallSets.eventually_iff.mp (H₁.and Hβ‚‚)
      with ⟨u, ⟨hxu, huo⟩, hu⟩
    exact ⟨u, hxu, huo, hu (by simp [inter_comm])⟩
  exact .symm <| (hgu.comp hfu (mapsTo_image _ _)).eq_iteratedFDerivWithin_of_uniqueDiffOn le_rfl
    (hs.inter huo) ⟨hxs, hxu⟩ |>.trans <| iteratedFDerivWithin_inter_open huo hxu
Iterated FrΓ©chet Derivative of Composition via Taylor Series for $C^n$ Functions with Eventual Membership
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$. Let $f : E \to F$ be a function that is $C^n$ within a set $s \subseteq E$ at a point $x \in s$, and let $g : F \to G$ be a function that is $C^n$ within a set $t \subseteq F$ at $f(x)$. Assume that both $s$ and $t$ have the property of unique differentiability on $\mathbb{K}$. If $f(y) \in t$ for all $y$ in some neighborhood of $x$ within $s$, then for any natural number $i \leq n$, the $i$-th iterated FrΓ©chet derivative of $g \circ f$ within $s$ at $x$ is equal to the $i$-th Taylor composition of the formal Taylor series of $g$ within $t$ at $f(x)$ and the formal Taylor series of $f$ within $s$ at $x$.
iteratedFDerivWithin_comp theorem
{t : Set F} (hg : ContDiffWithinAt π•œ n g t (f x)) (hf : ContDiffWithinAt π•œ n f s x) (ht : UniqueDiffOn π•œ t) (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) (hst : MapsTo f s t) {i : β„•} (hi : i ≀ n) : iteratedFDerivWithin π•œ i (g ∘ f) s x = (ftaylorSeriesWithin π•œ g t (f x)).taylorComp (ftaylorSeriesWithin π•œ f s x) i
Full source
theorem iteratedFDerivWithin_comp {t : Set F} (hg : ContDiffWithinAt π•œ n g t (f x))
    (hf : ContDiffWithinAt π•œ n f s x) (ht : UniqueDiffOn π•œ t) (hs : UniqueDiffOn π•œ s)
    (hx : x ∈ s) (hst : MapsTo f s t) {i : β„•} (hi : i ≀ n) :
    iteratedFDerivWithin π•œ i (g ∘ f) s x =
      (ftaylorSeriesWithin π•œ g t (f x)).taylorComp (ftaylorSeriesWithin π•œ f s x) i :=
  iteratedFDerivWithin_comp_of_eventually_mem hg hf ht hs hx (eventually_mem_nhdsWithin.mono hst) hi
Iterated FrΓ©chet Derivative of Composition for $C^n$ Functions via Taylor Series
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$. Let $f : E \to F$ be a function that is $C^n$ within a set $s \subseteq E$ at a point $x \in s$, and let $g : F \to G$ be a function that is $C^n$ within a set $t \subseteq F$ at $f(x)$. Assume that both $s$ and $t$ have the property of unique differentiability on $\mathbb{K}$. If $f$ maps $s$ into $t$, then for any natural number $i \leq n$, the $i$-th iterated FrΓ©chet derivative of $g \circ f$ within $s$ at $x$ is equal to the $i$-th Taylor composition of the formal Taylor series of $g$ within $t$ at $f(x)$ and the formal Taylor series of $f$ within $s$ at $x$.
iteratedFDeriv_comp theorem
(hg : ContDiffAt π•œ n g (f x)) (hf : ContDiffAt π•œ n f x) {i : β„•} (hi : i ≀ n) : iteratedFDeriv π•œ i (g ∘ f) x = (ftaylorSeries π•œ g (f x)).taylorComp (ftaylorSeries π•œ f x) i
Full source
theorem iteratedFDeriv_comp (hg : ContDiffAt π•œ n g (f x)) (hf : ContDiffAt π•œ n f x)
    {i : β„•} (hi : i ≀ n) :
    iteratedFDeriv π•œ i (g ∘ f) x =
      (ftaylorSeries π•œ g (f x)).taylorComp (ftaylorSeries π•œ f x) i := by
  simp only [← iteratedFDerivWithin_univ, ← ftaylorSeriesWithin_univ]
  exact iteratedFDerivWithin_comp hg.contDiffWithinAt hf.contDiffWithinAt
    uniqueDiffOn_univ uniqueDiffOn_univ (mem_univ _) (mapsTo_univ _ _) hi
Iterated FrΓ©chet Derivative of Composition via Taylor Series for $C^n$ Functions
Informal description
Let $E$, $F$, and $G$ be normed vector spaces over a nontrivially normed field $\mathbb{K}$. Let $f : E \to F$ be a function that is $C^n$ at a point $x \in E$, and let $g : F \to G$ be a function that is $C^n$ at $f(x)$. Then for any natural number $i \leq n$, the $i$-th iterated FrΓ©chet derivative of the composition $g \circ f$ at $x$ is equal to the $i$-th Taylor composition of the formal Taylor series of $g$ at $f(x)$ and the formal Taylor series of $f$ at $x$.
contDiff_fst theorem
: ContDiff π•œ n (Prod.fst : E Γ— F β†’ E)
Full source
/-- The first projection in a product is `C^∞`. -/
theorem contDiff_fst : ContDiff π•œ n (Prod.fst : E Γ— F β†’ E) :=
  IsBoundedLinearMap.contDiff IsBoundedLinearMap.fst
First Projection is $C^n$ Smooth
Informal description
For any extended natural number $n \in \mathbb{N}_\infty$ and normed vector spaces $E$ and $F$ over a nontrivially normed field $\mathbb{K}$, the first projection map $(x, y) \mapsto x$ from $E \times F$ to $E$ is continuously differentiable of order $n$ (i.e., $C^n$).
ContDiff.fst theorem
{f : E β†’ F Γ— G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x => (f x).1
Full source
/-- Postcomposing `f` with `Prod.fst` is `C^n` -/
theorem ContDiff.fst {f : E β†’ F Γ— G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x => (f x).1 :=
  contDiff_fst.comp hf
First Projection Preserves $C^n$ Smoothness
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $n \in \mathbb{N}_\infty$ be an extended natural number. If a function $f : E \to F \times G$ is continuously differentiable of order $n$ (i.e., $C^n$), then the function $x \mapsto (f(x)).1$ (the first projection of $f(x)$) is also $C^n$.
ContDiff.fst' theorem
{f : E β†’ G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x : E Γ— F => f x.1
Full source
/-- Precomposing `f` with `Prod.fst` is `C^n` -/
theorem ContDiff.fst' {f : E β†’ G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x : E Γ— F => f x.1 :=
  hf.comp contDiff_fst
Precomposition with First Projection Preserves $C^n$ Smoothness
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to G$ be a $C^n$ function for some extended natural number $n \in \mathbb{N}_\infty$. Then the function $(x, y) \mapsto f(x)$, where $(x, y) \in E \times F$, is also $C^n$.
contDiffOn_fst theorem
{s : Set (E Γ— F)} : ContDiffOn π•œ n (Prod.fst : E Γ— F β†’ E) s
Full source
/-- The first projection on a domain in a product is `C^∞`. -/
theorem contDiffOn_fst {s : Set (E Γ— F)} : ContDiffOn π•œ n (Prod.fst : E Γ— F β†’ E) s :=
  ContDiff.contDiffOn contDiff_fst
First Projection is $C^n$ Smooth on Subsets
Informal description
For any extended natural number $n \in \mathbb{N}_\infty$, any subset $s \subseteq E \times F$ of the product of normed spaces, the first projection map $(x, y) \mapsto x$ is continuously differentiable of order $n$ on $s$ (i.e., $C^n$ on $s$).
ContDiffOn.fst theorem
{f : E β†’ F Γ— G} {s : Set E} (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (fun x => (f x).1) s
Full source
theorem ContDiffOn.fst {f : E β†’ F Γ— G} {s : Set E} (hf : ContDiffOn π•œ n f s) :
    ContDiffOn π•œ n (fun x => (f x).1) s :=
  contDiff_fst.comp_contDiffOn hf
First Component of $C^n$ Function is $C^n$ on Subset
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given a function $f : E \to F \times G$ that is $C^n$ on $s$ (where $n \in \mathbb{N}_\infty$), the first component function $x \mapsto (f(x)).1$ is also $C^n$ on $s$.
contDiffAt_fst theorem
{p : E Γ— F} : ContDiffAt π•œ n (Prod.fst : E Γ— F β†’ E) p
Full source
/-- The first projection at a point in a product is `C^∞`. -/
theorem contDiffAt_fst {p : E Γ— F} : ContDiffAt π•œ n (Prod.fst : E Γ— F β†’ E) p :=
  contDiff_fst.contDiffAt
First Projection is $C^n$ Smooth at Every Point
Informal description
For any extended natural number $n \in \mathbb{N}_\infty$, nontrivially normed field $\mathbb{K}$, and normed spaces $E$ and $F$ over $\mathbb{K}$, the first projection map $(x, y) \mapsto x$ from $E \times F$ to $E$ is continuously differentiable of order $n$ at every point $p \in E \times F$.
ContDiffAt.fst theorem
{f : E β†’ F Γ— G} {x : E} (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (fun x => (f x).1) x
Full source
/-- Postcomposing `f` with `Prod.fst` is `C^n` at `(x, y)` -/
theorem ContDiffAt.fst {f : E β†’ F Γ— G} {x : E} (hf : ContDiffAt π•œ n f x) :
    ContDiffAt π•œ n (fun x => (f x).1) x :=
  contDiffAt_fst.comp x hf
$C^n$ Differentiability of First Component at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F \times G$ be a function that is $C^n$ at a point $x \in E$ for some extended natural number $n \in \mathbb{N}_\infty$. Then the first component function $x \mapsto (f(x)).1$ is also $C^n$ at $x$.
ContDiffAt.fst' theorem
{f : E β†’ G} {x : E} {y : F} (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (fun x : E Γ— F => f x.1) (x, y)
Full source
/-- Precomposing `f` with `Prod.fst` is `C^n` at `(x, y)` -/
theorem ContDiffAt.fst' {f : E β†’ G} {x : E} {y : F} (hf : ContDiffAt π•œ n f x) :
    ContDiffAt π•œ n (fun x : E Γ— F => f x.1) (x, y) :=
  ContDiffAt.comp (x, y) hf contDiffAt_fst
$C^n$ Smoothness of Precomposition with First Projection
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given a function $f : E \to G$ that is $C^n$ at a point $x \in E$, and any point $y \in F$, the function $(x, y) \mapsto f(x)$ from $E \times F$ to $G$ is $C^n$ at $(x, y)$.
ContDiffAt.fst'' theorem
{f : E β†’ G} {x : E Γ— F} (hf : ContDiffAt π•œ n f x.1) : ContDiffAt π•œ n (fun x : E Γ— F => f x.1) x
Full source
/-- Precomposing `f` with `Prod.fst` is `C^n` at `x : E Γ— F` -/
theorem ContDiffAt.fst'' {f : E β†’ G} {x : E Γ— F} (hf : ContDiffAt π•œ n f x.1) :
    ContDiffAt π•œ n (fun x : E Γ— F => f x.1) x :=
  hf.comp x contDiffAt_fst
$C^n$ Smoothness of First Component Precomposition at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to G$ be a function. For any extended natural number $n \in \mathbb{N}_\infty$ and any point $x \in E \times F$, if $f$ is $C^n$ at the first component $x.1$ of $x$, then the function $(x,y) \mapsto f(x)$ is $C^n$ at $x$.
contDiffWithinAt_fst theorem
{s : Set (E Γ— F)} {p : E Γ— F} : ContDiffWithinAt π•œ n (Prod.fst : E Γ— F β†’ E) s p
Full source
/-- The first projection within a domain at a point in a product is `C^∞`. -/
theorem contDiffWithinAt_fst {s : Set (E Γ— F)} {p : E Γ— F} :
    ContDiffWithinAt π•œ n (Prod.fst : E Γ— F β†’ E) s p :=
  contDiff_fst.contDiffWithinAt
First Projection is $C^n$ Smooth Within Any Subset at Any Point
Informal description
For any extended natural number $n \in \mathbb{N}_\infty$, any nontrivially normed field $\mathbb{K}$, and any normed spaces $E$ and $F$ over $\mathbb{K}$, the first projection map $(x, y) \mapsto x$ from $E \times F$ to $E$ is continuously differentiable of order $n$ within any subset $s \subseteq E \times F$ at any point $p \in E \times F$.
contDiff_snd theorem
: ContDiff π•œ n (Prod.snd : E Γ— F β†’ F)
Full source
/-- The second projection in a product is `C^∞`. -/
theorem contDiff_snd : ContDiff π•œ n (Prod.snd : E Γ— F β†’ F) :=
  IsBoundedLinearMap.contDiff IsBoundedLinearMap.snd
Second Projection is $C^n$ Smooth
Informal description
For any extended natural number $n$ and any normed spaces $E$ and $F$ over a nontrivially normed field $\mathbb{K}$, the second projection map $\operatorname{snd} : E \times F \to F$ is continuously differentiable of order $n$ (i.e., $C^n$).
ContDiff.snd theorem
{f : E β†’ F Γ— G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x => (f x).2
Full source
/-- Postcomposing `f` with `Prod.snd` is `C^n` -/
theorem ContDiff.snd {f : E β†’ F Γ— G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x => (f x).2 :=
  contDiff_snd.comp hf
Second Component of a $C^n$ Function is $C^n$
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $n \in \mathbb{N}_\infty$ be an extended natural number. If a function $f : E \to F \times G$ is continuously differentiable of order $n$ (i.e., $C^n$), then the function $x \mapsto (f(x)).2$ (the second component of $f(x)$) is also $C^n$.
ContDiff.snd' theorem
{f : F β†’ G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x : E Γ— F => f x.2
Full source
/-- Precomposing `f` with `Prod.snd` is `C^n` -/
theorem ContDiff.snd' {f : F β†’ G} (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x : E Γ— F => f x.2 :=
  hf.comp contDiff_snd
Precomposition with Second Projection Preserves \( C^n \) Smoothness
Informal description
Let \( E \), \( F \), and \( G \) be normed spaces over a nontrivially normed field \( \mathbb{K} \). Given a function \( f : F \to G \) that is continuously differentiable of order \( n \) (i.e., \( C^n \)), the function \( (x, y) \mapsto f(y) \) from \( E \times F \) to \( G \) is also \( C^n \).
contDiffOn_snd theorem
{s : Set (E Γ— F)} : ContDiffOn π•œ n (Prod.snd : E Γ— F β†’ F) s
Full source
/-- The second projection on a domain in a product is `C^∞`. -/
theorem contDiffOn_snd {s : Set (E Γ— F)} : ContDiffOn π•œ n (Prod.snd : E Γ— F β†’ F) s :=
  ContDiff.contDiffOn contDiff_snd
Second Projection is $C^n$ Smooth on Subsets
Informal description
For any extended natural number $n$, any nontrivially normed field $\mathbb{K}$, and any normed spaces $E$ and $F$ over $\mathbb{K}$, the second projection map $\operatorname{snd} : E \times F \to F$ is continuously differentiable of order $n$ on any subset $s \subseteq E \times F$.
ContDiffOn.snd theorem
{f : E β†’ F Γ— G} {s : Set E} (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (fun x => (f x).2) s
Full source
theorem ContDiffOn.snd {f : E β†’ F Γ— G} {s : Set E} (hf : ContDiffOn π•œ n f s) :
    ContDiffOn π•œ n (fun x => (f x).2) s :=
  contDiff_snd.comp_contDiffOn hf
Second component of a $C^n$ function is $C^n$ on a subset
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given a function $f : E \to F \times G$ that is $C^n$ on $s$ (i.e., continuously differentiable of order $n$ on $s$), the second component function $x \mapsto (f(x)).2$ is also $C^n$ on $s$.
contDiffAt_snd theorem
{p : E Γ— F} : ContDiffAt π•œ n (Prod.snd : E Γ— F β†’ F) p
Full source
/-- The second projection at a point in a product is `C^∞`. -/
theorem contDiffAt_snd {p : E Γ— F} : ContDiffAt π•œ n (Prod.snd : E Γ— F β†’ F) p :=
  contDiff_snd.contDiffAt
Second Projection is $C^n$ Smooth at Every Point
Informal description
For any extended natural number $n$, any nontrivially normed field $\mathbb{K}$, and any normed spaces $E$ and $F$ over $\mathbb{K}$, the second projection map $\operatorname{snd} : E \times F \to F$ is continuously differentiable of order $n$ at every point $p \in E \times F$.
ContDiffAt.snd theorem
{f : E β†’ F Γ— G} {x : E} (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (fun x => (f x).2) x
Full source
/-- Postcomposing `f` with `Prod.snd` is `C^n` at `x` -/
theorem ContDiffAt.snd {f : E β†’ F Γ— G} {x : E} (hf : ContDiffAt π•œ n f x) :
    ContDiffAt π•œ n (fun x => (f x).2) x :=
  contDiffAt_snd.comp x hf
$C^n$ Differentiability of Second Component at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F \times G$ be a function that is $C^n$ at a point $x \in E$. Then the second component function $x \mapsto (f(x)).2$ is also $C^n$ at $x$.
ContDiffAt.snd' theorem
{f : F β†’ G} {x : E} {y : F} (hf : ContDiffAt π•œ n f y) : ContDiffAt π•œ n (fun x : E Γ— F => f x.2) (x, y)
Full source
/-- Precomposing `f` with `Prod.snd` is `C^n` at `(x, y)` -/
theorem ContDiffAt.snd' {f : F β†’ G} {x : E} {y : F} (hf : ContDiffAt π•œ n f y) :
    ContDiffAt π•œ n (fun x : E Γ— F => f x.2) (x, y) :=
  ContDiffAt.comp (x, y) hf contDiffAt_snd
$C^n$ Smoothness of Precomposition with Second Projection
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given a function $f : F \to G$, points $x \in E$ and $y \in F$, and an extended natural number $n \in \mathbb{N}_\infty$, if $f$ is $C^n$ at $y$, then the function $(x, y) \mapsto f(y)$ is $C^n$ at $(x, y)$.
ContDiffAt.snd'' theorem
{f : F β†’ G} {x : E Γ— F} (hf : ContDiffAt π•œ n f x.2) : ContDiffAt π•œ n (fun x : E Γ— F => f x.2) x
Full source
/-- Precomposing `f` with `Prod.snd` is `C^n` at `x : E Γ— F` -/
theorem ContDiffAt.snd'' {f : F β†’ G} {x : E Γ— F} (hf : ContDiffAt π•œ n f x.2) :
    ContDiffAt π•œ n (fun x : E Γ— F => f x.2) x :=
  hf.comp x contDiffAt_snd
$C^n$ Differentiability of Second Component Precomposition at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : F \to G$ be a function. For any extended natural number $n \in \mathbb{N}_\infty$ and any point $x \in E \times F$, if $f$ is $C^n$ at the second component $x.2$ of $x$, then the function $(x : E \times F) \mapsto f(x.2)$ is $C^n$ at $x$.
contDiffWithinAt_snd theorem
{s : Set (E Γ— F)} {p : E Γ— F} : ContDiffWithinAt π•œ n (Prod.snd : E Γ— F β†’ F) s p
Full source
/-- The second projection within a domain at a point in a product is `C^∞`. -/
theorem contDiffWithinAt_snd {s : Set (E Γ— F)} {p : E Γ— F} :
    ContDiffWithinAt π•œ n (Prod.snd : E Γ— F β†’ F) s p :=
  contDiff_snd.contDiffWithinAt
Second Projection is $C^n$ Smooth Within Any Subset at Any Point
Informal description
For any extended natural number $n$, any nontrivially normed field $\mathbb{K}$, and any normed spaces $E$ and $F$ over $\mathbb{K}$, the second projection map $\operatorname{snd} : E \times F \to F$ is continuously differentiable of order $n$ within any subset $s \subseteq E \times F$ at any point $p \in E \times F$.
ContDiff.compβ‚‚ theorem
{g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} (hg : ContDiff π•œ n g) (hf₁ : ContDiff π•œ n f₁) (hfβ‚‚ : ContDiff π•œ n fβ‚‚) : ContDiff π•œ n fun x => g (f₁ x, fβ‚‚ x)
Full source
theorem ContDiff.compβ‚‚ {g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} (hg : ContDiff π•œ n g)
    (hf₁ : ContDiff π•œ n f₁) (hfβ‚‚ : ContDiff π•œ n fβ‚‚) : ContDiff π•œ n fun x => g (f₁ x, fβ‚‚ x) :=
  hg.comp <| hf₁.prodMk hfβ‚‚
Composition of $C^n$ Functions Preserves $C^n$ Differentiability (Two-Variable Case)
Informal description
Let $E_1$, $E_2$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $g : E_1 \times E_2 \to G$, $f_1 : F \to E_1$, and $f_2 : F \to E_2$, if: 1. $g$ is $C^n$, 2. $f_1$ is $C^n$, and 3. $f_2$ is $C^n$, then the function $x \mapsto g(f_1(x), f_2(x))$ is $C^n$.
ContDiffAt.compβ‚‚ theorem
{g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {x : F} (hg : ContDiffAt π•œ n g (f₁ x, fβ‚‚ x)) (hf₁ : ContDiffAt π•œ n f₁ x) (hfβ‚‚ : ContDiffAt π•œ n fβ‚‚ x) : ContDiffAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) x
Full source
theorem ContDiffAt.compβ‚‚ {g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {x : F}
    (hg : ContDiffAt π•œ n g (f₁ x, fβ‚‚ x))
    (hf₁ : ContDiffAt π•œ n f₁ x) (hfβ‚‚ : ContDiffAt π•œ n fβ‚‚ x) :
    ContDiffAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) x :=
  hg.comp x (hf₁.prodMk hfβ‚‚)
$C^n$ Differentiability of Pairwise Composition at a Point
Informal description
Let $E_1$, $E_2$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $g : E_1 \times E_2 \to G$, $f_1 : F \to E_1$, $f_2 : F \to E_2$, and a point $x \in F$, if: 1. $g$ is $C^n$ at $(f_1(x), f_2(x))$, 2. $f_1$ is $C^n$ at $x$, and 3. $f_2$ is $C^n$ at $x$, then the function $x \mapsto g(f_1(x), f_2(x))$ is $C^n$ at $x$.
ContDiffAt.compβ‚‚_contDiffWithinAt theorem
{g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {s : Set F} {x : F} (hg : ContDiffAt π•œ n g (f₁ x, fβ‚‚ x)) (hf₁ : ContDiffWithinAt π•œ n f₁ s x) (hfβ‚‚ : ContDiffWithinAt π•œ n fβ‚‚ s x) : ContDiffWithinAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) s x
Full source
theorem ContDiffAt.compβ‚‚_contDiffWithinAt {g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚}
    {s : Set F} {x : F} (hg : ContDiffAt π•œ n g (f₁ x, fβ‚‚ x))
    (hf₁ : ContDiffWithinAt π•œ n f₁ s x) (hfβ‚‚ : ContDiffWithinAt π•œ n fβ‚‚ s x) :
    ContDiffWithinAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) s x :=
  hg.comp_contDiffWithinAt x (hf₁.prodMk hfβ‚‚)
$C^n$ Differentiability of Composition of Two Functions at a Point within a Subset
Informal description
Let $E_1$, $E_2$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq F$ be a subset. Given functions $f_1 \colon F \to E_1$, $f_2 \colon F \to E_2$, and $g \colon E_1 \times E_2 \to G$, a point $x \in F$, and an extended natural number $n \in \mathbb{N}_\infty$, if: 1. $g$ is $C^n$ at $(f_1(x), f_2(x))$, and 2. $f_1$ and $f_2$ are $C^n$ within $s$ at $x$, then the function $x \mapsto g(f_1(x), f_2(x))$ is $C^n$ within $s$ at $x$.
ContDiff.compβ‚‚_contDiffAt theorem
{g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {x : F} (hg : ContDiff π•œ n g) (hf₁ : ContDiffAt π•œ n f₁ x) (hfβ‚‚ : ContDiffAt π•œ n fβ‚‚ x) : ContDiffAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) x
Full source
theorem ContDiff.compβ‚‚_contDiffAt {g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {x : F}
    (hg : ContDiff π•œ n g) (hf₁ : ContDiffAt π•œ n f₁ x) (hfβ‚‚ : ContDiffAt π•œ n fβ‚‚ x) :
    ContDiffAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) x :=
  hg.contDiffAt.compβ‚‚ hf₁ hfβ‚‚
$C^n$ Differentiability of Composition of a Bivariate $C^n$ Function with Two $C^n$ Functions at a Point
Informal description
Let $E_1$, $E_2$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $g : E_1 \times E_2 \to G$, $f_1 : F \to E_1$, $f_2 : F \to E_2$, and a point $x \in F$, if: 1. $g$ is $C^n$ on $E_1 \times E_2$, 2. $f_1$ is $C^n$ at $x$, and 3. $f_2$ is $C^n$ at $x$, then the function $x \mapsto g(f_1(x), f_2(x))$ is $C^n$ at $x$.
ContDiff.compβ‚‚_contDiffWithinAt theorem
{g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {s : Set F} {x : F} (hg : ContDiff π•œ n g) (hf₁ : ContDiffWithinAt π•œ n f₁ s x) (hfβ‚‚ : ContDiffWithinAt π•œ n fβ‚‚ s x) : ContDiffWithinAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) s x
Full source
theorem ContDiff.compβ‚‚_contDiffWithinAt {g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚}
    {s : Set F} {x : F} (hg : ContDiff π•œ n g)
    (hf₁ : ContDiffWithinAt π•œ n f₁ s x) (hfβ‚‚ : ContDiffWithinAt π•œ n fβ‚‚ s x) :
    ContDiffWithinAt π•œ n (fun x => g (f₁ x, fβ‚‚ x)) s x :=
  hg.contDiffAt.comp_contDiffWithinAt x (hf₁.prodMk hfβ‚‚)
Composition of a $C^n$ Bivariate Function with Two $C^n$ Functions within a Set at a Point
Informal description
Let $E_1$, $E_2$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq F$ be a subset. Given functions $f_1 \colon F \to E_1$, $f_2 \colon F \to E_2$, and $g \colon E_1 \times E_2 \to G$, and a point $x \in F$, if: 1. $g$ is $C^n$ on $E_1 \times E_2$, 2. $f_1$ is $C^n$ within $s$ at $x$, and 3. $f_2$ is $C^n$ within $s$ at $x$, then the function $x \mapsto g(f_1(x), f_2(x))$ is $C^n$ within $s$ at $x$.
ContDiff.compβ‚‚_contDiffOn theorem
{g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {s : Set F} (hg : ContDiff π•œ n g) (hf₁ : ContDiffOn π•œ n f₁ s) (hfβ‚‚ : ContDiffOn π•œ n fβ‚‚ s) : ContDiffOn π•œ n (fun x => g (f₁ x, fβ‚‚ x)) s
Full source
theorem ContDiff.compβ‚‚_contDiffOn {g : E₁ Γ— Eβ‚‚ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {s : Set F}
    (hg : ContDiff π•œ n g) (hf₁ : ContDiffOn π•œ n f₁ s) (hfβ‚‚ : ContDiffOn π•œ n fβ‚‚ s) :
    ContDiffOn π•œ n (fun x => g (f₁ x, fβ‚‚ x)) s :=
  hg.comp_contDiffOn <| hf₁.prodMk hfβ‚‚
Composition of a $C^n$ Bivariate Function with Two $C^n$ Functions on a Set is $C^n$
Informal description
Let $E_1$, $E_2$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq F$ be a subset. Given functions $g : E_1 \times E_2 \to G$, $f_1 : F \to E_1$, and $f_2 : F \to E_2$, if: 1. $g$ is $C^n$ on $E_1 \times E_2$, 2. $f_1$ is $C^n$ on $s$, and 3. $f_2$ is $C^n$ on $s$, then the function $x \mapsto g(f_1(x), f_2(x))$ is $C^n$ on $s$.
ContDiff.comp₃ theorem
{g : E₁ Γ— Eβ‚‚ Γ— E₃ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {f₃ : F β†’ E₃} (hg : ContDiff π•œ n g) (hf₁ : ContDiff π•œ n f₁) (hfβ‚‚ : ContDiff π•œ n fβ‚‚) (hf₃ : ContDiff π•œ n f₃) : ContDiff π•œ n fun x => g (f₁ x, fβ‚‚ x, f₃ x)
Full source
theorem ContDiff.comp₃ {g : E₁ Γ— Eβ‚‚ Γ— E₃ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {f₃ : F β†’ E₃}
    (hg : ContDiff π•œ n g) (hf₁ : ContDiff π•œ n f₁) (hfβ‚‚ : ContDiff π•œ n fβ‚‚) (hf₃ : ContDiff π•œ n f₃) :
    ContDiff π•œ n fun x => g (f₁ x, fβ‚‚ x, f₃ x) :=
  hg.compβ‚‚ hf₁ <| hfβ‚‚.prodMk hf₃
Composition of a \( C^n \) Trivariate Function with Three \( C^n \) Functions is \( C^n \)
Informal description
Let \( E_1, E_2, E_3, F, G \) be normed spaces over a nontrivially normed field \( \mathbb{K} \). Given functions \( g : E_1 \times E_2 \times E_3 \to G \), \( f_1 : F \to E_1 \), \( f_2 : F \to E_2 \), and \( f_3 : F \to E_3 \), if: 1. \( g \) is \( C^n \) on \( E_1 \times E_2 \times E_3 \), 2. \( f_1 \) is \( C^n \) on \( F \), 3. \( f_2 \) is \( C^n \) on \( F \), and 4. \( f_3 \) is \( C^n \) on \( F \), then the function \( x \mapsto g(f_1(x), f_2(x), f_3(x)) \) is \( C^n \) on \( F \).
ContDiff.comp₃_contDiffOn theorem
{g : E₁ Γ— Eβ‚‚ Γ— E₃ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {f₃ : F β†’ E₃} {s : Set F} (hg : ContDiff π•œ n g) (hf₁ : ContDiffOn π•œ n f₁ s) (hfβ‚‚ : ContDiffOn π•œ n fβ‚‚ s) (hf₃ : ContDiffOn π•œ n f₃ s) : ContDiffOn π•œ n (fun x => g (f₁ x, fβ‚‚ x, f₃ x)) s
Full source
theorem ContDiff.comp₃_contDiffOn {g : E₁ Γ— Eβ‚‚ Γ— E₃ β†’ G} {f₁ : F β†’ E₁} {fβ‚‚ : F β†’ Eβ‚‚} {f₃ : F β†’ E₃}
    {s : Set F} (hg : ContDiff π•œ n g) (hf₁ : ContDiffOn π•œ n f₁ s) (hfβ‚‚ : ContDiffOn π•œ n fβ‚‚ s)
    (hf₃ : ContDiffOn π•œ n f₃ s) : ContDiffOn π•œ n (fun x => g (f₁ x, fβ‚‚ x, f₃ x)) s :=
  hg.compβ‚‚_contDiffOn hf₁ <| hfβ‚‚.prodMk hf₃
Composition of a \( C^n \) Trivariate Function with Three \( C^n \) Functions on a Set is \( C^n \)
Informal description
Let \( E_1, E_2, E_3, F, G \) be normed spaces over a nontrivially normed field \( \mathbb{K} \), and let \( s \subseteq F \) be a subset. Given functions \( g : E_1 \times E_2 \times E_3 \to G \), \( f_1 : F \to E_1 \), \( f_2 : F \to E_2 \), and \( f_3 : F \to E_3 \), if: 1. \( g \) is \( C^n \) on \( E_1 \times E_2 \times E_3 \), 2. \( f_1 \) is \( C^n \) on \( s \), 3. \( f_2 \) is \( C^n \) on \( s \), and 4. \( f_3 \) is \( C^n \) on \( s \), then the function \( x \mapsto g(f_1(x), f_2(x), f_3(x)) \) is \( C^n \) on \( s \).
ContDiff.clm_comp theorem
{g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} (hg : ContDiff π•œ n g) (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x => (g x).comp (f x)
Full source
theorem ContDiff.clm_comp {g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} (hg : ContDiff π•œ n g)
    (hf : ContDiff π•œ n f) : ContDiff π•œ n fun x => (g x).comp (f x) :=
  isBoundedBilinearMap_comp.contDiff.compβ‚‚ (g := fun p => p.1.comp p.2) hg hf
Composition of $C^n$ Families of Continuous Linear Maps is $C^n$
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $X$ be a topological space. Given functions $g : X \to (F \to_{\mathcal{L}} G)$ and $f : X \to (E \to_{\mathcal{L}} F)$, if: 1. $g$ is $C^n$ on $X$, and 2. $f$ is $C^n$ on $X$, then the function $x \mapsto g(x) \circ f(x)$ is $C^n$ on $X$.
ContDiffOn.clm_comp theorem
{g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} {s : Set X} (hg : ContDiffOn π•œ n g s) (hf : ContDiffOn π•œ n f s) : ContDiffOn π•œ n (fun x => (g x).comp (f x)) s
Full source
theorem ContDiffOn.clm_comp {g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} {s : Set X}
    (hg : ContDiffOn π•œ n g s) (hf : ContDiffOn π•œ n f s) :
    ContDiffOn π•œ n (fun x => (g x).comp (f x)) s :=
  (isBoundedBilinearMap_comp (E := E) (F := F) (G := G)).contDiff.compβ‚‚_contDiffOn hg hf
Composition of $C^n$ Continuous Linear Maps is $C^n$ on a Set
Informal description
Let $X$, $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq X$ be a subset. Given functions $g : X \to (F \to_{\mathcal{L}} G)$ and $f : X \to (E \to_{\mathcal{L}} F)$, if: 1. $g$ is $C^n$ on $s$, and 2. $f$ is $C^n$ on $s$, then the function $x \mapsto g(x) \circ f(x)$ is $C^n$ on $s$.
ContDiffAt.clm_comp theorem
{g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} {x : X} (hg : ContDiffAt π•œ n g x) (hf : ContDiffAt π•œ n f x) : ContDiffAt π•œ n (fun x => (g x).comp (f x)) x
Full source
theorem ContDiffAt.clm_comp {g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} {x : X}
    (hg : ContDiffAt π•œ n g x) (hf : ContDiffAt π•œ n f x) :
    ContDiffAt π•œ n (fun x => (g x).comp (f x)) x :=
  (isBoundedBilinearMap_comp (E := E) (G := G)).contDiff.compβ‚‚_contDiffAt hg hf
$C^n$ Differentiability of Composition of Continuous Linear Maps at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $X$ be a topological space. Given functions $g : X \to (F \to_{\mathcal{L}} G)$ and $f : X \to (E \to_{\mathcal{L}} F)$, and a point $x \in X$, if: 1. $g$ is $C^n$ at $x$, and 2. $f$ is $C^n$ at $x$, then the function $x \mapsto (g(x)) \circ (f(x))$ (composition of continuous linear maps) is $C^n$ at $x$.
ContDiffWithinAt.clm_comp theorem
{g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} {s : Set X} {x : X} (hg : ContDiffWithinAt π•œ n g s x) (hf : ContDiffWithinAt π•œ n f s x) : ContDiffWithinAt π•œ n (fun x => (g x).comp (f x)) s x
Full source
theorem ContDiffWithinAt.clm_comp {g : X β†’ F β†’L[π•œ] G} {f : X β†’ E β†’L[π•œ] F} {s : Set X} {x : X}
    (hg : ContDiffWithinAt π•œ n g s x) (hf : ContDiffWithinAt π•œ n f s x) :
    ContDiffWithinAt π•œ n (fun x => (g x).comp (f x)) s x :=
  (isBoundedBilinearMap_comp (E := E) (G := G)).contDiff.compβ‚‚_contDiffWithinAt hg hf
Composition of $C^n$ continuous linear maps is $C^n$ within a set at a point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $X$ be a topological space. Given functions $g \colon X \to (F \to_{\mathcal{L}} G)$ and $f \colon X \to (E \to_{\mathcal{L}} F)$, a subset $s \subseteq X$, and a point $x \in X$, if: 1. $g$ is $C^n$ within $s$ at $x$, and 2. $f$ is $C^n$ within $s$ at $x$, then the function $x \mapsto (g(x)) \circ (f(x))$ is $C^n$ within $s$ at $x$.
ContDiff.clm_apply theorem
{f : E β†’ F β†’L[π•œ] G} {g : E β†’ F} (hf : ContDiff π•œ n f) (hg : ContDiff π•œ n g) : ContDiff π•œ n fun x => (f x) (g x)
Full source
theorem ContDiff.clm_apply {f : E β†’ F β†’L[π•œ] G} {g : E β†’ F} (hf : ContDiff π•œ n f)
    (hg : ContDiff π•œ n g) : ContDiff π•œ n fun x => (f x) (g x) :=
  isBoundedBilinearMap_apply.contDiff.compβ‚‚ hf hg
Application of $C^n$ Function to $C^n$ Argument Preserves $C^n$ Differentiability
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \to (F \to_{\mathcal{L}} G)$ (where $F \to_{\mathcal{L}} G$ denotes the space of continuous linear maps from $F$ to $G$) and $g : E \to F$, if: 1. $f$ is $C^n$ (continuously differentiable of order $n$), and 2. $g$ is $C^n$, then the function $x \mapsto f(x)(g(x))$ is $C^n$.
ContDiffOn.clm_apply theorem
{f : E β†’ F β†’L[π•œ] G} {g : E β†’ F} (hf : ContDiffOn π•œ n f s) (hg : ContDiffOn π•œ n g s) : ContDiffOn π•œ n (fun x => (f x) (g x)) s
Full source
theorem ContDiffOn.clm_apply {f : E β†’ F β†’L[π•œ] G} {g : E β†’ F} (hf : ContDiffOn π•œ n f s)
    (hg : ContDiffOn π•œ n g s) : ContDiffOn π•œ n (fun x => (f x) (g x)) s :=
  isBoundedBilinearMap_apply.contDiff.compβ‚‚_contDiffOn hf hg
Application of $C^n$ Operator-Valued Function to $C^n$ Function is $C^n$ on a Set
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given functions $f : E \to (F \to_{\mathcal{L}} G)$ (where $F \to_{\mathcal{L}} G$ denotes continuous linear maps from $F$ to $G$) and $g : E \to F$, if: 1. $f$ is $C^n$ on $s$, and 2. $g$ is $C^n$ on $s$, then the function $x \mapsto f(x)(g(x))$ is $C^n$ on $s$.
ContDiffAt.clm_apply theorem
{f : E β†’ F β†’L[π•œ] G} {g : E β†’ F} (hf : ContDiffAt π•œ n f x) (hg : ContDiffAt π•œ n g x) : ContDiffAt π•œ n (fun x => (f x) (g x)) x
Full source
theorem ContDiffAt.clm_apply {f : E β†’ F β†’L[π•œ] G} {g : E β†’ F} (hf : ContDiffAt π•œ n f x)
    (hg : ContDiffAt π•œ n g x) : ContDiffAt π•œ n (fun x => (f x) (g x)) x :=
  isBoundedBilinearMap_apply.contDiff.compβ‚‚_contDiffAt hf hg
$C^n$ Differentiability of Continuous Linear Map Application at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \to (F \to_{\mathcal{L}} G)$ and $g : E \to F$, and a point $x \in E$, if: 1. $f$ is $C^n$ at $x$, and 2. $g$ is $C^n$ at $x$, then the function $x \mapsto f(x)(g(x))$ is $C^n$ at $x$.
ContDiffWithinAt.clm_apply theorem
{f : E β†’ F β†’L[π•œ] G} {g : E β†’ F} (hf : ContDiffWithinAt π•œ n f s x) (hg : ContDiffWithinAt π•œ n g s x) : ContDiffWithinAt π•œ n (fun x => (f x) (g x)) s x
Full source
theorem ContDiffWithinAt.clm_apply {f : E β†’ F β†’L[π•œ] G} {g : E β†’ F}
    (hf : ContDiffWithinAt π•œ n f s x) (hg : ContDiffWithinAt π•œ n g s x) :
    ContDiffWithinAt π•œ n (fun x => (f x) (g x)) s x :=
  isBoundedBilinearMap_apply.contDiff.compβ‚‚_contDiffWithinAt hf hg
Differentiability of Continuous Linear Map Application within a Set at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given functions $f \colon E \to F \to_{\mathcal{L}} G$ and $g \colon E \to F$, and a point $x \in E$, if: 1. $f$ is $C^n$ within $s$ at $x$, and 2. $g$ is $C^n$ within $s$ at $x$, then the function $x \mapsto f(x)(g(x))$ is $C^n$ within $s$ at $x$.
ContDiff.smulRight theorem
{f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G} (hf : ContDiff π•œ n f) (hg : ContDiff π•œ n g) : ContDiff π•œ n fun x => (f x).smulRight (g x)
Full source
theorem ContDiff.smulRight {f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G} (hf : ContDiff π•œ n f)
    (hg : ContDiff π•œ n g) : ContDiff π•œ n fun x => (f x).smulRight (g x) :=
  isBoundedBilinearMap_smulRight.contDiff.compβ‚‚ (g := fun p => p.1.smulRight p.2) hf hg
Smoothness of the Tensor Product Operation $\mathrm{smulRight}$ for $C^n$ Functions
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \to (F \to_{\mathcal{L}} \mathbb{K})$ and $g : E \to G$ that are both $C^n$ (continuously differentiable of order $n$), the function $x \mapsto (f x).\mathrm{smulRight} (g x)$ is also $C^n$. Here, $(f x).\mathrm{smulRight} (g x)$ denotes the continuous linear map from $F$ to $G$ defined by $y \mapsto (f x)(y) \cdot (g x)$.
ContDiffOn.smulRight theorem
{f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G} (hf : ContDiffOn π•œ n f s) (hg : ContDiffOn π•œ n g s) : ContDiffOn π•œ n (fun x => (f x).smulRight (g x)) s
Full source
theorem ContDiffOn.smulRight {f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G} (hf : ContDiffOn π•œ n f s)
    (hg : ContDiffOn π•œ n g s) : ContDiffOn π•œ n (fun x => (f x).smulRight (g x)) s :=
  (isBoundedBilinearMap_smulRight (E := F)).contDiff.compβ‚‚_contDiffOn hf hg
Smoothness of the Tensor Product Operation $\mathrm{smulRight}$ for $C^n$ Functions on a Set
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given functions $f : E \to (F \to_{\mathcal{L}} \mathbb{K})$ and $g : E \to G$, if: 1. $f$ is $C^n$ on $s$, and 2. $g$ is $C^n$ on $s$, then the function $x \mapsto (f(x)).\mathrm{smulRight}(g(x))$ (which maps $x$ to the continuous linear map $v \mapsto f(x)(v) \cdot g(x)$) is $C^n$ on $s$.
ContDiffAt.smulRight theorem
{f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G} (hf : ContDiffAt π•œ n f x) (hg : ContDiffAt π•œ n g x) : ContDiffAt π•œ n (fun x => (f x).smulRight (g x)) x
Full source
theorem ContDiffAt.smulRight {f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G} (hf : ContDiffAt π•œ n f x)
    (hg : ContDiffAt π•œ n g x) : ContDiffAt π•œ n (fun x => (f x).smulRight (g x)) x :=
  (isBoundedBilinearMap_smulRight (E := F)).contDiff.compβ‚‚_contDiffAt hf hg
$C^n$ Differentiability of the $\mathrm{smulRight}$ Operation at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f \colon E \to F \to_{\mathcal{L}} \mathbb{K}$ and $g \colon E \to G$, and a point $x \in E$, if: 1. $f$ is $C^n$ at $x$, and 2. $g$ is $C^n$ at $x$, then the function $x \mapsto (f(x)).\mathrm{smulRight}(g(x))$ is $C^n$ at $x$. Here, $\mathrm{smulRight}$ denotes the operation that constructs a continuous linear map from $F$ to $G$ by scalar multiplication with $g(x)$.
ContDiffWithinAt.smulRight theorem
{f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G} (hf : ContDiffWithinAt π•œ n f s x) (hg : ContDiffWithinAt π•œ n g s x) : ContDiffWithinAt π•œ n (fun x => (f x).smulRight (g x)) s x
Full source
theorem ContDiffWithinAt.smulRight {f : E β†’ F β†’L[π•œ] π•œ} {g : E β†’ G}
    (hf : ContDiffWithinAt π•œ n f s x) (hg : ContDiffWithinAt π•œ n g s x) :
    ContDiffWithinAt π•œ n (fun x => (f x).smulRight (g x)) s x :=
  (isBoundedBilinearMap_smulRight (E := F)).contDiff.compβ‚‚_contDiffWithinAt hf hg
Smoothness of the $\mathrm{smulRight}$ operation within a set at a point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset. Given functions $f \colon E \to F \to_{\mathcal{L}} \mathbb{K}$ and $g \colon E \to G$, and a point $x \in E$, if: 1. $f$ is $C^n$ within $s$ at $x$, and 2. $g$ is $C^n$ within $s$ at $x$, then the function $x \mapsto (f(x)).\mathrm{smulRight}(g(x))$ (which maps $x$ to the continuous linear operator $v \mapsto f(x)(v) \cdot g(x)$) is $C^n$ within $s$ at $x$.
iteratedFDerivWithin_clm_apply_const_apply theorem
{s : Set E} (hs : UniqueDiffOn π•œ s) {c : E β†’ F β†’L[π•œ] G} (hc : ContDiffOn π•œ n c s) {i : β„•} (hi : i ≀ n) {x : E} (hx : x ∈ s) {u : F} {m : Fin i β†’ E} : (iteratedFDerivWithin π•œ i (fun y ↦ (c y) u) s x) m = (iteratedFDerivWithin π•œ i c s x) m u
Full source
/-- Application of a `ContinuousLinearMap` to a constant commutes with `iteratedFDerivWithin`. -/
theorem iteratedFDerivWithin_clm_apply_const_apply
    {s : Set E} (hs : UniqueDiffOn π•œ s) {c : E β†’ F β†’L[π•œ] G}
    (hc : ContDiffOn π•œ n c s) {i : β„•} (hi : i ≀ n) {x : E} (hx : x ∈ s) {u : F} {m : Fin i β†’ E} :
    (iteratedFDerivWithin π•œ i (fun y ↦ (c y) u) s x) m = (iteratedFDerivWithin π•œ i c s x) m u := by
  induction i generalizing x with
  | zero => simp
  | succ i ih =>
    replace hi : (i : WithTop β„•βˆž) < n := lt_of_lt_of_le (by norm_cast; simp) hi
    have h_deriv_apply : DifferentiableOn π•œ (iteratedFDerivWithin π•œ i (fun y ↦ (c y) u) s) s :=
      (hc.clm_apply contDiffOn_const).differentiableOn_iteratedFDerivWithin hi hs
    have h_deriv : DifferentiableOn π•œ (iteratedFDerivWithin π•œ i c s) s :=
      hc.differentiableOn_iteratedFDerivWithin hi hs
    simp only [iteratedFDerivWithin_succ_apply_left]
    rw [← fderivWithin_continuousMultilinear_apply_const_apply (hs x hx) (h_deriv_apply x hx)]
    rw [fderivWithin_congr' (fun x hx ↦ ih hi.le hx) hx]
    rw [fderivWithin_clm_apply (hs x hx) (h_deriv.continuousMultilinear_apply_const _ x hx)
      (differentiableWithinAt_const u)]
    rw [fderivWithin_const_apply]
    simp only [ContinuousLinearMap.flip_apply, ContinuousLinearMap.comp_zero, zero_add]
    rw [fderivWithin_continuousMultilinear_apply_const_apply (hs x hx) (h_deriv x hx)]
Iterated FrΓ©chet Derivative of Operator Application within a Set
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset with the property of unique differentiability. Given a function $c : E \to (F \to_{\mathcal{L}} G)$ that is $C^n$ on $s$, a natural number $i \leq n$, a point $x \in s$, a vector $u \in F$, and a multi-index $m \in \text{Fin}(i) \to E$, the $i$-th iterated FrΓ©chet derivative within $s$ of the function $y \mapsto c(y)(u)$ evaluated at $x$ and applied to $m$ is equal to the $i$-th iterated FrΓ©chet derivative within $s$ of $c$ evaluated at $x$ and applied to $m$, then composed with $u$.
iteratedFDeriv_clm_apply_const_apply theorem
{c : E β†’ F β†’L[π•œ] G} (hc : ContDiff π•œ n c) {i : β„•} (hi : i ≀ n) {x : E} {u : F} {m : Fin i β†’ E} : (iteratedFDeriv π•œ i (fun y ↦ (c y) u) x) m = (iteratedFDeriv π•œ i c x) m u
Full source
/-- Application of a `ContinuousLinearMap` to a constant commutes with `iteratedFDeriv`. -/
theorem iteratedFDeriv_clm_apply_const_apply
    {c : E β†’ F β†’L[π•œ] G} (hc : ContDiff π•œ n c)
    {i : β„•} (hi : i ≀ n) {x : E} {u : F} {m : Fin i β†’ E} :
    (iteratedFDeriv π•œ i (fun y ↦ (c y) u) x) m = (iteratedFDeriv π•œ i c x) m u := by
  simp only [← iteratedFDerivWithin_univ]
  exact iteratedFDerivWithin_clm_apply_const_apply uniqueDiffOn_univ hc.contDiffOn hi (mem_univ _)
Iterated FrΓ©chet Derivative of Operator Application at a Point
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given a $C^n$ function $c : E \to (F \to_{\mathcal{L}} G)$, a natural number $i \leq n$, a point $x \in E$, a vector $u \in F$, and a multi-index $m \in \text{Fin}(i) \to E$, the $i$-th iterated FrΓ©chet derivative of the function $y \mapsto c(y)(u)$ evaluated at $x$ and applied to $m$ is equal to the $i$-th iterated FrΓ©chet derivative of $c$ evaluated at $x$ and applied to $m$, then composed with $u$.
contDiff_prodAssoc theorem
{n : WithTop β„•βˆž} : ContDiff π•œ n <| Equiv.prodAssoc E F G
Full source
/-- The natural equivalence `(E Γ— F) Γ— G ≃ E Γ— (F Γ— G)` is smooth.

Warning: if you think you need this lemma, it is likely that you can simplify your proof by
reformulating the lemma that you're applying next using the tips in
Note [continuity lemma statement]
-/
theorem contDiff_prodAssoc {n : WithTop β„•βˆž} : ContDiff π•œ n <| Equiv.prodAssoc E F G :=
  (LinearIsometryEquiv.prodAssoc π•œ E F G).contDiff
Associativity Equivalence is $C^n$ for Product Spaces
Informal description
For any extended natural number $n \in \mathbb{N}_\infty$, the natural associativity equivalence $(E \times F) \times G \simeq E \times (F \times G)$ between normed spaces is continuously differentiable of order $n$ (i.e., $C^n$).
contDiff_prodAssoc_symm theorem
{n : WithTop β„•βˆž} : ContDiff π•œ n <| (Equiv.prodAssoc E F G).symm
Full source
/-- The natural equivalence `E Γ— (F Γ— G) ≃ (E Γ— F) Γ— G` is smooth.

Warning: see remarks attached to `contDiff_prodAssoc`
-/
theorem contDiff_prodAssoc_symm {n : WithTop β„•βˆž} : ContDiff π•œ n <| (Equiv.prodAssoc E F G).symm :=
  (LinearIsometryEquiv.prodAssoc π•œ E F G).symm.contDiff
Inverse Associativity Equivalence is \( C^n \)
Informal description
For any extended natural number \( n \in \mathbb{N}_\infty \), the inverse of the associativity equivalence \((E \times F) \times G \simeq E \times (F \times G)\) is a \( C^n \) function between the normed spaces \((E \times F) \times G\) and \( E \times (F \times G) \).
ContDiffWithinAt.hasFDerivWithinAt_nhds theorem
{f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F} (hn : n β‰  ∞) {xβ‚€ : E} (hf : ContDiffWithinAt π•œ (n + 1) (uncurry f) (insert xβ‚€ s Γ—Λ’ t) (xβ‚€, g xβ‚€)) (hg : ContDiffWithinAt π•œ n g s xβ‚€) (hgt : t ∈ 𝓝[g '' s] g xβ‚€) : βˆƒ v ∈ 𝓝[insert xβ‚€ s] xβ‚€, v βŠ† insert xβ‚€ s ∧ βˆƒ f' : E β†’ F β†’L[π•œ] G, (βˆ€ x ∈ v, HasFDerivWithinAt (f x) (f' x) t (g x)) ∧ ContDiffWithinAt π•œ n (fun x => f' x) s xβ‚€
Full source
/-- One direction of `contDiffWithinAt_succ_iff_hasFDerivWithinAt`, but where all derivatives are
taken within the same set. Version for partial derivatives / functions with parameters. If `f x` is
a `C^n+1` family of functions and `g x` is a `C^n` family of points, then the derivative of `f x` at
`g x` depends in a `C^n` way on `x`. We give a general version of this fact relative to sets which
may not have unique derivatives, in the following form.  If `f : E Γ— F β†’ G` is `C^n+1` at
`(xβ‚€, g(xβ‚€))` in `(s βˆͺ {xβ‚€}) Γ— t βŠ† E Γ— F` and `g : E β†’ F` is `C^n` at `xβ‚€` within some set `s βŠ† E`,
then there is a function `f' : E β†’ F β†’L[π•œ] G` that is `C^n` at `xβ‚€` within `s` such that for all `x`
sufficiently close to `xβ‚€` within `s βˆͺ {xβ‚€}` the function `y ↦ f x y` has derivative `f' x` at `g x`
within `t βŠ† F`.  For convenience, we return an explicit set of `x`'s where this holds that is a
subset of `s βˆͺ {xβ‚€}`.  We need one additional condition, namely that `t` is a neighborhood of
`g(xβ‚€)` within `g '' s`. -/
theorem ContDiffWithinAt.hasFDerivWithinAt_nhds {f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F} (hn : n β‰  ∞)
    {xβ‚€ : E} (hf : ContDiffWithinAt π•œ (n + 1) (uncurry f) (insert xβ‚€ s Γ—Λ’ t) (xβ‚€, g xβ‚€))
    (hg : ContDiffWithinAt π•œ n g s xβ‚€) (hgt : t ∈ 𝓝[g '' s] g xβ‚€) :
    βˆƒ v ∈ 𝓝[insert xβ‚€ s] xβ‚€, v βŠ† insert xβ‚€ s ∧ βˆƒ f' : E β†’ F β†’L[π•œ] G,
      (βˆ€ x ∈ v, HasFDerivWithinAt (f x) (f' x) t (g x)) ∧
        ContDiffWithinAt π•œ n (fun x => f' x) s xβ‚€ := by
  have hst : insertinsert xβ‚€ s Γ—Λ’ t ∈ 𝓝[(fun x => (x, g x)) '' s] (xβ‚€, g xβ‚€) := by
    refine nhdsWithin_mono _ ?_ (nhdsWithin_prod self_mem_nhdsWithin hgt)
    simp_rw [image_subset_iff, mk_preimage_prod, preimage_id', subset_inter_iff, subset_insert,
      true_and, subset_preimage_image]
  obtain ⟨v, hv, hvs, f_an, f', hvf', hf'⟩ :=
    (contDiffWithinAt_succ_iff_hasFDerivWithinAt' hn).mp hf
  refine
    ⟨(fun z => (z, g z)) ⁻¹' v ∩ insert xβ‚€ s, ?_, inter_subset_right, fun z =>
      (f' (z, g z)).comp (ContinuousLinearMap.inr π•œ E F), ?_, ?_⟩
  Β· refine inter_mem ?_ self_mem_nhdsWithin
    have := mem_of_mem_nhdsWithin (mem_insert _ _) hv
    refine mem_nhdsWithin_insert.mpr ⟨this, ?_⟩
    refine (continuousWithinAt_id.prodMk hg.continuousWithinAt).preimage_mem_nhdsWithin' ?_
    rw [← nhdsWithin_le_iff] at hst hv ⊒
    exact (hst.trans <| nhdsWithin_mono _ <| subset_insert _ _).trans hv
  Β· intro z hz
    have := hvf' (z, g z) hz.1
    refine this.comp _ (hasFDerivAt_prodMk_right _ _).hasFDerivWithinAt ?_
    exact mapsTo'.mpr (image_prodMk_subset_prod_right hz.2)
  Β· exact (hf'.continuousLinearMap_comp <| (ContinuousLinearMap.compL π•œ F (E Γ— F) G).flip
      (ContinuousLinearMap.inr π•œ E F)).comp_of_mem_nhdsWithin_image xβ‚€
      (contDiffWithinAt_id.prodMk hg) hst
Existence of $C^n$ Derivative for Parameter-Dependent Functions under Neighborhood Condition
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \times F \to G$ (via uncurrying) and $g : E \to F$, a point $x_0 \in E$, and an extended natural number $n \neq \infty$, suppose that: 1. $f$ is $C^{n+1}$ within $(s \cup \{x_0\}) \times t$ at $(x_0, g(x_0))$, 2. $g$ is $C^n$ within $s$ at $x_0$, 3. $t$ is a neighborhood of $g(x_0)$ within $g(s)$. Then there exists a neighborhood $v$ of $x_0$ within $s \cup \{x_0\}$ and a $C^n$ function $f' : E \to (F \toL[\mathbb{K}] G)$ such that: - For all $x \in v$, $f(x, \cdot)$ has FrΓ©chet derivative $f'(x)$ within $t$ at $g(x)$, - $f'$ is $C^n$ within $s$ at $x_0$.
ContDiffWithinAt.fderivWithin'' theorem
{f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F} (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (insert xβ‚€ s Γ—Λ’ t) (xβ‚€, g xβ‚€)) (hg : ContDiffWithinAt π•œ m g s xβ‚€) (ht : βˆ€αΆ  x in 𝓝[insert xβ‚€ s] xβ‚€, UniqueDiffWithinAt π•œ t (g x)) (hmn : m + 1 ≀ n) (hgt : t ∈ 𝓝[g '' s] g xβ‚€) : ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x)) s xβ‚€
Full source
/-- The most general lemma stating that `x ↦ fderivWithin π•œ (f x) t (g x)` is `C^n`
at a point within a set.
To show that `x ↦ D_yf(x,y)g(x)` (taken within `t`) is `C^m` at `xβ‚€` within `s`, we require that
* `f` is `C^n` at `(xβ‚€, g(xβ‚€))` within `(s βˆͺ {xβ‚€}) Γ— t` for `n β‰₯ m+1`.
* `g` is `C^m` at `xβ‚€` within `s`;
* Derivatives are unique at `g(x)` within `t` for `x` sufficiently close to `xβ‚€` within `s βˆͺ {xβ‚€}`;
* `t` is a neighborhood of `g(xβ‚€)` within `g '' s`; -/
theorem ContDiffWithinAt.fderivWithin'' {f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F}
    (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (insert xβ‚€ s Γ—Λ’ t) (xβ‚€, g xβ‚€))
    (hg : ContDiffWithinAt π•œ m g s xβ‚€)
    (ht : βˆ€αΆ  x in 𝓝[insert xβ‚€ s] xβ‚€, UniqueDiffWithinAt π•œ t (g x)) (hmn : m + 1 ≀ n)
    (hgt : t ∈ 𝓝[g '' s] g xβ‚€) :
    ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x)) s xβ‚€ := by
  have : βˆ€ k : β„•, k ≀ m β†’ ContDiffWithinAt π•œ k (fun x => fderivWithin π•œ (f x) t (g x)) s xβ‚€ := by
    intro k hkm
    obtain ⟨v, hv, -, f', hvf', hf'⟩ :=
      (hf.of_le <| (add_le_add_right hkm 1).trans hmn).hasFDerivWithinAt_nhds (by simp)
        (hg.of_le hkm) hgt
    refine hf'.congr_of_eventuallyEq_insert ?_
    filter_upwards [hv, ht]
    exact fun y hy h2y => (hvf' y hy).fderivWithin h2y
  match m with
  | Ο‰ =>
    obtain rfl : n = Ο‰ := by simpa using hmn
    obtain ⟨v, hv, -, f', hvf', hf'⟩ := hf.hasFDerivWithinAt_nhds (by simp) hg hgt
    refine hf'.congr_of_eventuallyEq_insert ?_
    filter_upwards [hv, ht]
    exact fun y hy h2y => (hvf' y hy).fderivWithin h2y
  | ∞ =>
    rw [contDiffWithinAt_infty]
    exact fun k ↦ this k (by exact_mod_cast le_top)
  | (m : β„•) => exact this _ le_rfl
Higher Differentiability of Parameter-Dependent Derivatives under Neighborhood Condition
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \times F \to G$ (via uncurrying) and $g : E \to F$, a point $x_0 \in E$, and extended natural numbers $m, n \in \mathbb{N}_\infty$ with $m + 1 \leq n$, suppose that: 1. $f$ is $C^n$ within $(s \cup \{x_0\}) \times t$ at $(x_0, g(x_0))$, 2. $g$ is $C^m$ within $s$ at $x_0$, 3. For all $x$ in a neighborhood of $x_0$ within $s \cup \{x_0\}$, the derivative of $f(x, \cdot)$ within $t$ at $g(x)$ is unique, 4. $t$ is a neighborhood of $g(x_0)$ within $g(s)$. Then the function $x \mapsto D_y f(x, y)|_{y = g(x)}$ (the derivative of $f(x, \cdot)$ within $t$ at $g(x)$) is $C^m$ within $s$ at $x_0$.
ContDiffWithinAt.fderivWithin' theorem
{f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F} (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (insert xβ‚€ s Γ—Λ’ t) (xβ‚€, g xβ‚€)) (hg : ContDiffWithinAt π•œ m g s xβ‚€) (ht : βˆ€αΆ  x in 𝓝[insert xβ‚€ s] xβ‚€, UniqueDiffWithinAt π•œ t (g x)) (hmn : m + 1 ≀ n) (hst : s βŠ† g ⁻¹' t) : ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x)) s xβ‚€
Full source
/-- A special case of `ContDiffWithinAt.fderivWithin''` where we require that `s βŠ† g⁻¹(t)`. -/
theorem ContDiffWithinAt.fderivWithin' {f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F}
    (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (insert xβ‚€ s Γ—Λ’ t) (xβ‚€, g xβ‚€))
    (hg : ContDiffWithinAt π•œ m g s xβ‚€)
    (ht : βˆ€αΆ  x in 𝓝[insert xβ‚€ s] xβ‚€, UniqueDiffWithinAt π•œ t (g x)) (hmn : m + 1 ≀ n)
    (hst : s βŠ† g ⁻¹' t) : ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x)) s xβ‚€ :=
  hf.fderivWithin'' hg ht hmn <| mem_of_superset self_mem_nhdsWithin <| image_subset_iff.mpr hst
Higher Differentiability of Parameter-Dependent Derivatives under Preimage Condition
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \times F \to G$ (via uncurrying) and $g : E \to F$, a point $x_0 \in E$, and extended natural numbers $m, n \in \mathbb{N}_\infty$ with $m + 1 \leq n$, suppose that: 1. $f$ is $C^n$ within $(s \cup \{x_0\}) \times t$ at $(x_0, g(x_0))$, 2. $g$ is $C^m$ within $s$ at $x_0$, 3. For all $x$ in a neighborhood of $x_0$ within $s \cup \{x_0\}$, the derivative of $f(x, \cdot)$ within $t$ at $g(x)$ is unique, 4. $s \subseteq g^{-1}(t)$. Then the function $x \mapsto D_y f(x, y)|_{y = g(x)}$ (the derivative of $f(x, \cdot)$ within $t$ at $g(x)$) is $C^m$ within $s$ at $x_0$.
ContDiffWithinAt.fderivWithin theorem
{f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F} (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (s Γ—Λ’ t) (xβ‚€, g xβ‚€)) (hg : ContDiffWithinAt π•œ m g s xβ‚€) (ht : UniqueDiffOn π•œ t) (hmn : m + 1 ≀ n) (hxβ‚€ : xβ‚€ ∈ s) (hst : s βŠ† g ⁻¹' t) : ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x)) s xβ‚€
Full source
/-- A special case of `ContDiffWithinAt.fderivWithin'` where we require that `xβ‚€ ∈ s` and there
are unique derivatives everywhere within `t`. -/
protected theorem ContDiffWithinAt.fderivWithin {f : E β†’ F β†’ G} {g : E β†’ F} {t : Set F}
    (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (s Γ—Λ’ t) (xβ‚€, g xβ‚€))
    (hg : ContDiffWithinAt π•œ m g s xβ‚€) (ht : UniqueDiffOn π•œ t) (hmn : m + 1 ≀ n) (hxβ‚€ : xβ‚€ ∈ s)
    (hst : s βŠ† g ⁻¹' t) : ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x)) s xβ‚€ := by
  rw [← insert_eq_self.mpr hxβ‚€] at hf
  refine hf.fderivWithin' hg ?_ hmn hst
  rw [insert_eq_self.mpr hxβ‚€]
  exact eventually_of_mem self_mem_nhdsWithin fun x hx => ht _ (hst hx)
Higher Differentiability of Parameter-Dependent Derivatives under Unique Differentiability Condition
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \times F \to G$ (via uncurrying) and $g : E \to F$, a point $x_0 \in s$, and extended natural numbers $m, n \in \mathbb{N}_\infty$ with $m + 1 \leq n$, suppose that: 1. $f$ is $C^n$ within $s \times t$ at $(x_0, g(x_0))$, 2. $g$ is $C^m$ within $s$ at $x_0$, 3. The derivative of $f(x, \cdot)$ within $t$ is unique for all $x \in t$, 4. $s \subseteq g^{-1}(t)$. Then the function $x \mapsto D_y f(x, y)|_{y = g(x)}$ (the derivative of $f(x, \cdot)$ within $t$ at $g(x)$) is $C^m$ within $s$ at $x_0$.
ContDiffWithinAt.fderivWithin_apply theorem
{f : E β†’ F β†’ G} {g k : E β†’ F} {t : Set F} (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (s Γ—Λ’ t) (xβ‚€, g xβ‚€)) (hg : ContDiffWithinAt π•œ m g s xβ‚€) (hk : ContDiffWithinAt π•œ m k s xβ‚€) (ht : UniqueDiffOn π•œ t) (hmn : m + 1 ≀ n) (hxβ‚€ : xβ‚€ ∈ s) (hst : s βŠ† g ⁻¹' t) : ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x) (k x)) s xβ‚€
Full source
/-- `x ↦ fderivWithin π•œ (f x) t (g x) (k x)` is smooth at a point within a set. -/
theorem ContDiffWithinAt.fderivWithin_apply {f : E β†’ F β†’ G} {g k : E β†’ F} {t : Set F}
    (hf : ContDiffWithinAt π•œ n (Function.uncurry f) (s Γ—Λ’ t) (xβ‚€, g xβ‚€))
    (hg : ContDiffWithinAt π•œ m g s xβ‚€) (hk : ContDiffWithinAt π•œ m k s xβ‚€) (ht : UniqueDiffOn π•œ t)
    (hmn : m + 1 ≀ n) (hxβ‚€ : xβ‚€ ∈ s) (hst : s βŠ† g ⁻¹' t) :
    ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ (f x) t (g x) (k x)) s xβ‚€ :=
  (contDiff_fst.clm_apply contDiff_snd).contDiffAt.comp_contDiffWithinAt xβ‚€
    ((hf.fderivWithin hg ht hmn hxβ‚€ hst).prodMk hk)
Smoothness of Parameter-Dependent Derivatives Applied to Smooth Functions
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$, $t \subseteq F$ be subsets. Given functions $f : E \times F \to G$ (via uncurrying), $g : E \to F$, and $k : E \to F$, a point $x_0 \in s$, and extended natural numbers $m, n \in \mathbb{N}_\infty$ with $m + 1 \leq n$, suppose that: 1. $f$ is $C^n$ within $s \times t$ at $(x_0, g(x_0))$, 2. $g$ is $C^m$ within $s$ at $x_0$, 3. $k$ is $C^m$ within $s$ at $x_0$, 4. The derivative of $f(x, \cdot)$ within $t$ is unique for all $x \in t$, 5. $s \subseteq g^{-1}(t)$. Then the function $x \mapsto D_y f(x, y)|_{y = g(x)}(k(x))$ (the derivative of $f(x, \cdot)$ within $t$ at $g(x)$ applied to $k(x)$) is $C^m$ within $s$ at $x_0$.
ContDiffWithinAt.fderivWithin_right theorem
(hf : ContDiffWithinAt π•œ n f s xβ‚€) (hs : UniqueDiffOn π•œ s) (hmn : m + 1 ≀ n) (hxβ‚€s : xβ‚€ ∈ s) : ContDiffWithinAt π•œ m (fderivWithin π•œ f s) s xβ‚€
Full source
/-- `fderivWithin π•œ f s` is smooth at `xβ‚€` within `s`. -/
theorem ContDiffWithinAt.fderivWithin_right (hf : ContDiffWithinAt π•œ n f s xβ‚€)
    (hs : UniqueDiffOn π•œ s) (hmn : m + 1 ≀ n) (hxβ‚€s : xβ‚€ ∈ s) :
    ContDiffWithinAt π•œ m (fderivWithin π•œ f s) s xβ‚€ :=
  ContDiffWithinAt.fderivWithin
    (ContDiffWithinAt.comp (xβ‚€, xβ‚€) hf contDiffWithinAt_snd <| prod_subset_preimage_snd s s)
    contDiffWithinAt_id hs hmn hxβ‚€s (by rw [preimage_id'])
Higher Differentiability of FrΓ©chet Derivative within a Set under Unique Differentiability Condition
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, $s \subseteq E$ be a subset, and $f : E \to F$ be a function. Given a point $x_0 \in s$ and extended natural numbers $m, n \in \mathbb{N}_\infty$ with $m + 1 \leq n$, if: 1. $f$ is $C^n$ within $s$ at $x_0$, and 2. The set $s$ has unique derivatives on $\mathbb{K}$, then the FrΓ©chet derivative of $f$ within $s$, denoted $Df|_s$, is $C^m$ within $s$ at $x_0$.
ContDiffWithinAt.fderivWithin_right_apply theorem
{f : F β†’ G} {k : F β†’ F} {s : Set F} {xβ‚€ : F} (hf : ContDiffWithinAt π•œ n f s xβ‚€) (hk : ContDiffWithinAt π•œ m k s xβ‚€) (hs : UniqueDiffOn π•œ s) (hmn : m + 1 ≀ n) (hxβ‚€s : xβ‚€ ∈ s) : ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ f s x (k x)) s xβ‚€
Full source
/-- `x ↦ fderivWithin π•œ f s x (k x)` is smooth at `xβ‚€` within `s`. -/
theorem ContDiffWithinAt.fderivWithin_right_apply
    {f : F β†’ G} {k : F β†’ F} {s : Set F} {xβ‚€ : F}
    (hf : ContDiffWithinAt π•œ n f s xβ‚€) (hk : ContDiffWithinAt π•œ m k s xβ‚€)
    (hs : UniqueDiffOn π•œ s) (hmn : m + 1 ≀ n) (hxβ‚€s : xβ‚€ ∈ s) :
    ContDiffWithinAt π•œ m (fun x => fderivWithin π•œ f s x (k x)) s xβ‚€ :=
  ContDiffWithinAt.fderivWithin_apply
    (ContDiffWithinAt.comp (xβ‚€, xβ‚€) hf contDiffWithinAt_snd <| prod_subset_preimage_snd s s)
    contDiffWithinAt_id hk hs hmn hxβ‚€s (by rw [preimage_id'])
Smoothness of FrΓ©chet Derivative Application within a Set
Informal description
Let $F$ and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, $s \subseteq F$ be a subset, and $f : F \to G$ and $k : F \to F$ be functions. Given a point $x_0 \in s$ and extended natural numbers $m, n \in \mathbb{N}_\infty$ with $m + 1 \leq n$, if: 1. $f$ is $C^n$ within $s$ at $x_0$, 2. $k$ is $C^m$ within $s$ at $x_0$, 3. The set $s$ has unique derivatives on $\mathbb{K}$, then the function $x \mapsto Df|_s(x)(k(x))$ (the FrΓ©chet derivative of $f$ within $s$ at $x$ applied to $k(x)$) is $C^m$ within $s$ at $x_0$.
ContDiffWithinAt.iteratedFDerivWithin_right theorem
{i : β„•} (hf : ContDiffWithinAt π•œ n f s xβ‚€) (hs : UniqueDiffOn π•œ s) (hmn : m + i ≀ n) (hxβ‚€s : xβ‚€ ∈ s) : ContDiffWithinAt π•œ m (iteratedFDerivWithin π•œ i f s) s xβ‚€
Full source
theorem ContDiffWithinAt.iteratedFDerivWithin_right {i : β„•} (hf : ContDiffWithinAt π•œ n f s xβ‚€)
    (hs : UniqueDiffOn π•œ s) (hmn : m + i ≀ n) (hxβ‚€s : xβ‚€ ∈ s) :
    ContDiffWithinAt π•œ m (iteratedFDerivWithin π•œ i f s) s xβ‚€ := by
  induction' i with i hi generalizing m
  Β· simp only [CharP.cast_eq_zero, add_zero] at hmn
    exact (hf.of_le hmn).continuousLinearMap_comp
      ((continuousMultilinearCurryFin0 π•œ E F).symm : _ β†’L[π•œ] E [Γ—0]β†’L[π•œ] F)
  Β· rw [Nat.cast_succ, add_comm _ 1, ← add_assoc] at hmn
    exact ((hi hmn).fderivWithin_right hs le_rfl hxβ‚€s).continuousLinearMap_comp
      ((continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (i+1) ↦ E) F).symm :
        _ β†’L[π•œ] E [Γ—(i+1)]β†’L[π•œ] F)
Higher Differentiability of Iterated FrΓ©chet Derivatives within a Set
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, $s \subseteq E$ be a subset, and $f : E \to F$ be a function. Given a point $x_0 \in s$, natural number $i \in \mathbb{N}$, and extended natural numbers $m, n \in \mathbb{N}_\infty$ with $m + i \leq n$, if: 1. $f$ is $C^n$ within $s$ at $x_0$, and 2. The set $s$ has unique derivatives on $\mathbb{K}$, then the $i$-th iterated FrΓ©chet derivative of $f$ within $s$, denoted $D^i f|_s$, is $C^m$ within $s$ at $x_0$.
ContDiffAt.fderiv theorem
{f : E β†’ F β†’ G} {g : E β†’ F} (hf : ContDiffAt π•œ n (Function.uncurry f) (xβ‚€, g xβ‚€)) (hg : ContDiffAt π•œ m g xβ‚€) (hmn : m + 1 ≀ n) : ContDiffAt π•œ m (fun x => fderiv π•œ (f x) (g x)) xβ‚€
Full source
/-- `x ↦ fderiv π•œ (f x) (g x)` is smooth at `xβ‚€`. -/
protected theorem ContDiffAt.fderiv {f : E β†’ F β†’ G} {g : E β†’ F}
    (hf : ContDiffAt π•œ n (Function.uncurry f) (xβ‚€, g xβ‚€)) (hg : ContDiffAt π•œ m g xβ‚€)
    (hmn : m + 1 ≀ n) : ContDiffAt π•œ m (fun x => fderiv π•œ (f x) (g x)) xβ‚€ := by
  simp_rw [← fderivWithin_univ]
  refine (ContDiffWithinAt.fderivWithin hf.contDiffWithinAt hg.contDiffWithinAt uniqueDiffOn_univ
    hmn (mem_univ xβ‚€) ?_).contDiffAt univ_mem
  rw [preimage_univ]
Higher Differentiability of Parameter-Dependent FrΓ©chet Derivatives
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \times F \to G$ and $g : E \to F$ be functions. Suppose that: 1. The uncurried function $f$ is $C^n$ at the point $(x_0, g(x_0))$, 2. The function $g$ is $C^m$ at $x_0$, 3. The inequality $m + 1 \leq n$ holds. Then the function $x \mapsto D_y f(x, y)|_{y = g(x)}$ (the FrΓ©chet derivative of $f(x, \cdot)$ at $g(x)$) is $C^m$ at $x_0$.
ContDiffAt.fderiv_right theorem
(hf : ContDiffAt π•œ n f xβ‚€) (hmn : m + 1 ≀ n) : ContDiffAt π•œ m (fderiv π•œ f) xβ‚€
Full source
/-- `fderiv π•œ f` is smooth at `xβ‚€`. -/
theorem ContDiffAt.fderiv_right (hf : ContDiffAt π•œ n f xβ‚€) (hmn : m + 1 ≀ n) :
    ContDiffAt π•œ m (fderiv π•œ f) xβ‚€ :=
  ContDiffAt.fderiv (ContDiffAt.comp (xβ‚€, xβ‚€) hf contDiffAt_snd) contDiffAt_id hmn
Higher Differentiability of FrΓ©chet Derivatives at a Point
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a function that is $C^n$ at a point $x_0 \in E$. If $m + 1 \leq n$ for some extended natural number $m \in \mathbb{N}_\infty$, then the FrΓ©chet derivative $Df$ of $f$ is $C^m$ at $x_0$.
ContDiffAt.iteratedFDeriv_right theorem
{i : β„•} (hf : ContDiffAt π•œ n f xβ‚€) (hmn : m + i ≀ n) : ContDiffAt π•œ m (iteratedFDeriv π•œ i f) xβ‚€
Full source
theorem ContDiffAt.iteratedFDeriv_right {i : β„•} (hf : ContDiffAt π•œ n f xβ‚€)
    (hmn : m + i ≀ n) : ContDiffAt π•œ m (iteratedFDeriv π•œ i f) xβ‚€ := by
  rw [← iteratedFDerivWithin_univ, ← contDiffWithinAt_univ] at *
  exact hf.iteratedFDerivWithin_right uniqueDiffOn_univ hmn trivial
Higher Differentiability of Iterated FrΓ©chet Derivatives at a Point
Informal description
Let \( E \) and \( F \) be normed spaces over a nontrivially normed field \( \mathbb{K} \), and let \( f : E \to F \) be a function that is \( C^n \) at a point \( x_0 \in E \). For any natural number \( i \) and extended natural number \( m \) such that \( m + i \leq n \), the \( i \)-th iterated FrΓ©chet derivative \( D^i f \) is \( C^m \) at \( x_0 \).
ContDiff.fderiv theorem
{f : E β†’ F β†’ G} {g : E β†’ F} (hf : ContDiff π•œ m <| Function.uncurry f) (hg : ContDiff π•œ n g) (hnm : n + 1 ≀ m) : ContDiff π•œ n fun x => fderiv π•œ (f x) (g x)
Full source
/-- `x ↦ fderiv π•œ (f x) (g x)` is smooth. -/
protected theorem ContDiff.fderiv {f : E β†’ F β†’ G} {g : E β†’ F}
    (hf : ContDiff π•œ m <| Function.uncurry f) (hg : ContDiff π•œ n g) (hnm : n + 1 ≀ m) :
    ContDiff π•œ n fun x => fderiv π•œ (f x) (g x) :=
  contDiff_iff_contDiffAt.mpr fun _ => hf.contDiffAt.fderiv hg.contDiffAt hnm
Higher Differentiability of Parameter-Dependent FrΓ©chet Derivatives
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \times F \to G$ and $g : E \to F$ be functions. Suppose that: 1. The uncurried function $f$ is $C^m$, 2. The function $g$ is $C^n$, 3. The inequality $n + 1 \leq m$ holds. Then the function $x \mapsto D_y f(x, y)|_{y = g(x)}$ (the FrΓ©chet derivative of $f(x, \cdot)$ at $g(x)$) is $C^n$.
ContDiff.fderiv_right theorem
(hf : ContDiff π•œ n f) (hmn : m + 1 ≀ n) : ContDiff π•œ m (fderiv π•œ f)
Full source
/-- `fderiv π•œ f` is smooth. -/
theorem ContDiff.fderiv_right (hf : ContDiff π•œ n f) (hmn : m + 1 ≀ n) :
    ContDiff π•œ m (fderiv π•œ f) :=
  contDiff_iff_contDiffAt.mpr fun _x => hf.contDiffAt.fderiv_right hmn
Higher Differentiability of FrΓ©chet Derivatives for $C^n$ Functions
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a $C^n$ function. If $m + 1 \leq n$ for some extended natural number $m \in \mathbb{N}_\infty$, then the FrΓ©chet derivative $Df$ of $f$ is $C^m$.
ContDiff.iteratedFDeriv_right theorem
{i : β„•} (hf : ContDiff π•œ n f) (hmn : m + i ≀ n) : ContDiff π•œ m (iteratedFDeriv π•œ i f)
Full source
theorem ContDiff.iteratedFDeriv_right {i : β„•} (hf : ContDiff π•œ n f)
    (hmn : m + i ≀ n) : ContDiff π•œ m (iteratedFDeriv π•œ i f) :=
  contDiff_iff_contDiffAt.mpr fun _x => hf.contDiffAt.iteratedFDeriv_right hmn
Higher Differentiability of Iterated FrΓ©chet Derivatives for $C^n$ Functions
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a $C^n$ function. For any natural number $i$ and extended natural number $m$ such that $m + i \leq n$, the $i$-th iterated FrΓ©chet derivative of $f$ is $C^m$.
Continuous.fderiv theorem
{f : E β†’ F β†’ G} {g : E β†’ F} (hf : ContDiff π•œ n <| Function.uncurry f) (hg : Continuous g) (hn : 1 ≀ n) : Continuous fun x => fderiv π•œ (f x) (g x)
Full source
/-- `x ↦ fderiv π•œ (f x) (g x)` is continuous. -/
theorem Continuous.fderiv {f : E β†’ F β†’ G} {g : E β†’ F}
    (hf : ContDiff π•œ n <| Function.uncurry f) (hg : Continuous g) (hn : 1 ≀ n) :
    Continuous fun x => fderiv π•œ (f x) (g x) :=
  (hf.fderiv (contDiff_zero.mpr hg) hn).continuous
Continuity of Parameter-Dependent FrΓ©chet Derivatives for $C^n$ Functions
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f \colon E \times F \to G$ and $g \colon E \to F$ such that: 1. The uncurried function $f$ is $C^n$, 2. The function $g$ is continuous, 3. The order of differentiability satisfies $n \geq 1$, then the function $x \mapsto D_y f(x, y)|_{y = g(x)}$ (the FrΓ©chet derivative of $f(x, \cdot)$ evaluated at $g(x)$) is continuous.
ContDiff.fderiv_apply theorem
{f : E β†’ F β†’ G} {g k : E β†’ F} (hf : ContDiff π•œ m <| Function.uncurry f) (hg : ContDiff π•œ n g) (hk : ContDiff π•œ n k) (hnm : n + 1 ≀ m) : ContDiff π•œ n fun x => fderiv π•œ (f x) (g x) (k x)
Full source
/-- `x ↦ fderiv π•œ (f x) (g x) (k x)` is smooth. -/
theorem ContDiff.fderiv_apply {f : E β†’ F β†’ G} {g k : E β†’ F}
    (hf : ContDiff π•œ m <| Function.uncurry f) (hg : ContDiff π•œ n g) (hk : ContDiff π•œ n k)
    (hnm : n + 1 ≀ m) : ContDiff π•œ n fun x => fderiv π•œ (f x) (g x) (k x) :=
  (hf.fderiv hg hnm).clm_apply hk
Higher Differentiability of Parameter-Dependent FrΓ©chet Derivative Application ($C^n$ Version)
Informal description
Let $E$, $F$, and $G$ be normed spaces over a nontrivially normed field $\mathbb{K}$. Given functions $f : E \times F \to G$, $g : E \to F$, and $k : E \to F$ such that: 1. The uncurried function $f$ is $C^m$, 2. Both $g$ and $k$ are $C^n$, 3. The inequality $n + 1 \leq m$ holds, then the function $x \mapsto D_y f(x, y)|_{y = g(x)}(k(x))$ (the FrΓ©chet derivative of $f(x, \cdot)$ at $g(x)$ applied to $k(x)$) is $C^n$.
contDiffOn_fderivWithin_apply theorem
{s : Set E} {f : E β†’ F} (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s) (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (fun p : E Γ— E => (fderivWithin π•œ f s p.1 : E β†’L[π•œ] F) p.2) (s Γ—Λ’ univ)
Full source
/-- The bundled derivative of a `C^{n+1}` function is `C^n`. -/
theorem contDiffOn_fderivWithin_apply {s : Set E} {f : E β†’ F} (hf : ContDiffOn π•œ n f s)
    (hs : UniqueDiffOn π•œ s) (hmn : m + 1 ≀ n) :
    ContDiffOn π•œ m (fun p : E Γ— E => (fderivWithin π•œ f s p.1 : E β†’L[π•œ] F) p.2) (s Γ—Λ’ univ) :=
  ((hf.fderivWithin hs hmn).comp contDiffOn_fst (prod_subset_preimage_fst _ _)).clm_apply
    contDiffOn_snd
Smoothness of FrΓ©chet Derivative Application on Product Space for $C^n$ Functions
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset with unique differentiability. For a function $f : E \to F$ that is $C^n$ on $s$ and integers $m, n$ with $m + 1 \leq n$, the function $(x, y) \mapsto Df|_s(x)(y)$ (where $Df|_s(x)$ is the FrΓ©chet derivative of $f$ at $x$ within $s$) is $C^m$ on the set $s \times E$.
ContDiffOn.continuousOn_fderivWithin_apply theorem
(hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s) (hn : 1 ≀ n) : ContinuousOn (fun p : E Γ— E => (fderivWithin π•œ f s p.1 : E β†’ F) p.2) (s Γ—Λ’ univ)
Full source
/-- If a function is at least `C^1`, its bundled derivative (mapping `(x, v)` to `Df(x) v`) is
continuous. -/
theorem ContDiffOn.continuousOn_fderivWithin_apply (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
    (hn : 1 ≀ n) :
    ContinuousOn (fun p : E Γ— E => (fderivWithin π•œ f s p.1 : E β†’ F) p.2) (s Γ—Λ’ univ) :=
  (contDiffOn_fderivWithin_apply (m := 0) hf hs hn).continuousOn
Continuity of Bundled FrΓ©chet Derivative for $C^n$ Functions on Uniquely Differentiable Sets
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $s \subseteq E$ be a subset with unique differentiability. If a function $f : E \to F$ is $C^n$ on $s$ for some $n \geq 1$, then the function $(x, y) \mapsto Df|_s(x)(y)$ (where $Df|_s(x)$ is the FrΓ©chet derivative of $f$ at $x$ within $s$) is continuous on $s \times E$.
ContDiff.contDiff_fderiv_apply theorem
{f : E β†’ F} (hf : ContDiff π•œ n f) (hmn : m + 1 ≀ n) : ContDiff π•œ m fun p : E Γ— E => (fderiv π•œ f p.1 : E β†’L[π•œ] F) p.2
Full source
/-- The bundled derivative of a `C^{n+1}` function is `C^n`. -/
theorem ContDiff.contDiff_fderiv_apply {f : E β†’ F} (hf : ContDiff π•œ n f) (hmn : m + 1 ≀ n) :
    ContDiff π•œ m fun p : E Γ— E => (fderiv π•œ f p.1 : E β†’L[π•œ] F) p.2 := by
  rw [← contDiffOn_univ] at hf ⊒
  rw [← fderivWithin_univ, ← univ_prod_univ]
  exact contDiffOn_fderivWithin_apply hf uniqueDiffOn_univ hmn
Smoothness of FrΓ©chet Derivative Application for $C^n$ Functions
Informal description
Let $E$ and $F$ be normed spaces over a nontrivially normed field $\mathbb{K}$, and let $f : E \to F$ be a $C^n$ function. For any extended natural numbers $m, n$ with $m + 1 \leq n$, the function $(x, y) \mapsto Df(x)(y)$, where $Df(x)$ is the FrΓ©chet derivative of $f$ at $x$, is $C^m$ on $E \times E$.
contDiffOn_succ_iff_derivWithin theorem
(hs : UniqueDiffOn π•œ sβ‚‚) : ContDiffOn π•œ (n + 1) fβ‚‚ sβ‚‚ ↔ DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ (n = Ο‰ β†’ AnalyticOn π•œ fβ‚‚ sβ‚‚) ∧ ContDiffOn π•œ n (derivWithin fβ‚‚ sβ‚‚) sβ‚‚
Full source
/-- A function is `C^(n + 1)` on a domain with unique derivatives if and only if it is
differentiable there, and its derivative (formulated with `derivWithin`) is `C^n`. -/
theorem contDiffOn_succ_iff_derivWithin (hs : UniqueDiffOn π•œ sβ‚‚) :
    ContDiffOnContDiffOn π•œ (n + 1) fβ‚‚ sβ‚‚ ↔
      DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ (n = Ο‰ β†’ AnalyticOn π•œ fβ‚‚ sβ‚‚) ∧
        ContDiffOn π•œ n (derivWithin fβ‚‚ sβ‚‚) sβ‚‚ := by
  rw [contDiffOn_succ_iff_fderivWithin hs, and_congr_right_iff]
  intro _
  constructor
  · rintro ⟨h', h⟩
    refine ⟨h', ?_⟩
    have : derivWithin fβ‚‚ sβ‚‚ = (fun u : π•œ β†’L[π•œ] F => u 1) ∘ fderivWithin π•œ fβ‚‚ sβ‚‚ := by
      ext x; rfl
    simp_rw [this]
    apply ContDiff.comp_contDiffOn _ h
    exact (isBoundedBilinearMap_apply.isBoundedLinearMap_left _).contDiff
  · rintro ⟨h', h⟩
    refine ⟨h', ?_⟩
    have : fderivWithin π•œ fβ‚‚ sβ‚‚ = smulRightsmulRight (1 : π•œ β†’L[π•œ] π•œ) ∘ derivWithin fβ‚‚ sβ‚‚ := by
      ext x; simp [derivWithin]
    simp only [this]
    apply ContDiff.comp_contDiffOn _ h
    have : IsBoundedBilinearMap π•œ fun _ : (π•œ β†’L[π•œ] π•œ) Γ— F => _ := isBoundedBilinearMap_smulRight
    exact (this.isBoundedLinearMap_right _).contDiff
Characterization of $C^{n+1}$ Differentiability via Differentiability and $C^n$ Differentiability of the Derivative on Uniquely Differentiable Sets
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, $s \subseteq E$ be a subset with unique differentiability, and $f : E \to F$ be a function. For any extended natural number $n \in \mathbb{N}_\infty$, the following are equivalent: 1. The function $f$ is $C^{n+1}$ on $s$. 2. The function $f$ is differentiable on $s$, and: - If $n = \omega$ (the analytic case), then $f$ is analytic on $s$. - The derivative $\text{derivWithin}\, f\, s$ is $C^n$ on $s$.
contDiffOn_infty_iff_derivWithin theorem
(hs : UniqueDiffOn π•œ sβ‚‚) : ContDiffOn π•œ ∞ fβ‚‚ sβ‚‚ ↔ DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ ContDiffOn π•œ ∞ (derivWithin fβ‚‚ sβ‚‚) sβ‚‚
Full source
theorem contDiffOn_infty_iff_derivWithin (hs : UniqueDiffOn π•œ sβ‚‚) :
    ContDiffOnContDiffOn π•œ ∞ fβ‚‚ sβ‚‚ ↔ DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ ContDiffOn π•œ ∞ (derivWithin fβ‚‚ sβ‚‚) sβ‚‚ := by
  rw [show ∞ = ∞ + 1 by rfl, contDiffOn_succ_iff_derivWithin hs]
  simp
Characterization of Infinite Differentiability via Differentiability and Infinite Differentiability of the Derivative on Uniquely Differentiable Sets
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, $s \subseteq E$ be a subset with unique differentiability, and $f : E \to F$ be a function. Then the following are equivalent: 1. The function $f$ is infinitely differentiable ($C^\infty$) on $s$. 2. The function $f$ is differentiable on $s$ and its derivative $\text{derivWithin}\, f\, s$ is infinitely differentiable on $s$.
contDiffOn_succ_iff_deriv_of_isOpen theorem
(hs : IsOpen sβ‚‚) : ContDiffOn π•œ (n + 1) fβ‚‚ sβ‚‚ ↔ DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ (n = Ο‰ β†’ AnalyticOn π•œ fβ‚‚ sβ‚‚) ∧ ContDiffOn π•œ n (deriv fβ‚‚) sβ‚‚
Full source
/-- A function is `C^(n + 1)` on an open domain if and only if it is
differentiable there, and its derivative (formulated with `deriv`) is `C^n`. -/
theorem contDiffOn_succ_iff_deriv_of_isOpen (hs : IsOpen sβ‚‚) :
    ContDiffOnContDiffOn π•œ (n + 1) fβ‚‚ sβ‚‚ ↔
      DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ (n = Ο‰ β†’ AnalyticOn π•œ fβ‚‚ sβ‚‚) ∧
        ContDiffOn π•œ n (deriv fβ‚‚) sβ‚‚ := by
  rw [contDiffOn_succ_iff_derivWithin hs.uniqueDiffOn]
  exact Iff.rfl.and (Iff.rfl.and (contDiffOn_congr fun _ => derivWithin_of_isOpen hs))
Characterization of $C^{n+1}$ Differentiability via Differentiability and $C^n$ Differentiability of the Derivative on Open Sets
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $s \subseteq E$ be an open subset. For any extended natural number $n \in \mathbb{N}_\infty$, the following are equivalent: 1. The function $f : E \to F$ is $C^{n+1}$ on $s$. 2. The function $f$ is differentiable on $s$, and: - If $n = \omega$ (the analytic case), then $f$ is analytic on $s$. - The derivative $\text{deriv}\, f$ is $C^n$ on $s$.
contDiffOn_infty_iff_deriv_of_isOpen theorem
(hs : IsOpen sβ‚‚) : ContDiffOn π•œ ∞ fβ‚‚ sβ‚‚ ↔ DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ ContDiffOn π•œ ∞ (deriv fβ‚‚) sβ‚‚
Full source
theorem contDiffOn_infty_iff_deriv_of_isOpen (hs : IsOpen sβ‚‚) :
    ContDiffOnContDiffOn π•œ ∞ fβ‚‚ sβ‚‚ ↔ DifferentiableOn π•œ fβ‚‚ sβ‚‚ ∧ ContDiffOn π•œ ∞ (deriv fβ‚‚) sβ‚‚ := by
  rw [show ∞ = ∞ + 1 by rfl, contDiffOn_succ_iff_deriv_of_isOpen hs]
  simp
Characterization of Infinite Differentiability via Differentiability and Infinite Differentiability of the Derivative on Open Sets
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $s \subseteq E$ be an open subset. A function $f : E \to F$ is infinitely differentiable ($C^\infty$) on $s$ if and only if $f$ is differentiable on $s$ and its derivative $\text{deriv}\, f$ is infinitely differentiable on $s$.
ContDiffOn.derivWithin theorem
(hf : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : UniqueDiffOn π•œ sβ‚‚) (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (derivWithin fβ‚‚ sβ‚‚) sβ‚‚
Full source
protected theorem ContDiffOn.derivWithin (hf : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : UniqueDiffOn π•œ sβ‚‚)
    (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (derivWithin fβ‚‚ sβ‚‚) sβ‚‚ :=
  ((contDiffOn_succ_iff_derivWithin hs).1 (hf.of_le hmn)).2.2
Differentiability of Derivatives within Uniquely Differentiable Sets for $C^n$ Functions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $s \subseteq E$ be a subset with unique differentiability. If a function $f : E \to F$ is $C^n$ on $s$ and $m + 1 \leq n$ in the extended natural numbers $\mathbb{N}_\infty$, then the derivative $\text{derivWithin}\, f\, s$ is $C^m$ on $s$.
ContDiffOn.deriv_of_isOpen theorem
(hf : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : IsOpen sβ‚‚) (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (deriv fβ‚‚) sβ‚‚
Full source
theorem ContDiffOn.deriv_of_isOpen (hf : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : IsOpen sβ‚‚) (hmn : m + 1 ≀ n) :
    ContDiffOn π•œ m (deriv fβ‚‚) sβ‚‚ :=
  (hf.derivWithin hs.uniqueDiffOn hmn).congr fun _ hx => (derivWithin_of_isOpen hs hx).symm
Differentiability of derivatives for $C^n$ functions on open sets
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $s \subseteq E$ be an open subset. If a function $f : E \to F$ is $C^n$-differentiable on $s$ and $m + 1 \leq n$ (where $n, m \in \mathbb{N}_\infty$), then the derivative $\text{deriv}\, f$ is $C^m$-differentiable on $s$.
ContDiffOn.continuousOn_derivWithin theorem
(h : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : UniqueDiffOn π•œ sβ‚‚) (hn : 1 ≀ n) : ContinuousOn (derivWithin fβ‚‚ sβ‚‚) sβ‚‚
Full source
theorem ContDiffOn.continuousOn_derivWithin (h : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : UniqueDiffOn π•œ sβ‚‚)
    (hn : 1 ≀ n) : ContinuousOn (derivWithin fβ‚‚ sβ‚‚) sβ‚‚ := by
  rw [show (1 : WithTop β„•βˆž) = 0 + 1 from rfl] at hn
  exact ((contDiffOn_succ_iff_derivWithin hs).1 (h.of_le hn)).2.2.continuousOn
Continuity of the derivative within a set for $C^n$ functions
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $f : E \to F$ be a function. If $f$ is $C^n$-differentiable on a set $s \subseteq E$ with unique differentiability, and $1 \leq n$, then the derivative $\text{derivWithin}\, f\, s$ is continuous on $s$.
ContDiffOn.continuousOn_deriv_of_isOpen theorem
(h : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : IsOpen sβ‚‚) (hn : 1 ≀ n) : ContinuousOn (deriv fβ‚‚) sβ‚‚
Full source
theorem ContDiffOn.continuousOn_deriv_of_isOpen (h : ContDiffOn π•œ n fβ‚‚ sβ‚‚) (hs : IsOpen sβ‚‚)
    (hn : 1 ≀ n) : ContinuousOn (deriv fβ‚‚) sβ‚‚ := by
  rw [show (1 : WithTop β„•βˆž) = 0 + 1 from rfl] at hn
  exact ((contDiffOn_succ_iff_deriv_of_isOpen hs).1 (h.of_le hn)).2.2.continuousOn
Continuity of the derivative for $C^n$ functions on open sets
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $s \subseteq E$ be an open subset. If a function $f : E \to F$ is $C^n$-differentiable on $s$ for some $n \geq 1$, then the derivative $\text{deriv}\, f$ is continuous on $s$.
contDiff_succ_iff_deriv theorem
: ContDiff π•œ (n + 1) fβ‚‚ ↔ Differentiable π•œ fβ‚‚ ∧ (n = Ο‰ β†’ AnalyticOn π•œ fβ‚‚ univ) ∧ ContDiff π•œ n (deriv fβ‚‚)
Full source
/-- A function is `C^(n + 1)` if and only if it is differentiable,
  and its derivative (formulated in terms of `deriv`) is `C^n`. -/
theorem contDiff_succ_iff_deriv :
    ContDiffContDiff π•œ (n + 1) fβ‚‚ ↔ Differentiable π•œ fβ‚‚ ∧ (n = Ο‰ β†’ AnalyticOn π•œ fβ‚‚ univ) ∧
      ContDiff π•œ n (deriv fβ‚‚) := by
  simp only [← contDiffOn_univ, contDiffOn_succ_iff_deriv_of_isOpen, isOpen_univ,
    differentiableOn_univ]
Characterization of $C^{n+1}$ differentiability via derivative
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $E$ and $F$ be normed spaces over $\mathbb{K}$, and $f : E \to F$ be a function. For any extended natural number $n \in \mathbb{N}_\infty$, the following are equivalent: 1. $f$ is $C^{n+1}$-differentiable; 2. $f$ is differentiable and: - If $n = \omega$, then $f$ is analytic on the entire space $E$; - The derivative $\text{deriv}\, f$ is $C^n$-differentiable.
contDiff_one_iff_deriv theorem
: ContDiff π•œ 1 fβ‚‚ ↔ Differentiable π•œ fβ‚‚ ∧ Continuous (deriv fβ‚‚)
Full source
theorem contDiff_one_iff_deriv :
    ContDiffContDiff π•œ 1 fβ‚‚ ↔ Differentiable π•œ fβ‚‚ ∧ Continuous (deriv fβ‚‚) := by
  rw [show (1 : WithTop β„•βˆž) = 0 + 1 from rfl, contDiff_succ_iff_deriv]
  simp
Characterization of $C^1$ functions via differentiability and continuous derivative
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, and let $f \colon \mathbb{K} \to F$ be a function where $F$ is a normed space over $\mathbb{K}$. Then $f$ is continuously differentiable of order 1 (i.e., $C^1$) if and only if $f$ is differentiable and its derivative $\text{deriv}\, f$ is continuous.
contDiff_infty_iff_deriv theorem
: ContDiff π•œ ∞ fβ‚‚ ↔ Differentiable π•œ fβ‚‚ ∧ ContDiff π•œ ∞ (deriv fβ‚‚)
Full source
theorem contDiff_infty_iff_deriv :
    ContDiffContDiff π•œ ∞ fβ‚‚ ↔ Differentiable π•œ fβ‚‚ ∧ ContDiff π•œ ∞ (deriv fβ‚‚) := by
  rw [show (∞ : WithTop β„•βˆž) = ∞ + 1 from rfl, contDiff_succ_iff_deriv]
  simp
Characterization of $C^\infty$ functions via infinite differentiability of the derivative
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $F$ be a normed space over $\mathbb{K}$, and $f : \mathbb{K} \to F$ be a function. Then $f$ is infinitely differentiable (i.e., $C^\infty$) if and only if $f$ is differentiable and its derivative $\text{deriv}\, f$ is also infinitely differentiable.
ContDiff.continuous_deriv theorem
(h : ContDiff π•œ n fβ‚‚) (hn : 1 ≀ n) : Continuous (deriv fβ‚‚)
Full source
theorem ContDiff.continuous_deriv (h : ContDiff π•œ n fβ‚‚) (hn : 1 ≀ n) : Continuous (deriv fβ‚‚) := by
  rw [show (1 : WithTop β„•βˆž) = 0 + 1 from rfl] at hn
  exact (contDiff_succ_iff_deriv.mp (h.of_le hn)).2.2.continuous
Continuity of the derivative for $C^n$ functions ($n \geq 1$)
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $F$ a normed space over $\mathbb{K}$, and $f \colon \mathbb{K} \to F$ a function. If $f$ is $C^n$-differentiable for some $n \geq 1$, then its derivative $\text{deriv}\, f$ is continuous.
ContDiff.iterate_deriv theorem
: βˆ€ (n : β„•) {fβ‚‚ : π•œ β†’ F}, ContDiff π•œ ∞ fβ‚‚ β†’ ContDiff π•œ ∞ (deriv^[n] fβ‚‚)
Full source
theorem ContDiff.iterate_deriv :
    βˆ€ (n : β„•) {fβ‚‚ : π•œ β†’ F}, ContDiff π•œ ∞ fβ‚‚ β†’ ContDiff π•œ ∞ (derivderiv^[n] fβ‚‚)
  | 0,     _, hf => hf
  | n + 1, _, hf => ContDiff.iterate_deriv n (contDiff_infty_iff_deriv.mp hf).2
Infinite Differentiability of Iterated Derivatives for \( C^\infty \) Functions
Informal description
For any natural number \( n \) and any infinitely differentiable function \( f : \mathbb{K} \to F \) (i.e., \( C^\infty \)), the \( n \)-th iterate of the derivative of \( f \), denoted \( \text{deriv}^n f \), is also infinitely differentiable.
ContDiff.iterate_deriv' theorem
(n : β„•) : βˆ€ (k : β„•) {fβ‚‚ : π•œ β†’ F}, ContDiff π•œ (n + k : β„•) fβ‚‚ β†’ ContDiff π•œ n (deriv^[k] fβ‚‚)
Full source
theorem ContDiff.iterate_deriv' (n : β„•) :
    βˆ€ (k : β„•) {fβ‚‚ : π•œ β†’ F}, ContDiff π•œ (n + k : β„•) fβ‚‚ β†’ ContDiff π•œ n (derivderiv^[k] fβ‚‚)
  | 0,     _, hf => hf
  | k + 1, _, hf => ContDiff.iterate_deriv' _ k (contDiff_succ_iff_deriv.mp hf).2.2
Differentiability of iterated derivatives: $\text{deriv}^k f$ is $C^n$ when $f$ is $C^{n+k}$
Informal description
Let $\mathbb{K}$ be a nontrivially normed field, $F$ a normed space over $\mathbb{K}$, and $f : \mathbb{K} \to F$ a function. For any natural numbers $n$ and $k$, if $f$ is $C^{n+k}$-differentiable (i.e., continuously differentiable of order $n+k$), then the $k$-th iterate of the derivative of $f$, denoted $\text{deriv}^k f$, is $C^n$-differentiable.