analysis.calculus.deriv.basic โŸท Mathlib.Analysis.Calculus.Deriv.Basic

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
@@ -3,7 +3,7 @@ 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
 -/
-import Analysis.Calculus.Fderiv.Basic
+import Analysis.Calculus.FDeriv.Basic
 
 #align_import analysis.calculus.deriv.basic from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
 
@@ -355,7 +355,7 @@ theorem HasDerivAtFilter.isBigO_sub_rev (hf : HasDerivAtFilter f f' x L) (hf' :
     (fun x' => x' - x) =O[L] fun x' => f x' - f x :=
   suffices AntilipschitzWith โ€–f'โ€–โ‚Šโปยน (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') from hf.isBigO_sub_rev this
   AddMonoidHomClass.antilipschitz_of_bound (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') fun x => by
-    simp [norm_smul, โ† div_eq_inv_mul, mul_div_cancel _ (mt norm_eq_zero.1 hf')]
+    simp [norm_smul, โ† div_eq_inv_mul, mul_div_cancel_rightโ‚€ _ (mt norm_eq_zero.1 hf')]
 #align has_deriv_at_filter.is_O_sub_rev HasDerivAtFilter.isBigO_sub_rev
 -/
 
Diff
@@ -703,7 +703,7 @@ theorem derivWithin_Ioi_eq_Ici {E : Type _} [NormedAddCommGroup E] [NormedSpace
     simpa using (uniqueDiffOn_Ici x).Eq le_rfl A B
   ยท rw [derivWithin_zero_of_not_differentiableWithinAt H,
       derivWithin_zero_of_not_differentiableWithinAt]
-    rwa [differentiableWithinAt_Ioi_iff_Ici] at H 
+    rwa [differentiableWithinAt_Ioi_iff_Ici] at H
 #align deriv_within_Ioi_eq_Ici derivWithin_Ioi_eq_Ici
 -/
 
Diff
@@ -659,10 +659,10 @@ theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = deri
 #align deriv_within_inter derivWithin_inter
 -/
 
-#print derivWithin_of_open /-
-theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x := by
+#print derivWithin_of_isOpen /-
+theorem derivWithin_of_isOpen (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x := by
   unfold derivWithin; rw [fderivWithin_of_isOpen hs hx]; rfl
-#align deriv_within_of_open derivWithin_of_open
+#align deriv_within_of_open derivWithin_of_isOpen
 -/
 
 #print deriv_mem_iff /-
Diff
@@ -661,7 +661,7 @@ theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = deri
 
 #print derivWithin_of_open /-
 theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x := by
-  unfold derivWithin; rw [fderivWithin_of_open hs hx]; rfl
+  unfold derivWithin; rw [fderivWithin_of_isOpen hs hx]; rfl
 #align deriv_within_of_open derivWithin_of_open
 -/
 
Diff
@@ -3,7 +3,7 @@ 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
 -/
-import Mathbin.Analysis.Calculus.Fderiv.Basic
+import Analysis.Calculus.Fderiv.Basic
 
 #align_import analysis.calculus.deriv.basic from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
 
Diff
@@ -513,11 +513,13 @@ theorem HasDerivWithinAt.union (hs : HasDerivWithinAt f f' s x) (ht : HasDerivWi
 #align has_deriv_within_at.union HasDerivWithinAt.union
 -/
 
-#print HasDerivWithinAt.nhdsWithin /-
-theorem HasDerivWithinAt.nhdsWithin (h : HasDerivWithinAt f f' s x) (ht : s โˆˆ ๐“[t] x) :
+/- warning: has_deriv_within_at.nhds_within clashes with has_deriv_within_at.mono_of_mem -> HasDerivWithinAt.mono_of_mem
+Case conversion may be inaccurate. Consider using '#align has_deriv_within_at.nhds_within HasDerivWithinAt.mono_of_memโ‚“'. -/
+#print HasDerivWithinAt.mono_of_mem /-
+theorem HasDerivWithinAt.mono_of_mem (h : HasDerivWithinAt f f' s x) (ht : s โˆˆ ๐“[t] x) :
     HasDerivWithinAt f f' t x :=
   (hasDerivWithinAt_inter' ht).1 (h.mono (inter_subset_right _ _))
-#align has_deriv_within_at.nhds_within HasDerivWithinAt.nhdsWithin
+#align has_deriv_within_at.nhds_within HasDerivWithinAt.mono_of_mem
 -/
 
 #print HasDerivWithinAt.hasDerivAt /-
Diff
@@ -251,7 +251,7 @@ theorem hasStrictDerivAt_iff_hasStrictFDerivAt :
 #align has_strict_deriv_at_iff_has_strict_fderiv_at hasStrictDerivAt_iff_hasStrictFDerivAt
 -/
 
-alias hasStrictDerivAt_iff_hasStrictFDerivAt โ†” HasStrictDerivAt.hasStrictFDerivAt _
+alias โŸจHasStrictDerivAt.hasStrictFDerivAt, _โŸฉ := hasStrictDerivAt_iff_hasStrictFDerivAt
 #align has_strict_deriv_at.has_strict_fderiv_at HasStrictDerivAt.hasStrictFDerivAt
 
 #print hasDerivAt_iff_hasFDerivAt /-
@@ -262,7 +262,7 @@ theorem hasDerivAt_iff_hasFDerivAt {f' : F} :
 #align has_deriv_at_iff_has_fderiv_at hasDerivAt_iff_hasFDerivAt
 -/
 
-alias hasDerivAt_iff_hasFDerivAt โ†” HasDerivAt.hasFDerivAt _
+alias โŸจHasDerivAt.hasFDerivAt, _โŸฉ := hasDerivAt_iff_hasFDerivAt
 #align has_deriv_at.has_fderiv_at HasDerivAt.hasFDerivAt
 
 #print derivWithin_zero_of_not_differentiableWithinAt /-
@@ -379,7 +379,7 @@ theorem hasDerivWithinAt_congr_set {s t : Set ๐•œ} (h : s =แถ [๐“ x] t) :
 #align has_deriv_within_at_congr_set hasDerivWithinAt_congr_set
 -/
 
-alias hasDerivWithinAt_congr_set โ†” HasDerivWithinAt.congr_set _
+alias โŸจHasDerivWithinAt.congr_set, _โŸฉ := hasDerivWithinAt_congr_set
 #align has_deriv_within_at.congr_set HasDerivWithinAt.congr_set
 
 #print hasDerivWithinAt_diff_singleton /-
@@ -398,7 +398,7 @@ theorem hasDerivWithinAt_Ioi_iff_Ici [PartialOrder ๐•œ] :
 #align has_deriv_within_at_Ioi_iff_Ici hasDerivWithinAt_Ioi_iff_Ici
 -/
 
-alias hasDerivWithinAt_Ioi_iff_Ici โ†” HasDerivWithinAt.Ici_of_Ioi HasDerivWithinAt.Ioi_of_Ici
+alias โŸจHasDerivWithinAt.Ici_of_Ioi, HasDerivWithinAt.Ioi_of_IciโŸฉ := hasDerivWithinAt_Ioi_iff_Ici
 #align has_deriv_within_at.Ici_of_Ioi HasDerivWithinAt.Ici_of_Ioi
 #align has_deriv_within_at.Ioi_of_Ici HasDerivWithinAt.Ioi_of_Ici
 
@@ -410,7 +410,7 @@ theorem hasDerivWithinAt_Iio_iff_Iic [PartialOrder ๐•œ] :
 #align has_deriv_within_at_Iio_iff_Iic hasDerivWithinAt_Iio_iff_Iic
 -/
 
-alias hasDerivWithinAt_Iio_iff_Iic โ†” HasDerivWithinAt.Iic_of_Iio HasDerivWithinAt.Iio_of_Iic
+alias โŸจHasDerivWithinAt.Iic_of_Iio, HasDerivWithinAt.Iio_of_IicโŸฉ := hasDerivWithinAt_Iio_iff_Iic
 #align has_deriv_within_at.Iic_of_Iio HasDerivWithinAt.Iic_of_Iio
 #align has_deriv_within_at.Iio_of_Iic HasDerivWithinAt.Iio_of_Iic
 
@@ -421,7 +421,7 @@ theorem HasDerivWithinAt.Ioi_iff_Ioo [LinearOrder ๐•œ] [OrderClosedTopology 
 #align has_deriv_within_at.Ioi_iff_Ioo HasDerivWithinAt.Ioi_iff_Ioo
 -/
 
-alias HasDerivWithinAt.Ioi_iff_Ioo โ†” HasDerivWithinAt.Ioi_of_Ioo HasDerivWithinAt.Ioo_of_Ioi
+alias โŸจHasDerivWithinAt.Ioi_of_Ioo, HasDerivWithinAt.Ioo_of_IoiโŸฉ := HasDerivWithinAt.Ioi_iff_Ioo
 #align has_deriv_within_at.Ioi_of_Ioo HasDerivWithinAt.Ioi_of_Ioo
 #align has_deriv_within_at.Ioo_of_Ioi HasDerivWithinAt.Ioo_of_Ioi
 
Diff
@@ -2,14 +2,11 @@
 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
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.basic
-! 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.Fderiv.Basic
 
+#align_import analysis.calculus.deriv.basic from "leanprover-community/mathlib"@"f60c6087a7275b72d5db3c5a1d0e19e35a429c0a"
+
 /-!
 
 # One-dimensional derivatives
Diff
@@ -176,21 +176,27 @@ variable {s t : Set ๐•œ}
 
 variable {L Lโ‚ Lโ‚‚ : Filter ๐•œ}
 
+#print hasFDerivAtFilter_iff_hasDerivAtFilter /-
 /-- Expressing `has_fderiv_at_filter f f' x L` in terms of `has_deriv_at_filter` -/
 theorem hasFDerivAtFilter_iff_hasDerivAtFilter {f' : ๐•œ โ†’L[๐•œ] F} :
     HasFDerivAtFilter f f' x L โ†” HasDerivAtFilter f (f' 1) x L := by simp [HasDerivAtFilter]
 #align has_fderiv_at_filter_iff_has_deriv_at_filter hasFDerivAtFilter_iff_hasDerivAtFilter
+-/
 
+#print HasFDerivAtFilter.hasDerivAtFilter /-
 theorem HasFDerivAtFilter.hasDerivAtFilter {f' : ๐•œ โ†’L[๐•œ] F} :
     HasFDerivAtFilter f f' x L โ†’ HasDerivAtFilter f (f' 1) x L :=
   hasFDerivAtFilter_iff_hasDerivAtFilter.mp
 #align has_fderiv_at_filter.has_deriv_at_filter HasFDerivAtFilter.hasDerivAtFilter
+-/
 
+#print hasFDerivWithinAt_iff_hasDerivWithinAt /-
 /-- Expressing `has_fderiv_within_at f f' s x` in terms of `has_deriv_within_at` -/
 theorem hasFDerivWithinAt_iff_hasDerivWithinAt {f' : ๐•œ โ†’L[๐•œ] F} :
     HasFDerivWithinAt f f' s x โ†” HasDerivWithinAt f (f' 1) s x :=
   hasFDerivAtFilter_iff_hasDerivAtFilter
 #align has_fderiv_within_at_iff_has_deriv_within_at hasFDerivWithinAt_iff_hasDerivWithinAt
+-/
 
 #print hasDerivWithinAt_iff_hasFDerivWithinAt /-
 /-- Expressing `has_deriv_within_at f f' s x` in terms of `has_fderiv_within_at` -/
@@ -200,10 +206,12 @@ theorem hasDerivWithinAt_iff_hasFDerivWithinAt {f' : F} :
 #align has_deriv_within_at_iff_has_fderiv_within_at hasDerivWithinAt_iff_hasFDerivWithinAt
 -/
 
+#print HasFDerivWithinAt.hasDerivWithinAt /-
 theorem HasFDerivWithinAt.hasDerivWithinAt {f' : ๐•œ โ†’L[๐•œ] F} :
     HasFDerivWithinAt f f' s x โ†’ HasDerivWithinAt f (f' 1) s x :=
   hasFDerivWithinAt_iff_hasDerivWithinAt.mp
 #align has_fderiv_within_at.has_deriv_within_at HasFDerivWithinAt.hasDerivWithinAt
+-/
 
 #print HasDerivWithinAt.hasFDerivWithinAt /-
 theorem HasDerivWithinAt.hasFDerivWithinAt {f' : F} :
@@ -212,24 +220,32 @@ theorem HasDerivWithinAt.hasFDerivWithinAt {f' : F} :
 #align has_deriv_within_at.has_fderiv_within_at HasDerivWithinAt.hasFDerivWithinAt
 -/
 
+#print hasFDerivAt_iff_hasDerivAt /-
 /-- Expressing `has_fderiv_at f f' x` in terms of `has_deriv_at` -/
 theorem hasFDerivAt_iff_hasDerivAt {f' : ๐•œ โ†’L[๐•œ] F} : HasFDerivAt f f' x โ†” HasDerivAt f (f' 1) x :=
   hasFDerivAtFilter_iff_hasDerivAtFilter
 #align has_fderiv_at_iff_has_deriv_at hasFDerivAt_iff_hasDerivAt
+-/
 
+#print HasFDerivAt.hasDerivAt /-
 theorem HasFDerivAt.hasDerivAt {f' : ๐•œ โ†’L[๐•œ] F} : HasFDerivAt f f' x โ†’ HasDerivAt f (f' 1) x :=
   hasFDerivAt_iff_hasDerivAt.mp
 #align has_fderiv_at.has_deriv_at HasFDerivAt.hasDerivAt
+-/
 
+#print hasStrictFDerivAt_iff_hasStrictDerivAt /-
 theorem hasStrictFDerivAt_iff_hasStrictDerivAt {f' : ๐•œ โ†’L[๐•œ] F} :
     HasStrictFDerivAt f f' x โ†” HasStrictDerivAt f (f' 1) x := by
   simp [HasStrictDerivAt, HasStrictFDerivAt]
 #align has_strict_fderiv_at_iff_has_strict_deriv_at hasStrictFDerivAt_iff_hasStrictDerivAt
+-/
 
+#print HasStrictFDerivAt.hasStrictDerivAt /-
 protected theorem HasStrictFDerivAt.hasStrictDerivAt {f' : ๐•œ โ†’L[๐•œ] F} :
     HasStrictFDerivAt f f' x โ†’ HasStrictDerivAt f (f' 1) x :=
   hasStrictFDerivAt_iff_hasStrictDerivAt.mp
 #align has_strict_fderiv_at.has_strict_deriv_at HasStrictFDerivAt.hasStrictDerivAt
+-/
 
 #print hasStrictDerivAt_iff_hasStrictFDerivAt /-
 theorem hasStrictDerivAt_iff_hasStrictFDerivAt :
@@ -252,23 +268,31 @@ theorem hasDerivAt_iff_hasFDerivAt {f' : F} :
 alias hasDerivAt_iff_hasFDerivAt โ†” HasDerivAt.hasFDerivAt _
 #align has_deriv_at.has_fderiv_at HasDerivAt.hasFDerivAt
 
+#print derivWithin_zero_of_not_differentiableWithinAt /-
 theorem derivWithin_zero_of_not_differentiableWithinAt (h : ยฌDifferentiableWithinAt ๐•œ f s x) :
     derivWithin f s x = 0 := by unfold derivWithin;
   rw [fderivWithin_zero_of_not_differentiableWithinAt]; simp; assumption
 #align deriv_within_zero_of_not_differentiable_within_at derivWithin_zero_of_not_differentiableWithinAt
+-/
 
+#print differentiableWithinAt_of_derivWithin_ne_zero /-
 theorem differentiableWithinAt_of_derivWithin_ne_zero (h : derivWithin f s x โ‰  0) :
     DifferentiableWithinAt ๐•œ f s x :=
   not_imp_comm.1 derivWithin_zero_of_not_differentiableWithinAt h
 #align differentiable_within_at_of_deriv_within_ne_zero differentiableWithinAt_of_derivWithin_ne_zero
+-/
 
+#print deriv_zero_of_not_differentiableAt /-
 theorem deriv_zero_of_not_differentiableAt (h : ยฌDifferentiableAt ๐•œ f x) : deriv f x = 0 := by
   unfold deriv; rw [fderiv_zero_of_not_differentiableAt]; simp; assumption
 #align deriv_zero_of_not_differentiable_at deriv_zero_of_not_differentiableAt
+-/
 
+#print differentiableAt_of_deriv_ne_zero /-
 theorem differentiableAt_of_deriv_ne_zero (h : deriv f x โ‰  0) : DifferentiableAt ๐•œ f x :=
   not_imp_comm.1 deriv_zero_of_not_differentiableAt h
 #align differentiable_at_of_deriv_ne_zero differentiableAt_of_deriv_ne_zero
+-/
 
 #print UniqueDiffWithinAt.eq_deriv /-
 theorem UniqueDiffWithinAt.eq_deriv (s : Set ๐•œ) (H : UniqueDiffWithinAt ๐•œ s x)
@@ -277,50 +301,66 @@ theorem UniqueDiffWithinAt.eq_deriv (s : Set ๐•œ) (H : UniqueDiffWithinAt ๐•œ
 #align unique_diff_within_at.eq_deriv UniqueDiffWithinAt.eq_deriv
 -/
 
+#print hasDerivAtFilter_iff_isLittleO /-
 theorem hasDerivAtFilter_iff_isLittleO :
     HasDerivAtFilter f f' x L โ†” (fun x' : ๐•œ => f x' - f x - (x' - x) โ€ข f') =o[L] fun x' => x' - x :=
   Iff.rfl
 #align has_deriv_at_filter_iff_is_o hasDerivAtFilter_iff_isLittleO
+-/
 
+#print hasDerivAtFilter_iff_tendsto /-
 theorem hasDerivAtFilter_iff_tendsto :
     HasDerivAtFilter f f' x L โ†”
       Tendsto (fun x' : ๐•œ => โ€–x' - xโ€–โปยน * โ€–f x' - f x - (x' - x) โ€ข f'โ€–) L (๐“ 0) :=
   hasFDerivAtFilter_iff_tendsto
 #align has_deriv_at_filter_iff_tendsto hasDerivAtFilter_iff_tendsto
+-/
 
+#print hasDerivWithinAt_iff_isLittleO /-
 theorem hasDerivWithinAt_iff_isLittleO :
     HasDerivWithinAt f f' s x โ†”
       (fun x' : ๐•œ => f x' - f x - (x' - x) โ€ข f') =o[๐“[s] x] fun x' => x' - x :=
   Iff.rfl
 #align has_deriv_within_at_iff_is_o hasDerivWithinAt_iff_isLittleO
+-/
 
+#print hasDerivWithinAt_iff_tendsto /-
 theorem hasDerivWithinAt_iff_tendsto :
     HasDerivWithinAt f f' s x โ†”
       Tendsto (fun x' => โ€–x' - xโ€–โปยน * โ€–f x' - f x - (x' - x) โ€ข f'โ€–) (๐“[s] x) (๐“ 0) :=
   hasFDerivAtFilter_iff_tendsto
 #align has_deriv_within_at_iff_tendsto hasDerivWithinAt_iff_tendsto
+-/
 
+#print hasDerivAt_iff_isLittleO /-
 theorem hasDerivAt_iff_isLittleO :
     HasDerivAt f f' x โ†” (fun x' : ๐•œ => f x' - f x - (x' - x) โ€ข f') =o[๐“ x] fun x' => x' - x :=
   Iff.rfl
 #align has_deriv_at_iff_is_o hasDerivAt_iff_isLittleO
+-/
 
+#print hasDerivAt_iff_tendsto /-
 theorem hasDerivAt_iff_tendsto :
     HasDerivAt f f' x โ†” Tendsto (fun x' => โ€–x' - xโ€–โปยน * โ€–f x' - f x - (x' - x) โ€ข f'โ€–) (๐“ x) (๐“ 0) :=
   hasFDerivAtFilter_iff_tendsto
 #align has_deriv_at_iff_tendsto hasDerivAt_iff_tendsto
+-/
 
+#print HasDerivAtFilter.isBigO_sub /-
 theorem HasDerivAtFilter.isBigO_sub (h : HasDerivAtFilter f f' x L) :
     (fun x' => f x' - f x) =O[L] fun x' => x' - x :=
   HasFDerivAtFilter.isBigO_sub h
 #align has_deriv_at_filter.is_O_sub HasDerivAtFilter.isBigO_sub
+-/
 
+#print HasDerivAtFilter.isBigO_sub_rev /-
 theorem HasDerivAtFilter.isBigO_sub_rev (hf : HasDerivAtFilter f f' x L) (hf' : f' โ‰  0) :
     (fun x' => x' - x) =O[L] fun x' => f x' - f x :=
   suffices AntilipschitzWith โ€–f'โ€–โ‚Šโปยน (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') from hf.isBigO_sub_rev this
   AddMonoidHomClass.antilipschitz_of_bound (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') fun x => by
     simp [norm_smul, โ† div_eq_inv_mul, mul_div_cancel _ (mt norm_eq_zero.1 hf')]
 #align has_deriv_at_filter.is_O_sub_rev HasDerivAtFilter.isBigO_sub_rev
+-/
 
 #print HasStrictDerivAt.hasDerivAt /-
 theorem HasStrictDerivAt.hasDerivAt (h : HasStrictDerivAt f f' x) : HasDerivAt f f' x :=
@@ -328,10 +368,12 @@ theorem HasStrictDerivAt.hasDerivAt (h : HasStrictDerivAt f f' x) : HasDerivAt f
 #align has_strict_deriv_at.has_deriv_at HasStrictDerivAt.hasDerivAt
 -/
 
+#print hasDerivWithinAt_congr_set' /-
 theorem hasDerivWithinAt_congr_set' {s t : Set ๐•œ} (y : ๐•œ) (h : s =แถ [๐“[{y}แถœ] x] t) :
     HasDerivWithinAt f f' s x โ†” HasDerivWithinAt f f' t x :=
   hasFDerivWithinAt_congr_set' y h
 #align has_deriv_within_at_congr_set' hasDerivWithinAt_congr_set'
+-/
 
 #print hasDerivWithinAt_congr_set /-
 theorem hasDerivWithinAt_congr_set {s t : Set ๐•œ} (h : s =แถ [๐“ x] t) :
@@ -343,11 +385,13 @@ theorem hasDerivWithinAt_congr_set {s t : Set ๐•œ} (h : s =แถ [๐“ x] t) :
 alias hasDerivWithinAt_congr_set โ†” HasDerivWithinAt.congr_set _
 #align has_deriv_within_at.congr_set HasDerivWithinAt.congr_set
 
+#print hasDerivWithinAt_diff_singleton /-
 @[simp]
 theorem hasDerivWithinAt_diff_singleton :
     HasDerivWithinAt f f' (s \ {x}) x โ†” HasDerivWithinAt f f' s x :=
   hasFDerivWithinAt_diff_singleton _
 #align has_deriv_within_at_diff_singleton hasDerivWithinAt_diff_singleton
+-/
 
 #print hasDerivWithinAt_Ioi_iff_Ici /-
 @[simp]
@@ -384,15 +428,19 @@ alias HasDerivWithinAt.Ioi_iff_Ioo โ†” HasDerivWithinAt.Ioi_of_Ioo HasDerivWithi
 #align has_deriv_within_at.Ioi_of_Ioo HasDerivWithinAt.Ioi_of_Ioo
 #align has_deriv_within_at.Ioo_of_Ioi HasDerivWithinAt.Ioo_of_Ioi
 
+#print hasDerivAt_iff_isLittleO_nhds_zero /-
 theorem hasDerivAt_iff_isLittleO_nhds_zero :
     HasDerivAt f f' x โ†” (fun h => f (x + h) - f x - h โ€ข f') =o[๐“ 0] fun h => h :=
   hasFDerivAt_iff_isLittleO_nhds_zero
 #align has_deriv_at_iff_is_o_nhds_zero hasDerivAt_iff_isLittleO_nhds_zero
+-/
 
+#print HasDerivAtFilter.mono /-
 theorem HasDerivAtFilter.mono (h : HasDerivAtFilter f f' x Lโ‚‚) (hst : Lโ‚ โ‰ค Lโ‚‚) :
     HasDerivAtFilter f f' x Lโ‚ :=
   HasFDerivAtFilter.mono h hst
 #align has_deriv_at_filter.mono HasDerivAtFilter.mono
+-/
 
 #print HasDerivWithinAt.mono /-
 theorem HasDerivWithinAt.mono (h : HasDerivWithinAt f f' t x) (hst : s โŠ† t) :
@@ -408,10 +456,12 @@ theorem HasDerivWithinAt.mono_of_mem (h : HasDerivWithinAt f f' t x) (hst : t 
 #align has_deriv_within_at.mono_of_mem HasDerivWithinAt.mono_of_mem
 -/
 
+#print HasDerivAt.hasDerivAtFilter /-
 theorem HasDerivAt.hasDerivAtFilter (h : HasDerivAt f f' x) (hL : L โ‰ค ๐“ x) :
     HasDerivAtFilter f f' x L :=
   HasFDerivAt.hasFDerivAtFilter h hL
 #align has_deriv_at.has_deriv_at_filter HasDerivAt.hasDerivAtFilter
+-/
 
 #print HasDerivAt.hasDerivWithinAt /-
 theorem HasDerivAt.hasDerivWithinAt (h : HasDerivAt f f' x) : HasDerivWithinAt f f' s x :=
@@ -445,20 +495,26 @@ theorem HasDerivAt.unique (hโ‚€ : HasDerivAt f fโ‚€' x) (hโ‚ : HasDerivAt f f
 #align has_deriv_at.unique HasDerivAt.unique
 -/
 
+#print hasDerivWithinAt_inter' /-
 theorem hasDerivWithinAt_inter' (h : t โˆˆ ๐“[s] x) :
     HasDerivWithinAt f f' (s โˆฉ t) x โ†” HasDerivWithinAt f f' s x :=
   hasFDerivWithinAt_inter' h
 #align has_deriv_within_at_inter' hasDerivWithinAt_inter'
+-/
 
+#print hasDerivWithinAt_inter /-
 theorem hasDerivWithinAt_inter (h : t โˆˆ ๐“ x) :
     HasDerivWithinAt f f' (s โˆฉ t) x โ†” HasDerivWithinAt f f' s x :=
   hasFDerivWithinAt_inter h
 #align has_deriv_within_at_inter hasDerivWithinAt_inter
+-/
 
+#print HasDerivWithinAt.union /-
 theorem HasDerivWithinAt.union (hs : HasDerivWithinAt f f' s x) (ht : HasDerivWithinAt f f' t x) :
     HasDerivWithinAt f f' (s โˆช t) x :=
   hs.HasFDerivWithinAt.union ht.HasFDerivWithinAt
 #align has_deriv_within_at.union HasDerivWithinAt.union
+-/
 
 #print HasDerivWithinAt.nhdsWithin /-
 theorem HasDerivWithinAt.nhdsWithin (h : HasDerivWithinAt f f' s x) (ht : s โˆˆ ๐“[t] x) :
@@ -528,9 +584,11 @@ theorem HasDerivWithinAt.derivWithin (h : HasDerivWithinAt f f' s x)
 #align has_deriv_within_at.deriv_within HasDerivWithinAt.derivWithin
 -/
 
+#print fderivWithin_derivWithin /-
 theorem fderivWithin_derivWithin : (fderivWithin ๐•œ f s x : ๐•œ โ†’ F) 1 = derivWithin f s x :=
   rfl
 #align fderiv_within_deriv_within fderivWithin_derivWithin
+-/
 
 #print derivWithin_fderivWithin /-
 theorem derivWithin_fderivWithin :
@@ -538,9 +596,11 @@ theorem derivWithin_fderivWithin :
 #align deriv_within_fderiv_within derivWithin_fderivWithin
 -/
 
+#print fderiv_deriv /-
 theorem fderiv_deriv : (fderiv ๐•œ f x : ๐•œ โ†’ F) 1 = deriv f x :=
   rfl
 #align fderiv_deriv fderiv_deriv
+-/
 
 #print deriv_fderiv /-
 theorem deriv_fderiv : smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) (deriv f x) = fderiv ๐•œ f x := by simp [deriv]
@@ -553,11 +613,13 @@ theorem DifferentiableAt.derivWithin (h : DifferentiableAt ๐•œ f x) (hxs : Uniq
 #align differentiable_at.deriv_within DifferentiableAt.derivWithin
 -/
 
+#print HasDerivWithinAt.deriv_eq_zero /-
 theorem HasDerivWithinAt.deriv_eq_zero (hd : HasDerivWithinAt f 0 s x)
     (H : UniqueDiffWithinAt ๐•œ s x) : deriv f x = 0 :=
   (em' (DifferentiableAt ๐•œ f x)).elim deriv_zero_of_not_differentiableAt fun h =>
     H.eq_deriv _ h.HasDerivAt.HasDerivWithinAt hd
 #align has_deriv_within_at.deriv_eq_zero HasDerivWithinAt.deriv_eq_zero
+-/
 
 #print derivWithin_of_mem /-
 theorem derivWithin_of_mem (st : t โˆˆ ๐“[s] x) (ht : UniqueDiffWithinAt ๐•œ s x)
@@ -573,9 +635,11 @@ theorem derivWithin_subset (st : s โŠ† t) (ht : UniqueDiffWithinAt ๐•œ s x)
 #align deriv_within_subset derivWithin_subset
 -/
 
+#print derivWithin_congr_set' /-
 theorem derivWithin_congr_set' (y : ๐•œ) (h : s =แถ [๐“[{y}แถœ] x] t) :
     derivWithin f s x = derivWithin f t x := by simp only [derivWithin, fderivWithin_congr_set' y h]
 #align deriv_within_congr_set' derivWithin_congr_set'
+-/
 
 #print derivWithin_congr_set /-
 theorem derivWithin_congr_set (h : s =แถ [๐“ x] t) : derivWithin f s x = derivWithin f t x := by
@@ -590,9 +654,11 @@ theorem derivWithin_univ : derivWithin f univ = deriv f := by ext; unfold derivW
 #align deriv_within_univ derivWithin_univ
 -/
 
+#print derivWithin_inter /-
 theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = derivWithin f s x := by
   unfold derivWithin; rw [fderivWithin_inter ht]
 #align deriv_within_inter derivWithin_inter
+-/
 
 #print derivWithin_of_open /-
 theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x := by
@@ -600,12 +666,15 @@ theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x =
 #align deriv_within_of_open derivWithin_of_open
 -/
 
+#print deriv_mem_iff /-
 theorem deriv_mem_iff {f : ๐•œ โ†’ F} {s : Set F} {x : ๐•œ} :
     deriv f x โˆˆ s โ†”
       DifferentiableAt ๐•œ f x โˆง deriv f x โˆˆ s โˆจ ยฌDifferentiableAt ๐•œ f x โˆง (0 : F) โˆˆ s :=
   by by_cases hx : DifferentiableAt ๐•œ f x <;> simp [deriv_zero_of_not_differentiableAt, *]
 #align deriv_mem_iff deriv_mem_iff
+-/
 
+#print derivWithin_mem_iff /-
 theorem derivWithin_mem_iff {f : ๐•œ โ†’ F} {t : Set ๐•œ} {s : Set F} {x : ๐•œ} :
     derivWithin f t x โˆˆ s โ†”
       DifferentiableWithinAt ๐•œ f t x โˆง derivWithin f t x โˆˆ s โˆจ
@@ -614,6 +683,7 @@ theorem derivWithin_mem_iff {f : ๐•œ โ†’ F} {t : Set ๐•œ} {s : Set F} {x : 
   by_cases hx : DifferentiableWithinAt ๐•œ f t x <;>
     simp [derivWithin_zero_of_not_differentiableWithinAt, *]
 #align deriv_within_mem_iff derivWithin_mem_iff
+-/
 
 #print differentiableWithinAt_Ioi_iff_Ici /-
 theorem differentiableWithinAt_Ioi_iff_Ici [PartialOrder ๐•œ] :
@@ -731,43 +801,61 @@ section id
 
 variable (s x L)
 
+#print hasDerivAtFilter_id /-
 theorem hasDerivAtFilter_id : HasDerivAtFilter id 1 x L :=
   (hasFDerivAtFilter_id x L).HasDerivAtFilter
 #align has_deriv_at_filter_id hasDerivAtFilter_id
+-/
 
+#print hasDerivWithinAt_id /-
 theorem hasDerivWithinAt_id : HasDerivWithinAt id 1 s x :=
   hasDerivAtFilter_id _ _
 #align has_deriv_within_at_id hasDerivWithinAt_id
+-/
 
+#print hasDerivAt_id /-
 theorem hasDerivAt_id : HasDerivAt id 1 x :=
   hasDerivAtFilter_id _ _
 #align has_deriv_at_id hasDerivAt_id
+-/
 
+#print hasDerivAt_id' /-
 theorem hasDerivAt_id' : HasDerivAt (fun x : ๐•œ => x) 1 x :=
   hasDerivAtFilter_id _ _
 #align has_deriv_at_id' hasDerivAt_id'
+-/
 
+#print hasStrictDerivAt_id /-
 theorem hasStrictDerivAt_id : HasStrictDerivAt id 1 x :=
   (hasStrictFDerivAt_id x).HasStrictDerivAt
 #align has_strict_deriv_at_id hasStrictDerivAt_id
+-/
 
+#print deriv_id /-
 theorem deriv_id : deriv id x = 1 :=
   HasDerivAt.deriv (hasDerivAt_id x)
 #align deriv_id deriv_id
+-/
 
+#print deriv_id' /-
 @[simp]
 theorem deriv_id' : deriv (@id ๐•œ) = fun _ => 1 :=
   funext deriv_id
 #align deriv_id' deriv_id'
+-/
 
+#print deriv_id'' /-
 @[simp]
 theorem deriv_id'' : (deriv fun x : ๐•œ => x) = fun _ => 1 :=
   deriv_id'
 #align deriv_id'' deriv_id''
+-/
 
+#print derivWithin_id /-
 theorem derivWithin_id (hxs : UniqueDiffWithinAt ๐•œ s x) : derivWithin id s x = 1 :=
   (hasDerivWithinAt_id x s).derivWithin hxs
 #align deriv_within_id derivWithin_id
+-/
 
 end id
 
@@ -778,34 +866,48 @@ section Const
 
 variable (c : F) (s x L)
 
+#print hasDerivAtFilter_const /-
 theorem hasDerivAtFilter_const : HasDerivAtFilter (fun x => c) 0 x L :=
   (hasFDerivAtFilter_const c x L).HasDerivAtFilter
 #align has_deriv_at_filter_const hasDerivAtFilter_const
+-/
 
+#print hasStrictDerivAt_const /-
 theorem hasStrictDerivAt_const : HasStrictDerivAt (fun x => c) 0 x :=
   (hasStrictFDerivAt_const c x).HasStrictDerivAt
 #align has_strict_deriv_at_const hasStrictDerivAt_const
+-/
 
+#print hasDerivWithinAt_const /-
 theorem hasDerivWithinAt_const : HasDerivWithinAt (fun x => c) 0 s x :=
   hasDerivAtFilter_const _ _ _
 #align has_deriv_within_at_const hasDerivWithinAt_const
+-/
 
+#print hasDerivAt_const /-
 theorem hasDerivAt_const : HasDerivAt (fun x => c) 0 x :=
   hasDerivAtFilter_const _ _ _
 #align has_deriv_at_const hasDerivAt_const
+-/
 
+#print deriv_const /-
 theorem deriv_const : deriv (fun x => c) x = 0 :=
   HasDerivAt.deriv (hasDerivAt_const x c)
 #align deriv_const deriv_const
+-/
 
+#print deriv_const' /-
 @[simp]
 theorem deriv_const' : (deriv fun x : ๐•œ => c) = fun x => 0 :=
   funext fun x => deriv_const x c
 #align deriv_const' deriv_const'
+-/
 
+#print derivWithin_const /-
 theorem derivWithin_const (hxs : UniqueDiffWithinAt ๐•œ s x) : derivWithin (fun x => c) s x = 0 :=
   (hasDerivWithinAt_const _ _ _).derivWithin hxs
 #align deriv_within_const derivWithin_const
+-/
 
 end Const
 
@@ -814,10 +916,12 @@ section Continuous
 /-! ### Continuity of a function admitting a derivative -/
 
 
+#print HasDerivAtFilter.tendsto_nhds /-
 theorem HasDerivAtFilter.tendsto_nhds (hL : L โ‰ค ๐“ x) (h : HasDerivAtFilter f f' x L) :
     Tendsto f L (๐“ (f x)) :=
   h.tendsto_nhds hL
 #align has_deriv_at_filter.tendsto_nhds HasDerivAtFilter.tendsto_nhds
+-/
 
 #print HasDerivWithinAt.continuousWithinAt /-
 theorem HasDerivWithinAt.continuousWithinAt (h : HasDerivWithinAt f f' s x) :
Diff
@@ -634,7 +634,7 @@ theorem derivWithin_Ioi_eq_Ici {E : Type _} [NormedAddCommGroup E] [NormedSpace
     simpa using (uniqueDiffOn_Ici x).Eq le_rfl A B
   ยท rw [derivWithin_zero_of_not_differentiableWithinAt H,
       derivWithin_zero_of_not_differentiableWithinAt]
-    rwa [differentiableWithinAt_Ioi_iff_Ici] at H
+    rwa [differentiableWithinAt_Ioi_iff_Ici] at H 
 #align deriv_within_Ioi_eq_Ici derivWithin_Ioi_eq_Ici
 -/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Gabriel Ebner, Sรฉbastien Gouรซzel
 
 ! This file was ported from Lean 3 source module analysis.calculus.deriv.basic
-! 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.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Analysis.Calculus.Fderiv.Basic
 
 # One-dimensional derivatives
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the derivative of a function `f : ๐•œ โ†’ F` where `๐•œ` is a
 normed field and `F` is a normed space over this field. The derivative of
 such a function `f` at a point `x` is given by an element `f' : F`.
Diff
@@ -90,7 +90,7 @@ universe u v w
 
 noncomputable section
 
-open Classical Topology BigOperators Filter ENNReal
+open scoped Classical Topology BigOperators Filter ENNReal
 
 open Filter Asymptotics Set
 
@@ -370,10 +370,12 @@ alias hasDerivWithinAt_Iio_iff_Iic โ†” HasDerivWithinAt.Iic_of_Iio HasDerivWithi
 #align has_deriv_within_at.Iic_of_Iio HasDerivWithinAt.Iic_of_Iio
 #align has_deriv_within_at.Iio_of_Iic HasDerivWithinAt.Iio_of_Iic
 
+#print HasDerivWithinAt.Ioi_iff_Ioo /-
 theorem HasDerivWithinAt.Ioi_iff_Ioo [LinearOrder ๐•œ] [OrderClosedTopology ๐•œ] {x y : ๐•œ} (h : x < y) :
     HasDerivWithinAt f f' (Ioo x y) x โ†” HasDerivWithinAt f f' (Ioi x) x :=
   hasFDerivWithinAt_inter <| Iio_mem_nhds h
 #align has_deriv_within_at.Ioi_iff_Ioo HasDerivWithinAt.Ioi_iff_Ioo
+-/
 
 alias HasDerivWithinAt.Ioi_iff_Ioo โ†” HasDerivWithinAt.Ioi_of_Ioo HasDerivWithinAt.Ioo_of_Ioi
 #align has_deriv_within_at.Ioi_of_Ioo HasDerivWithinAt.Ioi_of_Ioo
Diff
@@ -102,6 +102,7 @@ variable {F : Type v} [NormedAddCommGroup F] [NormedSpace ๐•œ F]
 
 variable {E : Type w} [NormedAddCommGroup E] [NormedSpace ๐•œ E]
 
+#print HasDerivAtFilter /-
 /-- `f` has the derivative `f'` at the point `x` as `x` goes along the filter `L`.
 
 That is, `f x' = f x + (x' - x) โ€ข f' + o(x' - x)` where `x'` converges along the filter `L`.
@@ -109,7 +110,9 @@ That is, `f x' = f x + (x' - x) โ€ข f' + o(x' - x)` where `x'` converges along t
 def HasDerivAtFilter (f : ๐•œ โ†’ F) (f' : F) (x : ๐•œ) (L : Filter ๐•œ) :=
   HasFDerivAtFilter f (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') x L
 #align has_deriv_at_filter HasDerivAtFilter
+-/
 
+#print HasDerivWithinAt /-
 /-- `f` has the derivative `f'` at the point `x` within the subset `s`.
 
 That is, `f x' = f x + (x' - x) โ€ข f' + o(x' - x)` where `x'` converges to `x` inside `s`.
@@ -117,7 +120,9 @@ That is, `f x' = f x + (x' - x) โ€ข f' + o(x' - x)` where `x'` converges to `x`
 def HasDerivWithinAt (f : ๐•œ โ†’ F) (f' : F) (s : Set ๐•œ) (x : ๐•œ) :=
   HasDerivAtFilter f f' x (๐“[s] x)
 #align has_deriv_within_at HasDerivWithinAt
+-/
 
+#print HasDerivAt /-
 /-- `f` has the derivative `f'` at the point `x`.
 
 That is, `f x' = f x + (x' - x) โ€ข f' + o(x' - x)` where `x'` converges to `x`.
@@ -125,14 +130,18 @@ That is, `f x' = f x + (x' - x) โ€ข f' + o(x' - x)` where `x'` converges to `x`.
 def HasDerivAt (f : ๐•œ โ†’ F) (f' : F) (x : ๐•œ) :=
   HasDerivAtFilter f f' x (๐“ x)
 #align has_deriv_at HasDerivAt
+-/
 
+#print HasStrictDerivAt /-
 /-- `f` has the derivative `f'` at the point `x` in the sense of strict differentiability.
 
 That is, `f y - f z = (y - z) โ€ข f' + o(y - z)` as `y, z โ†’ x`. -/
 def HasStrictDerivAt (f : ๐•œ โ†’ F) (f' : F) (x : ๐•œ) :=
   HasStrictFDerivAt f (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') x
 #align has_strict_deriv_at HasStrictDerivAt
+-/
 
+#print derivWithin /-
 /-- Derivative of `f` at the point `x` within the set `s`, if it exists.  Zero otherwise.
 
 If the derivative exists (i.e., `โˆƒ f', has_deriv_within_at f f' s x`), then
@@ -141,7 +150,9 @@ If the derivative exists (i.e., `โˆƒ f', has_deriv_within_at f f' s x`), then
 def derivWithin (f : ๐•œ โ†’ F) (s : Set ๐•œ) (x : ๐•œ) :=
   fderivWithin ๐•œ f s x 1
 #align deriv_within derivWithin
+-/
 
+#print deriv /-
 /-- Derivative of `f` at the point `x`, if it exists.  Zero otherwise.
 
 If the derivative exists (i.e., `โˆƒ f', has_deriv_at f f' x`), then
@@ -150,6 +161,7 @@ If the derivative exists (i.e., `โˆƒ f', has_deriv_at f f' x`), then
 def deriv (f : ๐•œ โ†’ F) (x : ๐•œ) :=
   fderiv ๐•œ f x 1
 #align deriv deriv
+-/
 
 variable {f fโ‚€ fโ‚ g : ๐•œ โ†’ F}
 
@@ -177,21 +189,25 @@ theorem hasFDerivWithinAt_iff_hasDerivWithinAt {f' : ๐•œ โ†’L[๐•œ] F} :
   hasFDerivAtFilter_iff_hasDerivAtFilter
 #align has_fderiv_within_at_iff_has_deriv_within_at hasFDerivWithinAt_iff_hasDerivWithinAt
 
+#print hasDerivWithinAt_iff_hasFDerivWithinAt /-
 /-- Expressing `has_deriv_within_at f f' s x` in terms of `has_fderiv_within_at` -/
 theorem hasDerivWithinAt_iff_hasFDerivWithinAt {f' : F} :
     HasDerivWithinAt f f' s x โ†” HasFDerivWithinAt f (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') s x :=
   Iff.rfl
 #align has_deriv_within_at_iff_has_fderiv_within_at hasDerivWithinAt_iff_hasFDerivWithinAt
+-/
 
 theorem HasFDerivWithinAt.hasDerivWithinAt {f' : ๐•œ โ†’L[๐•œ] F} :
     HasFDerivWithinAt f f' s x โ†’ HasDerivWithinAt f (f' 1) s x :=
   hasFDerivWithinAt_iff_hasDerivWithinAt.mp
 #align has_fderiv_within_at.has_deriv_within_at HasFDerivWithinAt.hasDerivWithinAt
 
+#print HasDerivWithinAt.hasFDerivWithinAt /-
 theorem HasDerivWithinAt.hasFDerivWithinAt {f' : F} :
     HasDerivWithinAt f f' s x โ†’ HasFDerivWithinAt f (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') s x :=
   hasDerivWithinAt_iff_hasFDerivWithinAt.mp
 #align has_deriv_within_at.has_fderiv_within_at HasDerivWithinAt.hasFDerivWithinAt
+-/
 
 /-- Expressing `has_fderiv_at f f' x` in terms of `has_deriv_at` -/
 theorem hasFDerivAt_iff_hasDerivAt {f' : ๐•œ โ†’L[๐•œ] F} : HasFDerivAt f f' x โ†” HasDerivAt f (f' 1) x :=
@@ -212,19 +228,23 @@ protected theorem HasStrictFDerivAt.hasStrictDerivAt {f' : ๐•œ โ†’L[๐•œ] F} :
   hasStrictFDerivAt_iff_hasStrictDerivAt.mp
 #align has_strict_fderiv_at.has_strict_deriv_at HasStrictFDerivAt.hasStrictDerivAt
 
+#print hasStrictDerivAt_iff_hasStrictFDerivAt /-
 theorem hasStrictDerivAt_iff_hasStrictFDerivAt :
     HasStrictDerivAt f f' x โ†” HasStrictFDerivAt f (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') x :=
   Iff.rfl
 #align has_strict_deriv_at_iff_has_strict_fderiv_at hasStrictDerivAt_iff_hasStrictFDerivAt
+-/
 
 alias hasStrictDerivAt_iff_hasStrictFDerivAt โ†” HasStrictDerivAt.hasStrictFDerivAt _
 #align has_strict_deriv_at.has_strict_fderiv_at HasStrictDerivAt.hasStrictFDerivAt
 
+#print hasDerivAt_iff_hasFDerivAt /-
 /-- Expressing `has_deriv_at f f' x` in terms of `has_fderiv_at` -/
 theorem hasDerivAt_iff_hasFDerivAt {f' : F} :
     HasDerivAt f f' x โ†” HasFDerivAt f (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') x :=
   Iff.rfl
 #align has_deriv_at_iff_has_fderiv_at hasDerivAt_iff_hasFDerivAt
+-/
 
 alias hasDerivAt_iff_hasFDerivAt โ†” HasDerivAt.hasFDerivAt _
 #align has_deriv_at.has_fderiv_at HasDerivAt.hasFDerivAt
@@ -247,10 +267,12 @@ theorem differentiableAt_of_deriv_ne_zero (h : deriv f x โ‰  0) : Differentiable
   not_imp_comm.1 deriv_zero_of_not_differentiableAt h
 #align differentiable_at_of_deriv_ne_zero differentiableAt_of_deriv_ne_zero
 
+#print UniqueDiffWithinAt.eq_deriv /-
 theorem UniqueDiffWithinAt.eq_deriv (s : Set ๐•œ) (H : UniqueDiffWithinAt ๐•œ s x)
     (h : HasDerivWithinAt f f' s x) (hโ‚ : HasDerivWithinAt f fโ‚' s x) : f' = fโ‚' :=
   smulRight_one_eq_iff.mp <| UniqueDiffWithinAt.eq H h hโ‚
 #align unique_diff_within_at.eq_deriv UniqueDiffWithinAt.eq_deriv
+-/
 
 theorem hasDerivAtFilter_iff_isLittleO :
     HasDerivAtFilter f f' x L โ†” (fun x' : ๐•œ => f x' - f x - (x' - x) โ€ข f') =o[L] fun x' => x' - x :=
@@ -297,19 +319,23 @@ theorem HasDerivAtFilter.isBigO_sub_rev (hf : HasDerivAtFilter f f' x L) (hf' :
     simp [norm_smul, โ† div_eq_inv_mul, mul_div_cancel _ (mt norm_eq_zero.1 hf')]
 #align has_deriv_at_filter.is_O_sub_rev HasDerivAtFilter.isBigO_sub_rev
 
+#print HasStrictDerivAt.hasDerivAt /-
 theorem HasStrictDerivAt.hasDerivAt (h : HasStrictDerivAt f f' x) : HasDerivAt f f' x :=
   h.HasFDerivAt
 #align has_strict_deriv_at.has_deriv_at HasStrictDerivAt.hasDerivAt
+-/
 
 theorem hasDerivWithinAt_congr_set' {s t : Set ๐•œ} (y : ๐•œ) (h : s =แถ [๐“[{y}แถœ] x] t) :
     HasDerivWithinAt f f' s x โ†” HasDerivWithinAt f f' t x :=
   hasFDerivWithinAt_congr_set' y h
 #align has_deriv_within_at_congr_set' hasDerivWithinAt_congr_set'
 
+#print hasDerivWithinAt_congr_set /-
 theorem hasDerivWithinAt_congr_set {s t : Set ๐•œ} (h : s =แถ [๐“ x] t) :
     HasDerivWithinAt f f' s x โ†” HasDerivWithinAt f f' t x :=
   hasFDerivWithinAt_congr_set h
 #align has_deriv_within_at_congr_set hasDerivWithinAt_congr_set
+-/
 
 alias hasDerivWithinAt_congr_set โ†” HasDerivWithinAt.congr_set _
 #align has_deriv_within_at.congr_set HasDerivWithinAt.congr_set
@@ -320,21 +346,25 @@ theorem hasDerivWithinAt_diff_singleton :
   hasFDerivWithinAt_diff_singleton _
 #align has_deriv_within_at_diff_singleton hasDerivWithinAt_diff_singleton
 
+#print hasDerivWithinAt_Ioi_iff_Ici /-
 @[simp]
 theorem hasDerivWithinAt_Ioi_iff_Ici [PartialOrder ๐•œ] :
     HasDerivWithinAt f f' (Ioi x) x โ†” HasDerivWithinAt f f' (Ici x) x := by
   rw [โ† Ici_diff_left, hasDerivWithinAt_diff_singleton]
 #align has_deriv_within_at_Ioi_iff_Ici hasDerivWithinAt_Ioi_iff_Ici
+-/
 
 alias hasDerivWithinAt_Ioi_iff_Ici โ†” HasDerivWithinAt.Ici_of_Ioi HasDerivWithinAt.Ioi_of_Ici
 #align has_deriv_within_at.Ici_of_Ioi HasDerivWithinAt.Ici_of_Ioi
 #align has_deriv_within_at.Ioi_of_Ici HasDerivWithinAt.Ioi_of_Ici
 
+#print hasDerivWithinAt_Iio_iff_Iic /-
 @[simp]
 theorem hasDerivWithinAt_Iio_iff_Iic [PartialOrder ๐•œ] :
     HasDerivWithinAt f f' (Iio x) x โ†” HasDerivWithinAt f f' (Iic x) x := by
   rw [โ† Iic_diff_right, hasDerivWithinAt_diff_singleton]
 #align has_deriv_within_at_Iio_iff_Iic hasDerivWithinAt_Iio_iff_Iic
+-/
 
 alias hasDerivWithinAt_Iio_iff_Iic โ†” HasDerivWithinAt.Iic_of_Iio HasDerivWithinAt.Iio_of_Iic
 #align has_deriv_within_at.Iic_of_Iio HasDerivWithinAt.Iic_of_Iio
@@ -359,42 +389,56 @@ theorem HasDerivAtFilter.mono (h : HasDerivAtFilter f f' x Lโ‚‚) (hst : Lโ‚ โ‰ค
   HasFDerivAtFilter.mono h hst
 #align has_deriv_at_filter.mono HasDerivAtFilter.mono
 
+#print HasDerivWithinAt.mono /-
 theorem HasDerivWithinAt.mono (h : HasDerivWithinAt f f' t x) (hst : s โŠ† t) :
     HasDerivWithinAt f f' s x :=
   HasFDerivWithinAt.mono h hst
 #align has_deriv_within_at.mono HasDerivWithinAt.mono
+-/
 
+#print HasDerivWithinAt.mono_of_mem /-
 theorem HasDerivWithinAt.mono_of_mem (h : HasDerivWithinAt f f' t x) (hst : t โˆˆ ๐“[s] x) :
     HasDerivWithinAt f f' s x :=
   HasFDerivWithinAt.mono_of_mem h hst
 #align has_deriv_within_at.mono_of_mem HasDerivWithinAt.mono_of_mem
+-/
 
 theorem HasDerivAt.hasDerivAtFilter (h : HasDerivAt f f' x) (hL : L โ‰ค ๐“ x) :
     HasDerivAtFilter f f' x L :=
   HasFDerivAt.hasFDerivAtFilter h hL
 #align has_deriv_at.has_deriv_at_filter HasDerivAt.hasDerivAtFilter
 
+#print HasDerivAt.hasDerivWithinAt /-
 theorem HasDerivAt.hasDerivWithinAt (h : HasDerivAt f f' x) : HasDerivWithinAt f f' s x :=
   HasFDerivAt.hasFDerivWithinAt h
 #align has_deriv_at.has_deriv_within_at HasDerivAt.hasDerivWithinAt
+-/
 
+#print HasDerivWithinAt.differentiableWithinAt /-
 theorem HasDerivWithinAt.differentiableWithinAt (h : HasDerivWithinAt f f' s x) :
     DifferentiableWithinAt ๐•œ f s x :=
   HasFDerivWithinAt.differentiableWithinAt h
 #align has_deriv_within_at.differentiable_within_at HasDerivWithinAt.differentiableWithinAt
+-/
 
+#print HasDerivAt.differentiableAt /-
 theorem HasDerivAt.differentiableAt (h : HasDerivAt f f' x) : DifferentiableAt ๐•œ f x :=
   HasFDerivAt.differentiableAt h
 #align has_deriv_at.differentiable_at HasDerivAt.differentiableAt
+-/
 
+#print hasDerivWithinAt_univ /-
 @[simp]
 theorem hasDerivWithinAt_univ : HasDerivWithinAt f f' univ x โ†” HasDerivAt f f' x :=
   hasFDerivWithinAt_univ
 #align has_deriv_within_at_univ hasDerivWithinAt_univ
+-/
 
+#print HasDerivAt.unique /-
 theorem HasDerivAt.unique (hโ‚€ : HasDerivAt f fโ‚€' x) (hโ‚ : HasDerivAt f fโ‚' x) : fโ‚€' = fโ‚' :=
   smulRight_one_eq_iff.mp <| hโ‚€.HasFDerivAt.unique hโ‚
 #align has_deriv_at.unique HasDerivAt.unique
+-/
 
 theorem hasDerivWithinAt_inter' (h : t โˆˆ ๐“[s] x) :
     HasDerivWithinAt f f' (s โˆฉ t) x โ†” HasDerivWithinAt f f' s x :=
@@ -411,72 +455,98 @@ theorem HasDerivWithinAt.union (hs : HasDerivWithinAt f f' s x) (ht : HasDerivWi
   hs.HasFDerivWithinAt.union ht.HasFDerivWithinAt
 #align has_deriv_within_at.union HasDerivWithinAt.union
 
+#print HasDerivWithinAt.nhdsWithin /-
 theorem HasDerivWithinAt.nhdsWithin (h : HasDerivWithinAt f f' s x) (ht : s โˆˆ ๐“[t] x) :
     HasDerivWithinAt f f' t x :=
   (hasDerivWithinAt_inter' ht).1 (h.mono (inter_subset_right _ _))
 #align has_deriv_within_at.nhds_within HasDerivWithinAt.nhdsWithin
+-/
 
+#print HasDerivWithinAt.hasDerivAt /-
 theorem HasDerivWithinAt.hasDerivAt (h : HasDerivWithinAt f f' s x) (hs : s โˆˆ ๐“ x) :
     HasDerivAt f f' x :=
   HasFDerivWithinAt.hasFDerivAt h hs
 #align has_deriv_within_at.has_deriv_at HasDerivWithinAt.hasDerivAt
+-/
 
+#print DifferentiableWithinAt.hasDerivWithinAt /-
 theorem DifferentiableWithinAt.hasDerivWithinAt (h : DifferentiableWithinAt ๐•œ f s x) :
     HasDerivWithinAt f (derivWithin f s x) s x :=
   h.HasFDerivWithinAt.HasDerivWithinAt
 #align differentiable_within_at.has_deriv_within_at DifferentiableWithinAt.hasDerivWithinAt
+-/
 
+#print DifferentiableAt.hasDerivAt /-
 theorem DifferentiableAt.hasDerivAt (h : DifferentiableAt ๐•œ f x) : HasDerivAt f (deriv f x) x :=
   h.HasFDerivAt.HasDerivAt
 #align differentiable_at.has_deriv_at DifferentiableAt.hasDerivAt
+-/
 
+#print hasDerivAt_deriv_iff /-
 @[simp]
 theorem hasDerivAt_deriv_iff : HasDerivAt f (deriv f x) x โ†” DifferentiableAt ๐•œ f x :=
   โŸจfun h => h.DifferentiableAt, fun h => h.HasDerivAtโŸฉ
 #align has_deriv_at_deriv_iff hasDerivAt_deriv_iff
+-/
 
+#print hasDerivWithinAt_derivWithin_iff /-
 @[simp]
 theorem hasDerivWithinAt_derivWithin_iff :
     HasDerivWithinAt f (derivWithin f s x) s x โ†” DifferentiableWithinAt ๐•œ f s x :=
   โŸจfun h => h.DifferentiableWithinAt, fun h => h.HasDerivWithinAtโŸฉ
 #align has_deriv_within_at_deriv_within_iff hasDerivWithinAt_derivWithin_iff
+-/
 
+#print DifferentiableOn.hasDerivAt /-
 theorem DifferentiableOn.hasDerivAt (h : DifferentiableOn ๐•œ f s) (hs : s โˆˆ ๐“ x) :
     HasDerivAt f (deriv f x) x :=
   (h.HasFDerivAt hs).HasDerivAt
 #align differentiable_on.has_deriv_at DifferentiableOn.hasDerivAt
+-/
 
+#print HasDerivAt.deriv /-
 theorem HasDerivAt.deriv (h : HasDerivAt f f' x) : deriv f x = f' :=
   h.DifferentiableAt.HasDerivAt.unique h
 #align has_deriv_at.deriv HasDerivAt.deriv
+-/
 
+#print deriv_eq /-
 theorem deriv_eq {f' : ๐•œ โ†’ F} (h : โˆ€ x, HasDerivAt f (f' x) x) : deriv f = f' :=
   funext fun x => (h x).deriv
 #align deriv_eq deriv_eq
+-/
 
+#print HasDerivWithinAt.derivWithin /-
 theorem HasDerivWithinAt.derivWithin (h : HasDerivWithinAt f f' s x)
     (hxs : UniqueDiffWithinAt ๐•œ s x) : derivWithin f s x = f' :=
   hxs.eq_deriv _ h.DifferentiableWithinAt.HasDerivWithinAt h
 #align has_deriv_within_at.deriv_within HasDerivWithinAt.derivWithin
+-/
 
 theorem fderivWithin_derivWithin : (fderivWithin ๐•œ f s x : ๐•œ โ†’ F) 1 = derivWithin f s x :=
   rfl
 #align fderiv_within_deriv_within fderivWithin_derivWithin
 
+#print derivWithin_fderivWithin /-
 theorem derivWithin_fderivWithin :
     smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) (derivWithin f s x) = fderivWithin ๐•œ f s x := by simp [derivWithin]
 #align deriv_within_fderiv_within derivWithin_fderivWithin
+-/
 
 theorem fderiv_deriv : (fderiv ๐•œ f x : ๐•œ โ†’ F) 1 = deriv f x :=
   rfl
 #align fderiv_deriv fderiv_deriv
 
+#print deriv_fderiv /-
 theorem deriv_fderiv : smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) (deriv f x) = fderiv ๐•œ f x := by simp [deriv]
 #align deriv_fderiv deriv_fderiv
+-/
 
+#print DifferentiableAt.derivWithin /-
 theorem DifferentiableAt.derivWithin (h : DifferentiableAt ๐•œ f x) (hxs : UniqueDiffWithinAt ๐•œ s x) :
     derivWithin f s x = deriv f x := by unfold derivWithin deriv; rw [h.fderiv_within hxs]
 #align differentiable_at.deriv_within DifferentiableAt.derivWithin
+-/
 
 theorem HasDerivWithinAt.deriv_eq_zero (hd : HasDerivWithinAt f 0 s x)
     (H : UniqueDiffWithinAt ๐•œ s x) : deriv f x = 0 :=
@@ -484,36 +554,46 @@ theorem HasDerivWithinAt.deriv_eq_zero (hd : HasDerivWithinAt f 0 s x)
     H.eq_deriv _ h.HasDerivAt.HasDerivWithinAt hd
 #align has_deriv_within_at.deriv_eq_zero HasDerivWithinAt.deriv_eq_zero
 
+#print derivWithin_of_mem /-
 theorem derivWithin_of_mem (st : t โˆˆ ๐“[s] x) (ht : UniqueDiffWithinAt ๐•œ s x)
     (h : DifferentiableWithinAt ๐•œ f t x) : derivWithin f s x = derivWithin f t x :=
   ((DifferentiableWithinAt.hasDerivWithinAt h).mono_of_mem st).derivWithin ht
 #align deriv_within_of_mem derivWithin_of_mem
+-/
 
+#print derivWithin_subset /-
 theorem derivWithin_subset (st : s โŠ† t) (ht : UniqueDiffWithinAt ๐•œ s x)
     (h : DifferentiableWithinAt ๐•œ f t x) : derivWithin f s x = derivWithin f t x :=
   ((DifferentiableWithinAt.hasDerivWithinAt h).mono st).derivWithin ht
 #align deriv_within_subset derivWithin_subset
+-/
 
 theorem derivWithin_congr_set' (y : ๐•œ) (h : s =แถ [๐“[{y}แถœ] x] t) :
     derivWithin f s x = derivWithin f t x := by simp only [derivWithin, fderivWithin_congr_set' y h]
 #align deriv_within_congr_set' derivWithin_congr_set'
 
+#print derivWithin_congr_set /-
 theorem derivWithin_congr_set (h : s =แถ [๐“ x] t) : derivWithin f s x = derivWithin f t x := by
   simp only [derivWithin, fderivWithin_congr_set h]
 #align deriv_within_congr_set derivWithin_congr_set
+-/
 
+#print derivWithin_univ /-
 @[simp]
 theorem derivWithin_univ : derivWithin f univ = deriv f := by ext; unfold derivWithin deriv;
   rw [fderivWithin_univ]
 #align deriv_within_univ derivWithin_univ
+-/
 
 theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = derivWithin f s x := by
   unfold derivWithin; rw [fderivWithin_inter ht]
 #align deriv_within_inter derivWithin_inter
 
+#print derivWithin_of_open /-
 theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x := by
   unfold derivWithin; rw [fderivWithin_of_open hs hx]; rfl
 #align deriv_within_of_open derivWithin_of_open
+-/
 
 theorem deriv_mem_iff {f : ๐•œ โ†’ F} {s : Set F} {x : ๐•œ} :
     deriv f x โˆˆ s โ†”
@@ -530,12 +610,15 @@ theorem derivWithin_mem_iff {f : ๐•œ โ†’ F} {t : Set ๐•œ} {s : Set F} {x : 
     simp [derivWithin_zero_of_not_differentiableWithinAt, *]
 #align deriv_within_mem_iff derivWithin_mem_iff
 
+#print differentiableWithinAt_Ioi_iff_Ici /-
 theorem differentiableWithinAt_Ioi_iff_Ici [PartialOrder ๐•œ] :
     DifferentiableWithinAt ๐•œ f (Ioi x) x โ†” DifferentiableWithinAt ๐•œ f (Ici x) x :=
   โŸจfun h => h.HasDerivWithinAt.Ici_of_Ioi.DifferentiableWithinAt, fun h =>
     h.HasDerivWithinAt.Ioi_of_Ici.DifferentiableWithinAtโŸฉ
 #align differentiable_within_at_Ioi_iff_Ici differentiableWithinAt_Ioi_iff_Ici
+-/
 
+#print derivWithin_Ioi_eq_Ici /-
 -- Golfed while splitting the file
 theorem derivWithin_Ioi_eq_Ici {E : Type _} [NormedAddCommGroup E] [NormedSpace โ„ E] (f : โ„ โ†’ E)
     (x : โ„) : derivWithin f (Ioi x) x = derivWithin f (Ici x) x :=
@@ -548,66 +631,91 @@ theorem derivWithin_Ioi_eq_Ici {E : Type _} [NormedAddCommGroup E] [NormedSpace
       derivWithin_zero_of_not_differentiableWithinAt]
     rwa [differentiableWithinAt_Ioi_iff_Ici] at H
 #align deriv_within_Ioi_eq_Ici derivWithin_Ioi_eq_Ici
+-/
 
 section congr
 
 /-! ### Congruence properties of derivatives -/
 
 
+#print Filter.EventuallyEq.hasDerivAtFilter_iff /-
 theorem Filter.EventuallyEq.hasDerivAtFilter_iff (hโ‚€ : fโ‚€ =แถ [L] fโ‚) (hx : fโ‚€ x = fโ‚ x)
     (hโ‚ : fโ‚€' = fโ‚') : HasDerivAtFilter fโ‚€ fโ‚€' x L โ†” HasDerivAtFilter fโ‚ fโ‚' x L :=
   hโ‚€.hasFDerivAtFilter_iff hx (by simp [hโ‚])
 #align filter.eventually_eq.has_deriv_at_filter_iff Filter.EventuallyEq.hasDerivAtFilter_iff
+-/
 
+#print HasDerivAtFilter.congr_of_eventuallyEq /-
 theorem HasDerivAtFilter.congr_of_eventuallyEq (h : HasDerivAtFilter f f' x L) (hL : fโ‚ =แถ [L] f)
     (hx : fโ‚ x = f x) : HasDerivAtFilter fโ‚ f' x L := by rwa [hL.has_deriv_at_filter_iff hx rfl]
 #align has_deriv_at_filter.congr_of_eventually_eq HasDerivAtFilter.congr_of_eventuallyEq
+-/
 
+#print HasDerivWithinAt.congr_mono /-
 theorem HasDerivWithinAt.congr_mono (h : HasDerivWithinAt f f' s x) (ht : โˆ€ x โˆˆ t, fโ‚ x = f x)
     (hx : fโ‚ x = f x) (hโ‚ : t โŠ† s) : HasDerivWithinAt fโ‚ f' t x :=
   HasFDerivWithinAt.congr_mono h ht hx hโ‚
 #align has_deriv_within_at.congr_mono HasDerivWithinAt.congr_mono
+-/
 
+#print HasDerivWithinAt.congr /-
 theorem HasDerivWithinAt.congr (h : HasDerivWithinAt f f' s x) (hs : โˆ€ x โˆˆ s, fโ‚ x = f x)
     (hx : fโ‚ x = f x) : HasDerivWithinAt fโ‚ f' s x :=
   h.congr_mono hs hx (Subset.refl _)
 #align has_deriv_within_at.congr HasDerivWithinAt.congr
+-/
 
+#print HasDerivWithinAt.congr_of_mem /-
 theorem HasDerivWithinAt.congr_of_mem (h : HasDerivWithinAt f f' s x) (hs : โˆ€ x โˆˆ s, fโ‚ x = f x)
     (hx : x โˆˆ s) : HasDerivWithinAt fโ‚ f' s x :=
   h.congr hs (hs _ hx)
 #align has_deriv_within_at.congr_of_mem HasDerivWithinAt.congr_of_mem
+-/
 
+#print HasDerivWithinAt.congr_of_eventuallyEq /-
 theorem HasDerivWithinAt.congr_of_eventuallyEq (h : HasDerivWithinAt f f' s x)
     (hโ‚ : fโ‚ =แถ [๐“[s] x] f) (hx : fโ‚ x = f x) : HasDerivWithinAt fโ‚ f' s x :=
   HasDerivAtFilter.congr_of_eventuallyEq h hโ‚ hx
 #align has_deriv_within_at.congr_of_eventually_eq HasDerivWithinAt.congr_of_eventuallyEq
+-/
 
+#print HasDerivWithinAt.congr_of_eventuallyEq_of_mem /-
 theorem HasDerivWithinAt.congr_of_eventuallyEq_of_mem (h : HasDerivWithinAt f f' s x)
     (hโ‚ : fโ‚ =แถ [๐“[s] x] f) (hx : x โˆˆ s) : HasDerivWithinAt fโ‚ f' s x :=
   h.congr_of_eventuallyEq hโ‚ (hโ‚.eq_of_nhdsWithin hx)
 #align has_deriv_within_at.congr_of_eventually_eq_of_mem HasDerivWithinAt.congr_of_eventuallyEq_of_mem
+-/
 
+#print HasDerivAt.congr_of_eventuallyEq /-
 theorem HasDerivAt.congr_of_eventuallyEq (h : HasDerivAt f f' x) (hโ‚ : fโ‚ =แถ [๐“ x] f) :
     HasDerivAt fโ‚ f' x :=
   HasDerivAtFilter.congr_of_eventuallyEq h hโ‚ (mem_of_mem_nhds hโ‚ : _)
 #align has_deriv_at.congr_of_eventually_eq HasDerivAt.congr_of_eventuallyEq
+-/
 
+#print Filter.EventuallyEq.derivWithin_eq /-
 theorem Filter.EventuallyEq.derivWithin_eq (hL : fโ‚ =แถ [๐“[s] x] f) (hx : fโ‚ x = f x) :
     derivWithin fโ‚ s x = derivWithin f s x := by unfold derivWithin; rw [hL.fderiv_within_eq hx]
 #align filter.eventually_eq.deriv_within_eq Filter.EventuallyEq.derivWithin_eq
+-/
 
+#print derivWithin_congr /-
 theorem derivWithin_congr (hs : EqOn fโ‚ f s) (hx : fโ‚ x = f x) :
     derivWithin fโ‚ s x = derivWithin f s x := by unfold derivWithin; rw [fderivWithin_congr hs hx]
 #align deriv_within_congr derivWithin_congr
+-/
 
+#print Filter.EventuallyEq.deriv_eq /-
 theorem Filter.EventuallyEq.deriv_eq (hL : fโ‚ =แถ [๐“ x] f) : deriv fโ‚ x = deriv f x := by
   unfold deriv; rwa [Filter.EventuallyEq.fderiv_eq]
 #align filter.eventually_eq.deriv_eq Filter.EventuallyEq.deriv_eq
+-/
 
+#print Filter.EventuallyEq.deriv /-
 protected theorem Filter.EventuallyEq.deriv (h : fโ‚ =แถ [๐“ x] f) : deriv fโ‚ =แถ [๐“ x] deriv f :=
   h.eventuallyEq_nhds.mono fun x h => h.deriv_eq
 #align filter.eventually_eq.deriv Filter.EventuallyEq.deriv
+-/
 
 end congr
 
@@ -706,18 +814,24 @@ theorem HasDerivAtFilter.tendsto_nhds (hL : L โ‰ค ๐“ x) (h : HasDerivAtFilter
   h.tendsto_nhds hL
 #align has_deriv_at_filter.tendsto_nhds HasDerivAtFilter.tendsto_nhds
 
+#print HasDerivWithinAt.continuousWithinAt /-
 theorem HasDerivWithinAt.continuousWithinAt (h : HasDerivWithinAt f f' s x) :
     ContinuousWithinAt f s x :=
   HasDerivAtFilter.tendsto_nhds inf_le_left h
 #align has_deriv_within_at.continuous_within_at HasDerivWithinAt.continuousWithinAt
+-/
 
+#print HasDerivAt.continuousAt /-
 theorem HasDerivAt.continuousAt (h : HasDerivAt f f' x) : ContinuousAt f x :=
   HasDerivAtFilter.tendsto_nhds le_rfl h
 #align has_deriv_at.continuous_at HasDerivAt.continuousAt
+-/
 
+#print HasDerivAt.continuousOn /-
 protected theorem HasDerivAt.continuousOn {f f' : ๐•œ โ†’ F} (hderiv : โˆ€ x โˆˆ s, HasDerivAt f (f' x) x) :
     ContinuousOn f s := fun x hx => (hderiv x hx).ContinuousAt.ContinuousWithinAt
 #align has_deriv_at.continuous_on HasDerivAt.continuousOn
+-/
 
 end Continuous
 
Diff
@@ -230,11 +230,8 @@ alias hasDerivAt_iff_hasFDerivAt โ†” HasDerivAt.hasFDerivAt _
 #align has_deriv_at.has_fderiv_at HasDerivAt.hasFDerivAt
 
 theorem derivWithin_zero_of_not_differentiableWithinAt (h : ยฌDifferentiableWithinAt ๐•œ f s x) :
-    derivWithin f s x = 0 := by
-  unfold derivWithin
-  rw [fderivWithin_zero_of_not_differentiableWithinAt]
-  simp
-  assumption
+    derivWithin f s x = 0 := by unfold derivWithin;
+  rw [fderivWithin_zero_of_not_differentiableWithinAt]; simp; assumption
 #align deriv_within_zero_of_not_differentiable_within_at derivWithin_zero_of_not_differentiableWithinAt
 
 theorem differentiableWithinAt_of_derivWithin_ne_zero (h : derivWithin f s x โ‰  0) :
@@ -242,12 +239,8 @@ theorem differentiableWithinAt_of_derivWithin_ne_zero (h : derivWithin f s x โ‰ 
   not_imp_comm.1 derivWithin_zero_of_not_differentiableWithinAt h
 #align differentiable_within_at_of_deriv_within_ne_zero differentiableWithinAt_of_derivWithin_ne_zero
 
-theorem deriv_zero_of_not_differentiableAt (h : ยฌDifferentiableAt ๐•œ f x) : deriv f x = 0 :=
-  by
-  unfold deriv
-  rw [fderiv_zero_of_not_differentiableAt]
-  simp
-  assumption
+theorem deriv_zero_of_not_differentiableAt (h : ยฌDifferentiableAt ๐•œ f x) : deriv f x = 0 := by
+  unfold deriv; rw [fderiv_zero_of_not_differentiableAt]; simp; assumption
 #align deriv_zero_of_not_differentiable_at deriv_zero_of_not_differentiableAt
 
 theorem differentiableAt_of_deriv_ne_zero (h : deriv f x โ‰  0) : DifferentiableAt ๐•œ f x :=
@@ -482,9 +475,7 @@ theorem deriv_fderiv : smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) (deriv f x) = fderiv
 #align deriv_fderiv deriv_fderiv
 
 theorem DifferentiableAt.derivWithin (h : DifferentiableAt ๐•œ f x) (hxs : UniqueDiffWithinAt ๐•œ s x) :
-    derivWithin f s x = deriv f x := by
-  unfold derivWithin deriv
-  rw [h.fderiv_within hxs]
+    derivWithin f s x = deriv f x := by unfold derivWithin deriv; rw [h.fderiv_within hxs]
 #align differentiable_at.deriv_within DifferentiableAt.derivWithin
 
 theorem HasDerivWithinAt.deriv_eq_zero (hd : HasDerivWithinAt f 0 s x)
@@ -512,24 +503,16 @@ theorem derivWithin_congr_set (h : s =แถ [๐“ x] t) : derivWithin f s x = deriv
 #align deriv_within_congr_set derivWithin_congr_set
 
 @[simp]
-theorem derivWithin_univ : derivWithin f univ = deriv f :=
-  by
-  ext
-  unfold derivWithin deriv
+theorem derivWithin_univ : derivWithin f univ = deriv f := by ext; unfold derivWithin deriv;
   rw [fderivWithin_univ]
 #align deriv_within_univ derivWithin_univ
 
-theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = derivWithin f s x :=
-  by
-  unfold derivWithin
-  rw [fderivWithin_inter ht]
+theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = derivWithin f s x := by
+  unfold derivWithin; rw [fderivWithin_inter ht]
 #align deriv_within_inter derivWithin_inter
 
-theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x :=
-  by
-  unfold derivWithin
-  rw [fderivWithin_of_open hs hx]
-  rfl
+theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x := by
+  unfold derivWithin; rw [fderivWithin_of_open hs hx]; rfl
 #align deriv_within_of_open derivWithin_of_open
 
 theorem deriv_mem_iff {f : ๐•œ โ†’ F} {s : Set F} {x : ๐•œ} :
@@ -611,23 +594,15 @@ theorem HasDerivAt.congr_of_eventuallyEq (h : HasDerivAt f f' x) (hโ‚ : fโ‚ =
 #align has_deriv_at.congr_of_eventually_eq HasDerivAt.congr_of_eventuallyEq
 
 theorem Filter.EventuallyEq.derivWithin_eq (hL : fโ‚ =แถ [๐“[s] x] f) (hx : fโ‚ x = f x) :
-    derivWithin fโ‚ s x = derivWithin f s x :=
-  by
-  unfold derivWithin
-  rw [hL.fderiv_within_eq hx]
+    derivWithin fโ‚ s x = derivWithin f s x := by unfold derivWithin; rw [hL.fderiv_within_eq hx]
 #align filter.eventually_eq.deriv_within_eq Filter.EventuallyEq.derivWithin_eq
 
 theorem derivWithin_congr (hs : EqOn fโ‚ f s) (hx : fโ‚ x = f x) :
-    derivWithin fโ‚ s x = derivWithin f s x :=
-  by
-  unfold derivWithin
-  rw [fderivWithin_congr hs hx]
+    derivWithin fโ‚ s x = derivWithin f s x := by unfold derivWithin; rw [fderivWithin_congr hs hx]
 #align deriv_within_congr derivWithin_congr
 
-theorem Filter.EventuallyEq.deriv_eq (hL : fโ‚ =แถ [๐“ x] f) : deriv fโ‚ x = deriv f x :=
-  by
-  unfold deriv
-  rwa [Filter.EventuallyEq.fderiv_eq]
+theorem Filter.EventuallyEq.deriv_eq (hL : fโ‚ =แถ [๐“ x] f) : deriv fโ‚ x = deriv f x := by
+  unfold deriv; rwa [Filter.EventuallyEq.fderiv_eq]
 #align filter.eventually_eq.deriv_eq Filter.EventuallyEq.deriv_eq
 
 protected theorem Filter.EventuallyEq.deriv (h : fโ‚ =แถ [๐“ x] f) : deriv fโ‚ =แถ [๐“ x] deriv f :=

Changes in mathlib4

mathlib3
mathlib4
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -300,7 +300,7 @@ nonrec theorem HasDerivAtFilter.isBigO_sub_rev (hf : HasDerivAtFilter f f' x L)
     (fun x' => x' - x) =O[L] fun x' => f x' - f x :=
   suffices AntilipschitzWith โ€–f'โ€–โ‚Šโปยน (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') from hf.isBigO_sub_rev this
   AddMonoidHomClass.antilipschitz_of_bound (smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) f') fun x => by
-    simp [norm_smul, โ† div_eq_inv_mul, mul_div_cancel _ (mt norm_eq_zero.1 hf')]
+    simp [norm_smul, โ† div_eq_inv_mul, mul_div_cancel_rightโ‚€ _ (mt norm_eq_zero.1 hf')]
 set_option linter.uppercaseLean3 false in
 #align has_deriv_at_filter.is_O_sub_rev HasDerivAtFilter.isBigO_sub_rev
 
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
@@ -151,13 +151,9 @@ def deriv (f : ๐•œ โ†’ F) (x : ๐•œ) :=
 #align deriv deriv
 
 variable {f fโ‚€ fโ‚ g : ๐•œ โ†’ F}
-
 variable {f' fโ‚€' fโ‚' g' : F}
-
 variable {x : ๐•œ}
-
 variable {s t : Set ๐•œ}
-
 variable {L Lโ‚ Lโ‚‚ : Filter ๐•œ}
 
 /-- Expressing `HasFDerivAtFilter f f' x L` in terms of `HasDerivAtFilter` -/
chore(Analysis/NormedSpace): split up OperatorNorm.lean (#10990)

Split the 2300-line behemoth OperatorNorm.lean into 8 smaller files, of which the largest is 600 lines.

Diff
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Gabriel Ebner, Sรฉbastien Gouรซzel
 -/
 import Mathlib.Analysis.Calculus.FDeriv.Basic
+import Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace
 
 #align_import analysis.calculus.deriv.basic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
 
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -537,7 +537,7 @@ theorem derivWithin_of_isOpen (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x
 
 lemma deriv_eqOn {f' : ๐•œ โ†’ F} (hs : IsOpen s) (hf' : โˆ€ x โˆˆ s, HasDerivWithinAt f (f' x) s x) :
     s.EqOn (deriv f) f' := fun x hx โ†ฆ by
-  rw [โ† derivWithin_of_isOpen hs hx, (hf' _ hx).derivWithin $ hs.uniqueDiffWithinAt hx]
+  rw [โ† derivWithin_of_isOpen hs hx, (hf' _ hx).derivWithin <| hs.uniqueDiffWithinAt hx]
 
 theorem deriv_mem_iff {f : ๐•œ โ†’ F} {s : Set F} {x : ๐•œ} :
     deriv f x โˆˆ s โ†”
feat: Any derivative is equal to deriv (#9481)

stated using Set.EqOn

From LeanAPAP

Diff
@@ -535,6 +535,10 @@ theorem derivWithin_of_isOpen (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x
   derivWithin_of_mem_nhds (hs.mem_nhds hx)
 #align deriv_within_of_open derivWithin_of_isOpen
 
+lemma deriv_eqOn {f' : ๐•œ โ†’ F} (hs : IsOpen s) (hf' : โˆ€ x โˆˆ s, HasDerivWithinAt f (f' x) s x) :
+    s.EqOn (deriv f) f' := fun x hx โ†ฆ by
+  rw [โ† derivWithin_of_isOpen hs hx, (hf' _ hx).derivWithin $ hs.uniqueDiffWithinAt hx]
+
 theorem deriv_mem_iff {f : ๐•œ โ†’ F} {s : Set F} {x : ๐•œ} :
     deriv f x โˆˆ s โ†”
       DifferentiableAt ๐•œ f x โˆง deriv f x โˆˆ s โˆจ ยฌDifferentiableAt ๐•œ f x โˆง (0 : F) โˆˆ s :=
refactor(FDeriv): use structure (#8907)

This way we can easily change the definition so that it works for topological vector spaces without generalizing any of the theorems right away.

Diff
@@ -262,7 +262,7 @@ theorem UniqueDiffWithinAt.eq_deriv (s : Set ๐•œ) (H : UniqueDiffWithinAt ๐•œ
 
 theorem hasDerivAtFilter_iff_isLittleO :
     HasDerivAtFilter f f' x L โ†” (fun x' : ๐•œ => f x' - f x - (x' - x) โ€ข f') =o[L] fun x' => x' - x :=
-  Iff.rfl
+  hasFDerivAtFilter_iff_isLittleO ..
 #align has_deriv_at_filter_iff_is_o hasDerivAtFilter_iff_isLittleO
 
 theorem hasDerivAtFilter_iff_tendsto :
@@ -274,7 +274,7 @@ theorem hasDerivAtFilter_iff_tendsto :
 theorem hasDerivWithinAt_iff_isLittleO :
     HasDerivWithinAt f f' s x โ†”
       (fun x' : ๐•œ => f x' - f x - (x' - x) โ€ข f') =o[๐“[s] x] fun x' => x' - x :=
-  Iff.rfl
+  hasFDerivAtFilter_iff_isLittleO ..
 #align has_deriv_within_at_iff_is_o hasDerivWithinAt_iff_isLittleO
 
 theorem hasDerivWithinAt_iff_tendsto :
@@ -285,7 +285,7 @@ theorem hasDerivWithinAt_iff_tendsto :
 
 theorem hasDerivAt_iff_isLittleO :
     HasDerivAt f f' x โ†” (fun x' : ๐•œ => f x' - f x - (x' - x) โ€ข f') =o[๐“ x] fun x' => x' - x :=
-  Iff.rfl
+  hasFDerivAtFilter_iff_isLittleO ..
 #align has_deriv_at_iff_is_o hasDerivAt_iff_isLittleO
 
 theorem hasDerivAt_iff_tendsto :
feat: Add congr_deriv lemmas mirroring congr_fderiv (#9065)

Add convenience lemmas

  • HasStrictDerivAt.congr_deriv
  • HasDerivAt.congr_deriv
  • HasDerivWithinAt.congr_deriv

These mirror the already existing

  • HasStrictFDerivAt.congr_fderiv
  • HasFDerivAt.congr_fderiv
  • HasFDerivWithinAt.congr_fderiv
Diff
@@ -614,6 +614,17 @@ theorem Filter.EventuallyEq.hasDerivWithinAt_iff_of_mem (hโ‚ : fโ‚ =แถ [๐“[s
   โŸจfun h' โ†ฆ h'.congr_of_eventuallyEq_of_mem hโ‚.symm hx,
   fun h' โ†ฆ h'.congr_of_eventuallyEq_of_mem hโ‚ hxโŸฉ
 
+theorem HasStrictDerivAt.congr_deriv (h : HasStrictDerivAt f f' x) (h' : f' = g') :
+    HasStrictDerivAt f g' x :=
+  h.congr_fderiv <| congr_arg _ h'
+
+theorem HasDerivAt.congr_deriv (h : HasDerivAt f f' x) (h' : f' = g') : HasDerivAt f g' x :=
+  HasFDerivAt.congr_fderiv h <| congr_arg _ h'
+
+theorem HasDerivWithinAt.congr_deriv (h : HasDerivWithinAt f f' s x) (h' : f' = g') :
+    HasDerivWithinAt f g' s x :=
+  HasFDerivWithinAt.congr_fderiv h <| congr_arg _ h'
+
 theorem HasDerivAt.congr_of_eventuallyEq (h : HasDerivAt f f' x) (hโ‚ : fโ‚ =แถ [๐“ x] f) :
     HasDerivAt fโ‚ f' x :=
   HasDerivAtFilter.congr_of_eventuallyEq h hโ‚ (mem_of_mem_nhds hโ‚ : _)
chore: rename lemmas containing "of_open" to match the naming convention (#8229)

Mostly, this means replacing "of_open" by "of_isOpen". A few lemmas names were misleading and are corrected differently. Zulip discussion.

Diff
@@ -531,9 +531,9 @@ theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = deri
 theorem derivWithin_of_mem_nhds (h : s โˆˆ ๐“ x) : derivWithin f s x = deriv f x := by
   simp only [derivWithin, deriv, fderivWithin_of_mem_nhds h]
 
-theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x :=
+theorem derivWithin_of_isOpen (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x :=
   derivWithin_of_mem_nhds (hs.mem_nhds hx)
-#align deriv_within_of_open derivWithin_of_open
+#align deriv_within_of_open derivWithin_of_isOpen
 
 theorem deriv_mem_iff {f : ๐•œ โ†’ F} {s : Set F} {x : ๐•œ} :
     deriv f x โˆˆ s โ†”
feat: better junk value for fderivWithin at isolated points (#7117)

Currently, when x is isolated in the set s, then fderivWithin k f s x can be anything. We modify the definition by ensuring that it is equal to 0 in this case. This ensures that the range of derivWithin is always contained in the closure of the span of the range of f.

Diff
@@ -234,6 +234,12 @@ theorem derivWithin_zero_of_not_differentiableWithinAt (h : ยฌDifferentiableWith
   simp
 #align deriv_within_zero_of_not_differentiable_within_at derivWithin_zero_of_not_differentiableWithinAt
 
+theorem derivWithin_zero_of_isolated (h : ๐“[s \ {x}] x = โŠฅ) : derivWithin f s x = 0 := by
+  rw [derivWithin, fderivWithin_zero_of_isolated h, ContinuousLinearMap.zero_apply]
+
+theorem derivWithin_zero_of_nmem_closure (h : x โˆ‰ closure s) : derivWithin f s x = 0 := by
+  rw [derivWithin, fderivWithin_zero_of_nmem_closure h, ContinuousLinearMap.zero_apply]
+
 theorem differentiableWithinAt_of_derivWithin_ne_zero (h : derivWithin f s x โ‰  0) :
     DifferentiableWithinAt ๐•œ f s x :=
   not_imp_comm.1 derivWithin_zero_of_not_differentiableWithinAt h
chore: tidy various files (#7137)
Diff
@@ -74,7 +74,7 @@ by { simp, ring }
 
 The relationship between the derivative of a function and its definition from a standard
 undergraduate course as the limit of the slope `(f y - f x) / (y - x)` as `y` tends to `๐“[โ‰ ] x`
-is developped in the file `Slope.lean`.
+is developed in the file `Slope.lean`.
 
 ## Implementation notes
 
feat: cleanup API around differentiable functions (#7004)

First calculus prerequisites for Rademacher theorem in #7003.

Add a few lemmas that were available for FDeriv but not for Deriv, weaken assumptions here and there.

Diff
@@ -72,6 +72,10 @@ example (x : โ„) : deriv (fun x โ†ฆ cos (sin x) * exp x) x = (cos(sin(x))-sin(s
 by { simp, ring }
 ```
 
+The relationship between the derivative of a function and its definition from a standard
+undergraduate course as the limit of the slope `(f y - f x) / (y - x)` as `y` tends to `๐“[โ‰ ] x`
+is developped in the file `Slope.lean`.
+
 ## Implementation notes
 
 Most of the theorems are direct restatements of the corresponding theorems
@@ -86,7 +90,7 @@ universe u v w
 
 noncomputable section
 
-open scoped Classical Topology BigOperators Filter ENNReal
+open scoped Classical Topology BigOperators Filter ENNReal NNReal
 
 open Filter Asymptotics Set
 
@@ -463,6 +467,9 @@ theorem derivWithin_fderivWithin :
     smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) (derivWithin f s x) = fderivWithin ๐•œ f s x := by simp [derivWithin]
 #align deriv_within_fderiv_within derivWithin_fderivWithin
 
+theorem norm_derivWithin_eq_norm_fderivWithin : โ€–derivWithin f s xโ€– = โ€–fderivWithin ๐•œ f s xโ€– := by
+  simp [โ† derivWithin_fderivWithin]
+
 theorem fderiv_deriv : (fderiv ๐•œ f x : ๐•œ โ†’ F) 1 = deriv f x :=
   rfl
 #align fderiv_deriv fderiv_deriv
@@ -470,6 +477,9 @@ theorem fderiv_deriv : (fderiv ๐•œ f x : ๐•œ โ†’ F) 1 = deriv f x :=
 theorem deriv_fderiv : smulRight (1 : ๐•œ โ†’L[๐•œ] ๐•œ) (deriv f x) = fderiv ๐•œ f x := by simp [deriv]
 #align deriv_fderiv deriv_fderiv
 
+theorem norm_deriv_eq_norm_fderiv : โ€–deriv f xโ€– = โ€–fderiv ๐•œ f xโ€– := by
+  simp [โ† deriv_fderiv]
+
 theorem DifferentiableAt.derivWithin (h : DifferentiableAt ๐•œ f x) (hxs : UniqueDiffWithinAt ๐•œ s x) :
     derivWithin f s x = deriv f x := by
   unfold derivWithin deriv
@@ -512,10 +522,11 @@ theorem derivWithin_inter (ht : t โˆˆ ๐“ x) : derivWithin f (s โˆฉ t) x = deri
   rw [fderivWithin_inter ht]
 #align deriv_within_inter derivWithin_inter
 
-theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x := by
-  unfold derivWithin
-  rw [fderivWithin_of_open hs hx]
-  rfl
+theorem derivWithin_of_mem_nhds (h : s โˆˆ ๐“ x) : derivWithin f s x = deriv f x := by
+  simp only [derivWithin, deriv, fderivWithin_of_mem_nhds h]
+
+theorem derivWithin_of_open (hs : IsOpen s) (hx : x โˆˆ s) : derivWithin f s x = deriv f x :=
+  derivWithin_of_mem_nhds (hs.mem_nhds hx)
 #align deriv_within_of_open derivWithin_of_open
 
 theorem deriv_mem_iff {f : ๐•œ โ†’ F} {s : Set F} {x : ๐•œ} :
@@ -583,16 +594,29 @@ theorem HasDerivWithinAt.congr_of_eventuallyEq (h : HasDerivWithinAt f f' s x)
   HasDerivAtFilter.congr_of_eventuallyEq h hโ‚ hx
 #align has_deriv_within_at.congr_of_eventually_eq HasDerivWithinAt.congr_of_eventuallyEq
 
+theorem Filter.EventuallyEq.hasDerivWithinAt_iff (hโ‚ : fโ‚ =แถ [๐“[s] x] f) (hx : fโ‚ x = f x) :
+    HasDerivWithinAt fโ‚ f' s x โ†” HasDerivWithinAt f f' s x :=
+  โŸจfun h' โ†ฆ h'.congr_of_eventuallyEq hโ‚.symm hx.symm, fun h' โ†ฆ h'.congr_of_eventuallyEq hโ‚ hxโŸฉ
+
 theorem HasDerivWithinAt.congr_of_eventuallyEq_of_mem (h : HasDerivWithinAt f f' s x)
     (hโ‚ : fโ‚ =แถ [๐“[s] x] f) (hx : x โˆˆ s) : HasDerivWithinAt fโ‚ f' s x :=
   h.congr_of_eventuallyEq hโ‚ (hโ‚.eq_of_nhdsWithin hx)
 #align has_deriv_within_at.congr_of_eventually_eq_of_mem HasDerivWithinAt.congr_of_eventuallyEq_of_mem
 
+theorem Filter.EventuallyEq.hasDerivWithinAt_iff_of_mem (hโ‚ : fโ‚ =แถ [๐“[s] x] f) (hx : x โˆˆ s) :
+    HasDerivWithinAt fโ‚ f' s x โ†” HasDerivWithinAt f f' s x :=
+  โŸจfun h' โ†ฆ h'.congr_of_eventuallyEq_of_mem hโ‚.symm hx,
+  fun h' โ†ฆ h'.congr_of_eventuallyEq_of_mem hโ‚ hxโŸฉ
+
 theorem HasDerivAt.congr_of_eventuallyEq (h : HasDerivAt f f' x) (hโ‚ : fโ‚ =แถ [๐“ x] f) :
     HasDerivAt fโ‚ f' x :=
   HasDerivAtFilter.congr_of_eventuallyEq h hโ‚ (mem_of_mem_nhds hโ‚ : _)
 #align has_deriv_at.congr_of_eventually_eq HasDerivAt.congr_of_eventuallyEq
 
+theorem Filter.EventuallyEq.hasDerivAt_iff (h : fโ‚€ =แถ [๐“ x] fโ‚) :
+    HasDerivAt fโ‚€ f' x โ†” HasDerivAt fโ‚ f' x :=
+  โŸจfun h' โ†ฆ h'.congr_of_eventuallyEq h.symm, fun h' โ†ฆ h'.congr_of_eventuallyEq hโŸฉ
+
 theorem Filter.EventuallyEq.derivWithin_eq (hs : fโ‚ =แถ [๐“[s] x] f) (hx : fโ‚ x = f x) :
     derivWithin fโ‚ s x = derivWithin f s x := by
   unfold derivWithin
@@ -722,3 +746,45 @@ protected theorem HasDerivAt.continuousOn {f f' : ๐•œ โ†’ F} (hderiv : โˆ€ x 
 #align has_deriv_at.continuous_on HasDerivAt.continuousOn
 
 end Continuous
+
+/-- Converse to the mean value inequality: if `f` is differentiable at `xโ‚€` and `C`-lipschitz
+on a neighborhood of `xโ‚€` then its derivative at `xโ‚€` has norm bounded by `C`. This version
+only assumes that `โ€–f x - f xโ‚€โ€– โ‰ค C * โ€–x - xโ‚€โ€–` in a neighborhood of `x`. -/
+theorem HasDerivAt.le_of_lip' {f : ๐•œ โ†’ F} {f' : F} {xโ‚€ : ๐•œ} (hf : HasDerivAt f f' xโ‚€)
+    {C : โ„} (hCโ‚€ : 0 โ‰ค C) (hlip : โˆ€แถ  x in ๐“ xโ‚€, โ€–f x - f xโ‚€โ€– โ‰ค C * โ€–x - xโ‚€โ€–) :
+    โ€–f'โ€– โ‰ค C := by
+  simpa using HasFDerivAt.le_of_lip' hf.hasFDerivAt hCโ‚€ hlip
+
+/-- Converse to the mean value inequality: if `f` is differentiable at `xโ‚€` and `C`-lipschitz
+on a neighborhood of `xโ‚€` then its derivative at `xโ‚€` has norm bounded by `C`. -/
+theorem HasDerivAt.le_of_lipschitzOn {f : ๐•œ โ†’ F} {f' : F} {xโ‚€ : ๐•œ} (hf : HasDerivAt f f' xโ‚€)
+    {s : Set ๐•œ} (hs : s โˆˆ ๐“ xโ‚€) {C : โ„โ‰ฅ0} (hlip : LipschitzOnWith C f s) : โ€–f'โ€– โ‰ค C := by
+  simpa using HasFDerivAt.le_of_lipschitzOn hf.hasFDerivAt hs hlip
+
+/-- Converse to the mean value inequality: if `f` is differentiable at `xโ‚€` and `C`-lipschitz
+then its derivative at `xโ‚€` has norm bounded by `C`. -/
+theorem HasDerivAt.le_of_lipschitz {f : ๐•œ โ†’ F} {f' : F} {xโ‚€ : ๐•œ} (hf : HasDerivAt f f' xโ‚€)
+    {C : โ„โ‰ฅ0} (hlip : LipschitzWith C f) : โ€–f'โ€– โ‰ค C := by
+  simpa using HasFDerivAt.le_of_lipschitz hf.hasFDerivAt hlip
+
+/-- Converse to the mean value inequality: if `f` is `C`-lipschitz
+on a neighborhood of `xโ‚€` then its derivative at `xโ‚€` has norm bounded by `C`. This version
+only assumes that `โ€–f x - f xโ‚€โ€– โ‰ค C * โ€–x - xโ‚€โ€–` in a neighborhood of `x`. -/
+theorem norm_deriv_le_of_lip' {f : ๐•œ โ†’ F} {xโ‚€ : ๐•œ}
+    {C : โ„} (hCโ‚€ : 0 โ‰ค C) (hlip : โˆ€แถ  x in ๐“ xโ‚€, โ€–f x - f xโ‚€โ€– โ‰ค C * โ€–x - xโ‚€โ€–) :
+    โ€–deriv f xโ‚€โ€– โ‰ค C := by
+  simpa [norm_deriv_eq_norm_fderiv] using norm_fderiv_le_of_lip' ๐•œ hCโ‚€ hlip
+
+/-- Converse to the mean value inequality: if `f` is `C`-lipschitz
+on a neighborhood of `xโ‚€` then its derivative at `xโ‚€` has norm bounded by `C`.
+Version using `deriv`. -/
+theorem norm_deriv_le_of_lipschitzOn {f : ๐•œ โ†’ F} {xโ‚€ : ๐•œ} {s : Set ๐•œ} (hs : s โˆˆ ๐“ xโ‚€)
+    {C : โ„โ‰ฅ0} (hlip : LipschitzOnWith C f s) : โ€–deriv f xโ‚€โ€– โ‰ค C := by
+  simpa [norm_deriv_eq_norm_fderiv] using norm_fderiv_le_of_lipschitzOn ๐•œ hs hlip
+
+/-- Converse to the mean value inequality: if `f` is `C`-lipschitz then
+its derivative at `xโ‚€` has norm bounded by `C`.
+Version using `deriv`. -/
+theorem norm_deriv_le_of_lipschitz {f : ๐•œ โ†’ F} {xโ‚€ : ๐•œ}
+    {C : โ„โ‰ฅ0} (hlip : LipschitzWith C f) : โ€–deriv f xโ‚€โ€– โ‰ค C := by
+  simpa [norm_deriv_eq_norm_fderiv] using norm_fderiv_le_of_lipschitz ๐•œ hlip
chore: remove duplicate lemma HasFDerivWithinAt.nhdsWithin (#6773)

This is a perfect duplicate of HasFDerivWithinAt.mono_of_mem.

Same thing with Deriv instead of FDeriv.

Diff
@@ -368,6 +368,7 @@ theorem HasDerivWithinAt.mono_of_mem (h : HasDerivWithinAt f f' t x) (hst : t 
     HasDerivWithinAt f f' s x :=
   HasFDerivWithinAt.mono_of_mem h hst
 #align has_deriv_within_at.mono_of_mem HasDerivWithinAt.mono_of_mem
+#align has_deriv_within_at.nhds_within HasDerivWithinAt.mono_of_mem
 
 theorem HasDerivAt.hasDerivAtFilter (h : HasDerivAt f f' x) (hL : L โ‰ค ๐“ x) :
     HasDerivAtFilter f f' x L :=
@@ -411,11 +412,6 @@ theorem HasDerivWithinAt.union (hs : HasDerivWithinAt f f' s x) (ht : HasDerivWi
   hs.hasFDerivWithinAt.union ht.hasFDerivWithinAt
 #align has_deriv_within_at.union HasDerivWithinAt.union
 
-theorem HasDerivWithinAt.nhdsWithin (h : HasDerivWithinAt f f' s x) (ht : s โˆˆ ๐“[t] x) :
-    HasDerivWithinAt f f' t x :=
-  (hasDerivWithinAt_inter' ht).1 (h.mono (inter_subset_right _ _))
-#align has_deriv_within_at.nhds_within HasDerivWithinAt.nhdsWithin
-
 theorem HasDerivWithinAt.hasDerivAt (h : HasDerivWithinAt f f' s x) (hs : s โˆˆ ๐“ x) :
     HasDerivAt f f' x :=
   HasFDerivWithinAt.hasFDerivAt h hs
feat: patch for new alias command (#6172)
Diff
@@ -211,7 +211,7 @@ theorem hasStrictDerivAt_iff_hasStrictFDerivAt :
   Iff.rfl
 #align has_strict_deriv_at_iff_has_strict_fderiv_at hasStrictDerivAt_iff_hasStrictFDerivAt
 
-alias hasStrictDerivAt_iff_hasStrictFDerivAt โ†” HasStrictDerivAt.hasStrictFDerivAt _
+alias โŸจHasStrictDerivAt.hasStrictFDerivAt, _โŸฉ := hasStrictDerivAt_iff_hasStrictFDerivAt
 #align has_strict_deriv_at.has_strict_fderiv_at HasStrictDerivAt.hasStrictFDerivAt
 
 /-- Expressing `HasDerivAt f f' x` in terms of `HasFDerivAt` -/
@@ -220,7 +220,7 @@ theorem hasDerivAt_iff_hasFDerivAt {f' : F} :
   Iff.rfl
 #align has_deriv_at_iff_has_fderiv_at hasDerivAt_iff_hasFDerivAt
 
-alias hasDerivAt_iff_hasFDerivAt โ†” HasDerivAt.hasFDerivAt _
+alias โŸจHasDerivAt.hasFDerivAt, _โŸฉ := hasDerivAt_iff_hasFDerivAt
 #align has_deriv_at.has_fderiv_at HasDerivAt.hasFDerivAt
 
 theorem derivWithin_zero_of_not_differentiableWithinAt (h : ยฌDifferentiableWithinAt ๐•œ f s x) :
@@ -311,7 +311,7 @@ theorem hasDerivWithinAt_congr_set {s t : Set ๐•œ} (h : s =แถ [๐“ x] t) :
   hasFDerivWithinAt_congr_set h
 #align has_deriv_within_at_congr_set hasDerivWithinAt_congr_set
 
-alias hasDerivWithinAt_congr_set โ†” HasDerivWithinAt.congr_set _
+alias โŸจHasDerivWithinAt.congr_set, _โŸฉ := hasDerivWithinAt_congr_set
 #align has_deriv_within_at.congr_set HasDerivWithinAt.congr_set
 
 @[simp]
@@ -326,7 +326,7 @@ theorem hasDerivWithinAt_Ioi_iff_Ici [PartialOrder ๐•œ] :
   rw [โ† Ici_diff_left, hasDerivWithinAt_diff_singleton]
 #align has_deriv_within_at_Ioi_iff_Ici hasDerivWithinAt_Ioi_iff_Ici
 
-alias hasDerivWithinAt_Ioi_iff_Ici โ†” HasDerivWithinAt.Ici_of_Ioi HasDerivWithinAt.Ioi_of_Ici
+alias โŸจHasDerivWithinAt.Ici_of_Ioi, HasDerivWithinAt.Ioi_of_IciโŸฉ := hasDerivWithinAt_Ioi_iff_Ici
 #align has_deriv_within_at.Ici_of_Ioi HasDerivWithinAt.Ici_of_Ioi
 #align has_deriv_within_at.Ioi_of_Ici HasDerivWithinAt.Ioi_of_Ici
 
@@ -336,7 +336,7 @@ theorem hasDerivWithinAt_Iio_iff_Iic [PartialOrder ๐•œ] :
   rw [โ† Iic_diff_right, hasDerivWithinAt_diff_singleton]
 #align has_deriv_within_at_Iio_iff_Iic hasDerivWithinAt_Iio_iff_Iic
 
-alias hasDerivWithinAt_Iio_iff_Iic โ†” HasDerivWithinAt.Iic_of_Iio HasDerivWithinAt.Iio_of_Iic
+alias โŸจHasDerivWithinAt.Iic_of_Iio, HasDerivWithinAt.Iio_of_IicโŸฉ := hasDerivWithinAt_Iio_iff_Iic
 #align has_deriv_within_at.Iic_of_Iio HasDerivWithinAt.Iic_of_Iio
 #align has_deriv_within_at.Iio_of_Iic HasDerivWithinAt.Iio_of_Iic
 
@@ -345,7 +345,7 @@ theorem HasDerivWithinAt.Ioi_iff_Ioo [LinearOrder ๐•œ] [OrderClosedTopology 
   hasFDerivWithinAt_inter <| Iio_mem_nhds h
 #align has_deriv_within_at.Ioi_iff_Ioo HasDerivWithinAt.Ioi_iff_Ioo
 
-alias HasDerivWithinAt.Ioi_iff_Ioo โ†” HasDerivWithinAt.Ioi_of_Ioo HasDerivWithinAt.Ioo_of_Ioi
+alias โŸจHasDerivWithinAt.Ioi_of_Ioo, HasDerivWithinAt.Ioo_of_IoiโŸฉ := HasDerivWithinAt.Ioi_iff_Ioo
 #align has_deriv_within_at.Ioi_of_Ioo HasDerivWithinAt.Ioi_of_Ioo
 #align has_deriv_within_at.Ioo_of_Ioi HasDerivWithinAt.Ioo_of_Ioi
 
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
@@ -543,7 +543,7 @@ theorem differentiableWithinAt_Ioi_iff_Ici [PartialOrder ๐•œ] :
 #align differentiable_within_at_Ioi_iff_Ici differentiableWithinAt_Ioi_iff_Ici
 
 -- Golfed while splitting the file
-theorem derivWithin_Ioi_eq_Ici {E : Type _} [NormedAddCommGroup E] [NormedSpace โ„ E] (f : โ„ โ†’ E)
+theorem derivWithin_Ioi_eq_Ici {E : Type*} [NormedAddCommGroup E] [NormedSpace โ„ E] (f : โ„ โ†’ E)
     (x : โ„) : derivWithin f (Ioi x) x = derivWithin f (Ici x) x := by
   by_cases H : DifferentiableWithinAt โ„ f (Ioi x) x
   ยท have A := H.hasDerivWithinAt.Ici_of_Ioi
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,14 +2,11 @@
 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
-
-! This file was ported from Lean 3 source module analysis.calculus.deriv.basic
-! 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.FDeriv.Basic
 
+#align_import analysis.calculus.deriv.basic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
 /-!
 
 # One-dimensional derivatives
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
@@ -54,7 +54,7 @@ We also show the existence and compute the derivatives of:
   - sum of finitely many functions (in `Add.lean`)
   - negation (in `Add.lean`)
   - subtraction (in `Add.lean`)
-  - star  (in `Star.lean`)
+  - star (in `Star.lean`)
   - multiplication of two functions in `๐•œ โ†’ ๐•œ` (in `Mul.lean`)
   - multiplication of a function in `๐•œ โ†’ ๐•œ` and of a function in `๐•œ โ†’ E` (in `Mul.lean`)
   - powers of a function (in `Pow.lean` and `ZPow.lean`)
chore: convert lambda in docs to fun (#5045)

Found with git grep -n "ฮป [a-zA-Z_ ]*,"

Diff
@@ -71,7 +71,7 @@ and they more frequently lead to the desired result.
 
 We set up the simplifier so that it can compute the derivative of simple functions. For instance,
 ```lean
-example (x : โ„) : deriv (ฮป x, cos (sin x) * exp x) x = (cos(sin(x))-sin(sin(x))*cos(x))*exp(x) :=
+example (x : โ„) : deriv (fun x โ†ฆ cos (sin x) * exp x) x = (cos(sin(x))-sin(sin(x))*cos(x))*exp(x) :=
 by { simp, ring }
 ```
 
chore: tidy various files (#4854)
Diff
@@ -229,9 +229,8 @@ alias hasDerivAt_iff_hasFDerivAt โ†” HasDerivAt.hasFDerivAt _
 theorem derivWithin_zero_of_not_differentiableWithinAt (h : ยฌDifferentiableWithinAt ๐•œ f s x) :
     derivWithin f s x = 0 := by
   unfold derivWithin
-  rw [fderivWithin_zero_of_not_differentiableWithinAt]
+  rw [fderivWithin_zero_of_not_differentiableWithinAt h]
   simp
-  assumption
 #align deriv_within_zero_of_not_differentiable_within_at derivWithin_zero_of_not_differentiableWithinAt
 
 theorem differentiableWithinAt_of_derivWithin_ne_zero (h : derivWithin f s x โ‰  0) :
@@ -241,9 +240,8 @@ theorem differentiableWithinAt_of_derivWithin_ne_zero (h : derivWithin f s x โ‰ 
 
 theorem deriv_zero_of_not_differentiableAt (h : ยฌDifferentiableAt ๐•œ f x) : deriv f x = 0 := by
   unfold deriv
-  rw [fderiv_zero_of_not_differentiableAt]
+  rw [fderiv_zero_of_not_differentiableAt h]
   simp
-  assumption
 #align deriv_zero_of_not_differentiable_at deriv_zero_of_not_differentiableAt
 
 theorem differentiableAt_of_deriv_ne_zero (h : deriv f x โ‰  0) : DifferentiableAt ๐•œ f x :=
@@ -731,4 +729,3 @@ protected theorem HasDerivAt.continuousOn {f f' : ๐•œ โ†’ F} (hderiv : โˆ€ x 
 #align has_deriv_at.continuous_on HasDerivAt.continuousOn
 
 end Continuous
-
feat: port Analysis.Calculus.Deriv.Basic (#4434)

Dependencies 10 + 673

674 files ported (98.5%)
300517 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