analysis.calculus.deriv.comp
β·
Mathlib.Analysis.Calculus.Deriv.Comp
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Ebner, SΓ©bastien GouΓ«zel, Yury Kudryashov, Yuyang Zhao
-/
import Analysis.Calculus.Deriv.Basic
-import Analysis.Calculus.Fderiv.Comp
-import Analysis.Calculus.Fderiv.RestrictScalars
+import Analysis.Calculus.FDeriv.Comp
+import Analysis.Calculus.FDeriv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -152,7 +152,7 @@ theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[
(hh : HasStrictDerivAt hβ hβ' (f x)) (hf : HasStrictFDerivAt f f' x) :
HasStrictFDerivAt (hβ β f) (hβ' β’ f') x :=
by
- rw [HasStrictDerivAt] at hh
+ rw [HasStrictDerivAt] at hh
convert (hh.restrict_scalars π).comp x hf
ext x
simp [mul_comm]
@@ -240,7 +240,7 @@ protected theorem HasDerivAtFilter.iterate {f : π β π} {f' : π} (hf :
(hL : Tendsto f L L) (hx : f x = x) (n : β) : HasDerivAtFilter (f^[n]) (f' ^ n) x L :=
by
have := hf.iterate hL hx n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_at_filter.iterate HasDerivAtFilter.iterate
-/
@@ -249,7 +249,7 @@ protected theorem HasDerivAt.iterate {f : π β π} {f' : π} (hf : HasDe
(n : β) : HasDerivAt (f^[n]) (f' ^ n) x :=
by
have := HasFDerivAt.iterate hf hx n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_at.iterate HasDerivAt.iterate
-/
@@ -258,7 +258,7 @@ protected theorem HasDerivWithinAt.iterate {f : π β π} {f' : π} (hf :
(hx : f x = x) (hs : MapsTo f s s) (n : β) : HasDerivWithinAt (f^[n]) (f' ^ n) s x :=
by
have := HasFDerivWithinAt.iterate hf hx hs n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_within_at.iterate HasDerivWithinAt.iterate
-/
@@ -267,7 +267,7 @@ protected theorem HasStrictDerivAt.iterate {f : π β π} {f' : π} (hf :
(hx : f x = x) (n : β) : HasStrictDerivAt (f^[n]) (f' ^ n) x :=
by
have := hf.iterate hx n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_strict_deriv_at.iterate HasStrictDerivAt.iterate
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2019 Gabriel Ebner. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Ebner, SΓ©bastien GouΓ«zel, Yury Kudryashov, Yuyang Zhao
-/
-import Mathbin.Analysis.Calculus.Deriv.Basic
-import Mathbin.Analysis.Calculus.Fderiv.Comp
-import Mathbin.Analysis.Calculus.Fderiv.RestrictScalars
+import Analysis.Calculus.Deriv.Basic
+import Analysis.Calculus.Fderiv.Comp
+import Analysis.Calculus.Fderiv.RestrictScalars
#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2019 Gabriel Ebner. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Ebner, SΓ©bastien GouΓ«zel, Yury Kudryashov, Yuyang Zhao
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.comp
-! leanprover-community/mathlib commit f60c6087a7275b72d5db3c5a1d0e19e35a429c0a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Analysis.Calculus.Deriv.Basic
import Mathbin.Analysis.Calculus.Fderiv.Comp
import Mathbin.Analysis.Calculus.Fderiv.RestrictScalars
+#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
+
/-!
# One-dimensional derivatives of compositions of functions
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -79,59 +79,78 @@ variable {π' : Type _} [NontriviallyNormedField π'] [NormedAlgebra π
[IsScalarTower π π' F] {s' t' : Set π'} {h : π β π'} {hβ : π β π} {hβ : π' β π'} {h' hβ' : π'}
{hβ' : π} {gβ : π' β F} {gβ' : F} {L' : Filter π'} (x)
+#print HasDerivAtFilter.scomp /-
theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter gβ gβ' (h x) L')
(hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by
simpa using ((hg.restrict_scalars π).comp x hh hL).HasDerivAtFilter
#align has_deriv_at_filter.scomp HasDerivAtFilter.scomp
+-/
+#print HasDerivWithinAt.scomp_hasDerivAt /-
theorem HasDerivWithinAt.scomp_hasDerivAt (hg : HasDerivWithinAt gβ gβ' s' (h x))
(hh : HasDerivAt h h' x) (hs : β x, h x β s') : HasDerivAt (gβ β h) (h' β’ gβ') x :=
hg.scomp x hh <| tendsto_inf.2 β¨hh.ContinuousAt, tendsto_principal.2 <| eventually_of_forall hsβ©
#align has_deriv_within_at.scomp_has_deriv_at HasDerivWithinAt.scomp_hasDerivAt
+-/
+#print HasDerivWithinAt.scomp /-
theorem HasDerivWithinAt.scomp (hg : HasDerivWithinAt gβ gβ' t' (h x))
(hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') :
HasDerivWithinAt (gβ β h) (h' β’ gβ') s x :=
hg.scomp x hh <| hh.ContinuousWithinAt.tendsto_nhdsWithin hst
#align has_deriv_within_at.scomp HasDerivWithinAt.scomp
+-/
+#print HasDerivAt.scomp /-
/-- The chain rule. -/
theorem HasDerivAt.scomp (hg : HasDerivAt gβ gβ' (h x)) (hh : HasDerivAt h h' x) :
HasDerivAt (gβ β h) (h' β’ gβ') x :=
hg.scomp x hh hh.ContinuousAt
#align has_deriv_at.scomp HasDerivAt.scomp
+-/
+#print HasStrictDerivAt.scomp /-
theorem HasStrictDerivAt.scomp (hg : HasStrictDerivAt gβ gβ' (h x)) (hh : HasStrictDerivAt h h' x) :
HasStrictDerivAt (gβ β h) (h' β’ gβ') x := by
simpa using ((hg.restrict_scalars π).comp x hh).HasStrictDerivAt
#align has_strict_deriv_at.scomp HasStrictDerivAt.scomp
+-/
+#print HasDerivAt.scomp_hasDerivWithinAt /-
theorem HasDerivAt.scomp_hasDerivWithinAt (hg : HasDerivAt gβ gβ' (h x))
(hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (gβ β h) (h' β’ gβ') s x :=
HasDerivWithinAt.scomp x hg.HasDerivWithinAt hh (mapsTo_univ _ _)
#align has_deriv_at.scomp_has_deriv_within_at HasDerivAt.scomp_hasDerivWithinAt
+-/
+#print derivWithin.scomp /-
theorem derivWithin.scomp (hg : DifferentiableWithinAt π' gβ t' (h x))
(hh : DifferentiableWithinAt π h s x) (hs : MapsTo h s t') (hxs : UniqueDiffWithinAt π s x) :
derivWithin (gβ β h) s x = derivWithin h s x β’ derivWithin gβ t' (h x) :=
(HasDerivWithinAt.scomp x hg.HasDerivWithinAt hh.HasDerivWithinAt hs).derivWithin hxs
#align deriv_within.scomp derivWithin.scomp
+-/
+#print deriv.scomp /-
theorem deriv.scomp (hg : DifferentiableAt π' gβ (h x)) (hh : DifferentiableAt π h x) :
deriv (gβ β h) x = deriv h x β’ deriv gβ (h x) :=
(HasDerivAt.scomp x hg.HasDerivAt hh.HasDerivAt).deriv
#align deriv.scomp deriv.scomp
+-/
/-! ### Derivative of the composition of a scalar and vector functions -/
+#print HasDerivAtFilter.comp_hasFDerivAtFilter /-
theorem HasDerivAtFilter.comp_hasFDerivAtFilter {f : E β π'} {f' : E βL[π] π'} (x) {L'' : Filter E}
(hhβ : HasDerivAtFilter hβ hβ' (f x) L') (hf : HasFDerivAtFilter f f' x L'')
(hL : Tendsto f L'' L') : HasFDerivAtFilter (hβ β f) (hβ' β’ f') x L'' := by
convert (hhβ.restrict_scalars π).comp x hf hL; ext x; simp [mul_comm]
#align has_deriv_at_filter.comp_has_fderiv_at_filter HasDerivAtFilter.comp_hasFDerivAtFilter
+-/
+#print HasStrictDerivAt.comp_hasStrictFDerivAt /-
theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[π] π'} (x)
(hh : HasStrictDerivAt hβ hβ' (f x)) (hf : HasStrictFDerivAt f f' x) :
HasStrictFDerivAt (hβ β f) (hβ' β’ f') x :=
@@ -141,90 +160,119 @@ theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[
ext x
simp [mul_comm]
#align has_strict_deriv_at.comp_has_strict_fderiv_at HasStrictDerivAt.comp_hasStrictFDerivAt
+-/
+#print HasDerivAt.comp_hasFDerivAt /-
theorem HasDerivAt.comp_hasFDerivAt {f : E β π'} {f' : E βL[π] π'} (x)
(hh : HasDerivAt hβ hβ' (f x)) (hf : HasFDerivAt f f' x) : HasFDerivAt (hβ β f) (hβ' β’ f') x :=
hh.comp_hasFDerivAtFilter x hf hf.ContinuousAt
#align has_deriv_at.comp_has_fderiv_at HasDerivAt.comp_hasFDerivAt
+-/
+#print HasDerivAt.comp_hasFDerivWithinAt /-
theorem HasDerivAt.comp_hasFDerivWithinAt {f : E β π'} {f' : E βL[π] π'} {s} (x)
(hh : HasDerivAt hβ hβ' (f x)) (hf : HasFDerivWithinAt f f' s x) :
HasFDerivWithinAt (hβ β f) (hβ' β’ f') s x :=
hh.comp_hasFDerivAtFilter x hf hf.ContinuousWithinAt
#align has_deriv_at.comp_has_fderiv_within_at HasDerivAt.comp_hasFDerivWithinAt
+-/
+#print HasDerivWithinAt.comp_hasFDerivWithinAt /-
theorem HasDerivWithinAt.comp_hasFDerivWithinAt {f : E β π'} {f' : E βL[π] π'} {s t} (x)
(hh : HasDerivWithinAt hβ hβ' t (f x)) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t) :
HasFDerivWithinAt (hβ β f) (hβ' β’ f') s x :=
hh.comp_hasFDerivAtFilter x hf <| hf.ContinuousWithinAt.tendsto_nhdsWithin hst
#align has_deriv_within_at.comp_has_fderiv_within_at HasDerivWithinAt.comp_hasFDerivWithinAt
+-/
/-! ### Derivative of the composition of two scalar functions -/
+#print HasDerivAtFilter.comp /-
theorem HasDerivAtFilter.comp (hhβ : HasDerivAtFilter hβ hβ' (h x) L')
(hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
HasDerivAtFilter (hβ β h) (hβ' * h') x L := by rw [mul_comm]; exact hhβ.scomp x hh hL
#align has_deriv_at_filter.comp HasDerivAtFilter.comp
+-/
+#print HasDerivWithinAt.comp /-
theorem HasDerivWithinAt.comp (hhβ : HasDerivWithinAt hβ hβ' s' (h x))
(hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') :
HasDerivWithinAt (hβ β h) (hβ' * h') s x := by rw [mul_comm]; exact hhβ.scomp x hh hst
#align has_deriv_within_at.comp HasDerivWithinAt.comp
+-/
+#print HasDerivAt.comp /-
/-- The chain rule. -/
theorem HasDerivAt.comp (hhβ : HasDerivAt hβ hβ' (h x)) (hh : HasDerivAt h h' x) :
HasDerivAt (hβ β h) (hβ' * h') x :=
hhβ.comp x hh hh.ContinuousAt
#align has_deriv_at.comp HasDerivAt.comp
+-/
+#print HasStrictDerivAt.comp /-
theorem HasStrictDerivAt.comp (hhβ : HasStrictDerivAt hβ hβ' (h x)) (hh : HasStrictDerivAt h h' x) :
HasStrictDerivAt (hβ β h) (hβ' * h') x := by rw [mul_comm]; exact hhβ.scomp x hh
#align has_strict_deriv_at.comp HasStrictDerivAt.comp
+-/
+#print HasDerivAt.comp_hasDerivWithinAt /-
theorem HasDerivAt.comp_hasDerivWithinAt (hhβ : HasDerivAt hβ hβ' (h x))
(hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (hβ β h) (hβ' * h') s x :=
hhβ.HasDerivWithinAt.comp x hh (mapsTo_univ _ _)
#align has_deriv_at.comp_has_deriv_within_at HasDerivAt.comp_hasDerivWithinAt
+-/
+#print derivWithin.comp /-
theorem derivWithin.comp (hhβ : DifferentiableWithinAt π' hβ s' (h x))
(hh : DifferentiableWithinAt π h s x) (hs : MapsTo h s s') (hxs : UniqueDiffWithinAt π s x) :
derivWithin (hβ β h) s x = derivWithin hβ s' (h x) * derivWithin h s x :=
(hhβ.HasDerivWithinAt.comp x hh.HasDerivWithinAt hs).derivWithin hxs
#align deriv_within.comp derivWithin.comp
+-/
+#print deriv.comp /-
theorem deriv.comp (hhβ : DifferentiableAt π' hβ (h x)) (hh : DifferentiableAt π h x) :
deriv (hβ β h) x = deriv hβ (h x) * deriv h x :=
(hhβ.HasDerivAt.comp x hh.HasDerivAt).deriv
#align deriv.comp deriv.comp
+-/
+#print HasDerivAtFilter.iterate /-
protected theorem HasDerivAtFilter.iterate {f : π β π} {f' : π} (hf : HasDerivAtFilter f f' x L)
(hL : Tendsto f L L) (hx : f x = x) (n : β) : HasDerivAtFilter (f^[n]) (f' ^ n) x L :=
by
have := hf.iterate hL hx n
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_at_filter.iterate HasDerivAtFilter.iterate
+-/
+#print HasDerivAt.iterate /-
protected theorem HasDerivAt.iterate {f : π β π} {f' : π} (hf : HasDerivAt f f' x) (hx : f x = x)
(n : β) : HasDerivAt (f^[n]) (f' ^ n) x :=
by
have := HasFDerivAt.iterate hf hx n
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_at.iterate HasDerivAt.iterate
+-/
+#print HasDerivWithinAt.iterate /-
protected theorem HasDerivWithinAt.iterate {f : π β π} {f' : π} (hf : HasDerivWithinAt f f' s x)
(hx : f x = x) (hs : MapsTo f s s) (n : β) : HasDerivWithinAt (f^[n]) (f' ^ n) s x :=
by
have := HasFDerivWithinAt.iterate hf hx hs n
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_within_at.iterate HasDerivWithinAt.iterate
+-/
+#print HasStrictDerivAt.iterate /-
protected theorem HasStrictDerivAt.iterate {f : π β π} {f' : π} (hf : HasStrictDerivAt f f' x)
(hx : f x = x) (n : β) : HasStrictDerivAt (f^[n]) (f' ^ n) x :=
by
have := hf.iterate hx n
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_strict_deriv_at.iterate HasStrictDerivAt.iterate
+-/
end Composition
@@ -239,6 +287,7 @@ variable {l : F β E} {l' : F βL[π] E}
variable (x)
+#print HasFDerivWithinAt.comp_hasDerivWithinAt /-
/-- The composition `l β f` where `l : F β E` and `f : π β F`, has a derivative within a set
equal to the FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithinAt l l' t (f x))
@@ -247,35 +296,46 @@ theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithi
simpa only [one_apply, one_smul, smul_right_apply, coe_comp', (Β· β Β·)] using
(hl.comp x hf.has_fderiv_within_at hst).HasDerivWithinAt
#align has_fderiv_within_at.comp_has_deriv_within_at HasFDerivWithinAt.comp_hasDerivWithinAt
+-/
+#print HasFDerivAt.comp_hasDerivWithinAt /-
theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x))
(hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l β f) (l' f') s x :=
hl.HasFDerivWithinAt.comp_hasDerivWithinAt x hf (mapsTo_univ _ _)
#align has_fderiv_at.comp_has_deriv_within_at HasFDerivAt.comp_hasDerivWithinAt
+-/
+#print HasFDerivAt.comp_hasDerivAt /-
/-- The composition `l β f` where `l : F β E` and `f : π β F`, has a derivative equal to the
FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) :
HasDerivAt (l β f) (l' f') x :=
hasDerivWithinAt_univ.mp <| hl.comp_hasDerivWithinAt x hf.HasDerivWithinAt
#align has_fderiv_at.comp_has_deriv_at HasFDerivAt.comp_hasDerivAt
+-/
+#print HasStrictFDerivAt.comp_hasStrictDerivAt /-
theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x))
(hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l β f) (l' f') x := by
simpa only [one_apply, one_smul, smul_right_apply, coe_comp', (Β· β Β·)] using
(hl.comp x hf.has_strict_fderiv_at).HasStrictDerivAt
#align has_strict_fderiv_at.comp_has_strict_deriv_at HasStrictFDerivAt.comp_hasStrictDerivAt
+-/
+#print fderivWithin.comp_derivWithin /-
theorem fderivWithin.comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt π l t (f x))
(hf : DifferentiableWithinAt π f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π s x) :
derivWithin (l β f) s x = (fderivWithin π l t (f x) : F β E) (derivWithin f s x) :=
(hl.HasFDerivWithinAt.comp_hasDerivWithinAt x hf.HasDerivWithinAt hs).derivWithin hxs
#align fderiv_within.comp_deriv_within fderivWithin.comp_derivWithin
+-/
+#print fderiv.comp_deriv /-
theorem fderiv.comp_deriv (hl : DifferentiableAt π l (f x)) (hf : DifferentiableAt π f x) :
deriv (l β f) x = (fderiv π l (f x) : F β E) (deriv f x) :=
(hl.HasFDerivAt.comp_hasDerivAt x hf.HasDerivAt).deriv
#align fderiv.comp_deriv fderiv.comp_deriv
+-/
end CompositionVector
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -129,7 +129,7 @@ theorem deriv.scomp (hg : DifferentiableAt π' gβ (h x)) (hh : Differentiabl
theorem HasDerivAtFilter.comp_hasFDerivAtFilter {f : E β π'} {f' : E βL[π] π'} (x) {L'' : Filter E}
(hhβ : HasDerivAtFilter hβ hβ' (f x) L') (hf : HasFDerivAtFilter f f' x L'')
(hL : Tendsto f L'' L') : HasFDerivAtFilter (hβ β f) (hβ' β’ f') x L'' := by
- convert(hhβ.restrict_scalars π).comp x hf hL; ext x; simp [mul_comm]
+ convert (hhβ.restrict_scalars π).comp x hf hL; ext x; simp [mul_comm]
#align has_deriv_at_filter.comp_has_fderiv_at_filter HasDerivAtFilter.comp_hasFDerivAtFilter
theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[π] π'} (x)
@@ -137,7 +137,7 @@ theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[
HasStrictFDerivAt (hβ β f) (hβ' β’ f') x :=
by
rw [HasStrictDerivAt] at hh
- convert(hh.restrict_scalars π).comp x hf
+ convert (hh.restrict_scalars π).comp x hf
ext x
simp [mul_comm]
#align has_strict_deriv_at.comp_has_strict_fderiv_at HasStrictDerivAt.comp_hasStrictFDerivAt
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -136,7 +136,7 @@ theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[
(hh : HasStrictDerivAt hβ hβ' (f x)) (hf : HasStrictFDerivAt f f' x) :
HasStrictFDerivAt (hβ β f) (hβ' β’ f') x :=
by
- rw [HasStrictDerivAt] at hh
+ rw [HasStrictDerivAt] at hh
convert(hh.restrict_scalars π).comp x hf
ext x
simp [mul_comm]
@@ -202,28 +202,28 @@ protected theorem HasDerivAtFilter.iterate {f : π β π} {f' : π} (hf :
(hL : Tendsto f L L) (hx : f x = x) (n : β) : HasDerivAtFilter (f^[n]) (f' ^ n) x L :=
by
have := hf.iterate hL hx n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_at_filter.iterate HasDerivAtFilter.iterate
protected theorem HasDerivAt.iterate {f : π β π} {f' : π} (hf : HasDerivAt f f' x) (hx : f x = x)
(n : β) : HasDerivAt (f^[n]) (f' ^ n) x :=
by
have := HasFDerivAt.iterate hf hx n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_at.iterate HasDerivAt.iterate
protected theorem HasDerivWithinAt.iterate {f : π β π} {f' : π} (hf : HasDerivWithinAt f f' s x)
(hx : f x = x) (hs : MapsTo f s s) (n : β) : HasDerivWithinAt (f^[n]) (f' ^ n) s x :=
by
have := HasFDerivWithinAt.iterate hf hx hs n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_within_at.iterate HasDerivWithinAt.iterate
protected theorem HasStrictDerivAt.iterate {f : π β π} {f' : π} (hf : HasStrictDerivAt f f' x)
(hx : f x = x) (n : β) : HasStrictDerivAt (f^[n]) (f' ^ n) x :=
by
have := hf.iterate hx n
- rwa [ContinuousLinearMap.smulRight_one_pow] at this
+ rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_strict_deriv_at.iterate HasStrictDerivAt.iterate
end Composition
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Ebner, SΓ©bastien GouΓ«zel, Yury Kudryashov, Yuyang Zhao
! This file was ported from Lean 3 source module analysis.calculus.deriv.comp
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
+! leanprover-community/mathlib commit f60c6087a7275b72d5db3c5a1d0e19e35a429c0a
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -15,6 +15,9 @@ import Mathbin.Analysis.Calculus.Fderiv.RestrictScalars
/-!
# One-dimensional derivatives of compositions of functions
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
In this file we prove the chain rule for the following cases:
* `has_deriv_at.comp` etc: `f : π' β π'` composed with `g : π β π'`;
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -35,7 +35,7 @@ derivative, chain rule
universe u v w
-open Classical Topology BigOperators Filter ENNReal
+open scoped Classical Topology BigOperators Filter ENNReal
open Filter Asymptotics Set
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -125,11 +125,8 @@ theorem deriv.scomp (hg : DifferentiableAt π' gβ (h x)) (hh : Differentiabl
theorem HasDerivAtFilter.comp_hasFDerivAtFilter {f : E β π'} {f' : E βL[π] π'} (x) {L'' : Filter E}
(hhβ : HasDerivAtFilter hβ hβ' (f x) L') (hf : HasFDerivAtFilter f f' x L'')
- (hL : Tendsto f L'' L') : HasFDerivAtFilter (hβ β f) (hβ' β’ f') x L'' :=
- by
- convert(hhβ.restrict_scalars π).comp x hf hL
- ext x
- simp [mul_comm]
+ (hL : Tendsto f L'' L') : HasFDerivAtFilter (hβ β f) (hβ' β’ f') x L'' := by
+ convert(hhβ.restrict_scalars π).comp x hf hL; ext x; simp [mul_comm]
#align has_deriv_at_filter.comp_has_fderiv_at_filter HasDerivAtFilter.comp_hasFDerivAtFilter
theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[π] π'} (x)
@@ -164,18 +161,12 @@ theorem HasDerivWithinAt.comp_hasFDerivWithinAt {f : E β π'} {f' : E βL[
theorem HasDerivAtFilter.comp (hhβ : HasDerivAtFilter hβ hβ' (h x) L')
(hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
- HasDerivAtFilter (hβ β h) (hβ' * h') x L :=
- by
- rw [mul_comm]
- exact hhβ.scomp x hh hL
+ HasDerivAtFilter (hβ β h) (hβ' * h') x L := by rw [mul_comm]; exact hhβ.scomp x hh hL
#align has_deriv_at_filter.comp HasDerivAtFilter.comp
theorem HasDerivWithinAt.comp (hhβ : HasDerivWithinAt hβ hβ' s' (h x))
(hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') :
- HasDerivWithinAt (hβ β h) (hβ' * h') s x :=
- by
- rw [mul_comm]
- exact hhβ.scomp x hh hst
+ HasDerivWithinAt (hβ β h) (hβ' * h') s x := by rw [mul_comm]; exact hhβ.scomp x hh hst
#align has_deriv_within_at.comp HasDerivWithinAt.comp
/-- The chain rule. -/
@@ -185,10 +176,7 @@ theorem HasDerivAt.comp (hhβ : HasDerivAt hβ hβ' (h x)) (hh : HasDerivAt h
#align has_deriv_at.comp HasDerivAt.comp
theorem HasStrictDerivAt.comp (hhβ : HasStrictDerivAt hβ hβ' (h x)) (hh : HasStrictDerivAt h h' x) :
- HasStrictDerivAt (hβ β h) (hβ' * h') x :=
- by
- rw [mul_comm]
- exact hhβ.scomp x hh
+ HasStrictDerivAt (hβ β h) (hβ' * h') x := by rw [mul_comm]; exact hhβ.scomp x hh
#align has_strict_deriv_at.comp HasStrictDerivAt.comp
theorem HasDerivAt.comp_hasDerivWithinAt (hhβ : HasDerivAt hβ hβ' (h x))
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
of_eq
versions for lemmas on composition of derivatives (#11867)
The versions we have assume that f
is differentiable at h x
and h
is differentiable at x
, to deduce that f o h
is differentiable at x
. In many applications, we have that f
is differentiable at some point which happens to be equal to h x
, but not definitionally, so one needs to jump through some hoops to apply the composition lemma. We add of_eq
versions assuming instead that f
is differentiable at y
and that y = h x
, which is much more flexible in practice.
@@ -21,6 +21,10 @@ In this file we prove the chain rule for the following cases:
Here `π` is the base normed field, `E` and `F` are normed spaces over `π` and `π'` is an algebra
over `π` (e.g., `π'=π` or `π=β`, `π'=β`).
+We also give versions with the `of_eq` suffix, which require an equality proof instead
+of definitional equality of the different points used in the composition. These versions are
+often more flexible to use.
+
For a more detailed overview of one-dimensional derivatives in mathlib, see the module docstring of
`analysis/calculus/deriv/basic`.
@@ -65,7 +69,7 @@ usual multiplication in `comp` lemmas.
get confused since there are too many possibilities for composition -/
variable {π' : Type*} [NontriviallyNormedField π'] [NormedAlgebra π π'] [NormedSpace π' F]
[IsScalarTower π π' F] {s' t' : Set π'} {h : π β π'} {hβ : π β π} {hβ : π' β π'} {h' hβ' : π'}
- {hβ' : π} {gβ : π' β F} {gβ' : F} {L' : Filter π'} (x)
+ {hβ' : π} {gβ : π' β F} {gβ' : F} {L' : Filter π'} {y : π'} (x)
theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter gβ gβ' (h x) L')
(hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') :
@@ -73,46 +77,87 @@ theorem HasDerivAtFilter.scomp (hg : HasDerivAtFilter gβ gβ' (h x) L')
simpa using ((hg.restrictScalars π).comp x hh hL).hasDerivAtFilter
#align has_deriv_at_filter.scomp HasDerivAtFilter.scomp
+theorem HasDerivAtFilter.scomp_of_eq (hg : HasDerivAtFilter gβ gβ' y L')
+ (hh : HasDerivAtFilter h h' x L) (hy : y = h x) (hL : Tendsto h L L') :
+ HasDerivAtFilter (gβ β h) (h' β’ gβ') x L := by
+ rw [hy] at hg; exact hg.scomp x hh hL
+
theorem HasDerivWithinAt.scomp_hasDerivAt (hg : HasDerivWithinAt gβ gβ' s' (h x))
(hh : HasDerivAt h h' x) (hs : β x, h x β s') : HasDerivAt (gβ β h) (h' β’ gβ') x :=
hg.scomp x hh <| tendsto_inf.2 β¨hh.continuousAt, tendsto_principal.2 <| eventually_of_forall hsβ©
#align has_deriv_within_at.scomp_has_deriv_at HasDerivWithinAt.scomp_hasDerivAt
+theorem HasDerivWithinAt.scomp_hasDerivAt_of_eq (hg : HasDerivWithinAt gβ gβ' s' y)
+ (hh : HasDerivAt h h' x) (hs : β x, h x β s') (hy : y = h x) :
+ HasDerivAt (gβ β h) (h' β’ gβ') x := by
+ rw [hy] at hg; exact hg.scomp_hasDerivAt x hh hs
+
nonrec theorem HasDerivWithinAt.scomp (hg : HasDerivWithinAt gβ gβ' t' (h x))
(hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') :
HasDerivWithinAt (gβ β h) (h' β’ gβ') s x :=
hg.scomp x hh <| hh.continuousWithinAt.tendsto_nhdsWithin hst
#align has_deriv_within_at.scomp HasDerivWithinAt.scomp
+theorem HasDerivWithinAt.scomp_of_eq (hg : HasDerivWithinAt gβ gβ' t' y)
+ (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s t') (hy : y = h x) :
+ HasDerivWithinAt (gβ β h) (h' β’ gβ') s x := by
+ rw [hy] at hg; exact hg.scomp x hh hst
+
/-- The chain rule. -/
nonrec theorem HasDerivAt.scomp (hg : HasDerivAt gβ gβ' (h x)) (hh : HasDerivAt h h' x) :
HasDerivAt (gβ β h) (h' β’ gβ') x :=
hg.scomp x hh hh.continuousAt
#align has_deriv_at.scomp HasDerivAt.scomp
+/-- The chain rule. -/
+theorem HasDerivAt.scomp_of_eq
+ (hg : HasDerivAt gβ gβ' y) (hh : HasDerivAt h h' x) (hy : y = h x) :
+ HasDerivAt (gβ β h) (h' β’ gβ') x := by
+ rw [hy] at hg; exact hg.scomp x hh
+
theorem HasStrictDerivAt.scomp (hg : HasStrictDerivAt gβ gβ' (h x)) (hh : HasStrictDerivAt h h' x) :
HasStrictDerivAt (gβ β h) (h' β’ gβ') x := by
simpa using ((hg.restrictScalars π).comp x hh).hasStrictDerivAt
#align has_strict_deriv_at.scomp HasStrictDerivAt.scomp
+theorem HasStrictDerivAt.scomp_of_eq
+ (hg : HasStrictDerivAt gβ gβ' y) (hh : HasStrictDerivAt h h' x) (hy : y = h x) :
+ HasStrictDerivAt (gβ β h) (h' β’ gβ') x := by
+ rw [hy] at hg; exact hg.scomp x hh
+
theorem HasDerivAt.scomp_hasDerivWithinAt (hg : HasDerivAt gβ gβ' (h x))
(hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (gβ β h) (h' β’ gβ') s x :=
HasDerivWithinAt.scomp x hg.hasDerivWithinAt hh (mapsTo_univ _ _)
#align has_deriv_at.scomp_has_deriv_within_at HasDerivAt.scomp_hasDerivWithinAt
+theorem HasDerivAt.scomp_hasDerivWithinAt_of_eq (hg : HasDerivAt gβ gβ' y)
+ (hh : HasDerivWithinAt h h' s x) (hy : y = h x) :
+ HasDerivWithinAt (gβ β h) (h' β’ gβ') s x := by
+ rw [hy] at hg; exact hg.scomp_hasDerivWithinAt x hh
+
theorem derivWithin.scomp (hg : DifferentiableWithinAt π' gβ t' (h x))
(hh : DifferentiableWithinAt π h s x) (hs : MapsTo h s t') (hxs : UniqueDiffWithinAt π s x) :
derivWithin (gβ β h) s x = derivWithin h s x β’ derivWithin gβ t' (h x) :=
(HasDerivWithinAt.scomp x hg.hasDerivWithinAt hh.hasDerivWithinAt hs).derivWithin hxs
#align deriv_within.scomp derivWithin.scomp
+theorem derivWithin.scomp_of_eq (hg : DifferentiableWithinAt π' gβ t' y)
+ (hh : DifferentiableWithinAt π h s x) (hs : MapsTo h s t') (hxs : UniqueDiffWithinAt π s x)
+ (hy : y = h x) :
+ derivWithin (gβ β h) s x = derivWithin h s x β’ derivWithin gβ t' (h x) := by
+ rw [hy] at hg; exact derivWithin.scomp x hg hh hs hxs
+
theorem deriv.scomp (hg : DifferentiableAt π' gβ (h x)) (hh : DifferentiableAt π h x) :
deriv (gβ β h) x = deriv h x β’ deriv gβ (h x) :=
(HasDerivAt.scomp x hg.hasDerivAt hh.hasDerivAt).deriv
#align deriv.scomp deriv.scomp
-/-! ### Derivative of the composition of a scalar and vector functions -/
+theorem deriv.scomp_of_eq
+ (hg : DifferentiableAt π' gβ y) (hh : DifferentiableAt π h x) (hy : y = h x) :
+ deriv (gβ β h) x = deriv h x β’ deriv gβ (h x) := by
+ rw [hy] at hg; exact deriv.scomp x hg hh
+/-! ### Derivative of the composition of a scalar and vector functions -/
theorem HasDerivAtFilter.comp_hasFDerivAtFilter {f : E β π'} {f' : E βL[π] π'} (x) {L'' : Filter E}
(hhβ : HasDerivAtFilter hβ hβ' (f x) L') (hf : HasFDerivAtFilter f f' x L'')
@@ -122,6 +167,12 @@ theorem HasDerivAtFilter.comp_hasFDerivAtFilter {f : E β π'} {f' : E βL[
simp [mul_comm]
#align has_deriv_at_filter.comp_has_fderiv_at_filter HasDerivAtFilter.comp_hasFDerivAtFilter
+theorem HasDerivAtFilter.comp_hasFDerivAtFilter_of_eq
+ {f : E β π'} {f' : E βL[π] π'} (x) {L'' : Filter E}
+ (hhβ : HasDerivAtFilter hβ hβ' y L') (hf : HasFDerivAtFilter f f' x L'')
+ (hL : Tendsto f L'' L') (hy : y = f x) : HasFDerivAtFilter (hβ β f) (hβ' β’ f') x L'' := by
+ rw [hy] at hhβ; exact hhβ.comp_hasFDerivAtFilter x hf hL
+
theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[π] π'} (x)
(hh : HasStrictDerivAt hβ hβ' (f x)) (hf : HasStrictFDerivAt f f' x) :
HasStrictFDerivAt (hβ β f) (hβ' β’ f') x := by
@@ -131,23 +182,44 @@ theorem HasStrictDerivAt.comp_hasStrictFDerivAt {f : E β π'} {f' : E βL[
simp [mul_comm]
#align has_strict_deriv_at.comp_has_strict_fderiv_at HasStrictDerivAt.comp_hasStrictFDerivAt
+theorem HasStrictDerivAt.comp_hasStrictFDerivAt_of_eq {f : E β π'} {f' : E βL[π] π'} (x)
+ (hh : HasStrictDerivAt hβ hβ' y) (hf : HasStrictFDerivAt f f' x) (hy : y = f x) :
+ HasStrictFDerivAt (hβ β f) (hβ' β’ f') x := by
+ rw [hy] at hh; exact hh.comp_hasStrictFDerivAt x hf
+
theorem HasDerivAt.comp_hasFDerivAt {f : E β π'} {f' : E βL[π] π'} (x)
(hh : HasDerivAt hβ hβ' (f x)) (hf : HasFDerivAt f f' x) : HasFDerivAt (hβ β f) (hβ' β’ f') x :=
hh.comp_hasFDerivAtFilter x hf hf.continuousAt
#align has_deriv_at.comp_has_fderiv_at HasDerivAt.comp_hasFDerivAt
+theorem HasDerivAt.comp_hasFDerivAt_of_eq {f : E β π'} {f' : E βL[π] π'} (x)
+ (hh : HasDerivAt hβ hβ' y) (hf : HasFDerivAt f f' x) (hy : y = f x) :
+ HasFDerivAt (hβ β f) (hβ' β’ f') x := by
+ rw [hy] at hh; exact hh.comp_hasFDerivAt x hf
+
theorem HasDerivAt.comp_hasFDerivWithinAt {f : E β π'} {f' : E βL[π] π'} {s} (x)
(hh : HasDerivAt hβ hβ' (f x)) (hf : HasFDerivWithinAt f f' s x) :
HasFDerivWithinAt (hβ β f) (hβ' β’ f') s x :=
hh.comp_hasFDerivAtFilter x hf hf.continuousWithinAt
#align has_deriv_at.comp_has_fderiv_within_at HasDerivAt.comp_hasFDerivWithinAt
+theorem HasDerivAt.comp_hasFDerivWithinAt_of_eq {f : E β π'} {f' : E βL[π] π'} {s} (x)
+ (hh : HasDerivAt hβ hβ' y) (hf : HasFDerivWithinAt f f' s x) (hy : y = f x) :
+ HasFDerivWithinAt (hβ β f) (hβ' β’ f') s x := by
+ rw [hy] at hh; exact hh.comp_hasFDerivWithinAt x hf
+
theorem HasDerivWithinAt.comp_hasFDerivWithinAt {f : E β π'} {f' : E βL[π] π'} {s t} (x)
(hh : HasDerivWithinAt hβ hβ' t (f x)) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t) :
HasFDerivWithinAt (hβ β f) (hβ' β’ f') s x :=
hh.comp_hasFDerivAtFilter x hf <| hf.continuousWithinAt.tendsto_nhdsWithin hst
#align has_deriv_within_at.comp_has_fderiv_within_at HasDerivWithinAt.comp_hasFDerivWithinAt
+theorem HasDerivWithinAt.comp_hasFDerivWithinAt_of_eq {f : E β π'} {f' : E βL[π] π'} {s t} (x)
+ (hh : HasDerivWithinAt hβ hβ' t y) (hf : HasFDerivWithinAt f f' s x) (hst : MapsTo f s t)
+ (hy : y = f x) :
+ HasFDerivWithinAt (hβ β f) (hβ' β’ f') s x := by
+ rw [hy] at hh; exact hh.comp_hasFDerivWithinAt x hf hst
+
/-! ### Derivative of the composition of two scalar functions -/
theorem HasDerivAtFilter.comp (hhβ : HasDerivAtFilter hβ hβ' (h x) L')
@@ -157,6 +229,11 @@ theorem HasDerivAtFilter.comp (hhβ : HasDerivAtFilter hβ hβ' (h x) L')
exact hhβ.scomp x hh hL
#align has_deriv_at_filter.comp HasDerivAtFilter.comp
+theorem HasDerivAtFilter.comp_of_eq (hhβ : HasDerivAtFilter hβ hβ' y L')
+ (hh : HasDerivAtFilter h h' x L) (hL : Tendsto h L L') (hy : y = h x) :
+ HasDerivAtFilter (hβ β h) (hβ' * h') x L := by
+ rw [hy] at hhβ; exact hhβ.comp x hh hL
+
theorem HasDerivWithinAt.comp (hhβ : HasDerivWithinAt hβ hβ' s' (h x))
(hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') :
HasDerivWithinAt (hβ β h) (hβ' * h') s x := by
@@ -164,34 +241,72 @@ theorem HasDerivWithinAt.comp (hhβ : HasDerivWithinAt hβ hβ' s' (h x))
exact hhβ.scomp x hh hst
#align has_deriv_within_at.comp HasDerivWithinAt.comp
-/-- The chain rule. -/
+theorem HasDerivWithinAt.comp_of_eq (hhβ : HasDerivWithinAt hβ hβ' s' y)
+ (hh : HasDerivWithinAt h h' s x) (hst : MapsTo h s s') (hy : y = h x) :
+ HasDerivWithinAt (hβ β h) (hβ' * h') s x := by
+ rw [hy] at hhβ; exact hhβ.comp x hh hst
+
+/-- The chain rule.
+
+Note that the function `hβ` is a function on an algebra. If you are looking for the chain rule
+with `hβ` taking values in a vector space, use `HasDerivAt.scomp`. -/
nonrec theorem HasDerivAt.comp (hhβ : HasDerivAt hβ hβ' (h x)) (hh : HasDerivAt h h' x) :
HasDerivAt (hβ β h) (hβ' * h') x :=
hhβ.comp x hh hh.continuousAt
#align has_deriv_at.comp HasDerivAt.comp
+/-- The chain rule.
+
+Note that the function `hβ` is a function on an algebra. If you are looking for the chain rule
+with `hβ` taking values in a vector space, use `HasDerivAt.scomp_of_eq`. -/
+theorem HasDerivAt.comp_of_eq
+ (hhβ : HasDerivAt hβ hβ' y) (hh : HasDerivAt h h' x) (hy : y = h x) :
+ HasDerivAt (hβ β h) (hβ' * h') x := by
+ rw [hy] at hhβ; exact hhβ.comp x hh
+
theorem HasStrictDerivAt.comp (hhβ : HasStrictDerivAt hβ hβ' (h x)) (hh : HasStrictDerivAt h h' x) :
HasStrictDerivAt (hβ β h) (hβ' * h') x := by
rw [mul_comm]
exact hhβ.scomp x hh
#align has_strict_deriv_at.comp HasStrictDerivAt.comp
+theorem HasStrictDerivAt.comp_of_eq
+ (hhβ : HasStrictDerivAt hβ hβ' y) (hh : HasStrictDerivAt h h' x) (hy : y = h x) :
+ HasStrictDerivAt (hβ β h) (hβ' * h') x := by
+ rw [hy] at hhβ; exact hhβ.comp x hh
+
theorem HasDerivAt.comp_hasDerivWithinAt (hhβ : HasDerivAt hβ hβ' (h x))
(hh : HasDerivWithinAt h h' s x) : HasDerivWithinAt (hβ β h) (hβ' * h') s x :=
hhβ.hasDerivWithinAt.comp x hh (mapsTo_univ _ _)
#align has_deriv_at.comp_has_deriv_within_at HasDerivAt.comp_hasDerivWithinAt
+theorem HasDerivAt.comp_hasDerivWithinAt_of_eq (hhβ : HasDerivAt hβ hβ' y)
+ (hh : HasDerivWithinAt h h' s x) (hy : y = h x) :
+ HasDerivWithinAt (hβ β h) (hβ' * h') s x := by
+ rw [hy] at hhβ; exact hhβ.comp_hasDerivWithinAt x hh
+
theorem derivWithin.comp (hhβ : DifferentiableWithinAt π' hβ s' (h x))
(hh : DifferentiableWithinAt π h s x) (hs : MapsTo h s s') (hxs : UniqueDiffWithinAt π s x) :
derivWithin (hβ β h) s x = derivWithin hβ s' (h x) * derivWithin h s x :=
(hhβ.hasDerivWithinAt.comp x hh.hasDerivWithinAt hs).derivWithin hxs
#align deriv_within.comp derivWithin.comp
+theorem derivWithin.comp_of_eq (hhβ : DifferentiableWithinAt π' hβ s' y)
+ (hh : DifferentiableWithinAt π h s x) (hs : MapsTo h s s') (hxs : UniqueDiffWithinAt π s x)
+ (hy : y = h x) :
+ derivWithin (hβ β h) s x = derivWithin hβ s' (h x) * derivWithin h s x := by
+ rw [hy] at hhβ; exact derivWithin.comp x hhβ hh hs hxs
+
theorem deriv.comp (hhβ : DifferentiableAt π' hβ (h x)) (hh : DifferentiableAt π h x) :
deriv (hβ β h) x = deriv hβ (h x) * deriv h x :=
(hhβ.hasDerivAt.comp x hh.hasDerivAt).deriv
#align deriv.comp deriv.comp
+theorem deriv.comp_of_eq (hhβ : DifferentiableAt π' hβ y) (hh : DifferentiableAt π h x)
+ (hy : y = h x) :
+ deriv (hβ β h) x = deriv hβ (h x) * deriv h x := by
+ rw [hy] at hhβ; exact deriv.comp x hhβ hh
+
protected nonrec theorem HasDerivAtFilter.iterate {f : π β π} {f' : π}
(hf : HasDerivAtFilter f f' x L) (hL : Tendsto f L L) (hx : f x = x) (n : β) :
HasDerivAtFilter f^[n] (f' ^ n) x L := by
@@ -225,7 +340,7 @@ section CompositionVector
open ContinuousLinearMap
-variable {l : F β E} {l' : F βL[π] E}
+variable {l : F β E} {l' : F βL[π] E} {y : F}
variable (x)
/-- The composition `l β f` where `l : F β E` and `f : π β F`, has a derivative within a set
@@ -237,11 +352,24 @@ theorem HasFDerivWithinAt.comp_hasDerivWithinAt {t : Set F} (hl : HasFDerivWithi
(hl.comp x hf.hasFDerivWithinAt hst).hasDerivWithinAt
#align has_fderiv_within_at.comp_has_deriv_within_at HasFDerivWithinAt.comp_hasDerivWithinAt
+/-- The composition `l β f` where `l : F β E` and `f : π β F`, has a derivative within a set
+equal to the FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
+theorem HasFDerivWithinAt.comp_hasDerivWithinAt_of_eq {t : Set F}
+ (hl : HasFDerivWithinAt l l' t y)
+ (hf : HasDerivWithinAt f f' s x) (hst : MapsTo f s t) (hy : y = f x) :
+ HasDerivWithinAt (l β f) (l' f') s x := by
+ rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf hst
+
theorem HasFDerivAt.comp_hasDerivWithinAt (hl : HasFDerivAt l l' (f x))
(hf : HasDerivWithinAt f f' s x) : HasDerivWithinAt (l β f) (l' f') s x :=
hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf (mapsTo_univ _ _)
#align has_fderiv_at.comp_has_deriv_within_at HasFDerivAt.comp_hasDerivWithinAt
+theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y)
+ (hf : HasDerivWithinAt f f' s x) (hy : y = f x) :
+ HasDerivWithinAt (l β f) (l' f') s x := by
+ rw [hy] at hl; exact hl.comp_hasDerivWithinAt x hf
+
/-- The composition `l β f` where `l : F β E` and `f : π β F`, has a derivative equal to the
FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDerivAt f f' x) :
@@ -249,21 +377,44 @@ theorem HasFDerivAt.comp_hasDerivAt (hl : HasFDerivAt l l' (f x)) (hf : HasDeriv
hasDerivWithinAt_univ.mp <| hl.comp_hasDerivWithinAt x hf.hasDerivWithinAt
#align has_fderiv_at.comp_has_deriv_at HasFDerivAt.comp_hasDerivAt
+/-- The composition `l β f` where `l : F β E` and `f : π β F`, has a derivative equal to the
+FrΓ©chet derivative of `l` applied to the derivative of `f`. -/
+theorem HasFDerivAt.comp_hasDerivAt_of_eq
+ (hl : HasFDerivAt l l' y) (hf : HasDerivAt f f' x) (hy : y = f x) :
+ HasDerivAt (l β f) (l' f') x := by
+ rw [hy] at hl; exact hl.comp_hasDerivAt x hf
+
theorem HasStrictFDerivAt.comp_hasStrictDerivAt (hl : HasStrictFDerivAt l l' (f x))
(hf : HasStrictDerivAt f f' x) : HasStrictDerivAt (l β f) (l' f') x := by
simpa only [one_apply, one_smul, smulRight_apply, coe_comp', (Β· β Β·)] using
(hl.comp x hf.hasStrictFDerivAt).hasStrictDerivAt
#align has_strict_fderiv_at.comp_has_strict_deriv_at HasStrictFDerivAt.comp_hasStrictDerivAt
+theorem HasStrictFDerivAt.comp_hasStrictDerivAt_of_eq (hl : HasStrictFDerivAt l l' y)
+ (hf : HasStrictDerivAt f f' x) (hy : y = f x) :
+ HasStrictDerivAt (l β f) (l' f') x := by
+ rw [hy] at hl; exact hl.comp_hasStrictDerivAt x hf
+
theorem fderivWithin.comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt π l t (f x))
(hf : DifferentiableWithinAt π f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π s x) :
derivWithin (l β f) s x = (fderivWithin π l t (f x) : F β E) (derivWithin f s x) :=
(hl.hasFDerivWithinAt.comp_hasDerivWithinAt x hf.hasDerivWithinAt hs).derivWithin hxs
#align fderiv_within.comp_deriv_within fderivWithin.comp_derivWithin
+theorem fderivWithin.comp_derivWithin_of_eq {t : Set F} (hl : DifferentiableWithinAt π l t y)
+ (hf : DifferentiableWithinAt π f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt π s x)
+ (hy : y = f x) :
+ derivWithin (l β f) s x = (fderivWithin π l t (f x) : F β E) (derivWithin f s x) := by
+ rw [hy] at hl; exact fderivWithin.comp_derivWithin x hl hf hs hxs
+
theorem fderiv.comp_deriv (hl : DifferentiableAt π l (f x)) (hf : DifferentiableAt π f x) :
deriv (l β f) x = (fderiv π l (f x) : F β E) (deriv f x) :=
(hl.hasFDerivAt.comp_hasDerivAt x hf.hasDerivAt).deriv
#align fderiv.comp_deriv fderiv.comp_deriv
+theorem fderiv.comp_deriv_of_eq (hl : DifferentiableAt π l y) (hf : DifferentiableAt π f x)
+ (hy : y = f x) :
+ deriv (l β f) x = (fderiv π l (f x) : F β E) (deriv f x) := by
+ rw [hy] at hl; exact fderiv.comp_deriv x hl hf
+
end CompositionVector
Empty lines were removed by executing the following Python script twice
import os
import re
# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.lean'):
file_path = os.path.join(dir_path, filename)
# Open the file and read its contents
with open(file_path, 'r') as file:
content = file.read()
# Use a regular expression to replace sequences of "variable" lines separated by empty lines
# with sequences without empty lines
modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)
# Write the modified content back to the file
with open(file_path, 'w') as file:
file.write(modified_content)
@@ -40,19 +40,12 @@ open Filter Asymptotics Set
open ContinuousLinearMap (smulRight smulRight_one_eq_iff)
variable {π : Type u} [NontriviallyNormedField π]
-
variable {F : Type v} [NormedAddCommGroup F] [NormedSpace π F]
-
variable {E : Type w} [NormedAddCommGroup E] [NormedSpace π E]
-
variable {f fβ fβ g : π β F}
-
variable {f' fβ' fβ' g' : F}
-
variable {x : π}
-
variable {s t : Set π}
-
variable {L Lβ Lβ : Filter π}
section Composition
@@ -233,7 +226,6 @@ section CompositionVector
open ContinuousLinearMap
variable {l : F β E} {l' : F βL[π] E}
-
variable (x)
/-- The composition `l β f` where `l : F β E` and `f : π β F`, has a derivative within a set
open Classical
(#11199)
We remove all but one open Classical
s, instead preferring to use open scoped Classical
. The only real side-effect this led to is moving a couple declarations to use Exists.choose
instead of Classical.choose
.
The first few commits are explicitly labelled regex replaces for ease of review.
@@ -32,7 +32,8 @@ derivative, chain rule
universe u v w
-open Classical Topology BigOperators Filter ENNReal
+open scoped Classical
+open Topology BigOperators Filter ENNReal
open Filter Asymptotics Set
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -69,7 +69,7 @@ usual multiplication in `comp` lemmas.
/- For composition lemmas, we put x explicit to help the elaborator, as otherwise Lean tends to
get confused since there are too many possibilities for composition -/
-variable {π' : Type _} [NontriviallyNormedField π'] [NormedAlgebra π π'] [NormedSpace π' F]
+variable {π' : Type*} [NontriviallyNormedField π'] [NormedAlgebra π π'] [NormedSpace π' F]
[IsScalarTower π π' F] {s' t' : Set π'} {h : π β π'} {hβ : π β π} {hβ : π' β π'} {h' hβ' : π'}
{hβ' : π} {gβ : π' β F} {gβ' : F} {L' : Filter π'} (x)
@@ -2,16 +2,13 @@
Copyright (c) 2019 Gabriel Ebner. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Gabriel Ebner, SΓ©bastien GouΓ«zel, Yury Kudryashov, Yuyang Zhao
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.comp
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Analysis.Calculus.Deriv.Basic
import Mathlib.Analysis.Calculus.FDeriv.Comp
import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
+#align_import analysis.calculus.deriv.comp from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
/-!
# One-dimensional derivatives of compositions of functions
@@ -219,7 +219,7 @@ protected theorem HasDerivWithinAt.iterate {f : π β π} {f' : π} (hf :
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_within_at.iterate HasDerivWithinAt.iterate
-protected nonrec theorem HasStrictDerivAt.iterate {f : π β π} {f' : π}
+protected nonrec theorem HasStrictDerivAt.iterate {f : π β π} {f' : π}
(hf : HasStrictDerivAt f f' x) (hx : f x = x) (n : β) :
HasStrictDerivAt f^[n] (f' ^ n) x := by
have := hf.iterate hx n
@@ -203,25 +203,25 @@ theorem deriv.comp (hhβ : DifferentiableAt π' hβ (h x)) (hh : Differentia
protected nonrec theorem HasDerivAtFilter.iterate {f : π β π} {f' : π}
(hf : HasDerivAtFilter f f' x L) (hL : Tendsto f L L) (hx : f x = x) (n : β) :
- HasDerivAtFilter (f^[n]) (f' ^ n) x L := by
+ HasDerivAtFilter f^[n] (f' ^ n) x L := by
have := hf.iterate hL hx n
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_at_filter.iterate HasDerivAtFilter.iterate
protected nonrec theorem HasDerivAt.iterate {f : π β π} {f' : π} (hf : HasDerivAt f f' x)
- (hx : f x = x) (n : β) : HasDerivAt (f^[n]) (f' ^ n) x :=
+ (hx : f x = x) (n : β) : HasDerivAt f^[n] (f' ^ n) x :=
hf.iterate _ (have := hf.tendsto_nhds le_rfl; by rwa [hx] at this) hx n
#align has_deriv_at.iterate HasDerivAt.iterate
protected theorem HasDerivWithinAt.iterate {f : π β π} {f' : π} (hf : HasDerivWithinAt f f' s x)
- (hx : f x = x) (hs : MapsTo f s s) (n : β) : HasDerivWithinAt (f^[n]) (f' ^ n) s x := by
+ (hx : f x = x) (hs : MapsTo f s s) (n : β) : HasDerivWithinAt f^[n] (f' ^ n) s x := by
have := HasFDerivWithinAt.iterate hf hx hs n
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_deriv_within_at.iterate HasDerivWithinAt.iterate
protected nonrec theorem HasStrictDerivAt.iterate {f : π β π} {f' : π}
(hf : HasStrictDerivAt f f' x) (hx : f x = x) (n : β) :
- HasStrictDerivAt (f^[n]) (f' ^ n) x := by
+ HasStrictDerivAt f^[n] (f' ^ n) x := by
have := hf.iterate hx n
rwa [ContinuousLinearMap.smulRight_one_pow] at this
#align has_strict_deriv_at.iterate HasStrictDerivAt.iterate
@@ -277,4 +277,3 @@ theorem fderiv.comp_deriv (hl : DifferentiableAt π l (f x)) (hf : Differentia
#align fderiv.comp_deriv fderiv.comp_deriv
end CompositionVector
-
The unported dependencies are
algebra.order.module
init.core
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
algebra.order.monoid.cancel.basic
init.data.list.default
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file