analysis.calculus.deriv.mul ⟷ Mathlib.Analysis.Calculus.Deriv.Mul

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, Anatole Dedecker, Yury Kudryashov
 -/
 import Analysis.Calculus.Deriv.Basic
-import Analysis.Calculus.Fderiv.Mul
-import Analysis.Calculus.Fderiv.Add
+import Analysis.Calculus.FDeriv.Mul
+import Analysis.Calculus.FDeriv.Add
 
 #align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
 
Diff
@@ -103,7 +103,7 @@ theorem HasStrictDerivAt.smul_const (hc : HasStrictDerivAt c c' x) (f : F) :
     HasStrictDerivAt (fun y => c y β€’ f) (c' β€’ f) x :=
   by
   have := hc.smul (hasStrictDerivAt_const x f)
-  rwa [smul_zero, zero_add] at this 
+  rwa [smul_zero, zero_add] at this
 #align has_strict_deriv_at.smul_const HasStrictDerivAt.smul_const
 -/
 
@@ -112,7 +112,7 @@ theorem HasDerivWithinAt.smul_const (hc : HasDerivWithinAt c c' s x) (f : F) :
     HasDerivWithinAt (fun y => c y β€’ f) (c' β€’ f) s x :=
   by
   have := hc.smul (hasDerivWithinAt_const x s f)
-  rwa [smul_zero, zero_add] at this 
+  rwa [smul_zero, zero_add] at this
 #align has_deriv_within_at.smul_const HasDerivWithinAt.smul_const
 -/
 
@@ -207,7 +207,7 @@ theorem HasDerivWithinAt.mul (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWith
   rwa [ContinuousLinearMap.add_apply, ContinuousLinearMap.smul_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.smulRight_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
-    add_comm] at this 
+    add_comm] at this
 #align has_deriv_within_at.mul HasDerivWithinAt.mul
 -/
 
@@ -228,7 +228,7 @@ theorem HasStrictDerivAt.mul (hc : HasStrictDerivAt c c' x) (hd : HasStrictDeriv
   rwa [ContinuousLinearMap.add_apply, ContinuousLinearMap.smul_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.smulRight_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
-    add_comm] at this 
+    add_comm] at this
 #align has_strict_deriv_at.mul HasStrictDerivAt.mul
 -/
 
@@ -457,7 +457,7 @@ theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrict
   by
   have := (hc.has_strict_fderiv_at.clm_comp hd.has_strict_fderiv_at).HasStrictDerivAt
   rwa [add_apply, comp_apply, comp_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this 
+    one_smul, add_comm] at this
 #align has_strict_deriv_at.clm_comp HasStrictDerivAt.clm_comp
 -/
 
@@ -468,7 +468,7 @@ theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
   by
   have := (hc.has_fderiv_within_at.clm_comp hd.has_fderiv_within_at).HasDerivWithinAt
   rwa [add_apply, comp_apply, comp_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this 
+    one_smul, add_comm] at this
 #align has_deriv_within_at.clm_comp HasDerivWithinAt.clm_comp
 -/
 
@@ -503,7 +503,7 @@ theorem HasStrictDerivAt.clm_apply (hc : HasStrictDerivAt c c' x) (hu : HasStric
   by
   have := (hc.has_strict_fderiv_at.clm_apply hu.has_strict_fderiv_at).HasStrictDerivAt
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this 
+    one_smul, add_comm] at this
 #align has_strict_deriv_at.clm_apply HasStrictDerivAt.clm_apply
 -/
 
@@ -514,7 +514,7 @@ theorem HasDerivWithinAt.clm_apply (hc : HasDerivWithinAt c c' s x)
   by
   have := (hc.has_fderiv_within_at.clm_apply hu.has_fderiv_within_at).HasDerivWithinAt
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this 
+    one_smul, add_comm] at this
 #align has_deriv_within_at.clm_apply HasDerivWithinAt.clm_apply
 -/
 
@@ -524,7 +524,7 @@ theorem HasDerivAt.clm_apply (hc : HasDerivAt c c' x) (hu : HasDerivAt u u' x) :
   by
   have := (hc.has_fderiv_at.clm_apply hu.has_fderiv_at).HasDerivAt
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this 
+    one_smul, add_comm] at this
 #align has_deriv_at.clm_apply HasDerivAt.clm_apply
 -/
 
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, Anatole Dedecker, Yury Kudryashov
 -/
-import Mathbin.Analysis.Calculus.Deriv.Basic
-import Mathbin.Analysis.Calculus.Fderiv.Mul
-import Mathbin.Analysis.Calculus.Fderiv.Add
+import Analysis.Calculus.Deriv.Basic
+import Analysis.Calculus.Fderiv.Mul
+import Analysis.Calculus.Fderiv.Add
 
 #align_import analysis.calculus.deriv.mul 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, Anatole Dedecker, Yury Kudryashov
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.mul
-! 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.Mul
 import Mathbin.Analysis.Calculus.Fderiv.Add
 
+#align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
+
 /-!
 # Derivative of `f x * g x`
 
Diff
@@ -63,65 +63,85 @@ section Smul
 variable {π•œ' : Type _} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] [NormedSpace π•œ' F]
   [IsScalarTower π•œ π•œ' F] {c : π•œ β†’ π•œ'} {c' : π•œ'}
 
+#print HasDerivWithinAt.smul /-
 theorem HasDerivWithinAt.smul (hc : HasDerivWithinAt c c' s x) (hf : HasDerivWithinAt f f' s x) :
     HasDerivWithinAt (fun y => c y β€’ f y) (c x β€’ f' + c' β€’ f x) s x := by
   simpa using (HasFDerivWithinAt.smul hc hf).HasDerivWithinAt
 #align has_deriv_within_at.smul HasDerivWithinAt.smul
+-/
 
+#print HasDerivAt.smul /-
 theorem HasDerivAt.smul (hc : HasDerivAt c c' x) (hf : HasDerivAt f f' x) :
     HasDerivAt (fun y => c y β€’ f y) (c x β€’ f' + c' β€’ f x) x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hc.smul hf
 #align has_deriv_at.smul HasDerivAt.smul
+-/
 
+#print HasStrictDerivAt.smul /-
 theorem HasStrictDerivAt.smul (hc : HasStrictDerivAt c c' x) (hf : HasStrictDerivAt f f' x) :
     HasStrictDerivAt (fun y => c y β€’ f y) (c x β€’ f' + c' β€’ f x) x := by
   simpa using (hc.smul hf).HasStrictDerivAt
 #align has_strict_deriv_at.smul HasStrictDerivAt.smul
+-/
 
+#print derivWithin_smul /-
 theorem derivWithin_smul (hxs : UniqueDiffWithinAt π•œ s x) (hc : DifferentiableWithinAt π•œ c s x)
     (hf : DifferentiableWithinAt π•œ f s x) :
     derivWithin (fun y => c y β€’ f y) s x = c x β€’ derivWithin f s x + derivWithin c s x β€’ f x :=
   (hc.HasDerivWithinAt.smul hf.HasDerivWithinAt).derivWithin hxs
 #align deriv_within_smul derivWithin_smul
+-/
 
+#print deriv_smul /-
 theorem deriv_smul (hc : DifferentiableAt π•œ c x) (hf : DifferentiableAt π•œ f x) :
     deriv (fun y => c y β€’ f y) x = c x β€’ deriv f x + deriv c x β€’ f x :=
   (hc.HasDerivAt.smul hf.HasDerivAt).deriv
 #align deriv_smul deriv_smul
+-/
 
+#print HasStrictDerivAt.smul_const /-
 theorem HasStrictDerivAt.smul_const (hc : HasStrictDerivAt c c' x) (f : F) :
     HasStrictDerivAt (fun y => c y β€’ f) (c' β€’ f) x :=
   by
   have := hc.smul (hasStrictDerivAt_const x f)
   rwa [smul_zero, zero_add] at this 
 #align has_strict_deriv_at.smul_const HasStrictDerivAt.smul_const
+-/
 
+#print HasDerivWithinAt.smul_const /-
 theorem HasDerivWithinAt.smul_const (hc : HasDerivWithinAt c c' s x) (f : F) :
     HasDerivWithinAt (fun y => c y β€’ f) (c' β€’ f) s x :=
   by
   have := hc.smul (hasDerivWithinAt_const x s f)
   rwa [smul_zero, zero_add] at this 
 #align has_deriv_within_at.smul_const HasDerivWithinAt.smul_const
+-/
 
+#print HasDerivAt.smul_const /-
 theorem HasDerivAt.smul_const (hc : HasDerivAt c c' x) (f : F) :
     HasDerivAt (fun y => c y β€’ f) (c' β€’ f) x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hc.smul_const f
 #align has_deriv_at.smul_const HasDerivAt.smul_const
+-/
 
+#print derivWithin_smul_const /-
 theorem derivWithin_smul_const (hxs : UniqueDiffWithinAt π•œ s x)
     (hc : DifferentiableWithinAt π•œ c s x) (f : F) :
     derivWithin (fun y => c y β€’ f) s x = derivWithin c s x β€’ f :=
   (hc.HasDerivWithinAt.smul_const f).derivWithin hxs
 #align deriv_within_smul_const derivWithin_smul_const
+-/
 
+#print deriv_smul_const /-
 theorem deriv_smul_const (hc : DifferentiableAt π•œ c x) (f : F) :
     deriv (fun y => c y β€’ f) x = deriv c x β€’ f :=
   (hc.HasDerivAt.smul_const f).deriv
 #align deriv_smul_const deriv_smul_const
+-/
 
 end Smul
 
@@ -129,36 +149,48 @@ section ConstSmul
 
 variable {R : Type _} [Semiring R] [Module R F] [SMulCommClass π•œ R F] [ContinuousConstSMul R F]
 
+#print HasStrictDerivAt.const_smul /-
 theorem HasStrictDerivAt.const_smul (c : R) (hf : HasStrictDerivAt f f' x) :
     HasStrictDerivAt (fun y => c β€’ f y) (c β€’ f') x := by
   simpa using (hf.const_smul c).HasStrictDerivAt
 #align has_strict_deriv_at.const_smul HasStrictDerivAt.const_smul
+-/
 
+#print HasDerivAtFilter.const_smul /-
 theorem HasDerivAtFilter.const_smul (c : R) (hf : HasDerivAtFilter f f' x L) :
     HasDerivAtFilter (fun y => c β€’ f y) (c β€’ f') x L := by
   simpa using (hf.const_smul c).HasDerivAtFilter
 #align has_deriv_at_filter.const_smul HasDerivAtFilter.const_smul
+-/
 
+#print HasDerivWithinAt.const_smul /-
 theorem HasDerivWithinAt.const_smul (c : R) (hf : HasDerivWithinAt f f' s x) :
     HasDerivWithinAt (fun y => c β€’ f y) (c β€’ f') s x :=
   hf.const_smul c
 #align has_deriv_within_at.const_smul HasDerivWithinAt.const_smul
+-/
 
+#print HasDerivAt.const_smul /-
 theorem HasDerivAt.const_smul (c : R) (hf : HasDerivAt f f' x) :
     HasDerivAt (fun y => c β€’ f y) (c β€’ f') x :=
   hf.const_smul c
 #align has_deriv_at.const_smul HasDerivAt.const_smul
+-/
 
+#print derivWithin_const_smul /-
 theorem derivWithin_const_smul (hxs : UniqueDiffWithinAt π•œ s x) (c : R)
     (hf : DifferentiableWithinAt π•œ f s x) :
     derivWithin (fun y => c β€’ f y) s x = c β€’ derivWithin f s x :=
   (hf.HasDerivWithinAt.const_smul c).derivWithin hxs
 #align deriv_within_const_smul derivWithin_const_smul
+-/
 
+#print deriv_const_smul /-
 theorem deriv_const_smul (c : R) (hf : DifferentiableAt π•œ f x) :
     deriv (fun y => c β€’ f y) x = c β€’ deriv f x :=
   (hf.HasDerivAt.const_smul c).deriv
 #align deriv_const_smul deriv_const_smul
+-/
 
 end ConstSmul
 
@@ -170,6 +202,7 @@ section Mul
 variable {π•œ' 𝔸 : Type _} [NormedField π•œ'] [NormedRing 𝔸] [NormedAlgebra π•œ π•œ'] [NormedAlgebra π•œ 𝔸]
   {c d : π•œ β†’ 𝔸} {c' d' : 𝔸} {u v : π•œ β†’ π•œ'}
 
+#print HasDerivWithinAt.mul /-
 theorem HasDerivWithinAt.mul (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWithinAt d d' s x) :
     HasDerivWithinAt (fun y => c y * d y) (c' * d x + c x * d') s x :=
   by
@@ -179,14 +212,18 @@ theorem HasDerivWithinAt.mul (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWith
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
     add_comm] at this 
 #align has_deriv_within_at.mul HasDerivWithinAt.mul
+-/
 
+#print HasDerivAt.mul /-
 theorem HasDerivAt.mul (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
     HasDerivAt (fun y => c y * d y) (c' * d x + c x * d') x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hc.mul hd
 #align has_deriv_at.mul HasDerivAt.mul
+-/
 
+#print HasStrictDerivAt.mul /-
 theorem HasStrictDerivAt.mul (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) :
     HasStrictDerivAt (fun y => c y * d y) (c' * d x + c x * d') x :=
   by
@@ -196,54 +233,72 @@ theorem HasStrictDerivAt.mul (hc : HasStrictDerivAt c c' x) (hd : HasStrictDeriv
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
     add_comm] at this 
 #align has_strict_deriv_at.mul HasStrictDerivAt.mul
+-/
 
+#print derivWithin_mul /-
 theorem derivWithin_mul (hxs : UniqueDiffWithinAt π•œ s x) (hc : DifferentiableWithinAt π•œ c s x)
     (hd : DifferentiableWithinAt π•œ d s x) :
     derivWithin (fun y => c y * d y) s x = derivWithin c s x * d x + c x * derivWithin d s x :=
   (hc.HasDerivWithinAt.mul hd.HasDerivWithinAt).derivWithin hxs
 #align deriv_within_mul derivWithin_mul
+-/
 
+#print deriv_mul /-
 @[simp]
 theorem deriv_mul (hc : DifferentiableAt π•œ c x) (hd : DifferentiableAt π•œ d x) :
     deriv (fun y => c y * d y) x = deriv c x * d x + c x * deriv d x :=
   (hc.HasDerivAt.mul hd.HasDerivAt).deriv
 #align deriv_mul deriv_mul
+-/
 
+#print HasDerivWithinAt.mul_const /-
 theorem HasDerivWithinAt.mul_const (hc : HasDerivWithinAt c c' s x) (d : 𝔸) :
     HasDerivWithinAt (fun y => c y * d) (c' * d) s x :=
   by
   convert hc.mul (hasDerivWithinAt_const x s d)
   rw [MulZeroClass.mul_zero, add_zero]
 #align has_deriv_within_at.mul_const HasDerivWithinAt.mul_const
+-/
 
+#print HasDerivAt.mul_const /-
 theorem HasDerivAt.mul_const (hc : HasDerivAt c c' x) (d : 𝔸) :
     HasDerivAt (fun y => c y * d) (c' * d) x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hc.mul_const d
 #align has_deriv_at.mul_const HasDerivAt.mul_const
+-/
 
+#print hasDerivAt_mul_const /-
 theorem hasDerivAt_mul_const (c : π•œ) : HasDerivAt (fun x => x * c) c x := by
   simpa only [one_mul] using (hasDerivAt_id' x).mul_const c
 #align has_deriv_at_mul_const hasDerivAt_mul_const
+-/
 
+#print HasStrictDerivAt.mul_const /-
 theorem HasStrictDerivAt.mul_const (hc : HasStrictDerivAt c c' x) (d : 𝔸) :
     HasStrictDerivAt (fun y => c y * d) (c' * d) x :=
   by
   convert hc.mul (hasStrictDerivAt_const x d)
   rw [MulZeroClass.mul_zero, add_zero]
 #align has_strict_deriv_at.mul_const HasStrictDerivAt.mul_const
+-/
 
+#print derivWithin_mul_const /-
 theorem derivWithin_mul_const (hxs : UniqueDiffWithinAt π•œ s x) (hc : DifferentiableWithinAt π•œ c s x)
     (d : 𝔸) : derivWithin (fun y => c y * d) s x = derivWithin c s x * d :=
   (hc.HasDerivWithinAt.mul_const d).derivWithin hxs
 #align deriv_within_mul_const derivWithin_mul_const
+-/
 
+#print deriv_mul_const /-
 theorem deriv_mul_const (hc : DifferentiableAt π•œ c x) (d : 𝔸) :
     deriv (fun y => c y * d) x = deriv c x * d :=
   (hc.HasDerivAt.mul_const d).deriv
 #align deriv_mul_const deriv_mul_const
+-/
 
+#print deriv_mul_const_field /-
 theorem deriv_mul_const_field (v : π•œ') : deriv (fun y => u y * v) x = deriv u x * v :=
   by
   by_cases hu : DifferentiableAt π•œ u x
@@ -254,52 +309,69 @@ theorem deriv_mul_const_field (v : π•œ') : deriv (fun y => u y * v) x = deriv u
     Β· refine' deriv_zero_of_not_differentiableAt (mt (fun H => _) hu)
       simpa only [mul_inv_cancel_rightβ‚€ hd] using H.mul_const v⁻¹
 #align deriv_mul_const_field deriv_mul_const_field
+-/
 
+#print deriv_mul_const_field' /-
 @[simp]
 theorem deriv_mul_const_field' (v : π•œ') : (deriv fun x => u x * v) = fun x => deriv u x * v :=
   funext fun _ => deriv_mul_const_field v
 #align deriv_mul_const_field' deriv_mul_const_field'
+-/
 
+#print HasDerivWithinAt.const_mul /-
 theorem HasDerivWithinAt.const_mul (c : 𝔸) (hd : HasDerivWithinAt d d' s x) :
     HasDerivWithinAt (fun y => c * d y) (c * d') s x :=
   by
   convert (hasDerivWithinAt_const x s c).mul hd
   rw [MulZeroClass.zero_mul, zero_add]
 #align has_deriv_within_at.const_mul HasDerivWithinAt.const_mul
+-/
 
+#print HasDerivAt.const_mul /-
 theorem HasDerivAt.const_mul (c : 𝔸) (hd : HasDerivAt d d' x) :
     HasDerivAt (fun y => c * d y) (c * d') x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hd.const_mul c
 #align has_deriv_at.const_mul HasDerivAt.const_mul
+-/
 
+#print HasStrictDerivAt.const_mul /-
 theorem HasStrictDerivAt.const_mul (c : 𝔸) (hd : HasStrictDerivAt d d' x) :
     HasStrictDerivAt (fun y => c * d y) (c * d') x :=
   by
   convert (hasStrictDerivAt_const _ _).mul hd
   rw [MulZeroClass.zero_mul, zero_add]
 #align has_strict_deriv_at.const_mul HasStrictDerivAt.const_mul
+-/
 
+#print derivWithin_const_mul /-
 theorem derivWithin_const_mul (hxs : UniqueDiffWithinAt π•œ s x) (c : 𝔸)
     (hd : DifferentiableWithinAt π•œ d s x) :
     derivWithin (fun y => c * d y) s x = c * derivWithin d s x :=
   (hd.HasDerivWithinAt.const_mul c).derivWithin hxs
 #align deriv_within_const_mul derivWithin_const_mul
+-/
 
+#print deriv_const_mul /-
 theorem deriv_const_mul (c : 𝔸) (hd : DifferentiableAt π•œ d x) :
     deriv (fun y => c * d y) x = c * deriv d x :=
   (hd.HasDerivAt.const_mul c).deriv
 #align deriv_const_mul deriv_const_mul
+-/
 
+#print deriv_const_mul_field /-
 theorem deriv_const_mul_field (u : π•œ') : deriv (fun y => u * v y) x = u * deriv v x := by
   simp only [mul_comm u, deriv_mul_const_field]
 #align deriv_const_mul_field deriv_const_mul_field
+-/
 
+#print deriv_const_mul_field' /-
 @[simp]
 theorem deriv_const_mul_field' (u : π•œ') : (deriv fun x => u * v x) = fun x => u * deriv v x :=
   funext fun x => deriv_const_mul_field u
 #align deriv_const_mul_field' deriv_const_mul_field'
+-/
 
 end Mul
 
@@ -307,50 +379,68 @@ section Div
 
 variable {π•œ' : Type _} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] {c d : π•œ β†’ π•œ'} {c' d' : π•œ'}
 
+#print HasDerivAt.div_const /-
 theorem HasDerivAt.div_const (hc : HasDerivAt c c' x) (d : π•œ') :
     HasDerivAt (fun x => c x / d) (c' / d) x := by
   simpa only [div_eq_mul_inv] using hc.mul_const d⁻¹
 #align has_deriv_at.div_const HasDerivAt.div_const
+-/
 
+#print HasDerivWithinAt.div_const /-
 theorem HasDerivWithinAt.div_const (hc : HasDerivWithinAt c c' s x) (d : π•œ') :
     HasDerivWithinAt (fun x => c x / d) (c' / d) s x := by
   simpa only [div_eq_mul_inv] using hc.mul_const d⁻¹
 #align has_deriv_within_at.div_const HasDerivWithinAt.div_const
+-/
 
+#print HasStrictDerivAt.div_const /-
 theorem HasStrictDerivAt.div_const (hc : HasStrictDerivAt c c' x) (d : π•œ') :
     HasStrictDerivAt (fun x => c x / d) (c' / d) x := by
   simpa only [div_eq_mul_inv] using hc.mul_const d⁻¹
 #align has_strict_deriv_at.div_const HasStrictDerivAt.div_const
+-/
 
+#print DifferentiableWithinAt.div_const /-
 theorem DifferentiableWithinAt.div_const (hc : DifferentiableWithinAt π•œ c s x) (d : π•œ') :
     DifferentiableWithinAt π•œ (fun x => c x / d) s x :=
   (hc.HasDerivWithinAt.div_const _).DifferentiableWithinAt
 #align differentiable_within_at.div_const DifferentiableWithinAt.div_const
+-/
 
+#print DifferentiableAt.div_const /-
 @[simp]
 theorem DifferentiableAt.div_const (hc : DifferentiableAt π•œ c x) (d : π•œ') :
     DifferentiableAt π•œ (fun x => c x / d) x :=
   (hc.HasDerivAt.div_const _).DifferentiableAt
 #align differentiable_at.div_const DifferentiableAt.div_const
+-/
 
+#print DifferentiableOn.div_const /-
 theorem DifferentiableOn.div_const (hc : DifferentiableOn π•œ c s) (d : π•œ') :
     DifferentiableOn π•œ (fun x => c x / d) s := fun x hx => (hc x hx).div_const d
 #align differentiable_on.div_const DifferentiableOn.div_const
+-/
 
+#print Differentiable.div_const /-
 @[simp]
 theorem Differentiable.div_const (hc : Differentiable π•œ c) (d : π•œ') :
     Differentiable π•œ fun x => c x / d := fun x => (hc x).div_const d
 #align differentiable.div_const Differentiable.div_const
+-/
 
+#print derivWithin_div_const /-
 theorem derivWithin_div_const (hc : DifferentiableWithinAt π•œ c s x) (d : π•œ')
     (hxs : UniqueDiffWithinAt π•œ s x) : derivWithin (fun x => c x / d) s x = derivWithin c s x / d :=
   by simp [div_eq_inv_mul, derivWithin_const_mul, hc, hxs]
 #align deriv_within_div_const derivWithin_div_const
+-/
 
+#print deriv_div_const /-
 @[simp]
 theorem deriv_div_const (d : π•œ') : deriv (fun x => c x / d) x = deriv c x / d := by
   simp only [div_eq_mul_inv, deriv_mul_const_field]
 #align deriv_div_const deriv_div_const
+-/
 
 end Div
 
@@ -364,6 +454,7 @@ open ContinuousLinearMap
 variable {G : Type _} [NormedAddCommGroup G] [NormedSpace π•œ G] {c : π•œ β†’ F β†’L[π•œ] G} {c' : F β†’L[π•œ] G}
   {d : π•œ β†’ E β†’L[π•œ] F} {d' : E β†’L[π•œ] F} {u : π•œ β†’ F} {u' : F}
 
+#print HasStrictDerivAt.clm_comp /-
 theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) :
     HasStrictDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x :=
   by
@@ -371,7 +462,9 @@ theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrict
   rwa [add_apply, comp_apply, comp_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
     one_smul, add_comm] at this 
 #align has_strict_deriv_at.clm_comp HasStrictDerivAt.clm_comp
+-/
 
+#print HasDerivWithinAt.clm_comp /-
 theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
     (hd : HasDerivWithinAt d d' s x) :
     HasDerivWithinAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') s x :=
@@ -380,26 +473,34 @@ theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
   rwa [add_apply, comp_apply, comp_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
     one_smul, add_comm] at this 
 #align has_deriv_within_at.clm_comp HasDerivWithinAt.clm_comp
+-/
 
+#print HasDerivAt.clm_comp /-
 theorem HasDerivAt.clm_comp (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
     HasDerivAt (fun y => (c y).comp (d y)) (c'.comp (d x) + (c x).comp d') x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hc.clm_comp hd
 #align has_deriv_at.clm_comp HasDerivAt.clm_comp
+-/
 
+#print derivWithin_clm_comp /-
 theorem derivWithin_clm_comp (hc : DifferentiableWithinAt π•œ c s x)
     (hd : DifferentiableWithinAt π•œ d s x) (hxs : UniqueDiffWithinAt π•œ s x) :
     derivWithin (fun y => (c y).comp (d y)) s x =
       (derivWithin c s x).comp (d x) + (c x).comp (derivWithin d s x) :=
   (hc.HasDerivWithinAt.clm_comp hd.HasDerivWithinAt).derivWithin hxs
 #align deriv_within_clm_comp derivWithin_clm_comp
+-/
 
+#print deriv_clm_comp /-
 theorem deriv_clm_comp (hc : DifferentiableAt π•œ c x) (hd : DifferentiableAt π•œ d x) :
     deriv (fun y => (c y).comp (d y)) x = (deriv c x).comp (d x) + (c x).comp (deriv d x) :=
   (hc.HasDerivAt.clm_comp hd.HasDerivAt).deriv
 #align deriv_clm_comp deriv_clm_comp
+-/
 
+#print HasStrictDerivAt.clm_apply /-
 theorem HasStrictDerivAt.clm_apply (hc : HasStrictDerivAt c c' x) (hu : HasStrictDerivAt u u' x) :
     HasStrictDerivAt (fun y => (c y) (u y)) (c' (u x) + c x u') x :=
   by
@@ -407,7 +508,9 @@ theorem HasStrictDerivAt.clm_apply (hc : HasStrictDerivAt c c' x) (hu : HasStric
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
     one_smul, add_comm] at this 
 #align has_strict_deriv_at.clm_apply HasStrictDerivAt.clm_apply
+-/
 
+#print HasDerivWithinAt.clm_apply /-
 theorem HasDerivWithinAt.clm_apply (hc : HasDerivWithinAt c c' s x)
     (hu : HasDerivWithinAt u u' s x) :
     HasDerivWithinAt (fun y => (c y) (u y)) (c' (u x) + c x u') s x :=
@@ -416,7 +519,9 @@ theorem HasDerivWithinAt.clm_apply (hc : HasDerivWithinAt c c' s x)
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
     one_smul, add_comm] at this 
 #align has_deriv_within_at.clm_apply HasDerivWithinAt.clm_apply
+-/
 
+#print HasDerivAt.clm_apply /-
 theorem HasDerivAt.clm_apply (hc : HasDerivAt c c' x) (hu : HasDerivAt u u' x) :
     HasDerivAt (fun y => (c y) (u y)) (c' (u x) + c x u') x :=
   by
@@ -424,17 +529,22 @@ theorem HasDerivAt.clm_apply (hc : HasDerivAt c c' x) (hu : HasDerivAt u u' x) :
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
     one_smul, add_comm] at this 
 #align has_deriv_at.clm_apply HasDerivAt.clm_apply
+-/
 
+#print derivWithin_clm_apply /-
 theorem derivWithin_clm_apply (hxs : UniqueDiffWithinAt π•œ s x) (hc : DifferentiableWithinAt π•œ c s x)
     (hu : DifferentiableWithinAt π•œ u s x) :
     derivWithin (fun y => (c y) (u y)) s x = derivWithin c s x (u x) + c x (derivWithin u s x) :=
   (hc.HasDerivWithinAt.clm_apply hu.HasDerivWithinAt).derivWithin hxs
 #align deriv_within_clm_apply derivWithin_clm_apply
+-/
 
+#print deriv_clm_apply /-
 theorem deriv_clm_apply (hc : DifferentiableAt π•œ c x) (hu : DifferentiableAt π•œ u x) :
     deriv (fun y => (c y) (u y)) x = deriv c x (u x) + c x (deriv u x) :=
   (hc.HasDerivAt.clm_apply hu.HasDerivAt).deriv
 #align deriv_clm_apply deriv_clm_apply
+-/
 
 end ClmCompApply
 
Diff
@@ -263,7 +263,7 @@ theorem deriv_mul_const_field' (v : π•œ') : (deriv fun x => u x * v) = fun x =>
 theorem HasDerivWithinAt.const_mul (c : 𝔸) (hd : HasDerivWithinAt d d' s x) :
     HasDerivWithinAt (fun y => c * d y) (c * d') s x :=
   by
-  convert(hasDerivWithinAt_const x s c).mul hd
+  convert (hasDerivWithinAt_const x s c).mul hd
   rw [MulZeroClass.zero_mul, zero_add]
 #align has_deriv_within_at.const_mul HasDerivWithinAt.const_mul
 
@@ -277,7 +277,7 @@ theorem HasDerivAt.const_mul (c : 𝔸) (hd : HasDerivAt d d' x) :
 theorem HasStrictDerivAt.const_mul (c : 𝔸) (hd : HasStrictDerivAt d d' x) :
     HasStrictDerivAt (fun y => c * d y) (c * d') x :=
   by
-  convert(hasStrictDerivAt_const _ _).mul hd
+  convert (hasStrictDerivAt_const _ _).mul hd
   rw [MulZeroClass.zero_mul, zero_add]
 #align has_strict_deriv_at.const_mul HasStrictDerivAt.const_mul
 
Diff
@@ -95,14 +95,14 @@ theorem HasStrictDerivAt.smul_const (hc : HasStrictDerivAt c c' x) (f : F) :
     HasStrictDerivAt (fun y => c y β€’ f) (c' β€’ f) x :=
   by
   have := hc.smul (hasStrictDerivAt_const x f)
-  rwa [smul_zero, zero_add] at this
+  rwa [smul_zero, zero_add] at this 
 #align has_strict_deriv_at.smul_const HasStrictDerivAt.smul_const
 
 theorem HasDerivWithinAt.smul_const (hc : HasDerivWithinAt c c' s x) (f : F) :
     HasDerivWithinAt (fun y => c y β€’ f) (c' β€’ f) s x :=
   by
   have := hc.smul (hasDerivWithinAt_const x s f)
-  rwa [smul_zero, zero_add] at this
+  rwa [smul_zero, zero_add] at this 
 #align has_deriv_within_at.smul_const HasDerivWithinAt.smul_const
 
 theorem HasDerivAt.smul_const (hc : HasDerivAt c c' x) (f : F) :
@@ -177,7 +177,7 @@ theorem HasDerivWithinAt.mul (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWith
   rwa [ContinuousLinearMap.add_apply, ContinuousLinearMap.smul_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.smulRight_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
-    add_comm] at this
+    add_comm] at this 
 #align has_deriv_within_at.mul HasDerivWithinAt.mul
 
 theorem HasDerivAt.mul (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
@@ -194,7 +194,7 @@ theorem HasStrictDerivAt.mul (hc : HasStrictDerivAt c c' x) (hd : HasStrictDeriv
   rwa [ContinuousLinearMap.add_apply, ContinuousLinearMap.smul_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.smulRight_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
-    add_comm] at this
+    add_comm] at this 
 #align has_strict_deriv_at.mul HasStrictDerivAt.mul
 
 theorem derivWithin_mul (hxs : UniqueDiffWithinAt π•œ s x) (hc : DifferentiableWithinAt π•œ c s x)
@@ -369,7 +369,7 @@ theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrict
   by
   have := (hc.has_strict_fderiv_at.clm_comp hd.has_strict_fderiv_at).HasStrictDerivAt
   rwa [add_apply, comp_apply, comp_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this
+    one_smul, add_comm] at this 
 #align has_strict_deriv_at.clm_comp HasStrictDerivAt.clm_comp
 
 theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
@@ -378,7 +378,7 @@ theorem HasDerivWithinAt.clm_comp (hc : HasDerivWithinAt c c' s x)
   by
   have := (hc.has_fderiv_within_at.clm_comp hd.has_fderiv_within_at).HasDerivWithinAt
   rwa [add_apply, comp_apply, comp_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this
+    one_smul, add_comm] at this 
 #align has_deriv_within_at.clm_comp HasDerivWithinAt.clm_comp
 
 theorem HasDerivAt.clm_comp (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
@@ -405,7 +405,7 @@ theorem HasStrictDerivAt.clm_apply (hc : HasStrictDerivAt c c' x) (hu : HasStric
   by
   have := (hc.has_strict_fderiv_at.clm_apply hu.has_strict_fderiv_at).HasStrictDerivAt
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this
+    one_smul, add_comm] at this 
 #align has_strict_deriv_at.clm_apply HasStrictDerivAt.clm_apply
 
 theorem HasDerivWithinAt.clm_apply (hc : HasDerivWithinAt c c' s x)
@@ -414,7 +414,7 @@ theorem HasDerivWithinAt.clm_apply (hc : HasDerivWithinAt c c' s x)
   by
   have := (hc.has_fderiv_within_at.clm_apply hu.has_fderiv_within_at).HasDerivWithinAt
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this
+    one_smul, add_comm] at this 
 #align has_deriv_within_at.clm_apply HasDerivWithinAt.clm_apply
 
 theorem HasDerivAt.clm_apply (hc : HasDerivAt c c' x) (hu : HasDerivAt u u' x) :
@@ -422,7 +422,7 @@ theorem HasDerivAt.clm_apply (hc : HasDerivAt c c' x) (hu : HasDerivAt u u' x) :
   by
   have := (hc.has_fderiv_at.clm_apply hu.has_fderiv_at).HasDerivAt
   rwa [add_apply, comp_apply, flip_apply, smul_right_apply, smul_right_apply, one_apply, one_smul,
-    one_smul, add_comm] at this
+    one_smul, add_comm] at this 
 #align has_deriv_at.clm_apply HasDerivAt.clm_apply
 
 theorem derivWithin_clm_apply (hxs : UniqueDiffWithinAt π•œ s x) (hc : DifferentiableWithinAt π•œ c s x)
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Gabriel Ebner, Anatole Dedecker, Yury Kudryashov
 
 ! This file was ported from Lean 3 source module analysis.calculus.deriv.mul
-! 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.Add
 /-!
 # Derivative of `f x * g x`
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we prove formulas for `(f x * g x)'` and `(f x β€’ g x)'`.
 
 For a more detailed overview of one-dimensional derivatives in mathlib, see the module docstring of
Diff
@@ -30,7 +30,7 @@ universe u v w
 
 noncomputable section
 
-open Classical Topology BigOperators Filter ENNReal
+open scoped Classical Topology BigOperators Filter ENNReal
 
 open Filter Asymptotics Set
 

Changes in mathlib4

mathlib3
mathlib4
feat: deriv versions of composition lemmas with bilinear maps (#11868)

We already have the fderiv versions.

Diff
@@ -36,12 +36,46 @@ 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 {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G]
 variable {f fβ‚€ f₁ g : π•œ β†’ F}
 variable {f' fβ‚€' f₁' g' : F}
 variable {x : π•œ}
 variable {s t : Set π•œ}
 variable {L L₁ Lβ‚‚ : Filter π•œ}
 
+/-! ### Derivative of bilinear maps -/
+
+namespace ContinuousLinearMap
+
+variable {B : E β†’L[π•œ] F β†’L[π•œ] G} {u : π•œ β†’ E} {v : π•œ β†’ F} {u' : E} {v' : F}
+
+theorem hasDerivWithinAt_of_bilinear
+    (hu : HasDerivWithinAt u u' s x) (hv : HasDerivWithinAt v v' s x) :
+    HasDerivWithinAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) s x := by
+  simpa using (B.hasFDerivWithinAt_of_bilinear
+    hu.hasFDerivWithinAt hv.hasFDerivWithinAt).hasDerivWithinAt
+
+theorem hasDerivAt_of_bilinear (hu : HasDerivAt u u' x) (hv : HasDerivAt v v' x) :
+    HasDerivAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) x := by
+  simpa using (B.hasFDerivAt_of_bilinear hu.hasFDerivAt hv.hasFDerivAt).hasDerivAt
+
+theorem hasStrictDerivAt_of_bilinear (hu : HasStrictDerivAt u u' x) (hv : HasStrictDerivAt v v' x) :
+    HasStrictDerivAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) x := by
+  simpa using
+    (B.hasStrictFDerivAt_of_bilinear hu.hasStrictFDerivAt hv.hasStrictFDerivAt).hasStrictDerivAt
+
+theorem derivWithin_of_bilinear (hxs : UniqueDiffWithinAt π•œ s x)
+    (hu : DifferentiableWithinAt π•œ u s x) (hv : DifferentiableWithinAt π•œ v s x) :
+    derivWithin (fun y => B (u y) (v y)) s x =
+      B (u x) (derivWithin v s x) + B (derivWithin u s x) (v x) :=
+  (B.hasDerivWithinAt_of_bilinear hu.hasDerivWithinAt hv.hasDerivWithinAt).derivWithin hxs
+
+theorem deriv_of_bilinear (hu : DifferentiableAt π•œ u x) (hv : DifferentiableAt π•œ v x) :
+    deriv (fun y => B (u y) (v y)) x = B (u x) (deriv v x) + B (deriv u x) (v x) :=
+  (B.hasDerivAt_of_bilinear hu.hasDerivAt hv.hasDerivAt).deriv
+
+end ContinuousLinearMap
+
 section SMul
 
 /-! ### Derivative of the multiplication of a scalar function and a vector function -/
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
@@ -34,19 +34,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 SMul
feat(Analysis/Calculus/{Iterated}Deriv/*): add lemmas on composition with negation (#11173)

This adds

lemma deriv_comp_neg (f : π•œ β†’ F) (a : π•œ) : deriv (fun x ↦ f (-x)) a = -deriv f (-a)

/-- A variant of `deriv_const_smul` without differentiability assumption when the scalar
multiplication is by field elements. -/
lemma deriv_const_smul' {f : π•œ β†’ F} {x : π•œ} {R : Type*} [Field R] [Module R F] [SMulCommClass π•œ R F]
    [ContinuousConstSMul R F] (c : R) :
    deriv (fun y ↦ c β€’ f y) x = c β€’ deriv f x

lemma iteratedDeriv_neg (n : β„•) (f : π•œ β†’ F) (a : π•œ) :
    iteratedDeriv n (fun x ↦ -(f x)) a = -(iteratedDeriv n f a)

lemma iteratedDeriv_comp_neg (n : β„•) (f : π•œ β†’ F) (a : π•œ) :
    iteratedDeriv n (fun x ↦ f (-x)) a = (-1 : π•œ) ^ n β€’ iteratedDeriv n f (-a)

which will come in handy in some future PRs on L-series.

See here on Zulip.

Diff
@@ -150,6 +150,22 @@ theorem deriv_const_smul (c : R) (hf : DifferentiableAt π•œ f x) :
   (hf.hasDerivAt.const_smul c).deriv
 #align deriv_const_smul deriv_const_smul
 
+/-- A variant of `deriv_const_smul` without differentiability assumption when the scalar
+multiplication is by field elements. -/
+lemma deriv_const_smul' {f : π•œ β†’ F} {x : π•œ} {R : Type*} [Field R] [Module R F] [SMulCommClass π•œ R F]
+    [ContinuousConstSMul R F] (c : R) :
+    deriv (fun y ↦ c β€’ f y) x = c β€’ deriv f x := by
+  by_cases hf : DifferentiableAt π•œ f x
+  Β· exact deriv_const_smul c hf
+  Β· rcases eq_or_ne c 0 with rfl | hc
+    Β· simp only [zero_smul, deriv_const']
+    Β· have H : Β¬DifferentiableAt π•œ (fun y ↦ c β€’ f y) x := by
+        contrapose! hf
+        change DifferentiableAt π•œ (fun y ↦ f y) x
+        conv => enter [2, y]; rw [← inv_smul_smulβ‚€ hc (f y)]
+        exact DifferentiableAt.const_smul hf c⁻¹
+      rw [deriv_zero_of_not_differentiableAt hf, deriv_zero_of_not_differentiableAt H, smul_zero]
+
 end ConstSMul
 
 section Mul
feat: Add norm_iteratedFDeriv_prod_le using Sym (#10022)

add (iterated) deriv for prod

  • Add HasFDerivAt + variants for Finset.prod (and ContinuousMultilinearMap.mkPiAlgebra)
  • Add missing iteratedFDerivWithin equivalents for zero, const (resolves a todo in Analysis.Calculus.ContDiff.Basic)
  • Add iteratedFDeriv[Within]_sum for symmetry
  • Add a couple of convenience lemmas for Sym and Finset.{prod,sum}
Diff
@@ -283,6 +283,38 @@ theorem deriv_const_mul_field' (u : π•œ') : (deriv fun x => u * v x) = fun x =>
 
 end Mul
 
+section Prod
+
+variable {ΞΉ : Type*} [DecidableEq ΞΉ] {𝔸' : Type*} [NormedCommRing 𝔸'] [NormedAlgebra π•œ 𝔸']
+  {u : Finset ΞΉ} {f : ΞΉ β†’ π•œ β†’ 𝔸'} {f' : ΞΉ β†’ 𝔸'}
+
+theorem HasDerivAt.finset_prod (hf : βˆ€ i ∈ u, HasDerivAt (f i) (f' i) x) :
+    HasDerivAt (∏ i in u, f i Β·) (βˆ‘ i in u, (∏ j in u.erase i, f j x) β€’ f' i) x := by
+  simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
+    (HasFDerivAt.finset_prod (fun i hi ↦ (hf i hi).hasFDerivAt)).hasDerivAt
+
+theorem HasDerivWithinAt.finset_prod (hf : βˆ€ i ∈ u, HasDerivWithinAt (f i) (f' i) s x) :
+    HasDerivWithinAt (∏ i in u, f i Β·) (βˆ‘ i in u, (∏ j in u.erase i, f j x) β€’ f' i) s x := by
+  simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
+    (HasFDerivWithinAt.finset_prod (fun i hi ↦ (hf i hi).hasFDerivWithinAt)).hasDerivWithinAt
+
+theorem HasStrictDerivAt.finset_prod (hf : βˆ€ i ∈ u, HasStrictDerivAt (f i) (f' i) x) :
+    HasStrictDerivAt (∏ i in u, f i Β·) (βˆ‘ i in u, (∏ j in u.erase i, f j x) β€’ f' i) x := by
+  simpa [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] using
+    (HasStrictFDerivAt.finset_prod (fun i hi ↦ (hf i hi).hasStrictFDerivAt)).hasStrictDerivAt
+
+theorem deriv_finset_prod (hf : βˆ€ i ∈ u, DifferentiableAt π•œ (f i) x) :
+    deriv (∏ i in u, f i Β·) x = βˆ‘ i in u, (∏ j in u.erase i, f j x) β€’ deriv (f i) x :=
+  (HasDerivAt.finset_prod fun i hi ↦ (hf i hi).hasDerivAt).deriv
+
+theorem derivWithin_finset_prod (hxs : UniqueDiffWithinAt π•œ s x)
+    (hf : βˆ€ i ∈ u, DifferentiableWithinAt π•œ (f i) s x) :
+    derivWithin (∏ i in u, f i ·) s x =
+      βˆ‘ i in u, (∏ j in u.erase i, f j x) β€’ derivWithin (f i) s x :=
+  (HasDerivWithinAt.finset_prod fun i hi ↦ (hf i hi).hasDerivWithinAt).derivWithin hxs
+
+end Prod
+
 section Div
 
 variable {π•œ' : Type*} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] {c d : π•œ β†’ π•œ'} {c' d' : π•œ'}
fix: Clm -> CLM, Cle -> CLE (#10018)

Rename

  • Complex.equivRealProdClm β†’ Complex.equivRealProdCLM;
    • TODO: should this one use CLE?
  • Complex.reClm β†’ Complex.reCLM;
  • Complex.imClm β†’ Complex.imCLM;
  • Complex.conjLie β†’ Complex.conjLIE;
  • Complex.conjCle β†’ Complex.conjCLE;
  • Complex.ofRealLi β†’ Complex.ofRealLI;
  • Complex.ofRealClm β†’ Complex.ofRealCLM;
  • fderivInnerClm β†’ fderivInnerCLM;
  • LinearPMap.adjointDomainMkClm β†’ LinearPMap.adjointDomainMkCLM;
  • LinearPMap.adjointDomainMkClmExtend β†’ LinearPMap.adjointDomainMkCLMExtend;
  • IsROrC.reClm β†’ IsROrC.reCLM;
  • IsROrC.imClm β†’ IsROrC.imCLM;
  • IsROrC.conjLie β†’ IsROrC.conjLIE;
  • IsROrC.conjCle β†’ IsROrC.conjCLE;
  • IsROrC.ofRealLi β†’ IsROrC.ofRealLI;
  • IsROrC.ofRealClm β†’ IsROrC.ofRealCLM;
  • MeasureTheory.condexpL1Clm β†’ MeasureTheory.condexpL1CLM;
  • algebraMapClm β†’ algebraMapCLM;
  • WeakDual.CharacterSpace.toClm β†’ WeakDual.CharacterSpace.toCLM;
  • BoundedContinuousFunction.evalClm β†’ BoundedContinuousFunction.evalCLM;
  • ContinuousMap.evalClm β†’ ContinuousMap.evalCLM;
  • TrivSqZeroExt.fstClm β†’ TrivSqZeroExt.fstClm;
  • TrivSqZeroExt.sndClm β†’ TrivSqZeroExt.sndCLM;
  • TrivSqZeroExt.inlClm β†’ TrivSqZeroExt.inlCLM;
  • TrivSqZeroExt.inrClm β†’ TrivSqZeroExt.inrCLM

and related theorems.

Diff
@@ -334,7 +334,7 @@ theorem deriv_div_const (d : π•œ') : deriv (fun x => c x / d) x = deriv c x / d
 
 end Div
 
-section ClmCompApply
+section CLMCompApply
 
 /-! ### Derivative of the pointwise composition/application of continuous linear maps -/
 
@@ -410,4 +410,4 @@ theorem deriv_clm_apply (hc : DifferentiableAt π•œ c x) (hu : DifferentiableAt
   (hc.hasDerivAt.clm_apply hu.hasDerivAt).deriv
 #align deriv_clm_apply deriv_clm_apply
 
-end ClmCompApply
+end CLMCompApply
chore: Nsmul -> NSMul, Zpow -> ZPow, etc (#9067)

Normalising to naming convention rule number 6.

Diff
@@ -49,7 +49,7 @@ variable {s t : Set π•œ}
 
 variable {L L₁ Lβ‚‚ : Filter π•œ}
 
-section Smul
+section SMul
 
 /-! ### Derivative of the multiplication of a scalar function and a vector function -/
 
@@ -113,9 +113,9 @@ theorem deriv_smul_const (hc : DifferentiableAt π•œ c x) (f : F) :
   (hc.hasDerivAt.smul_const f).deriv
 #align deriv_smul_const deriv_smul_const
 
-end Smul
+end SMul
 
-section ConstSmul
+section ConstSMul
 
 variable {R : Type*} [Semiring R] [Module R F] [SMulCommClass π•œ R F] [ContinuousConstSMul R F]
 
@@ -150,7 +150,7 @@ theorem deriv_const_smul (c : R) (hf : DifferentiableAt π•œ f x) :
   (hf.hasDerivAt.const_smul c).deriv
 #align deriv_const_smul deriv_const_smul
 
-end ConstSmul
+end ConstSMul
 
 section Mul
 
@@ -411,4 +411,3 @@ theorem deriv_clm_apply (hc : DifferentiableAt π•œ c x) (hu : DifferentiableAt
 #align deriv_clm_apply deriv_clm_apply
 
 end ClmCompApply
-
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -231,9 +231,9 @@ theorem deriv_mul_const (hc : DifferentiableAt π•œ c x) (d : 𝔸) :
 theorem deriv_mul_const_field (v : π•œ') : deriv (fun y => u y * v) x = deriv u x * v := by
   by_cases hu : DifferentiableAt π•œ u x
   Β· exact deriv_mul_const hu v
-  Β· rw [deriv_zero_of_not_differentiableAt hu, MulZeroClass.zero_mul]
+  Β· rw [deriv_zero_of_not_differentiableAt hu, zero_mul]
     rcases eq_or_ne v 0 with (rfl | hd)
-    Β· simp only [MulZeroClass.mul_zero, deriv_const]
+    Β· simp only [mul_zero, deriv_const]
     Β· refine' deriv_zero_of_not_differentiableAt (mt (fun H => _) hu)
       simpa only [mul_inv_cancel_rightβ‚€ hd] using H.mul_const v⁻¹
 #align deriv_mul_const_field deriv_mul_const_field
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
@@ -54,7 +54,7 @@ section Smul
 /-! ### Derivative of the multiplication of a scalar function and a vector function -/
 
 
-variable {π•œ' : Type _} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] [NormedSpace π•œ' F]
+variable {π•œ' : Type*} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] [NormedSpace π•œ' F]
   [IsScalarTower π•œ π•œ' F] {c : π•œ β†’ π•œ'} {c' : π•œ'}
 
 theorem HasDerivWithinAt.smul (hc : HasDerivWithinAt c c' s x) (hf : HasDerivWithinAt f f' s x) :
@@ -117,7 +117,7 @@ end Smul
 
 section ConstSmul
 
-variable {R : Type _} [Semiring R] [Module R F] [SMulCommClass π•œ R F] [ContinuousConstSMul R F]
+variable {R : Type*} [Semiring R] [Module R F] [SMulCommClass π•œ R F] [ContinuousConstSMul R F]
 
 nonrec theorem HasStrictDerivAt.const_smul (c : R) (hf : HasStrictDerivAt f f' x) :
     HasStrictDerivAt (fun y => c β€’ f y) (c β€’ f') x := by
@@ -157,7 +157,7 @@ section Mul
 /-! ### Derivative of the multiplication of two functions -/
 
 
-variable {π•œ' 𝔸 : Type _} [NormedField π•œ'] [NormedRing 𝔸] [NormedAlgebra π•œ π•œ'] [NormedAlgebra π•œ 𝔸]
+variable {π•œ' 𝔸 : Type*} [NormedField π•œ'] [NormedRing 𝔸] [NormedAlgebra π•œ π•œ'] [NormedAlgebra π•œ 𝔸]
   {c d : π•œ β†’ 𝔸} {c' d' : 𝔸} {u v : π•œ β†’ π•œ'}
 
 theorem HasDerivWithinAt.mul (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWithinAt d d' s x) :
@@ -285,7 +285,7 @@ end Mul
 
 section Div
 
-variable {π•œ' : Type _} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] {c d : π•œ β†’ π•œ'} {c' d' : π•œ'}
+variable {π•œ' : Type*} [NontriviallyNormedField π•œ'] [NormedAlgebra π•œ π•œ'] {c d : π•œ β†’ π•œ'} {c' d' : π•œ'}
 
 theorem HasDerivAt.div_const (hc : HasDerivAt c c' x) (d : π•œ') :
     HasDerivAt (fun x => c x / d) (c' / d) x := by
@@ -341,7 +341,7 @@ section ClmCompApply
 
 open ContinuousLinearMap
 
-variable {G : Type _} [NormedAddCommGroup G] [NormedSpace π•œ G] {c : π•œ β†’ F β†’L[π•œ] G} {c' : F β†’L[π•œ] G}
+variable {G : Type*} [NormedAddCommGroup G] [NormedSpace π•œ G] {c : π•œ β†’ F β†’L[π•œ] G} {c' : F β†’L[π•œ] G}
   {d : π•œ β†’ E β†’L[π•œ] F} {d' : E β†’L[π•œ] F} {u : π•œ β†’ F} {u' : F}
 
 theorem HasStrictDerivAt.clm_comp (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' 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, Anatole Dedecker, Yury Kudryashov
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.mul
-! 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.Mul
 import Mathlib.Analysis.Calculus.FDeriv.Add
 
+#align_import analysis.calculus.deriv.mul from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
 /-!
 # Derivative of `f x * g x`
 
feat: port Analysis.Calculus.Deriv.Mul (#4440)

Dependencies 10 + 680

681 files ported (98.6%)
302948 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