analysis.calculus.deriv.comp ⟷ Mathlib.Analysis.Calculus.Deriv.Comp

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -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"
 
Diff
@@ -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
 -/
 
Diff
@@ -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"
 
Diff
@@ -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
 
Diff
@@ -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
 
Diff
@@ -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
Diff
@@ -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
Diff
@@ -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 : π•œ β†’ π•œ'`;
Diff
@@ -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
 
Diff
@@ -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))

Changes in mathlib4

mathlib3
mathlib4
feat: add 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.

Diff
@@ -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
chore(*): remove empty lines between variable statements (#11418)

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)
Diff
@@ -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
chore: scope open Classical (#11199)

We remove all but one open Classicals, 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.

Diff
@@ -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
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -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)
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -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
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -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
fix precedence of Nat.iterate (#5589)
Diff
@@ -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
-
feat: port Analysis.Calculus.Deriv.Comp (#4436)

Dependencies 10 + 676

677 files ported (98.5%)
301133 lines ported (98.3%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file