From 83bf88a11cc22e1805f3e8a2788a705892cc82df Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Wed, 8 Nov 2023 18:36:42 +0000 Subject: [PATCH] feat: add HasDerivAt.norm_sq (#8268) This is just a special case of the `HasFDerivAt` version --- Mathlib/Analysis/InnerProductSpace/Calculus.lean | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Mathlib/Analysis/InnerProductSpace/Calculus.lean b/Mathlib/Analysis/InnerProductSpace/Calculus.lean index 696ceea9e8703..37023816b8118 100644 --- a/Mathlib/Analysis/InnerProductSpace/Calculus.lean +++ b/Mathlib/Analysis/InnerProductSpace/Calculus.lean @@ -231,10 +231,19 @@ theorem HasFDerivAt.norm_sq {f : G → F} {f' : G →L[ℝ] F} (hf : HasFDerivAt HasFDerivAt (‖f ·‖ ^ 2) (2 • (innerSL ℝ (f x)).comp f') x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp x hf +theorem HasDerivAt.norm_sq {f : ℝ → F} {f' : F} {x : ℝ} (hf : HasDerivAt f f' x) : + HasDerivAt (‖f ·‖ ^ 2) (2 * Inner.inner (f x) f') x := by + simpa using hf.hasFDerivAt.norm_sq.hasDerivAt + theorem HasFDerivWithinAt.norm_sq {f : G → F} {f' : G →L[ℝ] F} (hf : HasFDerivWithinAt f f' s x) : HasFDerivWithinAt (‖f ·‖ ^ 2) (2 • (innerSL ℝ (f x)).comp f') s x := (hasStrictFDerivAt_norm_sq _).hasFDerivAt.comp_hasFDerivWithinAt x hf +theorem HasDerivWithinAt.norm_sq {f : ℝ → F} {f' : F} {s : Set ℝ} {x : ℝ} + (hf : HasDerivWithinAt f f' s x) : + HasDerivWithinAt (‖f ·‖ ^ 2) (2 * Inner.inner (f x) f') s x := by + simpa using hf.hasFDerivWithinAt.norm_sq.hasDerivWithinAt + theorem DifferentiableAt.norm_sq (hf : DifferentiableAt ℝ f x) : DifferentiableAt ℝ (fun y => ‖f y‖ ^ 2) x := ((contDiffAt_id.norm_sq 𝕜).differentiableAt le_rfl).comp x hf