/-
Copyright (c) 2019 Sébastien Gouëzel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Sébastien Gouëzel
-/
module
public import Mathlib.Analysis.Calculus.FDeriv.Pow
set_option doc.verso true
set_option doc.verso.suggestions false
/-!
# Derivative of `(f x) ^ n`, `n : ℕ`
In this file we prove that the Fréchet derivative of `fun x => f x ^ n`,
where `n` is a natural number, is `n * f x ^ (n - 1) * f'`.
Additionally, we prove the case for non-commutative rings (with primed names like `deriv_pow'`),
where the result is instead `∑ i ∈ Finset.range n, f x ^ (n.pred - i) * f' * f x ^ i`.
For a more detailed overview of one-dimensional derivatives in mathlib, see the module docstring of
`Mathlib/Analysis/Calculus/Deriv/Basic.lean`.
## Keywords
derivative, power
-/
public section
variable { : Type*}
section NormedRing
variable [NontriviallyNormedField ] [NormedRing ]
variable [NormedAlgebra ] {f : → } {f' : } {x : } {s : Set }
theorem HasStrictDerivAt.fun_pow' (h : HasStrictDerivAt f f' x) (n : ℕ) :
HasStrictDerivAt (fun x ↦ f x ^ n)
(∑ i ∈ Finset.range n, f x ^ (n.pred - i) * f' * f x ^ i) x := by
simpa using! h.hasStrictFDerivAt.pow' n |>.hasStrictDerivAt
theorem HasStrictDerivAt.pow' (h : HasStrictDerivAt f f' x) (n : ℕ) :
HasStrictDerivAt (f ^ n)
(∑ i ∈ Finset.range n, f x ^ (n.pred - i) * f' * f x ^ i) x :=
h.fun_pow' n
theorem HasDerivWithinAt.fun_pow' (h : HasDerivWithinAt f f' s x) (n : ℕ) :
HasDerivWithinAt (fun x ↦ f x ^ n)
(∑ i ∈ Finset.range n, f x ^ (n.pred - i) * f' * f x ^ i) s x := by
simpa using! h.hasFDerivWithinAt.pow' n |>.hasDerivWithinAt
theorem HasDerivWithinAt.pow' (h : HasDerivWithinAt f f' s x) (n : ℕ) :
HasDerivWithinAt (f ^ n)
(∑ i ∈ Finset.range n, f x ^ (n.pred - i) * f' * f x ^ i) s x := h.fun_pow' n
theorem HasDerivAt.fun_pow' (h : HasDerivAt f f' x) (n : ℕ) :
HasDerivAt (fun x ↦ f x ^ n)
(∑ i ∈ Finset.range n, f x ^ (n.pred - i) * f' * f x ^ i) x := by
simpa using! h.hasFDerivAt.pow' n |>.hasDerivAt
theorem HasDerivAt.pow' (h : HasDerivAt f f' x) (n : ℕ) :
HasDerivAt (f ^ n)
(∑ i ∈ Finset.range n, f x ^ (n.pred - i) * f' * f x ^ i) x := h.fun_pow' n
@[simp low]
theorem derivWithin_fun_pow' (h : DifferentiableWithinAt f s x) (n : ℕ) :
derivWithin (fun x => f x ^ n) s x =
∑ i ∈ Finset.range n, f x ^ (n.pred - i) * derivWithin f s x * f x ^ i := by
by_cases hsx : UniqueDiffWithinAt s x
· exact (h.hasDerivWithinAt.pow' n).derivWithin hsx
· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
@[simp low]
theorem derivWithin_pow' (h : DifferentiableWithinAt f s x) (n : ℕ) :
derivWithin (f ^ n) s x =
∑ i ∈ Finset.range n, f x ^ (n.pred - i) * derivWithin f s x * f x ^ i :=
derivWithin_fun_pow' h n
@[simp low]
theorem deriv_fun_pow' (h : DifferentiableAt f x) (n : ℕ) :
deriv (fun x => f x ^ n) x = ∑ i ∈ Finset.range n, f x ^ (n.pred - i) * deriv f x * f x ^ i :=
(h.hasDerivAt.pow' n).deriv
@[simp low]
theorem deriv_pow' (h : DifferentiableAt f x) (n : ℕ) :
deriv (f ^ n) x = ∑ i ∈ Finset.range n, f x ^ (n.pred - i) * deriv f x * f x ^ i :=
deriv_fun_pow' h n
end NormedRing
section NormedCommRing
variable [NontriviallyNormedField ] [NormedCommRing ]
variable [NormedAlgebra ] {f : → } {f' : } {x : } {s : Set }
open scoped RightActions
theorem HasStrictDerivAt.fun_pow (h : HasStrictDerivAt f f' x) (n : ℕ) :
HasStrictDerivAt (fun x ↦ f x ^ n) (n * f x ^ (n - 1) * f') x := by
simpa using h.hasStrictFDerivAt.pow n |>.hasStrictDerivAt
theorem HasStrictDerivAt.pow (h : HasStrictDerivAt f f' x) (n : ℕ) :
HasStrictDerivAt (f ^ n) (n * f x ^ (n - 1) * f') x := h.fun_pow n
theorem HasDerivWithinAt.fun_pow (h : HasDerivWithinAt f f' s x) (n : ℕ) :
HasDerivWithinAt (fun x ↦ f x ^ n) (n * f x ^ (n - 1) * f') s x := by
simpa using h.hasFDerivWithinAt.pow n |>.hasDerivWithinAt
theorem HasDerivWithinAt.pow (h : HasDerivWithinAt f f' s x) (n : ℕ) :
HasDerivWithinAt (f ^ n) (n * f x ^ (n - 1) * f') s x := h.fun_pow n
@[to_fun]
theorem HasDerivAt.pow (h : HasDerivAt f f' x) (n : ℕ) :
HasDerivAt (f ^ n) (n * f x ^ (n - 1) * f') x := by
simpa using! h.hasFDerivAt.pow n |>.hasDerivAt
@[to_fun (attr := simp) derivWithin_fun_pow]
theorem derivWithin_pow (h : DifferentiableWithinAt f s x) (n : ℕ) :
derivWithin (f ^ n) s x = n * f x ^ (n - 1) * derivWithin f s x := by
by_cases hsx : UniqueDiffWithinAt s x
· exact (h.hasDerivWithinAt.pow n).derivWithin hsx
· simp [derivWithin_zero_of_not_uniqueDiffWithinAt hsx]
@[to_fun (attr := simp) deriv_fun_pow]
theorem deriv_pow (h : DifferentiableAt f x) (n : ℕ) :
deriv (f ^ n) x = n * f x ^ (n - 1) * deriv f x := (h.hasDerivAt.pow n).deriv
end NormedCommRing
section NontriviallyNormedField
variable [NontriviallyNormedField ] {x : } {s : Set }
theorem hasStrictDerivAt_pow (n : ℕ) (x : ) :
HasStrictDerivAt (fun x : ↦ x ^ n) (n * x ^ (n - 1)) x := by
simpa using! (hasStrictDerivAt_id x).pow n
theorem hasDerivWithinAt_pow (n : ℕ) (x : ) :
HasDerivWithinAt (fun x : ↦ x ^ n) (n * x ^ (n - 1)) s x := by
simpa using! (hasDerivWithinAt_id x s).pow n
theorem hasDerivAt_pow (n : ℕ) (x : ) :
HasDerivAt (fun x : => x ^ n) ((n : ) * x ^ (n - 1)) x := by
simpa using (hasStrictDerivAt_pow n x).hasDerivAt
theorem derivWithin_pow_field (h : UniqueDiffWithinAt s x) (n : ℕ) :
derivWithin (fun x => x ^ n) s x = (n : ) * x ^ (n - 1) := by
rw [derivWithin_fun_pow (differentiableWithinAt_fun_id) n, derivWithin_id' _ _ h, mul_one]
theorem deriv_pow_field (n : ℕ) : deriv (fun x => x ^ n) x = (n : ) * x ^ (n - 1) := by
simp
end NontriviallyNormedField
¤ Dauer der Verarbeitung: 0.22 Sekunden
¤
*© Formatika GbR, Deutschland