analysis.calculus.cont_diff_def ⟷ Mathlib.Analysis.Calculus.ContDiff.Defs

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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -1803,7 +1803,7 @@ theorem contDiffAt_one_iff :
   by
   simp_rw [show (1 : β„•βˆž) = (0 + 1 : β„•) from (zero_add 1).symm, contDiffAt_succ_iff_hasFDerivAt,
     show ((0 : β„•) : β„•βˆž) = 0 from rfl, contDiffAt_zero,
-    exists_mem_and_iff antitone_bforall antitone_continuousOn, and_comm']
+    exists_mem_and_iff antitone_bforall antitone_continuousOn, and_comm]
 #align cont_diff_at_one_iff contDiffAt_one_iff
 -/
 
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 -/
-import Analysis.Calculus.Fderiv.Add
-import Analysis.Calculus.Fderiv.Mul
-import Analysis.Calculus.Fderiv.Equiv
-import Analysis.Calculus.Fderiv.RestrictScalars
+import Analysis.Calculus.FDeriv.Add
+import Analysis.Calculus.FDeriv.Mul
+import Analysis.Calculus.FDeriv.Equiv
+import Analysis.Calculus.FDeriv.RestrictScalars
 import Analysis.Calculus.FormalMultilinearSeries
 
 #align_import analysis.calculus.cont_diff_def from "leanprover-community/mathlib"@"2ebc1d6c2fed9f54c95bbc3998eaa5570527129a"
@@ -1192,10 +1192,10 @@ theorem contDiffWithinAt_zero (hx : x ∈ s) :
 #align cont_diff_within_at_zero contDiffWithinAt_zero
 -/
 
-#print HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn /-
+#print HasFTaylorSeriesUpToOn.eq_iteratedFDerivWithin_of_uniqueDiffOn /-
 /-- On a set with unique differentiability, any choice of iterated differential has to coincide
 with the one we have chosen in `iterated_fderiv_within π•œ m f s`. -/
-theorem HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
+theorem HasFTaylorSeriesUpToOn.eq_iteratedFDerivWithin_of_uniqueDiffOn
     (h : HasFTaylorSeriesUpToOn n f p s) {m : β„•} (hmn : (m : β„•βˆž) ≀ n) (hs : UniqueDiffOn π•œ s)
     (hx : x ∈ s) : p x m = iteratedFDerivWithin π•œ m f s x :=
   by
@@ -1209,7 +1209,7 @@ theorem HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
         (IH (le_of_lt A) hx).symm
     rw [iteratedFDerivWithin_succ_eq_comp_left, Function.comp_apply, this.fderiv_within (hs x hx)]
     exact (ContinuousMultilinearMap.uncurry_curryLeft _).symm
-#align has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
+#align has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on HasFTaylorSeriesUpToOn.eq_iteratedFDerivWithin_of_uniqueDiffOn
 -/
 
 #print ContDiffOn.ftaylorSeriesWithin /-
@@ -1231,7 +1231,7 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
       by
       change p x m.succ = iteratedFDerivWithin π•œ m.succ f s x
       rw [← iteratedFDerivWithin_inter_open o_open xo]
-      exact (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hx, xo⟩
+      exact (Hp.mono ho).eq_iteratedFDerivWithin_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hx, xo⟩
     rw [← this, ← hasFDerivWithinAt_inter (IsOpen.mem_nhds o_open xo)]
     have A : βˆ€ y ∈ s ∩ o, p y m = ftaylorSeriesWithin π•œ f s y m :=
       by
@@ -1239,7 +1239,7 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
       change p y m = iteratedFDerivWithin π•œ m f s y
       rw [← iteratedFDerivWithin_inter_open o_open yo]
       exact
-        (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn (WithTop.coe_le_coe.2 (Nat.le_succ m))
+        (Hp.mono ho).eq_iteratedFDerivWithin_of_uniqueDiffOn (WithTop.coe_le_coe.2 (Nat.le_succ m))
           (hs.inter o_open) ⟨hy, yo⟩
     exact
       ((Hp.mono ho).fderivWithin m (WithTop.coe_lt_coe.2 (lt_add_one m)) x ⟨hx, xo⟩).congr
@@ -1257,7 +1257,7 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
       rintro y ⟨hy, yo⟩
       change p y m = iteratedFDerivWithin π•œ m f s y
       rw [← iteratedFDerivWithin_inter_open o_open yo]
-      exact (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hy, yo⟩
+      exact (Hp.mono ho).eq_iteratedFDerivWithin_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hy, yo⟩
     exact ((Hp.mono ho).cont m le_rfl).congr fun y hy => (A y hy).symm
 #align cont_diff_on.ftaylor_series_within ContDiffOn.ftaylorSeriesWithin
 -/
Diff
@@ -235,7 +235,7 @@ theorem HasFTaylorSeriesUpToOn.continuousOn (h : HasFTaylorSeriesUpToOn n f p s)
     ContinuousOn f s :=
   by
   have := (h.cont 0 bot_le).congr fun x hx => (h.zero_eq' hx).symm
-  rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this 
+  rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this
 #align has_ftaylor_series_up_to_on.continuous_on HasFTaylorSeriesUpToOn.continuousOn
 -/
 
@@ -426,7 +426,7 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ)
             ((p x).shift m.succ).curryLeft s x :=
           Htaylor.fderiv_within _ A x hx
-        rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff'] at this 
+        rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff'] at this
         convert this
         ext y v
         change
@@ -443,7 +443,7 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
           ContinuousOn
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ) s :=
           Htaylor.cont _ A
-        rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this 
+        rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this
 #align has_ftaylor_series_up_to_on_succ_iff_right hasFTaylorSeriesUpToOn_succ_iff_right
 -/
 
@@ -503,7 +503,7 @@ theorem ContDiffWithinAt.continuousWithinAt (h : ContDiffWithinAt π•œ n f s x)
     ContinuousWithinAt f s x :=
   by
   rcases h 0 bot_le with ⟨u, hu, p, H⟩
-  rw [mem_nhdsWithin_insert] at hu 
+  rw [mem_nhdsWithin_insert] at hu
   exact (H.continuous_on.continuous_within_at hu.1).mono_of_mem hu.2
 #align cont_diff_within_at.continuous_within_at ContDiffWithinAt.continuousWithinAt
 -/
@@ -629,7 +629,7 @@ theorem ContDiffWithinAt.differentiable_within_at' (h : ContDiffWithinAt π•œ n
   by
   rcases h 1 hn with ⟨u, hu, p, H⟩
   rcases mem_nhdsWithin.1 hu with ⟨t, t_open, xt, tu⟩
-  rw [inter_comm] at tu 
+  rw [inter_comm] at tu
   have := ((H.mono tu).DifferentiableOn le_rfl) x ⟨mem_insert x s, xt⟩
   exact (differentiableWithinAt_inter (IsOpen.mem_nhds t_open xt)).1 this
 #align cont_diff_within_at.differentiable_within_at' ContDiffWithinAt.differentiable_within_at'
@@ -661,7 +661,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
     Β· convert self_mem_nhdsWithin
       have : x ∈ insert x s := by simp
       exact insert_eq_of_mem (mem_of_mem_nhdsWithin this hu)
-    Β· rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp 
+    Β· rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp
       exact Hp.2.2.of_le hm
   · rintro ⟨u, hu, f', f'_eq_deriv, Hf'⟩
     rw [contDiffWithinAt_nat]
@@ -711,7 +711,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt' {n : β„•} :
   refine' ⟨fun hf => _, _⟩
   · obtain ⟨u, hu, f', huf', hf'⟩ := cont_diff_within_at_succ_iff_has_fderiv_within_at.mp hf
     obtain ⟨w, hw, hxw, hwu⟩ := mem_nhds_within.mp hu
-    rw [inter_comm] at hwu 
+    rw [inter_comm] at hwu
     refine'
       ⟨insert x s ∩ w, inter_mem_nhdsWithin _ (hw.mem_nhds hxw), inter_subset_left _ _, f',
         fun y hy => _, _⟩
@@ -769,7 +769,7 @@ theorem ContDiffWithinAt.contDiffOn' {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : Co
   by
   rcases h m hm with ⟨t, ht, p, hp⟩
   rcases mem_nhdsWithin.1 ht with ⟨u, huo, hxu, hut⟩
-  rw [inter_comm] at hut 
+  rw [inter_comm] at hut
   exact ⟨u, huo, hxu, (hp.mono hut).ContDiffOn⟩
 #align cont_diff_within_at.cont_diff_on' ContDiffWithinAt.contDiffOn'
 -/
@@ -897,7 +897,7 @@ theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
     refine'
       ⟨u, hu, fun y => (continuousMultilinearCurryFin1 π•œ E F) (p y 1), fun y hy =>
         Hp.has_fderiv_within_at (WithTop.coe_le_coe.2 (Nat.le_add_left 1 n)) hy, _⟩
-    rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp 
+    rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp
     intro z hz m hm
     refine' ⟨u, _, fun x : E => (p x).shift, Hp.2.2.of_le hm⟩
     convert self_mem_nhdsWithin
@@ -1183,7 +1183,7 @@ theorem contDiffWithinAt_zero (hx : x ∈ s) :
     obtain ⟨u, H, p, hp⟩ := h 0 (by norm_num)
     refine' ⟨u, _, _⟩
     Β· simpa [hx] using H
-    Β· simp only [WithTop.coe_zero, hasFTaylorSeriesUpToOn_zero_iff] at hp 
+    Β· simp only [WithTop.coe_zero, hasFTaylorSeriesUpToOn_zero_iff] at hp
       exact hp.1.mono (inter_subset_right s u)
   · rintro ⟨u, H, hu⟩
     rw [← contDiffWithinAt_inter' H]
@@ -1224,9 +1224,9 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
       iteratedFDerivWithin_zero_apply]
   Β· intro m hm x hx
     rcases(h x hx) m.succ (ENat.add_one_le_of_lt hm) with ⟨u, hu, p, Hp⟩
-    rw [insert_eq_of_mem hx] at hu 
+    rw [insert_eq_of_mem hx] at hu
     rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
-    rw [inter_comm] at ho 
+    rw [inter_comm] at ho
     have : p x m.succ = ftaylorSeriesWithin π•œ f s x m.succ :=
       by
       change p x m.succ = iteratedFDerivWithin π•œ m.succ f s x
@@ -1249,8 +1249,8 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
     intro x hx
     rcases h x hx m hm with ⟨u, hu, p, Hp⟩
     rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
-    rw [insert_eq_of_mem hx] at ho 
-    rw [inter_comm] at ho 
+    rw [insert_eq_of_mem hx] at ho
+    rw [inter_comm] at ho
     refine' ⟨o, o_open, xo, _⟩
     have A : βˆ€ y ∈ s ∩ o, p y m = ftaylorSeriesWithin π•œ f s y m :=
       by
@@ -1327,7 +1327,7 @@ theorem ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin {m : β„•}
   have C : DifferentiableWithinAt π•œ (iteratedFDerivWithin π•œ m f t) t x :=
     hu.differentiable_on_iterated_fderiv_within (Nat.cast_lt.2 m.lt_succ_self) (hs.inter uo) x
       ⟨mem_insert _ _, xu⟩
-  rw [differentiableWithinAt_congr_set' _ A] at C 
+  rw [differentiableWithinAt_congr_set' _ A] at C
   exact C.congr_of_eventually_eq (B.filter_mono inf_le_left) B.self_of_nhds
 #align cont_diff_within_at.differentiable_within_at_iterated_fderiv_within ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin
 -/
@@ -1366,16 +1366,16 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
   refine' ⟨H.differentiable_on (WithTop.coe_le_coe.2 (Nat.le_add_left 1 n)), fun x hx => _⟩
   rcases contDiffWithinAt_succ_iff_hasFDerivWithinAt.1 (H x hx) with ⟨u, hu, f', hff', hf'⟩
   rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
-  rw [inter_comm, insert_eq_of_mem hx] at ho 
+  rw [inter_comm, insert_eq_of_mem hx] at ho
   have := hf'.mono ho
-  rw [contDiffWithinAt_inter' (mem_nhdsWithin_of_mem_nhds (IsOpen.mem_nhds o_open xo))] at this 
+  rw [contDiffWithinAt_inter' (mem_nhdsWithin_of_mem_nhds (IsOpen.mem_nhds o_open xo))] at this
   apply this.congr_of_eventually_eq' _ hx
   have : o ∩ s ∈ 𝓝[s] x := mem_nhdsWithin.2 ⟨o, o_open, xo, subset.refl _⟩
-  rw [inter_comm] at this 
+  rw [inter_comm] at this
   apply Filter.eventuallyEq_of_mem this fun y hy => _
   have A : fderivWithin π•œ f (s ∩ o) y = f' y :=
     ((hff' y (ho hy)).mono ho).fderivWithin (hs.inter o_open y hy)
-  rwa [fderivWithin_inter (o_open.mem_nhds hy.2)] at A 
+  rwa [fderivWithin_inter (o_open.mem_nhds hy.2)] at A
 #align cont_diff_on_succ_iff_fderiv_within contDiffOn_succ_iff_fderivWithin
 -/
 
@@ -1450,11 +1450,11 @@ theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn
     (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (fun y => fderivWithin π•œ f s y) s :=
   by
   cases m
-  Β· change ∞ + 1 ≀ n at hmn 
+  Β· change ∞ + 1 ≀ n at hmn
     have : n = ∞ := by simpa using hmn
-    rw [this] at hf 
+    rw [this] at hf
     exact ((contDiffOn_top_iff_fderivWithin hs).1 hf).2
-  Β· change (m.succ : β„•βˆž) ≀ n at hmn 
+  Β· change (m.succ : β„•βˆž) ≀ n at hmn
     exact ((contDiffOn_succ_iff_fderivWithin hs).1 (hf.of_le hmn)).2
 #align cont_diff_on.fderiv_within ContDiffOn.fderivWithin
 -/
@@ -1545,7 +1545,7 @@ theorem HasFTaylorSeriesUpTo.ofLe (h : HasFTaylorSeriesUpTo n f p) (hmn : m ≀
 #print HasFTaylorSeriesUpTo.continuous /-
 theorem HasFTaylorSeriesUpTo.continuous (h : HasFTaylorSeriesUpTo n f p) : Continuous f :=
   by
-  rw [← hasFTaylorSeriesUpToOn_univ_iff] at h 
+  rw [← hasFTaylorSeriesUpToOn_univ_iff] at h
   rw [continuous_iff_continuousOn_univ]
   exact h.continuous_on
 #align has_ftaylor_series_up_to.continuous HasFTaylorSeriesUpTo.continuous
Diff
@@ -1062,7 +1062,7 @@ theorem Filter.EventuallyEq.iteratedFDerivWithin' (h : f₁ =αΆ [𝓝[s] x] f) (
     iteratedFDerivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f t :=
   by
   induction' n with n ihn
-  Β· exact h.mono fun y hy => FunLike.ext _ _ fun _ => hy
+  Β· exact h.mono fun y hy => DFunLike.ext _ _ fun _ => hy
   Β· have : fderivWithin π•œ _ t =αΆ [𝓝[s] x] fderivWithin π•œ _ t := ihn.fderiv_within' ht
     apply this.mono
     intro y hy
Diff
@@ -1057,8 +1057,8 @@ theorem iteratedFDerivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fi
 #align iterated_fderiv_within_one_apply iteratedFDerivWithin_one_apply
 -/
 
-#print Filter.EventuallyEq.iterated_fderiv_within' /-
-theorem Filter.EventuallyEq.iterated_fderiv_within' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
+#print Filter.EventuallyEq.iteratedFDerivWithin' /-
+theorem Filter.EventuallyEq.iteratedFDerivWithin' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
     iteratedFDerivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f t :=
   by
   induction' n with n ihn
@@ -1067,13 +1067,13 @@ theorem Filter.EventuallyEq.iterated_fderiv_within' (h : f₁ =αΆ [𝓝[s] x] f)
     apply this.mono
     intro y hy
     simp only [iteratedFDerivWithin_succ_eq_comp_left, hy, (· ∘ ·)]
-#align filter.eventually_eq.iterated_fderiv_within' Filter.EventuallyEq.iterated_fderiv_within'
+#align filter.eventually_eq.iterated_fderiv_within' Filter.EventuallyEq.iteratedFDerivWithin'
 -/
 
 #print Filter.EventuallyEq.iteratedFDerivWithin /-
 protected theorem Filter.EventuallyEq.iteratedFDerivWithin (h : f₁ =αΆ [𝓝[s] x] f) (n : β„•) :
     iteratedFDerivWithin π•œ n f₁ s =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f s :=
-  h.iterated_fderiv_within' Subset.rfl n
+  h.iteratedFDerivWithin' Subset.rfl n
 #align filter.eventually_eq.iterated_fderiv_within Filter.EventuallyEq.iteratedFDerivWithin
 -/
 
@@ -1083,7 +1083,7 @@ iterated differentials within this set at `x` coincide. -/
 theorem Filter.EventuallyEq.iteratedFDerivWithin_eq (h : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x)
     (n : β„•) : iteratedFDerivWithin π•œ n f₁ s x = iteratedFDerivWithin π•œ n f s x :=
   have : f₁ =αΆ [𝓝[insert x s] x] f := by simpa [eventually_eq, hx]
-  (this.iterated_fderiv_within' (subset_insert _ _) n).self_of_nhdsWithin (mem_insert _ _)
+  (this.iteratedFDerivWithin' (subset_insert _ _) n).self_of_nhdsWithin (mem_insert _ _)
 #align filter.eventually_eq.iterated_fderiv_within_eq Filter.EventuallyEq.iteratedFDerivWithin_eq
 -/
 
@@ -1379,8 +1379,8 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
 #align cont_diff_on_succ_iff_fderiv_within contDiffOn_succ_iff_fderivWithin
 -/
 
-#print contDiffOn_succ_iff_has_fderiv_within /-
-theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ s) :
+#print contDiffOn_succ_iff_hasFDerivWithin /-
+theorem contDiffOn_succ_iff_hasFDerivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
       βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiffOn π•œ n f' s ∧ βˆ€ x, x ∈ s β†’ HasFDerivWithinAt f (f' x) s x :=
   by
@@ -1389,7 +1389,7 @@ theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ
   rcases h with ⟨f', h1, h2⟩
   refine' ⟨fun x hx => (h2 x hx).DifferentiableWithinAt, fun x hx => _⟩
   exact (h1 x hx).congr' (fun y hy => (h2 y hy).fderivWithin (hs y hy)) hx
-#align cont_diff_on_succ_iff_has_fderiv_within contDiffOn_succ_iff_has_fderiv_within
+#align cont_diff_on_succ_iff_has_fderiv_within contDiffOn_succ_iff_hasFDerivWithin
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]] -/
@@ -1844,15 +1844,15 @@ theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀
 #align cont_diff_iff_forall_nat_le contDiff_iff_forall_nat_le
 -/
 
-#print contDiff_succ_iff_has_fderiv /-
+#print contDiff_succ_iff_hasFDerivAt /-
 /-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
-theorem contDiff_succ_iff_has_fderiv {n : β„•} :
+theorem contDiff_succ_iff_hasFDerivAt {n : β„•} :
     ContDiff π•œ (n + 1 : β„•) f ↔
       βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiff π•œ n f' ∧ βˆ€ x, HasFDerivAt f (f' x) x :=
   by
   simp only [← contDiffOn_univ, ← hasFDerivWithinAt_univ,
-    contDiffOn_succ_iff_has_fderiv_within uniqueDiffOn_univ, Set.mem_univ, forall_true_left]
-#align cont_diff_succ_iff_has_fderiv contDiff_succ_iff_has_fderiv
+    contDiffOn_succ_iff_hasFDerivWithin uniqueDiffOn_univ, Set.mem_univ, forall_true_left]
+#align cont_diff_succ_iff_has_fderiv contDiff_succ_iff_hasFDerivAt
 -/
 
 /-! ### Iterated derivative -/
Diff
@@ -1393,10 +1393,10 @@ theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]] -/
-#print contDiffOn_succ_iff_fderiv_of_open /-
+#print contDiffOn_succ_iff_fderiv_of_isOpen /-
 /-- A function is `C^(n + 1)` on an open domain if and only if it is
 differentiable there, and its derivative (expressed with `fderiv`) is `C^n`. -/
-theorem contDiffOn_succ_iff_fderiv_of_open {n : β„•} (hs : IsOpen s) :
+theorem contDiffOn_succ_iff_fderiv_of_isOpen {n : β„•} (hs : IsOpen s) :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
       DifferentiableOn π•œ f s ∧ ContDiffOn π•œ n (fun y => fderiv π•œ f y) s :=
   by
@@ -1406,7 +1406,7 @@ theorem contDiffOn_succ_iff_fderiv_of_open {n : β„•} (hs : IsOpen s) :
   apply contDiffOn_congr
   intro x hx
   exact fderivWithin_of_isOpen hs hx
-#align cont_diff_on_succ_iff_fderiv_of_open contDiffOn_succ_iff_fderiv_of_open
+#align cont_diff_on_succ_iff_fderiv_of_open contDiffOn_succ_iff_fderiv_of_isOpen
 -/
 
 #print contDiffOn_top_iff_fderivWithin /-
@@ -1430,10 +1430,10 @@ theorem contDiffOn_top_iff_fderivWithin (hs : UniqueDiffOn π•œ s) :
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]] -/
-#print contDiffOn_top_iff_fderiv_of_open /-
+#print contDiffOn_top_iff_fderiv_of_isOpen /-
 /-- A function is `C^∞` on an open domain if and only if it is differentiable there, and its
 derivative (expressed with `fderiv`) is `C^∞`. -/
-theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
+theorem contDiffOn_top_iff_fderiv_of_isOpen (hs : IsOpen s) :
     ContDiffOn π•œ ∞ f s ↔ DifferentiableOn π•œ f s ∧ ContDiffOn π•œ ∞ (fun y => fderiv π•œ f y) s :=
   by
   rw [contDiffOn_top_iff_fderivWithin hs.unique_diff_on]
@@ -1442,7 +1442,7 @@ theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
   apply contDiffOn_congr
   intro x hx
   exact fderivWithin_of_isOpen hs hx
-#align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_open
+#align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_isOpen
 -/
 
 #print ContDiffOn.fderivWithin /-
@@ -1459,11 +1459,11 @@ theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn
 #align cont_diff_on.fderiv_within ContDiffOn.fderivWithin
 -/
 
-#print ContDiffOn.fderiv_of_open /-
-theorem ContDiffOn.fderiv_of_open (hf : ContDiffOn π•œ n f s) (hs : IsOpen s) (hmn : m + 1 ≀ n) :
+#print ContDiffOn.fderiv_of_isOpen /-
+theorem ContDiffOn.fderiv_of_isOpen (hf : ContDiffOn π•œ n f s) (hs : IsOpen s) (hmn : m + 1 ≀ n) :
     ContDiffOn π•œ m (fun y => fderiv π•œ f y) s :=
   (hf.fderivWithin hs.UniqueDiffOn hmn).congr fun x hx => (fderivWithin_of_isOpen hs hx).symm
-#align cont_diff_on.fderiv_of_open ContDiffOn.fderiv_of_open
+#align cont_diff_on.fderiv_of_open ContDiffOn.fderiv_of_isOpen
 -/
 
 #print ContDiffOn.continuousOn_fderivWithin /-
@@ -1473,11 +1473,11 @@ theorem ContDiffOn.continuousOn_fderivWithin (h : ContDiffOn π•œ n f s) (hs : U
 #align cont_diff_on.continuous_on_fderiv_within ContDiffOn.continuousOn_fderivWithin
 -/
 
-#print ContDiffOn.continuousOn_fderiv_of_open /-
-theorem ContDiffOn.continuousOn_fderiv_of_open (h : ContDiffOn π•œ n f s) (hs : IsOpen s)
+#print ContDiffOn.continuousOn_fderiv_of_isOpen /-
+theorem ContDiffOn.continuousOn_fderiv_of_isOpen (h : ContDiffOn π•œ n f s) (hs : IsOpen s)
     (hn : 1 ≀ n) : ContinuousOn (fun x => fderiv π•œ f x) s :=
-  ((contDiffOn_succ_iff_fderiv_of_open hs).1 (h.of_le hn)).2.ContinuousOn
-#align cont_diff_on.continuous_on_fderiv_of_open ContDiffOn.continuousOn_fderiv_of_open
+  ((contDiffOn_succ_iff_fderiv_of_isOpen hs).1 (h.of_le hn)).2.ContinuousOn
+#align cont_diff_on.continuous_on_fderiv_of_open ContDiffOn.continuousOn_fderiv_of_isOpen
 -/
 
 /-! ### Functions with a Taylor series on the whole space -/
Diff
@@ -1405,7 +1405,7 @@ theorem contDiffOn_succ_iff_fderiv_of_open {n : β„•} (hs : IsOpen s) :
     "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]]"
   apply contDiffOn_congr
   intro x hx
-  exact fderivWithin_of_open hs hx
+  exact fderivWithin_of_isOpen hs hx
 #align cont_diff_on_succ_iff_fderiv_of_open contDiffOn_succ_iff_fderiv_of_open
 -/
 
@@ -1441,7 +1441,7 @@ theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
     "./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]]"
   apply contDiffOn_congr
   intro x hx
-  exact fderivWithin_of_open hs hx
+  exact fderivWithin_of_isOpen hs hx
 #align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_open
 -/
 
@@ -1462,7 +1462,7 @@ theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn
 #print ContDiffOn.fderiv_of_open /-
 theorem ContDiffOn.fderiv_of_open (hf : ContDiffOn π•œ n f s) (hs : IsOpen s) (hmn : m + 1 ≀ n) :
     ContDiffOn π•œ m (fun y => fderiv π•œ f y) s :=
-  (hf.fderivWithin hs.UniqueDiffOn hmn).congr fun x hx => (fderivWithin_of_open hs hx).symm
+  (hf.fderivWithin hs.UniqueDiffOn hmn).congr fun x hx => (fderivWithin_of_isOpen hs hx).symm
 #align cont_diff_on.fderiv_of_open ContDiffOn.fderiv_of_open
 -/
 
@@ -1984,7 +1984,7 @@ theorem iteratedFDerivWithin_of_isOpen (n : β„•) (hs : IsOpen s) :
     rw [iteratedFDeriv_succ_eq_comp_left, iteratedFDerivWithin_succ_eq_comp_left]
     dsimp
     congr 1
-    rw [fderivWithin_of_open hs hx]
+    rw [fderivWithin_of_isOpen hs hx]
     apply Filter.EventuallyEq.fderiv_eq
     filter_upwards [hs.mem_nhds hx]
     exact IH
Diff
@@ -3,11 +3,11 @@ Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 -/
-import Mathbin.Analysis.Calculus.Fderiv.Add
-import Mathbin.Analysis.Calculus.Fderiv.Mul
-import Mathbin.Analysis.Calculus.Fderiv.Equiv
-import Mathbin.Analysis.Calculus.Fderiv.RestrictScalars
-import Mathbin.Analysis.Calculus.FormalMultilinearSeries
+import Analysis.Calculus.Fderiv.Add
+import Analysis.Calculus.Fderiv.Mul
+import Analysis.Calculus.Fderiv.Equiv
+import Analysis.Calculus.Fderiv.RestrictScalars
+import Analysis.Calculus.FormalMultilinearSeries
 
 #align_import analysis.calculus.cont_diff_def from "leanprover-community/mathlib"@"2ebc1d6c2fed9f54c95bbc3998eaa5570527129a"
 
Diff
@@ -2123,7 +2123,7 @@ theorem ContDiff.continuous_fderiv (h : ContDiff π•œ n f) (hn : 1 ≀ n) :
 continuous. -/
 theorem ContDiff.continuous_fderiv_apply (h : ContDiff π•œ n f) (hn : 1 ≀ n) :
     Continuous fun p : E Γ— E => (fderiv π•œ f p.1 : E β†’ F) p.2 :=
-  have A : Continuous fun q : (E β†’L[π•œ] F) Γ— E => q.1 q.2 := isBoundedBilinearMapApply.Continuous
+  have A : Continuous fun q : (E β†’L[π•œ] F) Γ— E => q.1 q.2 := isBoundedBilinearMap_apply.Continuous
   have B : Continuous fun p : E Γ— E => (fderiv π•œ f p.1, p.2) :=
     ((h.continuous_fderiv hn).comp continuous_fst).prod_mk continuous_snd
   A.comp B
Diff
@@ -610,7 +610,7 @@ theorem contDiffWithinAt_insert {y : E} :
 #align cont_diff_within_at_insert contDiffWithinAt_insert
 -/
 
-alias contDiffWithinAt_insert ↔ ContDiffWithinAt.of_insert ContDiffWithinAt.insert'
+alias ⟨ContDiffWithinAt.of_insert, ContDiffWithinAt.insert'⟩ := contDiffWithinAt_insert
 #align cont_diff_within_at.of_insert ContDiffWithinAt.of_insert
 #align cont_diff_within_at.insert' ContDiffWithinAt.insert'
 
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
-
-! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit 2ebc1d6c2fed9f54c95bbc3998eaa5570527129a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.Fderiv.Add
 import Mathbin.Analysis.Calculus.Fderiv.Mul
@@ -14,6 +9,8 @@ import Mathbin.Analysis.Calculus.Fderiv.Equiv
 import Mathbin.Analysis.Calculus.Fderiv.RestrictScalars
 import Mathbin.Analysis.Calculus.FormalMultilinearSeries
 
+#align_import analysis.calculus.cont_diff_def from "leanprover-community/mathlib"@"2ebc1d6c2fed9f54c95bbc3998eaa5570527129a"
+
 /-!
 # Higher differentiability
 
Diff
@@ -305,7 +305,7 @@ theorem HasFTaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFTaylorSeriesUpToOn n f
   rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
   have : ((0 : β„•) : β„•βˆž) < n := lt_of_lt_of_le (WithTop.coe_lt_coe.2 Nat.zero_lt_one) hn
   convert h.fderiv_within _ this x hx
-  ext (y v)
+  ext y v
   change (p x 1) (snoc 0 y) = (p x 1) (cons y v)
   unfold_coes
   congr with i
@@ -404,7 +404,7 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
           (p x m.succ.succ).curryRight.curryLeft s x
       rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
       convert H.fderiv_within _ A x hx
-      ext (y v)
+      ext y v
       change
         (p x m.succ.succ) (snoc (cons y (init v)) (v (last _))) =
           (p x (Nat.succ (Nat.succ m))) (cons y v)
@@ -431,7 +431,7 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
           Htaylor.fderiv_within _ A x hx
         rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff'] at this 
         convert this
-        ext (y v)
+        ext y v
         change
           (p x (Nat.succ (Nat.succ m))) (cons y v) =
             (p x m.succ.succ) (snoc (cons y (init v)) (v (last _)))
@@ -689,10 +689,10 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
         congr
         decide
       Β· convert (Hp'.mono (inter_subset_left v u)).congr fun x hx => Hp'.zero_eq x hx.1
-        Β· ext (x y)
+        Β· ext x y
           change p' x 0 (init (@snoc 0 (fun i : Fin 1 => E) 0 y)) y = p' x 0 0 y
           rw [init_snoc]
-        Β· ext (x k v y)
+        Β· ext x k v y
           change
             p' x k (init (@snoc k (fun i : Fin k.succ => E) v y))
                 (@snoc k (fun i : Fin k.succ => E) v y (last k)) =
@@ -1968,7 +1968,7 @@ theorem iteratedFDerivWithin_univ {n : β„•} :
   by
   induction' n with n IH
   Β· ext x; simp
-  Β· ext (x m)
+  Β· ext x m
     rw [iteratedFDeriv_succ_apply_left, iteratedFDerivWithin_succ_apply_left, IH, fderivWithin_univ]
 #align iterated_fderiv_within_univ iteratedFDerivWithin_univ
 -/
Diff
@@ -168,7 +168,6 @@ noncomputable section
 
 open scoped Classical BigOperators NNReal Topology Filter
 
--- mathport name: «expr∞»
 local notation "∞" => (⊀ : β„•βˆž)
 
 attribute [local instance 1001] NormedAddCommGroup.toAddCommGroup NormedSpace.toModule'
@@ -199,10 +198,12 @@ structure HasFTaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMul
 #align has_ftaylor_series_up_to_on HasFTaylorSeriesUpToOn
 -/
 
+#print HasFTaylorSeriesUpToOn.zero_eq' /-
 theorem HasFTaylorSeriesUpToOn.zero_eq' (h : HasFTaylorSeriesUpToOn n f p s) {x : E} (hx : x ∈ s) :
     p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) := by rw [← h.zero_eq x hx]; symm;
   exact ContinuousMultilinearMap.uncurry0_curry0 _
 #align has_ftaylor_series_up_to_on.zero_eq' HasFTaylorSeriesUpToOn.zero_eq'
+-/
 
 #print HasFTaylorSeriesUpToOn.congr /-
 /-- If two functions coincide on a set `s`, then a Taylor series for the first one is as well a
@@ -224,11 +225,13 @@ theorem HasFTaylorSeriesUpToOn.mono (h : HasFTaylorSeriesUpToOn n f p s) {t : Se
 #align has_ftaylor_series_up_to_on.mono HasFTaylorSeriesUpToOn.mono
 -/
 
+#print HasFTaylorSeriesUpToOn.of_le /-
 theorem HasFTaylorSeriesUpToOn.of_le (h : HasFTaylorSeriesUpToOn n f p s) (hmn : m ≀ n) :
     HasFTaylorSeriesUpToOn m f p s :=
   ⟨h.zero_eq, fun k hk x hx => h.fderivWithin k (lt_of_lt_of_le hk hmn) x hx, fun k hk =>
     h.cont k (le_trans hk hmn)⟩
 #align has_ftaylor_series_up_to_on.of_le HasFTaylorSeriesUpToOn.of_le
+-/
 
 #print HasFTaylorSeriesUpToOn.continuousOn /-
 theorem HasFTaylorSeriesUpToOn.continuousOn (h : HasFTaylorSeriesUpToOn n f p s) :
@@ -287,6 +290,7 @@ theorem hasFTaylorSeriesUpToOn_top_iff' :
 #align has_ftaylor_series_up_to_on_top_iff' hasFTaylorSeriesUpToOn_top_iff'
 -/
 
+#print HasFTaylorSeriesUpToOn.hasFDerivWithinAt /-
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
 theorem HasFTaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
@@ -308,18 +312,24 @@ theorem HasFTaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFTaylorSeriesUpToOn n f
   rw [Unique.eq_default i]
   rfl
 #align has_ftaylor_series_up_to_on.has_fderiv_within_at HasFTaylorSeriesUpToOn.hasFDerivWithinAt
+-/
 
+#print HasFTaylorSeriesUpToOn.differentiableOn /-
 theorem HasFTaylorSeriesUpToOn.differentiableOn (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n) :
     DifferentiableOn π•œ f s := fun x hx => (h.HasFDerivWithinAt hn hx).DifferentiableWithinAt
 #align has_ftaylor_series_up_to_on.differentiable_on HasFTaylorSeriesUpToOn.differentiableOn
+-/
 
+#print HasFTaylorSeriesUpToOn.hasFDerivAt /-
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then the term
 of order `1` of this series is a derivative of `f` at `x`. -/
 theorem HasFTaylorSeriesUpToOn.hasFDerivAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
     (hx : s ∈ 𝓝 x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) x :=
   (h.HasFDerivWithinAt hn (mem_of_mem_nhds hx)).HasFDerivAt hx
 #align has_ftaylor_series_up_to_on.has_fderiv_at HasFTaylorSeriesUpToOn.hasFDerivAt
+-/
 
+#print HasFTaylorSeriesUpToOn.eventually_hasFDerivAt /-
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
 in a neighborhood of `x`, the term of order `1` of this series is a derivative of `f`. -/
 theorem HasFTaylorSeriesUpToOn.eventually_hasFDerivAt (h : HasFTaylorSeriesUpToOn n f p s)
@@ -327,14 +337,18 @@ theorem HasFTaylorSeriesUpToOn.eventually_hasFDerivAt (h : HasFTaylorSeriesUpToO
     βˆ€αΆ  y in 𝓝 x, HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p y 1)) y :=
   (eventually_eventually_nhds.2 hx).mono fun y hy => h.HasFDerivAt hn hy
 #align has_ftaylor_series_up_to_on.eventually_has_fderiv_at HasFTaylorSeriesUpToOn.eventually_hasFDerivAt
+-/
 
+#print HasFTaylorSeriesUpToOn.differentiableAt /-
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
 it is differentiable at `x`. -/
 theorem HasFTaylorSeriesUpToOn.differentiableAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
     (hx : s ∈ 𝓝 x) : DifferentiableAt π•œ f x :=
   (h.HasFDerivAt hn hx).DifferentiableAt
 #align has_ftaylor_series_up_to_on.differentiable_at HasFTaylorSeriesUpToOn.differentiableAt
+-/
 
+#print hasFTaylorSeriesUpToOn_succ_iff_left /-
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p` is a Taylor series up to `n`, and
 `p (n + 1)` is a derivative of `p n`. -/
 theorem hasFTaylorSeriesUpToOn_succ_iff_left {n : β„•} :
@@ -364,7 +378,9 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_left {n : β„•} :
         rw [this]
         exact h.2.2
 #align has_ftaylor_series_up_to_on_succ_iff_left hasFTaylorSeriesUpToOn_succ_iff_left
+-/
 
+#print hasFTaylorSeriesUpToOn_succ_iff_right /-
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p.shift` is a Taylor series up to `n`
 for `p 1`, which is a derivative of `f`. -/
 theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
@@ -432,6 +448,7 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
           Htaylor.cont _ A
         rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this 
 #align has_ftaylor_series_up_to_on_succ_iff_right hasFTaylorSeriesUpToOn_succ_iff_right
+-/
 
 /-! ### Smooth functions within a set around a point -/
 
@@ -456,21 +473,27 @@ def ContDiffWithinAt (n : β„•βˆž) (f : E β†’ F) (s : Set E) (x : E) : Prop :=
 
 variable {π•œ}
 
+#print contDiffWithinAt_nat /-
 theorem contDiffWithinAt_nat {n : β„•} :
     ContDiffWithinAt π•œ n f s x ↔
       βˆƒ u ∈ 𝓝[insert x s] x,
         βˆƒ p : E β†’ FormalMultilinearSeries π•œ E F, HasFTaylorSeriesUpToOn n f p u :=
   ⟨fun H => H n le_rfl, fun ⟨u, hu, p, hp⟩ m hm => ⟨u, hu, p, hp.of_le hm⟩⟩
 #align cont_diff_within_at_nat contDiffWithinAt_nat
+-/
 
+#print ContDiffWithinAt.of_le /-
 theorem ContDiffWithinAt.of_le (h : ContDiffWithinAt π•œ n f s x) (hmn : m ≀ n) :
     ContDiffWithinAt π•œ m f s x := fun k hk => h k (le_trans hk hmn)
 #align cont_diff_within_at.of_le ContDiffWithinAt.of_le
+-/
 
+#print contDiffWithinAt_iff_forall_nat_le /-
 theorem contDiffWithinAt_iff_forall_nat_le :
     ContDiffWithinAt π•œ n f s x ↔ βˆ€ m : β„•, ↑m ≀ n β†’ ContDiffWithinAt π•œ m f s x :=
   ⟨fun H m hm => H.of_le hm, fun H m hm => H m hm _ le_rfl⟩
 #align cont_diff_within_at_iff_forall_nat_le contDiffWithinAt_iff_forall_nat_le
+-/
 
 #print contDiffWithinAt_top /-
 theorem contDiffWithinAt_top : ContDiffWithinAt π•œ ∞ f s x ↔ βˆ€ n : β„•, ContDiffWithinAt π•œ n f s x :=
@@ -565,15 +588,19 @@ theorem contDiffWithinAt_congr_nhds {t : Set E} (hst : 𝓝[s] x = 𝓝[t] x) :
 #align cont_diff_within_at_congr_nhds contDiffWithinAt_congr_nhds
 -/
 
+#print contDiffWithinAt_inter' /-
 theorem contDiffWithinAt_inter' (h : t ∈ 𝓝[s] x) :
     ContDiffWithinAt π•œ n f (s ∩ t) x ↔ ContDiffWithinAt π•œ n f s x :=
   contDiffWithinAt_congr_nhds <| Eq.symm <| nhdsWithin_restrict'' _ h
 #align cont_diff_within_at_inter' contDiffWithinAt_inter'
+-/
 
+#print contDiffWithinAt_inter /-
 theorem contDiffWithinAt_inter (h : t ∈ 𝓝 x) :
     ContDiffWithinAt π•œ n f (s ∩ t) x ↔ ContDiffWithinAt π•œ n f s x :=
   contDiffWithinAt_inter' (mem_nhdsWithin_of_mem_nhds h)
 #align cont_diff_within_at_inter contDiffWithinAt_inter
+-/
 
 #print contDiffWithinAt_insert /-
 theorem contDiffWithinAt_insert {y : E} :
@@ -597,6 +624,7 @@ theorem ContDiffWithinAt.insert (h : ContDiffWithinAt π•œ n f s x) :
 #align cont_diff_within_at.insert ContDiffWithinAt.insert
 -/
 
+#print ContDiffWithinAt.differentiable_within_at' /-
 /-- If a function is `C^n` within a set at a point, with `n β‰₯ 1`, then it is differentiable
 within this set at this point. -/
 theorem ContDiffWithinAt.differentiable_within_at' (h : ContDiffWithinAt π•œ n f s x) (hn : 1 ≀ n) :
@@ -608,12 +636,16 @@ theorem ContDiffWithinAt.differentiable_within_at' (h : ContDiffWithinAt π•œ n
   have := ((H.mono tu).DifferentiableOn le_rfl) x ⟨mem_insert x s, xt⟩
   exact (differentiableWithinAt_inter (IsOpen.mem_nhds t_open xt)).1 this
 #align cont_diff_within_at.differentiable_within_at' ContDiffWithinAt.differentiable_within_at'
+-/
 
+#print ContDiffWithinAt.differentiableWithinAt /-
 theorem ContDiffWithinAt.differentiableWithinAt (h : ContDiffWithinAt π•œ n f s x) (hn : 1 ≀ n) :
     DifferentiableWithinAt π•œ f s x :=
   (h.differentiable_within_at' hn).mono (subset_insert x s)
 #align cont_diff_within_at.differentiable_within_at ContDiffWithinAt.differentiableWithinAt
+-/
 
+#print contDiffWithinAt_succ_iff_hasFDerivWithinAt /-
 /-- A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`. -/
 theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
     ContDiffWithinAt π•œ (n + 1 : β„•) f s x ↔
@@ -667,7 +699,9 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
               p' x k v y
           rw [snoc_last, init_snoc]
 #align cont_diff_within_at_succ_iff_has_fderiv_within_at contDiffWithinAt_succ_iff_hasFDerivWithinAt
+-/
 
+#print contDiffWithinAt_succ_iff_hasFDerivWithinAt' /-
 /-- A version of `cont_diff_within_at_succ_iff_has_fderiv_within_at` where all derivatives
   are taken within the same set. -/
 theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt' {n : β„•} :
@@ -693,6 +727,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt' {n : β„•} :
     rintro ⟨u, hu, hus, f', huf', hf'⟩
     refine' ⟨u, hu, f', fun y hy => (huf' y hy).insert'.mono hus, hf'.insert.mono hus⟩
 #align cont_diff_within_at_succ_iff_has_fderiv_within_at' contDiffWithinAt_succ_iff_hasFDerivWithinAt'
+-/
 
 /-! ### Smooth functions within a set -/
 
@@ -731,6 +766,7 @@ theorem ContDiffOn.contDiffWithinAt (h : ContDiffOn π•œ n f s) (hx : x ∈ s) :
 #align cont_diff_on.cont_diff_within_at ContDiffOn.contDiffWithinAt
 -/
 
+#print ContDiffWithinAt.contDiffOn' /-
 theorem ContDiffWithinAt.contDiffOn' {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : ContDiffWithinAt π•œ n f s x) :
     βˆƒ u, IsOpen u ∧ x ∈ u ∧ ContDiffOn π•œ m f (insert x s ∩ u) :=
   by
@@ -739,12 +775,15 @@ theorem ContDiffWithinAt.contDiffOn' {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : Co
   rw [inter_comm] at hut 
   exact ⟨u, huo, hxu, (hp.mono hut).ContDiffOn⟩
 #align cont_diff_within_at.cont_diff_on' ContDiffWithinAt.contDiffOn'
+-/
 
+#print ContDiffWithinAt.contDiffOn /-
 theorem ContDiffWithinAt.contDiffOn {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : ContDiffWithinAt π•œ n f s x) :
     βˆƒ u ∈ 𝓝[insert x s] x, u βŠ† insert x s ∧ ContDiffOn π•œ m f u :=
   let ⟨u, uo, xu, h⟩ := h.contDiffOn' hm
   ⟨_, inter_mem_nhdsWithin _ (uo.mem_nhds xu), inter_subset_left _ _, h⟩
 #align cont_diff_within_at.cont_diff_on ContDiffWithinAt.contDiffOn
+-/
 
 #print ContDiffWithinAt.eventually /-
 protected theorem ContDiffWithinAt.eventually {n : β„•} (h : ContDiffWithinAt π•œ n f s x) :
@@ -758,21 +797,29 @@ protected theorem ContDiffWithinAt.eventually {n : β„•} (h : ContDiffWithinAt 
 #align cont_diff_within_at.eventually ContDiffWithinAt.eventually
 -/
 
+#print ContDiffOn.of_le /-
 theorem ContDiffOn.of_le (h : ContDiffOn π•œ n f s) (hmn : m ≀ n) : ContDiffOn π•œ m f s := fun x hx =>
   (h x hx).of_le hmn
 #align cont_diff_on.of_le ContDiffOn.of_le
+-/
 
+#print ContDiffOn.of_succ /-
 theorem ContDiffOn.of_succ {n : β„•} (h : ContDiffOn π•œ (n + 1) f s) : ContDiffOn π•œ n f s :=
   h.of_le <| WithTop.coe_le_coe.mpr le_self_add
 #align cont_diff_on.of_succ ContDiffOn.of_succ
+-/
 
+#print ContDiffOn.one_of_succ /-
 theorem ContDiffOn.one_of_succ {n : β„•} (h : ContDiffOn π•œ (n + 1) f s) : ContDiffOn π•œ 1 f s :=
   h.of_le <| WithTop.coe_le_coe.mpr le_add_self
 #align cont_diff_on.one_of_succ ContDiffOn.one_of_succ
+-/
 
+#print contDiffOn_iff_forall_nat_le /-
 theorem contDiffOn_iff_forall_nat_le : ContDiffOn π•œ n f s ↔ βˆ€ m : β„•, ↑m ≀ n β†’ ContDiffOn π•œ m f s :=
   ⟨fun H m hm => H.of_le hm, fun H x hx m hm => H m hm x hx m le_rfl⟩
 #align cont_diff_on_iff_forall_nat_le contDiffOn_iff_forall_nat_le
+-/
 
 #print contDiffOn_top /-
 theorem contDiffOn_top : ContDiffOn π•œ ∞ f s ↔ βˆ€ n : β„•, ContDiffOn π•œ n f s :=
@@ -820,11 +867,14 @@ theorem ContDiffOn.congr_mono (hf : ContDiffOn π•œ n f s) (h₁ : βˆ€ x ∈ s
 #align cont_diff_on.congr_mono ContDiffOn.congr_mono
 -/
 
+#print ContDiffOn.differentiableOn /-
 /-- If a function is `C^n` on a set with `n β‰₯ 1`, then it is differentiable there. -/
 theorem ContDiffOn.differentiableOn (h : ContDiffOn π•œ n f s) (hn : 1 ≀ n) :
     DifferentiableOn π•œ f s := fun x hx => (h x hx).DifferentiableWithinAt hn
 #align cont_diff_on.differentiable_on ContDiffOn.differentiableOn
+-/
 
+#print contDiffOn_of_locally_contDiffOn /-
 /-- If a function is `C^n` around each point in a set, then it is `C^n` on the set. -/
 theorem contDiffOn_of_locally_contDiffOn
     (h : βˆ€ x ∈ s, βˆƒ u, IsOpen u ∧ x ∈ u ∧ ContDiffOn π•œ n f (s ∩ u)) : ContDiffOn π•œ n f s :=
@@ -834,7 +884,9 @@ theorem contDiffOn_of_locally_contDiffOn
   apply (contDiffWithinAt_inter _).1 (hu x ⟨xs, xu⟩)
   exact IsOpen.mem_nhds u_open xu
 #align cont_diff_on_of_locally_cont_diff_on contDiffOn_of_locally_contDiffOn
+-/
 
+#print contDiffOn_succ_iff_hasFDerivWithinAt /-
 /-- A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`. -/
 theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
@@ -859,6 +911,7 @@ theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
     have : x ∈ u := mem_of_mem_nhdsWithin (mem_insert _ _) u_nhbd
     exact ⟨u, u_nhbd, f', hu, hf' x this⟩
 #align cont_diff_on_succ_iff_has_fderiv_within_at contDiffOn_succ_iff_hasFDerivWithinAt
+-/
 
 /-! ### Iterated derivative within a set -/
 
@@ -893,10 +946,12 @@ theorem iteratedFDerivWithin_zero_apply (m : Fin 0 β†’ E) :
 #align iterated_fderiv_within_zero_apply iteratedFDerivWithin_zero_apply
 -/
 
+#print iteratedFDerivWithin_zero_eq_comp /-
 theorem iteratedFDerivWithin_zero_eq_comp :
     iteratedFDerivWithin π•œ 0 f s = (continuousMultilinearCurryFin0 π•œ E F).symm ∘ f :=
   rfl
 #align iterated_fderiv_within_zero_eq_comp iteratedFDerivWithin_zero_eq_comp
+-/
 
 #print norm_iteratedFDerivWithin_zero /-
 @[simp]
@@ -905,12 +960,15 @@ theorem norm_iteratedFDerivWithin_zero : β€–iteratedFDerivWithin π•œ 0 f s xβ€–
 #align norm_iterated_fderiv_within_zero norm_iteratedFDerivWithin_zero
 -/
 
+#print iteratedFDerivWithin_succ_apply_left /-
 theorem iteratedFDerivWithin_succ_apply_left {n : β„•} (m : Fin (n + 1) β†’ E) :
     (iteratedFDerivWithin π•œ (n + 1) f s x : (Fin (n + 1) β†’ E) β†’ F) m =
       (fderivWithin π•œ (iteratedFDerivWithin π•œ n f s) s x : E β†’ E[Γ—n]β†’L[π•œ] F) (m 0) (tail m) :=
   rfl
 #align iterated_fderiv_within_succ_apply_left iteratedFDerivWithin_succ_apply_left
+-/
 
+#print iteratedFDerivWithin_succ_eq_comp_left /-
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
 and the derivative of the `n`-th derivative. -/
 theorem iteratedFDerivWithin_succ_eq_comp_left {n : β„•} :
@@ -919,6 +977,7 @@ theorem iteratedFDerivWithin_succ_eq_comp_left {n : β„•} :
         fderivWithin π•œ (iteratedFDerivWithin π•œ n f s) s :=
   rfl
 #align iterated_fderiv_within_succ_eq_comp_left iteratedFDerivWithin_succ_eq_comp_left
+-/
 
 #print norm_fderivWithin_iteratedFDerivWithin /-
 theorem norm_fderivWithin_iteratedFDerivWithin {n : β„•} :
@@ -927,6 +986,7 @@ theorem norm_fderivWithin_iteratedFDerivWithin {n : β„•} :
 #align norm_fderiv_within_iterated_fderiv_within norm_fderivWithin_iteratedFDerivWithin
 -/
 
+#print iteratedFDerivWithin_succ_apply_right /-
 theorem iteratedFDerivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s)
     (m : Fin (n + 1) β†’ E) :
     (iteratedFDerivWithin π•œ (n + 1) f s x : (Fin (n + 1) β†’ E) β†’ F) m =
@@ -968,6 +1028,7 @@ theorem iteratedFDerivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ
             (m (last (n + 1))) :=
         by rw [iteratedFDerivWithin_succ_apply_left, tail_init_eq_init_tail]; rfl
 #align iterated_fderiv_within_succ_apply_right iteratedFDerivWithin_succ_apply_right
+-/
 
 #print iteratedFDerivWithin_succ_eq_comp_right /-
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
@@ -988,6 +1049,7 @@ theorem norm_iteratedFDerivWithin_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ
 #align norm_iterated_fderiv_within_fderiv_within norm_iteratedFDerivWithin_fderivWithin
 -/
 
+#print iteratedFDerivWithin_one_apply /-
 @[simp]
 theorem iteratedFDerivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fin 1 β†’ E) :
     (iteratedFDerivWithin π•œ 1 f s x : (Fin 1 β†’ E) β†’ F) m = (fderivWithin π•œ f s x : E β†’ F) (m 0) :=
@@ -996,6 +1058,7 @@ theorem iteratedFDerivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fi
     (continuousMultilinearCurryFin0 π•œ E F).symm.comp_fderivWithin h]
   rfl
 #align iterated_fderiv_within_one_apply iteratedFDerivWithin_one_apply
+-/
 
 #print Filter.EventuallyEq.iterated_fderiv_within' /-
 theorem Filter.EventuallyEq.iterated_fderiv_within' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
@@ -1047,6 +1110,7 @@ protected theorem Set.EqOn.iteratedFDerivWithin (hs : EqOn f₁ f s) (n : β„•) :
 #align set.eq_on.iterated_fderiv_within Set.EqOn.iteratedFDerivWithin
 -/
 
+#print iteratedFDerivWithin_eventually_congr_set' /-
 theorem iteratedFDerivWithin_eventually_congr_set' (y : E) (h : s =αΆ [𝓝[{y}ᢜ] x] t) (n : β„•) :
     iteratedFDerivWithin π•œ n f s =αΆ [𝓝 x] iteratedFDerivWithin π•œ n f t :=
   by
@@ -1056,6 +1120,7 @@ theorem iteratedFDerivWithin_eventually_congr_set' (y : E) (h : s =αΆ [𝓝[{y}
     simp only [iteratedFDerivWithin_succ_eq_comp_left, (· ∘ ·)]
     rw [(ihn hy).fderivWithin_eq_nhds, fderivWithin_congr_set' _ hy]
 #align iterated_fderiv_within_eventually_congr_set' iteratedFDerivWithin_eventually_congr_set'
+-/
 
 #print iteratedFDerivWithin_eventually_congr_set /-
 theorem iteratedFDerivWithin_eventually_congr_set (h : s =αΆ [𝓝 x] t) (n : β„•) :
@@ -1112,6 +1177,7 @@ theorem contDiffOn_zero : ContDiffOn π•œ 0 f s ↔ ContinuousOn f s :=
 #align cont_diff_on_zero contDiffOn_zero
 -/
 
+#print contDiffWithinAt_zero /-
 theorem contDiffWithinAt_zero (hx : x ∈ s) :
     ContDiffWithinAt π•œ 0 f s x ↔ βˆƒ u ∈ 𝓝[s] x, ContinuousOn f (s ∩ u) :=
   by
@@ -1127,7 +1193,9 @@ theorem contDiffWithinAt_zero (hx : x ∈ s) :
     have h' : x ∈ s ∩ u := ⟨hx, mem_of_mem_nhdsWithin hx H⟩
     exact (cont_diff_on_zero.mpr hu).ContDiffWithinAt h'
 #align cont_diff_within_at_zero contDiffWithinAt_zero
+-/
 
+#print HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn /-
 /-- On a set with unique differentiability, any choice of iterated differential has to coincide
 with the one we have chosen in `iterated_fderiv_within π•œ m f s`. -/
 theorem HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
@@ -1145,6 +1213,7 @@ theorem HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
     rw [iteratedFDerivWithin_succ_eq_comp_left, Function.comp_apply, this.fderiv_within (hs x hx)]
     exact (ContinuousMultilinearMap.uncurry_curryLeft _).symm
 #align has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
+-/
 
 #print ContDiffOn.ftaylorSeriesWithin /-
 /-- When a function is `C^n` in a set `s` of unique differentiability, it admits
@@ -1196,6 +1265,7 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
 #align cont_diff_on.ftaylor_series_within ContDiffOn.ftaylorSeriesWithin
 -/
 
+#print contDiffOn_of_continuousOn_differentiableOn /-
 theorem contDiffOn_of_continuousOn_differentiableOn
     (Hcont : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (fun x => iteratedFDerivWithin π•œ m f s x) s)
     (Hdiff :
@@ -1216,25 +1286,33 @@ theorem contDiffOn_of_continuousOn_differentiableOn
   Β· intro k hk
     exact Hcont k (le_trans hk hm)
 #align cont_diff_on_of_continuous_on_differentiable_on contDiffOn_of_continuousOn_differentiableOn
+-/
 
+#print contDiffOn_of_differentiableOn /-
 theorem contDiffOn_of_differentiableOn
     (h : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ DifferentiableOn π•œ (iteratedFDerivWithin π•œ m f s) s) :
     ContDiffOn π•œ n f s :=
   contDiffOn_of_continuousOn_differentiableOn (fun m hm => (h m hm).ContinuousOn) fun m hm =>
     h m (le_of_lt hm)
 #align cont_diff_on_of_differentiable_on contDiffOn_of_differentiableOn
+-/
 
+#print ContDiffOn.continuousOn_iteratedFDerivWithin /-
 theorem ContDiffOn.continuousOn_iteratedFDerivWithin {m : β„•} (h : ContDiffOn π•œ n f s)
     (hmn : (m : β„•βˆž) ≀ n) (hs : UniqueDiffOn π•œ s) : ContinuousOn (iteratedFDerivWithin π•œ m f s) s :=
   (h.ftaylorSeriesWithin hs).cont m hmn
 #align cont_diff_on.continuous_on_iterated_fderiv_within ContDiffOn.continuousOn_iteratedFDerivWithin
+-/
 
+#print ContDiffOn.differentiableOn_iteratedFDerivWithin /-
 theorem ContDiffOn.differentiableOn_iteratedFDerivWithin {m : β„•} (h : ContDiffOn π•œ n f s)
     (hmn : (m : β„•βˆž) < n) (hs : UniqueDiffOn π•œ s) :
     DifferentiableOn π•œ (iteratedFDerivWithin π•œ m f s) s := fun x hx =>
   ((h.ftaylorSeriesWithin hs).fderivWithin m hmn x hx).DifferentiableWithinAt
 #align cont_diff_on.differentiable_on_iterated_fderiv_within ContDiffOn.differentiableOn_iteratedFDerivWithin
+-/
 
+#print ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin /-
 theorem ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin {m : β„•}
     (h : ContDiffWithinAt π•œ n f s x) (hmn : (m : β„•βˆž) < n) (hs : UniqueDiffOn π•œ (insert x s)) :
     DifferentiableWithinAt π•œ (iteratedFDerivWithin π•œ m f s) s x :=
@@ -1255,7 +1333,9 @@ theorem ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin {m : β„•}
   rw [differentiableWithinAt_congr_set' _ A] at C 
   exact C.congr_of_eventually_eq (B.filter_mono inf_le_left) B.self_of_nhds
 #align cont_diff_within_at.differentiable_within_at_iterated_fderiv_within ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin
+-/
 
+#print contDiffOn_iff_continuousOn_differentiableOn /-
 theorem contDiffOn_iff_continuousOn_differentiableOn (hs : UniqueDiffOn π•œ s) :
     ContDiffOn π•œ n f s ↔
       (βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (fun x => iteratedFDerivWithin π•œ m f s x) s) ∧
@@ -1265,6 +1345,7 @@ theorem contDiffOn_iff_continuousOn_differentiableOn (hs : UniqueDiffOn π•œ s)
       h.differentiableOn_iteratedFDerivWithin hm hs⟩,
     fun h => contDiffOn_of_continuousOn_differentiableOn h.1 h.2⟩
 #align cont_diff_on_iff_continuous_on_differentiable_on contDiffOn_iff_continuousOn_differentiableOn
+-/
 
 #print contDiffOn_succ_of_fderivWithin /-
 theorem contDiffOn_succ_of_fderivWithin {n : β„•} (hf : DifferentiableOn π•œ f s)
@@ -1367,6 +1448,7 @@ theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
 #align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_open
 -/
 
+#print ContDiffOn.fderivWithin /-
 theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
     (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (fun y => fderivWithin π•œ f s y) s :=
   by
@@ -1378,21 +1460,28 @@ theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn
   Β· change (m.succ : β„•βˆž) ≀ n at hmn 
     exact ((contDiffOn_succ_iff_fderivWithin hs).1 (hf.of_le hmn)).2
 #align cont_diff_on.fderiv_within ContDiffOn.fderivWithin
+-/
 
+#print ContDiffOn.fderiv_of_open /-
 theorem ContDiffOn.fderiv_of_open (hf : ContDiffOn π•œ n f s) (hs : IsOpen s) (hmn : m + 1 ≀ n) :
     ContDiffOn π•œ m (fun y => fderiv π•œ f y) s :=
   (hf.fderivWithin hs.UniqueDiffOn hmn).congr fun x hx => (fderivWithin_of_open hs hx).symm
 #align cont_diff_on.fderiv_of_open ContDiffOn.fderiv_of_open
+-/
 
+#print ContDiffOn.continuousOn_fderivWithin /-
 theorem ContDiffOn.continuousOn_fderivWithin (h : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
     (hn : 1 ≀ n) : ContinuousOn (fun x => fderivWithin π•œ f s x) s :=
   ((contDiffOn_succ_iff_fderivWithin hs).1 (h.of_le hn)).2.ContinuousOn
 #align cont_diff_on.continuous_on_fderiv_within ContDiffOn.continuousOn_fderivWithin
+-/
 
+#print ContDiffOn.continuousOn_fderiv_of_open /-
 theorem ContDiffOn.continuousOn_fderiv_of_open (h : ContDiffOn π•œ n f s) (hs : IsOpen s)
     (hn : 1 ≀ n) : ContinuousOn (fun x => fderiv π•œ f x) s :=
   ((contDiffOn_succ_iff_fderiv_of_open hs).1 (h.of_le hn)).2.ContinuousOn
 #align cont_diff_on.continuous_on_fderiv_of_open ContDiffOn.continuousOn_fderiv_of_open
+-/
 
 /-! ### Functions with a Taylor series on the whole space -/
 
@@ -1409,10 +1498,12 @@ structure HasFTaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMulti
 #align has_ftaylor_series_up_to HasFTaylorSeriesUpTo
 -/
 
+#print HasFTaylorSeriesUpTo.zero_eq' /-
 theorem HasFTaylorSeriesUpTo.zero_eq' (h : HasFTaylorSeriesUpTo n f p) (x : E) :
     p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) := by rw [← h.zero_eq x]; symm;
   exact ContinuousMultilinearMap.uncurry0_curry0 _
 #align has_ftaylor_series_up_to.zero_eq' HasFTaylorSeriesUpTo.zero_eq'
+-/
 
 #print hasFTaylorSeriesUpToOn_univ_iff /-
 theorem hasFTaylorSeriesUpToOn_univ_iff :
@@ -1447,10 +1538,12 @@ theorem HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn (h : HasFTaylorSeriesUpTo n
 #align has_ftaylor_series_up_to.has_ftaylor_series_up_to_on HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn
 -/
 
+#print HasFTaylorSeriesUpTo.ofLe /-
 theorem HasFTaylorSeriesUpTo.ofLe (h : HasFTaylorSeriesUpTo n f p) (hmn : m ≀ n) :
     HasFTaylorSeriesUpTo m f p := by rw [← hasFTaylorSeriesUpToOn_univ_iff] at h ⊒;
   exact h.of_le hmn
 #align has_ftaylor_series_up_to.of_le HasFTaylorSeriesUpTo.ofLe
+-/
 
 #print HasFTaylorSeriesUpTo.continuous /-
 theorem HasFTaylorSeriesUpTo.continuous (h : HasFTaylorSeriesUpTo n f p) : Continuous f :=
@@ -1489,6 +1582,7 @@ theorem hasFTaylorSeriesUpTo_top_iff' :
 #align has_ftaylor_series_up_to_top_iff' hasFTaylorSeriesUpTo_top_iff'
 -/
 
+#print HasFTaylorSeriesUpTo.hasFDerivAt /-
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
 theorem HasFTaylorSeriesUpTo.hasFDerivAt (h : HasFTaylorSeriesUpTo n f p) (hn : 1 ≀ n) (x : E) :
@@ -1497,11 +1591,15 @@ theorem HasFTaylorSeriesUpTo.hasFDerivAt (h : HasFTaylorSeriesUpTo n f p) (hn :
   rw [← hasFDerivWithinAt_univ]
   exact (hasFTaylorSeriesUpToOn_univ_iff.2 h).HasFDerivWithinAt hn (mem_univ _)
 #align has_ftaylor_series_up_to.has_fderiv_at HasFTaylorSeriesUpTo.hasFDerivAt
+-/
 
+#print HasFTaylorSeriesUpTo.differentiable /-
 theorem HasFTaylorSeriesUpTo.differentiable (h : HasFTaylorSeriesUpTo n f p) (hn : 1 ≀ n) :
     Differentiable π•œ f := fun x => (h.HasFDerivAt hn x).DifferentiableAt
 #align has_ftaylor_series_up_to.differentiable HasFTaylorSeriesUpTo.differentiable
+-/
 
+#print hasFTaylorSeriesUpTo_succ_iff_right /-
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p.shift` is a Taylor series up to `n`
 for `p 1`, which is a derivative of `f`. -/
 theorem hasFTaylorSeriesUpTo_succ_iff_right {n : β„•} :
@@ -1514,6 +1612,7 @@ theorem hasFTaylorSeriesUpTo_succ_iff_right {n : β„•} :
   simp only [hasFTaylorSeriesUpToOn_succ_iff_right, ← hasFTaylorSeriesUpToOn_univ_iff, mem_univ,
     forall_true_left, hasFDerivWithinAt_univ]
 #align has_ftaylor_series_up_to_succ_iff_right hasFTaylorSeriesUpTo_succ_iff_right
+-/
 
 /-! ### Smooth functions at a point -/
 
@@ -1562,9 +1661,11 @@ theorem ContDiffAt.congr_of_eventuallyEq (h : ContDiffAt π•œ n f x) (hg : f₁
 #align cont_diff_at.congr_of_eventually_eq ContDiffAt.congr_of_eventuallyEq
 -/
 
+#print ContDiffAt.of_le /-
 theorem ContDiffAt.of_le (h : ContDiffAt π•œ n f x) (hmn : m ≀ n) : ContDiffAt π•œ m f x :=
   h.of_le hmn
 #align cont_diff_at.of_le ContDiffAt.of_le
+-/
 
 #print ContDiffAt.continuousAt /-
 theorem ContDiffAt.continuousAt (h : ContDiffAt π•œ n f x) : ContinuousAt f x := by
@@ -1572,12 +1673,15 @@ theorem ContDiffAt.continuousAt (h : ContDiffAt π•œ n f x) : ContinuousAt f x :
 #align cont_diff_at.continuous_at ContDiffAt.continuousAt
 -/
 
+#print ContDiffAt.differentiableAt /-
 /-- If a function is `C^n` with `n β‰₯ 1` at a point, then it is differentiable there. -/
 theorem ContDiffAt.differentiableAt (h : ContDiffAt π•œ n f x) (hn : 1 ≀ n) :
     DifferentiableAt π•œ f x := by
   simpa [hn, differentiableWithinAt_univ] using h.differentiable_within_at
 #align cont_diff_at.differentiable_at ContDiffAt.differentiableAt
+-/
 
+#print contDiffAt_succ_iff_hasFDerivAt /-
 /-- A function is `C^(n + 1)` at a point iff locally, it has a derivative which is `C^n`. -/
 theorem contDiffAt_succ_iff_hasFDerivAt {n : β„•} :
     ContDiffAt π•œ (n + 1 : β„•) f x ↔
@@ -1598,6 +1702,7 @@ theorem contDiffAt_succ_iff_hasFDerivAt {n : β„•} :
     intro x hxu
     exact (h_fderiv x hxu).HasFDerivWithinAt
 #align cont_diff_at_succ_iff_has_fderiv_at contDiffAt_succ_iff_hasFDerivAt
+-/
 
 #print ContDiffAt.eventually /-
 protected theorem ContDiffAt.eventually {n : β„•} (h : ContDiffAt π•œ n f x) :
@@ -1688,10 +1793,13 @@ theorem contDiff_zero : ContDiff π•œ 0 f ↔ Continuous f :=
 #align cont_diff_zero contDiff_zero
 -/
 
+#print contDiffAt_zero /-
 theorem contDiffAt_zero : ContDiffAt π•œ 0 f x ↔ βˆƒ u ∈ 𝓝 x, ContinuousOn f u := by
   rw [← contDiffWithinAt_univ]; simp [contDiffWithinAt_zero, nhdsWithin_univ]
 #align cont_diff_at_zero contDiffAt_zero
+-/
 
+#print contDiffAt_one_iff /-
 theorem contDiffAt_one_iff :
     ContDiffAt π•œ 1 f x ↔
       βˆƒ f' : E β†’ E β†’L[π•œ] F, βˆƒ u ∈ 𝓝 x, ContinuousOn f' u ∧ βˆ€ x ∈ u, HasFDerivAt f (f' x) x :=
@@ -1700,18 +1808,25 @@ theorem contDiffAt_one_iff :
     show ((0 : β„•) : β„•βˆž) = 0 from rfl, contDiffAt_zero,
     exists_mem_and_iff antitone_bforall antitone_continuousOn, and_comm']
 #align cont_diff_at_one_iff contDiffAt_one_iff
+-/
 
+#print ContDiff.of_le /-
 theorem ContDiff.of_le (h : ContDiff π•œ n f) (hmn : m ≀ n) : ContDiff π•œ m f :=
   contDiffOn_univ.1 <| (contDiffOn_univ.2 h).of_le hmn
 #align cont_diff.of_le ContDiff.of_le
+-/
 
+#print ContDiff.of_succ /-
 theorem ContDiff.of_succ {n : β„•} (h : ContDiff π•œ (n + 1) f) : ContDiff π•œ n f :=
   h.of_le <| WithTop.coe_le_coe.mpr le_self_add
 #align cont_diff.of_succ ContDiff.of_succ
+-/
 
+#print ContDiff.one_of_succ /-
 theorem ContDiff.one_of_succ {n : β„•} (h : ContDiff π•œ (n + 1) f) : ContDiff π•œ 1 f :=
   h.of_le <| WithTop.coe_le_coe.mpr le_add_self
 #align cont_diff.one_of_succ ContDiff.one_of_succ
+-/
 
 #print ContDiff.continuous /-
 theorem ContDiff.continuous (h : ContDiff π•œ n f) : Continuous f :=
@@ -1719,14 +1834,18 @@ theorem ContDiff.continuous (h : ContDiff π•œ n f) : Continuous f :=
 #align cont_diff.continuous ContDiff.continuous
 -/
 
+#print ContDiff.differentiable /-
 /-- If a function is `C^n` with `n β‰₯ 1`, then it is differentiable. -/
 theorem ContDiff.differentiable (h : ContDiff π•œ n f) (hn : 1 ≀ n) : Differentiable π•œ f :=
   differentiableOn_univ.1 <| (contDiffOn_univ.2 h).DifferentiableOn hn
 #align cont_diff.differentiable ContDiff.differentiable
+-/
 
+#print contDiff_iff_forall_nat_le /-
 theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀ n β†’ ContDiff π•œ m f := by
   simp_rw [← contDiffOn_univ]; exact contDiffOn_iff_forall_nat_le
 #align cont_diff_iff_forall_nat_le contDiff_iff_forall_nat_le
+-/
 
 #print contDiff_succ_iff_has_fderiv /-
 /-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
@@ -1769,10 +1888,12 @@ theorem iteratedFDeriv_zero_apply (m : Fin 0 β†’ E) :
 #align iterated_fderiv_zero_apply iteratedFDeriv_zero_apply
 -/
 
+#print iteratedFDeriv_zero_eq_comp /-
 theorem iteratedFDeriv_zero_eq_comp :
     iteratedFDeriv π•œ 0 f = (continuousMultilinearCurryFin0 π•œ E F).symm ∘ f :=
   rfl
 #align iterated_fderiv_zero_eq_comp iteratedFDeriv_zero_eq_comp
+-/
 
 #print norm_iteratedFDeriv_zero /-
 @[simp]
@@ -1787,12 +1908,15 @@ theorem iteratedFDeriv_with_zero_eq : iteratedFDerivWithin π•œ 0 f s = iterated
 #align iterated_fderiv_with_zero_eq iteratedFDeriv_with_zero_eq
 -/
 
+#print iteratedFDeriv_succ_apply_left /-
 theorem iteratedFDeriv_succ_apply_left {n : β„•} (m : Fin (n + 1) β†’ E) :
     (iteratedFDeriv π•œ (n + 1) f x : (Fin (n + 1) β†’ E) β†’ F) m =
       (fderiv π•œ (iteratedFDeriv π•œ n f) x : E β†’ E[Γ—n]β†’L[π•œ] F) (m 0) (tail m) :=
   rfl
 #align iterated_fderiv_succ_apply_left iteratedFDeriv_succ_apply_left
+-/
 
+#print iteratedFDeriv_succ_eq_comp_left /-
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
 and the derivative of the `n`-th derivative. -/
 theorem iteratedFDeriv_succ_eq_comp_left {n : β„•} :
@@ -1801,7 +1925,9 @@ theorem iteratedFDeriv_succ_eq_comp_left {n : β„•} :
         fderiv π•œ (iteratedFDeriv π•œ n f) :=
   rfl
 #align iterated_fderiv_succ_eq_comp_left iteratedFDeriv_succ_eq_comp_left
+-/
 
+#print fderiv_iteratedFDeriv /-
 /-- Writing explicitly the derivative of the `n`-th derivative as the composition of a currying
 linear equiv, and the `n + 1`-th derivative. -/
 theorem fderiv_iteratedFDeriv {n : β„•} :
@@ -1813,7 +1939,9 @@ theorem fderiv_iteratedFDeriv {n : β„•} :
   ext1 x
   simp only [Function.comp_apply, LinearIsometryEquiv.symm_apply_apply]
 #align fderiv_iterated_fderiv fderiv_iteratedFDeriv
+-/
 
+#print HasCompactSupport.iteratedFDeriv /-
 theorem HasCompactSupport.iteratedFDeriv (hf : HasCompactSupport f) (n : β„•) :
     HasCompactSupport (iteratedFDeriv π•œ n f) :=
   by
@@ -1825,6 +1953,7 @@ theorem HasCompactSupport.iteratedFDeriv (hf : HasCompactSupport f) (n : β„•) :
     apply (IH.fderiv π•œ).compLeft
     exact LinearIsometryEquiv.map_zero _
 #align has_compact_support.iterated_fderiv HasCompactSupport.iteratedFDeriv
+-/
 
 #print norm_fderiv_iteratedFDeriv /-
 theorem norm_fderiv_iteratedFDeriv {n : β„•} :
@@ -1874,6 +2003,7 @@ theorem ftaylorSeriesWithin_univ : ftaylorSeriesWithin π•œ f univ = ftaylorSeri
 #align ftaylor_series_within_univ ftaylorSeriesWithin_univ
 -/
 
+#print iteratedFDeriv_succ_apply_right /-
 theorem iteratedFDeriv_succ_apply_right {n : β„•} (m : Fin (n + 1) β†’ E) :
     (iteratedFDeriv π•œ (n + 1) f x : (Fin (n + 1) β†’ E) β†’ F) m =
       iteratedFDeriv π•œ n (fun y => fderiv π•œ f y) x (init m) (m (last n)) :=
@@ -1881,6 +2011,7 @@ theorem iteratedFDeriv_succ_apply_right {n : β„•} (m : Fin (n + 1) β†’ E) :
   rw [← iteratedFDerivWithin_univ, ← iteratedFDerivWithin_univ, ← fderivWithin_univ]
   exact iteratedFDerivWithin_succ_apply_right uniqueDiffOn_univ (mem_univ _) _
 #align iterated_fderiv_succ_apply_right iteratedFDeriv_succ_apply_right
+-/
 
 #print iteratedFDeriv_succ_eq_comp_right /-
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
@@ -1900,11 +2031,13 @@ theorem norm_iteratedFDeriv_fderiv {n : β„•} :
 #align norm_iterated_fderiv_fderiv norm_iteratedFDeriv_fderiv
 -/
 
+#print iteratedFDeriv_one_apply /-
 @[simp]
 theorem iteratedFDeriv_one_apply (m : Fin 1 β†’ E) :
     (iteratedFDeriv π•œ 1 f x : (Fin 1 β†’ E) β†’ F) m = (fderiv π•œ f x : E β†’ F) (m 0) := by
   rw [iteratedFDeriv_succ_apply_right, iteratedFDeriv_zero_apply]; rfl
 #align iterated_fderiv_one_apply iteratedFDeriv_one_apply
+-/
 
 #print contDiff_iff_ftaylorSeries /-
 /-- When a function is `C^n` in a set `s` of unique differentiability, it admits
@@ -1919,6 +2052,7 @@ theorem contDiff_iff_ftaylorSeries :
 #align cont_diff_iff_ftaylor_series contDiff_iff_ftaylorSeries
 -/
 
+#print contDiff_iff_continuous_differentiable /-
 theorem contDiff_iff_continuous_differentiable :
     ContDiff π•œ n f ↔
       (βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ Continuous fun x => iteratedFDeriv π•œ m f x) ∧
@@ -1927,24 +2061,31 @@ theorem contDiff_iff_continuous_differentiable :
   simp [cont_diff_on_univ.symm, continuous_iff_continuousOn_univ, differentiable_on_univ.symm,
     iteratedFDerivWithin_univ, contDiffOn_iff_continuousOn_differentiableOn uniqueDiffOn_univ]
 #align cont_diff_iff_continuous_differentiable contDiff_iff_continuous_differentiable
+-/
 
+#print ContDiff.continuous_iteratedFDeriv /-
 /-- If `f` is `C^n` then its `m`-times iterated derivative is continuous for `m ≀ n`. -/
 theorem ContDiff.continuous_iteratedFDeriv {m : β„•} (hm : (m : β„•βˆž) ≀ n) (hf : ContDiff π•œ n f) :
     Continuous fun x => iteratedFDeriv π•œ m f x :=
   (contDiff_iff_continuous_differentiable.mp hf).1 m hm
 #align cont_diff.continuous_iterated_fderiv ContDiff.continuous_iteratedFDeriv
+-/
 
+#print ContDiff.differentiable_iteratedFDeriv /-
 /-- If `f` is `C^n` then its `m`-times iterated derivative is differentiable for `m < n`. -/
 theorem ContDiff.differentiable_iteratedFDeriv {m : β„•} (hm : (m : β„•βˆž) < n) (hf : ContDiff π•œ n f) :
     Differentiable π•œ fun x => iteratedFDeriv π•œ m f x :=
   (contDiff_iff_continuous_differentiable.mp hf).2 m hm
 #align cont_diff.differentiable_iterated_fderiv ContDiff.differentiable_iteratedFDeriv
+-/
 
+#print contDiff_of_differentiable_iteratedFDeriv /-
 theorem contDiff_of_differentiable_iteratedFDeriv
     (h : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ Differentiable π•œ (iteratedFDeriv π•œ m f)) : ContDiff π•œ n f :=
   contDiff_iff_continuous_differentiable.2
     ⟨fun m hm => (h m hm).Continuous, fun m hm => h m (le_of_lt hm)⟩
 #align cont_diff_of_differentiable_iterated_fderiv contDiff_of_differentiable_iteratedFDeriv
+-/
 
 #print contDiff_succ_iff_fderiv /-
 /-- A function is `C^(n + 1)` if and only if it is differentiable,
@@ -1973,11 +2114,14 @@ theorem contDiff_top_iff_fderiv :
 #align cont_diff_top_iff_fderiv contDiff_top_iff_fderiv
 -/
 
+#print ContDiff.continuous_fderiv /-
 theorem ContDiff.continuous_fderiv (h : ContDiff π•œ n f) (hn : 1 ≀ n) :
     Continuous fun x => fderiv π•œ f x :=
   (contDiff_succ_iff_fderiv.1 (h.of_le hn)).2.Continuous
 #align cont_diff.continuous_fderiv ContDiff.continuous_fderiv
+-/
 
+#print ContDiff.continuous_fderiv_apply /-
 /-- If a function is at least `C^1`, its bundled derivative (mapping `(x, v)` to `Df(x) v`) is
 continuous. -/
 theorem ContDiff.continuous_fderiv_apply (h : ContDiff π•œ n f) (hn : 1 ≀ n) :
@@ -1987,4 +2131,5 @@ theorem ContDiff.continuous_fderiv_apply (h : ContDiff π•œ n f) (hn : 1 ≀ n)
     ((h.continuous_fderiv hn).comp continuous_fst).prod_mk continuous_snd
   A.comp B
 #align cont_diff.continuous_fderiv_apply ContDiff.continuous_fderiv_apply
+-/
 
Diff
@@ -967,7 +967,6 @@ theorem iteratedFDerivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ
           iteratedFDerivWithin π•œ (Nat.succ n) (fun y => fderivWithin π•œ f s y) s x (init m)
             (m (last (n + 1))) :=
         by rw [iteratedFDerivWithin_succ_apply_left, tail_init_eq_init_tail]; rfl
-      
 #align iterated_fderiv_within_succ_apply_right iteratedFDerivWithin_succ_apply_right
 
 #print iteratedFDerivWithin_succ_eq_comp_right /-
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit 3a69562db5a458db8322b190ec8d9a8bbd8a5b14
+! leanprover-community/mathlib commit 2ebc1d6c2fed9f54c95bbc3998eaa5570527129a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -17,6 +17,9 @@ import Mathbin.Analysis.Calculus.FormalMultilinearSeries
 /-!
 # Higher differentiability
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 A function is `C^1` on a domain if it is differentiable there, and its derivative is continuous.
 By induction, it is `C^n` if it is `C^{n-1}` and its (n-1)-th derivative is `C^1` there or,
 equivalently, if it is `C^1` and its derivative is `C^{n-1}`.
@@ -489,7 +492,7 @@ theorem ContDiffWithinAt.continuousWithinAt (h : ContDiffWithinAt π•œ n f s x)
 theorem ContDiffWithinAt.congr_of_eventuallyEq (h : ContDiffWithinAt π•œ n f s x)
     (h₁ : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x) : ContDiffWithinAt π•œ n f₁ s x := fun m hm =>
   let ⟨u, hu, p, H⟩ := h m hm
-  ⟨{ x ∈ u | f₁ x = f x }, Filter.inter_mem hu (mem_nhdsWithin_insert.2 ⟨hx, hβ‚βŸ©), p,
+  ⟨{x ∈ u | f₁ x = f x}, Filter.inter_mem hu (mem_nhdsWithin_insert.2 ⟨hx, hβ‚βŸ©), p,
     (H.mono (sep_subset _ _)).congr fun _ => And.right⟩
 #align cont_diff_within_at.congr_of_eventually_eq ContDiffWithinAt.congr_of_eventuallyEq
 -/
@@ -644,7 +647,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
           HasFDerivWithinAt (fun z => (continuousMultilinearCurryFin0 π•œ E F).symm (f z))
             (FormalMultilinearSeries.unshift (p' y) (f y) 1).curryLeft (v ∩ u) y
         rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
-        convert(f'_eq_deriv y hy.2).mono (inter_subset_right v u)
+        convert (f'_eq_deriv y hy.2).mono (inter_subset_right v u)
         rw [← Hp'.zero_eq y hy.1]
         ext z
         change
@@ -653,7 +656,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
         unfold_coes
         congr
         decide
-      Β· convert(Hp'.mono (inter_subset_left v u)).congr fun x hx => Hp'.zero_eq x hx.1
+      Β· convert (Hp'.mono (inter_subset_left v u)).congr fun x hx => Hp'.zero_eq x hx.1
         Β· ext (x y)
           change p' x 0 (init (@snoc 0 (fun i : Fin 1 => E) 0 y)) y = p' x 0 0 y
           rw [init_snoc]
@@ -1207,7 +1210,7 @@ theorem contDiffOn_of_continuousOn_differentiableOn
     simp only [ftaylorSeriesWithin, ContinuousMultilinearMap.uncurry0_apply,
       iteratedFDerivWithin_zero_apply]
   Β· intro k hk y hy
-    convert(Hdiff k (lt_of_lt_of_le hk hm) y hy).HasFDerivWithinAt
+    convert (Hdiff k (lt_of_lt_of_le hk hm) y hy).HasFDerivWithinAt
     simp only [ftaylorSeriesWithin, iteratedFDerivWithin_succ_eq_comp_left,
       ContinuousLinearEquiv.coe_apply, Function.comp_apply, coeFn_coeBase]
     exact ContinuousLinearMap.curry_uncurryLeft _
Diff
@@ -168,8 +168,8 @@ open scoped Classical BigOperators NNReal Topology Filter
 -- mathport name: «expr∞»
 local notation "∞" => (⊀ : β„•βˆž)
 
-attribute [local instance 1001]
-  NormedAddCommGroup.toAddCommGroup NormedSpace.toModule' AddCommGroup.toAddCommMonoid
+attribute [local instance 1001] NormedAddCommGroup.toAddCommGroup NormedSpace.toModule'
+  AddCommGroup.toAddCommMonoid
 
 open Set Fin Filter Function
 
@@ -187,7 +187,7 @@ variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddC
 derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a predicate analogous to
 `has_fderiv_within_at` but for higher order derivatives. -/
 structure HasFTaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F)
-  (s : Set E) : Prop where
+    (s : Set E) : Prop where
   zero_eq : βˆ€ x ∈ s, (p x 0).uncurry0 = f x
   fderivWithin :
     βˆ€ (m : β„•) (hm : (m : β„•βˆž) < n),
@@ -232,7 +232,7 @@ theorem HasFTaylorSeriesUpToOn.continuousOn (h : HasFTaylorSeriesUpToOn n f p s)
     ContinuousOn f s :=
   by
   have := (h.cont 0 bot_le).congr fun x hx => (h.zero_eq' hx).symm
-  rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this
+  rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this 
 #align has_ftaylor_series_up_to_on.continuous_on HasFTaylorSeriesUpToOn.continuousOn
 -/
 
@@ -376,8 +376,8 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
     refine' ⟨H.zero_eq, H.fderiv_within 0 (WithTop.coe_lt_coe.2 (Nat.succ_pos n)), _⟩
     constructor
     Β· intro x hx; rfl
-    Β· intro m(hm : (m : β„•βˆž) < n)x(hx : x ∈ s)
-      have A : (m.succ : β„•βˆž) < n.succ := by rw [WithTop.coe_lt_coe] at hm⊒;
+    Β· intro m (hm : (m : β„•βˆž) < n) x (hx : x ∈ s)
+      have A : (m.succ : β„•βˆž) < n.succ := by rw [WithTop.coe_lt_coe] at hm ⊒;
         exact nat.lt_succ_iff.mpr hm
       change
         HasFDerivWithinAt
@@ -390,8 +390,8 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
         (p x m.succ.succ) (snoc (cons y (init v)) (v (last _))) =
           (p x (Nat.succ (Nat.succ m))) (cons y v)
       rw [← cons_snoc_eq_snoc_cons, snoc_init_self]
-    Β· intro m(hm : (m : β„•βˆž) ≀ n)
-      have A : (m.succ : β„•βˆž) ≀ n.succ := by rw [WithTop.coe_le_coe] at hm⊒;
+    Β· intro m (hm : (m : β„•βˆž) ≀ n)
+      have A : (m.succ : β„•βˆž) ≀ n.succ := by rw [WithTop.coe_le_coe] at hm ⊒;
         exact nat.pred_le_iff.mp hm
       change
         ContinuousOn
@@ -401,33 +401,33 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
   · rintro ⟨Hzero_eq, Hfderiv_zero, Htaylor⟩
     constructor
     Β· exact Hzero_eq
-    Β· intro m(hm : (m : β„•βˆž) < n.succ)x(hx : x ∈ s)
+    Β· intro m (hm : (m : β„•βˆž) < n.succ) x (hx : x ∈ s)
       cases m
       Β· exact Hfderiv_zero x hx
-      Β· have A : (m : β„•βˆž) < n := by rw [WithTop.coe_lt_coe] at hm⊒; exact Nat.lt_of_succ_lt_succ hm
+      Β· have A : (m : β„•βˆž) < n := by rw [WithTop.coe_lt_coe] at hm ⊒; exact Nat.lt_of_succ_lt_succ hm
         have :
           HasFDerivWithinAt
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ)
             ((p x).shift m.succ).curryLeft s x :=
           Htaylor.fderiv_within _ A x hx
-        rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff'] at this
+        rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff'] at this 
         convert this
         ext (y v)
         change
           (p x (Nat.succ (Nat.succ m))) (cons y v) =
             (p x m.succ.succ) (snoc (cons y (init v)) (v (last _)))
         rw [← cons_snoc_eq_snoc_cons, snoc_init_self]
-    Β· intro m(hm : (m : β„•βˆž) ≀ n.succ)
+    Β· intro m (hm : (m : β„•βˆž) ≀ n.succ)
       cases m
       Β· have : DifferentiableOn π•œ (fun x => p x 0) s := fun x hx =>
           (Hfderiv_zero x hx).DifferentiableWithinAt
         exact this.continuous_on
-      Β· have A : (m : β„•βˆž) ≀ n := by rw [WithTop.coe_le_coe] at hm⊒; exact nat.lt_succ_iff.mp hm
+      Β· have A : (m : β„•βˆž) ≀ n := by rw [WithTop.coe_le_coe] at hm ⊒; exact nat.lt_succ_iff.mp hm
         have :
           ContinuousOn
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ) s :=
           Htaylor.cont _ A
-        rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this
+        rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this 
 #align has_ftaylor_series_up_to_on_succ_iff_right hasFTaylorSeriesUpToOn_succ_iff_right
 
 /-! ### Smooth functions within a set around a point -/
@@ -480,7 +480,7 @@ theorem ContDiffWithinAt.continuousWithinAt (h : ContDiffWithinAt π•œ n f s x)
     ContinuousWithinAt f s x :=
   by
   rcases h 0 bot_le with ⟨u, hu, p, H⟩
-  rw [mem_nhdsWithin_insert] at hu
+  rw [mem_nhdsWithin_insert] at hu 
   exact (H.continuous_on.continuous_within_at hu.1).mono_of_mem hu.2
 #align cont_diff_within_at.continuous_within_at ContDiffWithinAt.continuousWithinAt
 -/
@@ -601,7 +601,7 @@ theorem ContDiffWithinAt.differentiable_within_at' (h : ContDiffWithinAt π•œ n
   by
   rcases h 1 hn with ⟨u, hu, p, H⟩
   rcases mem_nhdsWithin.1 hu with ⟨t, t_open, xt, tu⟩
-  rw [inter_comm] at tu
+  rw [inter_comm] at tu 
   have := ((H.mono tu).DifferentiableOn le_rfl) x ⟨mem_insert x s, xt⟩
   exact (differentiableWithinAt_inter (IsOpen.mem_nhds t_open xt)).1 this
 #align cont_diff_within_at.differentiable_within_at' ContDiffWithinAt.differentiable_within_at'
@@ -629,7 +629,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
     Β· convert self_mem_nhdsWithin
       have : x ∈ insert x s := by simp
       exact insert_eq_of_mem (mem_of_mem_nhdsWithin this hu)
-    Β· rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp
+    Β· rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp 
       exact Hp.2.2.of_le hm
   · rintro ⟨u, hu, f', f'_eq_deriv, Hf'⟩
     rw [contDiffWithinAt_nat]
@@ -677,7 +677,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt' {n : β„•} :
   refine' ⟨fun hf => _, _⟩
   · obtain ⟨u, hu, f', huf', hf'⟩ := cont_diff_within_at_succ_iff_has_fderiv_within_at.mp hf
     obtain ⟨w, hw, hxw, hwu⟩ := mem_nhds_within.mp hu
-    rw [inter_comm] at hwu
+    rw [inter_comm] at hwu 
     refine'
       ⟨insert x s ∩ w, inter_mem_nhdsWithin _ (hw.mem_nhds hxw), inter_subset_left _ _, f',
         fun y hy => _, _⟩
@@ -733,7 +733,7 @@ theorem ContDiffWithinAt.contDiffOn' {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : Co
   by
   rcases h m hm with ⟨t, ht, p, hp⟩
   rcases mem_nhdsWithin.1 ht with ⟨u, huo, hxu, hut⟩
-  rw [inter_comm] at hut
+  rw [inter_comm] at hut 
   exact ⟨u, huo, hxu, (hp.mono hut).ContDiffOn⟩
 #align cont_diff_within_at.cont_diff_on' ContDiffWithinAt.contDiffOn'
 
@@ -782,7 +782,7 @@ theorem contDiffOn_all_iff_nat : (βˆ€ n, ContDiffOn π•œ n f s) ↔ βˆ€ n : β„•,
   by
   refine' ⟨fun H n => H n, _⟩
   rintro H (_ | n)
-  exacts[contDiffOn_top.2 H, H n]
+  exacts [contDiffOn_top.2 H, H n]
 #align cont_diff_on_all_iff_nat contDiffOn_all_iff_nat
 -/
 
@@ -845,7 +845,7 @@ theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
     refine'
       ⟨u, hu, fun y => (continuousMultilinearCurryFin1 π•œ E F) (p y 1), fun y hy =>
         Hp.has_fderiv_within_at (WithTop.coe_le_coe.2 (Nat.le_add_left 1 n)) hy, _⟩
-    rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp
+    rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp 
     intro z hz m hm
     refine' ⟨u, _, fun x : E => (p x).shift, Hp.2.2.of_le hm⟩
     convert self_mem_nhdsWithin
@@ -1118,7 +1118,7 @@ theorem contDiffWithinAt_zero (hx : x ∈ s) :
     obtain ⟨u, H, p, hp⟩ := h 0 (by norm_num)
     refine' ⟨u, _, _⟩
     Β· simpa [hx] using H
-    Β· simp only [WithTop.coe_zero, hasFTaylorSeriesUpToOn_zero_iff] at hp
+    Β· simp only [WithTop.coe_zero, hasFTaylorSeriesUpToOn_zero_iff] at hp 
       exact hp.1.mono (inter_subset_right s u)
   · rintro ⟨u, H, hu⟩
     rw [← contDiffWithinAt_inter' H]
@@ -1156,9 +1156,9 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
       iteratedFDerivWithin_zero_apply]
   Β· intro m hm x hx
     rcases(h x hx) m.succ (ENat.add_one_le_of_lt hm) with ⟨u, hu, p, Hp⟩
-    rw [insert_eq_of_mem hx] at hu
+    rw [insert_eq_of_mem hx] at hu 
     rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
-    rw [inter_comm] at ho
+    rw [inter_comm] at ho 
     have : p x m.succ = ftaylorSeriesWithin π•œ f s x m.succ :=
       by
       change p x m.succ = iteratedFDerivWithin π•œ m.succ f s x
@@ -1181,8 +1181,8 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
     intro x hx
     rcases h x hx m hm with ⟨u, hu, p, Hp⟩
     rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
-    rw [insert_eq_of_mem hx] at ho
-    rw [inter_comm] at ho
+    rw [insert_eq_of_mem hx] at ho 
+    rw [inter_comm] at ho 
     refine' ⟨o, o_open, xo, _⟩
     have A : βˆ€ y ∈ s ∩ o, p y m = ftaylorSeriesWithin π•œ f s y m :=
       by
@@ -1244,13 +1244,13 @@ theorem ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin {m : β„•}
     simp only [set_eventually_eq_iff_inf_principal, ← nhdsWithin_inter']
     rw [← inter_assoc, nhdsWithin_inter_of_mem', ← diff_eq_compl_inter, insert_diff_of_mem,
       diff_eq_compl_inter]
-    exacts[rfl, mem_nhdsWithin_of_mem_nhds (uo.mem_nhds xu)]
+    exacts [rfl, mem_nhdsWithin_of_mem_nhds (uo.mem_nhds xu)]
   have B : iteratedFDerivWithin π•œ m f s =αΆ [𝓝 x] iteratedFDerivWithin π•œ m f t :=
     iteratedFDerivWithin_eventually_congr_set' _ A.symm _
   have C : DifferentiableWithinAt π•œ (iteratedFDerivWithin π•œ m f t) t x :=
     hu.differentiable_on_iterated_fderiv_within (Nat.cast_lt.2 m.lt_succ_self) (hs.inter uo) x
       ⟨mem_insert _ _, xu⟩
-  rw [differentiableWithinAt_congr_set' _ A] at C
+  rw [differentiableWithinAt_congr_set' _ A] at C 
   exact C.congr_of_eventually_eq (B.filter_mono inf_le_left) B.self_of_nhds
 #align cont_diff_within_at.differentiable_within_at_iterated_fderiv_within ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin
 
@@ -1286,16 +1286,16 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
   refine' ⟨H.differentiable_on (WithTop.coe_le_coe.2 (Nat.le_add_left 1 n)), fun x hx => _⟩
   rcases contDiffWithinAt_succ_iff_hasFDerivWithinAt.1 (H x hx) with ⟨u, hu, f', hff', hf'⟩
   rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
-  rw [inter_comm, insert_eq_of_mem hx] at ho
+  rw [inter_comm, insert_eq_of_mem hx] at ho 
   have := hf'.mono ho
-  rw [contDiffWithinAt_inter' (mem_nhdsWithin_of_mem_nhds (IsOpen.mem_nhds o_open xo))] at this
+  rw [contDiffWithinAt_inter' (mem_nhdsWithin_of_mem_nhds (IsOpen.mem_nhds o_open xo))] at this 
   apply this.congr_of_eventually_eq' _ hx
   have : o ∩ s ∈ 𝓝[s] x := mem_nhdsWithin.2 ⟨o, o_open, xo, subset.refl _⟩
-  rw [inter_comm] at this
+  rw [inter_comm] at this 
   apply Filter.eventuallyEq_of_mem this fun y hy => _
   have A : fderivWithin π•œ f (s ∩ o) y = f' y :=
     ((hff' y (ho hy)).mono ho).fderivWithin (hs.inter o_open y hy)
-  rwa [fderivWithin_inter (o_open.mem_nhds hy.2)] at A
+  rwa [fderivWithin_inter (o_open.mem_nhds hy.2)] at A 
 #align cont_diff_on_succ_iff_fderiv_within contDiffOn_succ_iff_fderivWithin
 -/
 
@@ -1369,11 +1369,11 @@ theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn
     (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (fun y => fderivWithin π•œ f s y) s :=
   by
   cases m
-  Β· change ∞ + 1 ≀ n at hmn
+  Β· change ∞ + 1 ≀ n at hmn 
     have : n = ∞ := by simpa using hmn
-    rw [this] at hf
+    rw [this] at hf 
     exact ((contDiffOn_top_iff_fderivWithin hs).1 hf).2
-  Β· change (m.succ : β„•βˆž) ≀ n at hmn
+  Β· change (m.succ : β„•βˆž) ≀ n at hmn 
     exact ((contDiffOn_succ_iff_fderivWithin hs).1 (hf.of_le hmn)).2
 #align cont_diff_on.fderiv_within ContDiffOn.fderivWithin
 
@@ -1400,7 +1400,7 @@ theorem ContDiffOn.continuousOn_fderiv_of_open (h : ContDiffOn π•œ n f s) (hs :
 derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a predicate analogous to
 `has_fderiv_at` but for higher order derivatives. -/
 structure HasFTaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F) :
-  Prop where
+    Prop where
   zero_eq : βˆ€ x, (p x 0).uncurry0 = f x
   fderiv : βˆ€ (m : β„•) (hm : (m : β„•βˆž) < n), βˆ€ x, HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x
   cont : βˆ€ (m : β„•) (hm : (m : β„•βˆž) ≀ n), Continuous fun x => p x m
@@ -1446,13 +1446,14 @@ theorem HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn (h : HasFTaylorSeriesUpTo n
 -/
 
 theorem HasFTaylorSeriesUpTo.ofLe (h : HasFTaylorSeriesUpTo n f p) (hmn : m ≀ n) :
-    HasFTaylorSeriesUpTo m f p := by rw [← hasFTaylorSeriesUpToOn_univ_iff] at h⊒; exact h.of_le hmn
+    HasFTaylorSeriesUpTo m f p := by rw [← hasFTaylorSeriesUpToOn_univ_iff] at h ⊒;
+  exact h.of_le hmn
 #align has_ftaylor_series_up_to.of_le HasFTaylorSeriesUpTo.ofLe
 
 #print HasFTaylorSeriesUpTo.continuous /-
 theorem HasFTaylorSeriesUpTo.continuous (h : HasFTaylorSeriesUpTo n f p) : Continuous f :=
   by
-  rw [← hasFTaylorSeriesUpToOn_univ_iff] at h
+  rw [← hasFTaylorSeriesUpToOn_univ_iff] at h 
   rw [continuous_iff_continuousOn_univ]
   exact h.continuous_on
 #align has_ftaylor_series_up_to.continuous HasFTaylorSeriesUpTo.continuous
Diff
@@ -182,54 +182,63 @@ variable {π•œ : Type _} [NontriviallyNormedField π•œ] {E : Type _} [NormedAddC
 /-! ### Functions with a Taylor series on a domain -/
 
 
+#print HasFTaylorSeriesUpToOn /-
 /-- `has_ftaylor_series_up_to_on n f p s` registers the fact that `p 0 = f` and `p (m+1)` is a
 derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a predicate analogous to
 `has_fderiv_within_at` but for higher order derivatives. -/
-structure HasFtaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F)
+structure HasFTaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F)
   (s : Set E) : Prop where
   zero_eq : βˆ€ x ∈ s, (p x 0).uncurry0 = f x
   fderivWithin :
     βˆ€ (m : β„•) (hm : (m : β„•βˆž) < n),
       βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x
   cont : βˆ€ (m : β„•) (hm : (m : β„•βˆž) ≀ n), ContinuousOn (fun x => p x m) s
-#align has_ftaylor_series_up_to_on HasFtaylorSeriesUpToOn
+#align has_ftaylor_series_up_to_on HasFTaylorSeriesUpToOn
+-/
 
-theorem HasFtaylorSeriesUpToOn.zero_eq' (h : HasFtaylorSeriesUpToOn n f p s) {x : E} (hx : x ∈ s) :
+theorem HasFTaylorSeriesUpToOn.zero_eq' (h : HasFTaylorSeriesUpToOn n f p s) {x : E} (hx : x ∈ s) :
     p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) := by rw [← h.zero_eq x hx]; symm;
   exact ContinuousMultilinearMap.uncurry0_curry0 _
-#align has_ftaylor_series_up_to_on.zero_eq' HasFtaylorSeriesUpToOn.zero_eq'
+#align has_ftaylor_series_up_to_on.zero_eq' HasFTaylorSeriesUpToOn.zero_eq'
 
+#print HasFTaylorSeriesUpToOn.congr /-
 /-- If two functions coincide on a set `s`, then a Taylor series for the first one is as well a
 Taylor series for the second one. -/
-theorem HasFtaylorSeriesUpToOn.congr (h : HasFtaylorSeriesUpToOn n f p s)
-    (h₁ : βˆ€ x ∈ s, f₁ x = f x) : HasFtaylorSeriesUpToOn n f₁ p s :=
+theorem HasFTaylorSeriesUpToOn.congr (h : HasFTaylorSeriesUpToOn n f p s)
+    (h₁ : βˆ€ x ∈ s, f₁ x = f x) : HasFTaylorSeriesUpToOn n f₁ p s :=
   by
   refine' ⟨fun x hx => _, h.fderiv_within, h.cont⟩
   rw [h₁ x hx]
   exact h.zero_eq x hx
-#align has_ftaylor_series_up_to_on.congr HasFtaylorSeriesUpToOn.congr
+#align has_ftaylor_series_up_to_on.congr HasFTaylorSeriesUpToOn.congr
+-/
 
-theorem HasFtaylorSeriesUpToOn.mono (h : HasFtaylorSeriesUpToOn n f p s) {t : Set E} (hst : t βŠ† s) :
-    HasFtaylorSeriesUpToOn n f p t :=
+#print HasFTaylorSeriesUpToOn.mono /-
+theorem HasFTaylorSeriesUpToOn.mono (h : HasFTaylorSeriesUpToOn n f p s) {t : Set E} (hst : t βŠ† s) :
+    HasFTaylorSeriesUpToOn n f p t :=
   ⟨fun x hx => h.zero_eq x (hst hx), fun m hm x hx => (h.fderivWithin m hm x (hst hx)).mono hst,
     fun m hm => (h.cont m hm).mono hst⟩
-#align has_ftaylor_series_up_to_on.mono HasFtaylorSeriesUpToOn.mono
+#align has_ftaylor_series_up_to_on.mono HasFTaylorSeriesUpToOn.mono
+-/
 
-theorem HasFtaylorSeriesUpToOn.ofLe (h : HasFtaylorSeriesUpToOn n f p s) (hmn : m ≀ n) :
-    HasFtaylorSeriesUpToOn m f p s :=
+theorem HasFTaylorSeriesUpToOn.of_le (h : HasFTaylorSeriesUpToOn n f p s) (hmn : m ≀ n) :
+    HasFTaylorSeriesUpToOn m f p s :=
   ⟨h.zero_eq, fun k hk x hx => h.fderivWithin k (lt_of_lt_of_le hk hmn) x hx, fun k hk =>
     h.cont k (le_trans hk hmn)⟩
-#align has_ftaylor_series_up_to_on.of_le HasFtaylorSeriesUpToOn.ofLe
+#align has_ftaylor_series_up_to_on.of_le HasFTaylorSeriesUpToOn.of_le
 
-theorem HasFtaylorSeriesUpToOn.continuousOn (h : HasFtaylorSeriesUpToOn n f p s) :
+#print HasFTaylorSeriesUpToOn.continuousOn /-
+theorem HasFTaylorSeriesUpToOn.continuousOn (h : HasFTaylorSeriesUpToOn n f p s) :
     ContinuousOn f s :=
   by
   have := (h.cont 0 bot_le).congr fun x hx => (h.zero_eq' hx).symm
   rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this
-#align has_ftaylor_series_up_to_on.continuous_on HasFtaylorSeriesUpToOn.continuousOn
+#align has_ftaylor_series_up_to_on.continuous_on HasFTaylorSeriesUpToOn.continuousOn
+-/
 
-theorem hasFtaylorSeriesUpToOn_zero_iff :
-    HasFtaylorSeriesUpToOn 0 f p s ↔ ContinuousOn f s ∧ βˆ€ x ∈ s, (p x 0).uncurry0 = f x :=
+#print hasFTaylorSeriesUpToOn_zero_iff /-
+theorem hasFTaylorSeriesUpToOn_zero_iff :
+    HasFTaylorSeriesUpToOn 0 f p s ↔ ContinuousOn f s ∧ βˆ€ x ∈ s, (p x 0).uncurry0 = f x :=
   by
   refine'
     ⟨fun H => ⟨H.ContinuousOn, H.zero_eq⟩, fun H =>
@@ -240,10 +249,12 @@ theorem hasFtaylorSeriesUpToOn_zero_iff :
     rw [← H.2 x hx]; symm; exact ContinuousMultilinearMap.uncurry0_curry0 _
   rw [continuousOn_congr this, LinearIsometryEquiv.comp_continuousOn_iff]
   exact H.1
-#align has_ftaylor_series_up_to_on_zero_iff hasFtaylorSeriesUpToOn_zero_iff
+#align has_ftaylor_series_up_to_on_zero_iff hasFTaylorSeriesUpToOn_zero_iff
+-/
 
-theorem hasFtaylorSeriesUpToOn_top_iff :
-    HasFtaylorSeriesUpToOn ∞ f p s ↔ βˆ€ n : β„•, HasFtaylorSeriesUpToOn n f p s :=
+#print hasFTaylorSeriesUpToOn_top_iff /-
+theorem hasFTaylorSeriesUpToOn_top_iff :
+    HasFTaylorSeriesUpToOn ∞ f p s ↔ βˆ€ n : β„•, HasFTaylorSeriesUpToOn n f p s :=
   by
   constructor
   Β· intro H n; exact H.of_le le_top
@@ -254,12 +265,14 @@ theorem hasFtaylorSeriesUpToOn_top_iff :
       apply (H m.succ).fderivWithin m (WithTop.coe_lt_coe.2 (lt_add_one m))
     Β· intro m hm
       apply (H m).cont m le_rfl
-#align has_ftaylor_series_up_to_on_top_iff hasFtaylorSeriesUpToOn_top_iff
+#align has_ftaylor_series_up_to_on_top_iff hasFTaylorSeriesUpToOn_top_iff
+-/
 
+#print hasFTaylorSeriesUpToOn_top_iff' /-
 /-- In the case that `n = ∞` we don't need the continuity assumption in
 `has_ftaylor_series_up_to_on`. -/
-theorem hasFtaylorSeriesUpToOn_top_iff' :
-    HasFtaylorSeriesUpToOn ∞ f p s ↔
+theorem hasFTaylorSeriesUpToOn_top_iff' :
+    HasFTaylorSeriesUpToOn ∞ f p s ↔
       (βˆ€ x ∈ s, (p x 0).uncurry0 = f x) ∧
         βˆ€ m : β„•, βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x :=
   ⟨-- Everything except for the continuity is trivial:
@@ -268,11 +281,12 @@ theorem hasFtaylorSeriesUpToOn_top_iff' :
       (-- The continuity follows from the existence of a derivative:
             h.2
           m x hx).ContinuousWithinAt⟩⟩
-#align has_ftaylor_series_up_to_on_top_iff' hasFtaylorSeriesUpToOn_top_iff'
+#align has_ftaylor_series_up_to_on_top_iff' hasFTaylorSeriesUpToOn_top_iff'
+-/
 
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
-theorem HasFtaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
+theorem HasFTaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
     (hx : x ∈ s) : HasFDerivWithinAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x :=
   by
   have A : βˆ€ y ∈ s, f y = (continuousMultilinearCurryFin0 π•œ E F) (p y 0) := by intro y hy;
@@ -290,39 +304,39 @@ theorem HasFtaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFtaylorSeriesUpToOn n f
   congr with i
   rw [Unique.eq_default i]
   rfl
-#align has_ftaylor_series_up_to_on.has_fderiv_within_at HasFtaylorSeriesUpToOn.hasFDerivWithinAt
+#align has_ftaylor_series_up_to_on.has_fderiv_within_at HasFTaylorSeriesUpToOn.hasFDerivWithinAt
 
-theorem HasFtaylorSeriesUpToOn.differentiableOn (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n) :
+theorem HasFTaylorSeriesUpToOn.differentiableOn (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n) :
     DifferentiableOn π•œ f s := fun x hx => (h.HasFDerivWithinAt hn hx).DifferentiableWithinAt
-#align has_ftaylor_series_up_to_on.differentiable_on HasFtaylorSeriesUpToOn.differentiableOn
+#align has_ftaylor_series_up_to_on.differentiable_on HasFTaylorSeriesUpToOn.differentiableOn
 
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then the term
 of order `1` of this series is a derivative of `f` at `x`. -/
-theorem HasFtaylorSeriesUpToOn.hasFDerivAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
+theorem HasFTaylorSeriesUpToOn.hasFDerivAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
     (hx : s ∈ 𝓝 x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) x :=
   (h.HasFDerivWithinAt hn (mem_of_mem_nhds hx)).HasFDerivAt hx
-#align has_ftaylor_series_up_to_on.has_fderiv_at HasFtaylorSeriesUpToOn.hasFDerivAt
+#align has_ftaylor_series_up_to_on.has_fderiv_at HasFTaylorSeriesUpToOn.hasFDerivAt
 
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
 in a neighborhood of `x`, the term of order `1` of this series is a derivative of `f`. -/
-theorem HasFtaylorSeriesUpToOn.eventually_hasFDerivAt (h : HasFtaylorSeriesUpToOn n f p s)
+theorem HasFTaylorSeriesUpToOn.eventually_hasFDerivAt (h : HasFTaylorSeriesUpToOn n f p s)
     (hn : 1 ≀ n) (hx : s ∈ 𝓝 x) :
     βˆ€αΆ  y in 𝓝 x, HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p y 1)) y :=
   (eventually_eventually_nhds.2 hx).mono fun y hy => h.HasFDerivAt hn hy
-#align has_ftaylor_series_up_to_on.eventually_has_fderiv_at HasFtaylorSeriesUpToOn.eventually_hasFDerivAt
+#align has_ftaylor_series_up_to_on.eventually_has_fderiv_at HasFTaylorSeriesUpToOn.eventually_hasFDerivAt
 
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
 it is differentiable at `x`. -/
-theorem HasFtaylorSeriesUpToOn.differentiableAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
+theorem HasFTaylorSeriesUpToOn.differentiableAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
     (hx : s ∈ 𝓝 x) : DifferentiableAt π•œ f x :=
   (h.HasFDerivAt hn hx).DifferentiableAt
-#align has_ftaylor_series_up_to_on.differentiable_at HasFtaylorSeriesUpToOn.differentiableAt
+#align has_ftaylor_series_up_to_on.differentiable_at HasFTaylorSeriesUpToOn.differentiableAt
 
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p` is a Taylor series up to `n`, and
 `p (n + 1)` is a derivative of `p n`. -/
-theorem hasFtaylorSeriesUpToOn_succ_iff_left {n : β„•} :
-    HasFtaylorSeriesUpToOn (n + 1) f p s ↔
-      HasFtaylorSeriesUpToOn n f p s ∧
+theorem hasFTaylorSeriesUpToOn_succ_iff_left {n : β„•} :
+    HasFTaylorSeriesUpToOn (n + 1) f p s ↔
+      HasFTaylorSeriesUpToOn n f p s ∧
         (βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y n) (p x n.succ).curryLeft s x) ∧
           ContinuousOn (fun x => p x (n + 1)) s :=
   by
@@ -346,15 +360,15 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_left {n : β„•} :
       Β· have : m = n + 1 := le_antisymm (WithTop.coe_le_coe.1 hm) (not_le.1 h')
         rw [this]
         exact h.2.2
-#align has_ftaylor_series_up_to_on_succ_iff_left hasFtaylorSeriesUpToOn_succ_iff_left
+#align has_ftaylor_series_up_to_on_succ_iff_left hasFTaylorSeriesUpToOn_succ_iff_left
 
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p.shift` is a Taylor series up to `n`
 for `p 1`, which is a derivative of `f`. -/
-theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
-    HasFtaylorSeriesUpToOn (n + 1 : β„•) f p s ↔
+theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
+    HasFTaylorSeriesUpToOn (n + 1 : β„•) f p s ↔
       (βˆ€ x ∈ s, (p x 0).uncurry0 = f x) ∧
         (βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y 0) (p x 1).curryLeft s x) ∧
-          HasFtaylorSeriesUpToOn n (fun x => continuousMultilinearCurryFin1 π•œ E F (p x 1))
+          HasFTaylorSeriesUpToOn n (fun x => continuousMultilinearCurryFin1 π•œ E F (p x 1))
             (fun x => (p x).shift) s :=
   by
   constructor
@@ -414,13 +428,14 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ) s :=
           Htaylor.cont _ A
         rwa [LinearIsometryEquiv.comp_continuousOn_iff] at this
-#align has_ftaylor_series_up_to_on_succ_iff_right hasFtaylorSeriesUpToOn_succ_iff_right
+#align has_ftaylor_series_up_to_on_succ_iff_right hasFTaylorSeriesUpToOn_succ_iff_right
 
 /-! ### Smooth functions within a set around a point -/
 
 
 variable (π•œ)
 
+#print ContDiffWithinAt /-
 /-- A function is continuously differentiable up to order `n` within a set `s` at a point `x` if
 it admits continuous derivatives up to order `n` in a neighborhood of `x` in `s βˆͺ {x}`.
 For `n = ∞`, we only require that this holds up to any finite order (where the neighborhood may
@@ -432,15 +447,16 @@ better, is `C^∞` at `0` within `univ`.
 def ContDiffWithinAt (n : β„•βˆž) (f : E β†’ F) (s : Set E) (x : E) : Prop :=
   βˆ€ m : β„•,
     (m : β„•βˆž) ≀ n β†’
-      βˆƒ u ∈ 𝓝[insert x s] x, βˆƒ p : E β†’ FormalMultilinearSeries π•œ E F, HasFtaylorSeriesUpToOn m f p u
+      βˆƒ u ∈ 𝓝[insert x s] x, βˆƒ p : E β†’ FormalMultilinearSeries π•œ E F, HasFTaylorSeriesUpToOn m f p u
 #align cont_diff_within_at ContDiffWithinAt
+-/
 
 variable {π•œ}
 
 theorem contDiffWithinAt_nat {n : β„•} :
     ContDiffWithinAt π•œ n f s x ↔
       βˆƒ u ∈ 𝓝[insert x s] x,
-        βˆƒ p : E β†’ FormalMultilinearSeries π•œ E F, HasFtaylorSeriesUpToOn n f p u :=
+        βˆƒ p : E β†’ FormalMultilinearSeries π•œ E F, HasFTaylorSeriesUpToOn n f p u :=
   ⟨fun H => H n le_rfl, fun ⟨u, hu, p, hp⟩ m hm => ⟨u, hu, p, hp.of_le hm⟩⟩
 #align cont_diff_within_at_nat contDiffWithinAt_nat
 
@@ -453,10 +469,13 @@ theorem contDiffWithinAt_iff_forall_nat_le :
   ⟨fun H m hm => H.of_le hm, fun H m hm => H m hm _ le_rfl⟩
 #align cont_diff_within_at_iff_forall_nat_le contDiffWithinAt_iff_forall_nat_le
 
+#print contDiffWithinAt_top /-
 theorem contDiffWithinAt_top : ContDiffWithinAt π•œ ∞ f s x ↔ βˆ€ n : β„•, ContDiffWithinAt π•œ n f s x :=
   contDiffWithinAt_iff_forall_nat_le.trans <| by simp only [forall_prop_of_true, le_top]
 #align cont_diff_within_at_top contDiffWithinAt_top
+-/
 
+#print ContDiffWithinAt.continuousWithinAt /-
 theorem ContDiffWithinAt.continuousWithinAt (h : ContDiffWithinAt π•œ n f s x) :
     ContinuousWithinAt f s x :=
   by
@@ -464,41 +483,55 @@ theorem ContDiffWithinAt.continuousWithinAt (h : ContDiffWithinAt π•œ n f s x)
   rw [mem_nhdsWithin_insert] at hu
   exact (H.continuous_on.continuous_within_at hu.1).mono_of_mem hu.2
 #align cont_diff_within_at.continuous_within_at ContDiffWithinAt.continuousWithinAt
+-/
 
+#print ContDiffWithinAt.congr_of_eventuallyEq /-
 theorem ContDiffWithinAt.congr_of_eventuallyEq (h : ContDiffWithinAt π•œ n f s x)
     (h₁ : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x) : ContDiffWithinAt π•œ n f₁ s x := fun m hm =>
   let ⟨u, hu, p, H⟩ := h m hm
   ⟨{ x ∈ u | f₁ x = f x }, Filter.inter_mem hu (mem_nhdsWithin_insert.2 ⟨hx, hβ‚βŸ©), p,
     (H.mono (sep_subset _ _)).congr fun _ => And.right⟩
 #align cont_diff_within_at.congr_of_eventually_eq ContDiffWithinAt.congr_of_eventuallyEq
+-/
 
+#print ContDiffWithinAt.congr_of_eventuallyEq_insert /-
 theorem ContDiffWithinAt.congr_of_eventuallyEq_insert (h : ContDiffWithinAt π•œ n f s x)
     (h₁ : f₁ =αΆ [𝓝[insert x s] x] f) : ContDiffWithinAt π•œ n f₁ s x :=
   h.congr_of_eventuallyEq (nhdsWithin_mono x (subset_insert x s) h₁)
     (mem_of_mem_nhdsWithin (mem_insert x s) h₁ : _)
 #align cont_diff_within_at.congr_of_eventually_eq_insert ContDiffWithinAt.congr_of_eventuallyEq_insert
+-/
 
+#print ContDiffWithinAt.congr_of_eventually_eq' /-
 theorem ContDiffWithinAt.congr_of_eventually_eq' (h : ContDiffWithinAt π•œ n f s x)
     (h₁ : f₁ =αΆ [𝓝[s] x] f) (hx : x ∈ s) : ContDiffWithinAt π•œ n f₁ s x :=
   h.congr_of_eventuallyEq h₁ <| h₁.self_of_nhdsWithin hx
 #align cont_diff_within_at.congr_of_eventually_eq' ContDiffWithinAt.congr_of_eventually_eq'
+-/
 
+#print Filter.EventuallyEq.contDiffWithinAt_iff /-
 theorem Filter.EventuallyEq.contDiffWithinAt_iff (h₁ : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x) :
     ContDiffWithinAt π•œ n f₁ s x ↔ ContDiffWithinAt π•œ n f s x :=
   ⟨fun H => ContDiffWithinAt.congr_of_eventuallyEq H h₁.symm hx.symm, fun H =>
     H.congr_of_eventuallyEq h₁ hx⟩
 #align filter.eventually_eq.cont_diff_within_at_iff Filter.EventuallyEq.contDiffWithinAt_iff
+-/
 
+#print ContDiffWithinAt.congr /-
 theorem ContDiffWithinAt.congr (h : ContDiffWithinAt π•œ n f s x) (h₁ : βˆ€ y ∈ s, f₁ y = f y)
     (hx : f₁ x = f x) : ContDiffWithinAt π•œ n f₁ s x :=
   h.congr_of_eventuallyEq (Filter.eventuallyEq_of_mem self_mem_nhdsWithin h₁) hx
 #align cont_diff_within_at.congr ContDiffWithinAt.congr
+-/
 
+#print ContDiffWithinAt.congr' /-
 theorem ContDiffWithinAt.congr' (h : ContDiffWithinAt π•œ n f s x) (h₁ : βˆ€ y ∈ s, f₁ y = f y)
     (hx : x ∈ s) : ContDiffWithinAt π•œ n f₁ s x :=
   h.congr h₁ (h₁ _ hx)
 #align cont_diff_within_at.congr' ContDiffWithinAt.congr'
+-/
 
+#print ContDiffWithinAt.mono_of_mem /-
 theorem ContDiffWithinAt.mono_of_mem (h : ContDiffWithinAt π•œ n f s x) {t : Set E}
     (hst : s ∈ 𝓝[t] x) : ContDiffWithinAt π•œ n f t x :=
   by
@@ -506,21 +539,28 @@ theorem ContDiffWithinAt.mono_of_mem (h : ContDiffWithinAt π•œ n f s x) {t : Se
   rcases h m hm with ⟨u, hu, p, H⟩
   exact ⟨u, nhdsWithin_le_of_mem (insert_mem_nhdsWithin_insert hst) hu, p, H⟩
 #align cont_diff_within_at.mono_of_mem ContDiffWithinAt.mono_of_mem
+-/
 
+#print ContDiffWithinAt.mono /-
 theorem ContDiffWithinAt.mono (h : ContDiffWithinAt π•œ n f s x) {t : Set E} (hst : t βŠ† s) :
     ContDiffWithinAt π•œ n f t x :=
   h.mono_of_mem <| Filter.mem_of_superset self_mem_nhdsWithin hst
 #align cont_diff_within_at.mono ContDiffWithinAt.mono
+-/
 
+#print ContDiffWithinAt.congr_nhds /-
 theorem ContDiffWithinAt.congr_nhds (h : ContDiffWithinAt π•œ n f s x) {t : Set E}
     (hst : 𝓝[s] x = 𝓝[t] x) : ContDiffWithinAt π•œ n f t x :=
   h.mono_of_mem <| hst β–Έ self_mem_nhdsWithin
 #align cont_diff_within_at.congr_nhds ContDiffWithinAt.congr_nhds
+-/
 
+#print contDiffWithinAt_congr_nhds /-
 theorem contDiffWithinAt_congr_nhds {t : Set E} (hst : 𝓝[s] x = 𝓝[t] x) :
     ContDiffWithinAt π•œ n f s x ↔ ContDiffWithinAt π•œ n f t x :=
   ⟨fun h => h.congr_nhds hst, fun h => h.congr_nhds hst.symm⟩
 #align cont_diff_within_at_congr_nhds contDiffWithinAt_congr_nhds
+-/
 
 theorem contDiffWithinAt_inter' (h : t ∈ 𝓝[s] x) :
     ContDiffWithinAt π•œ n f (s ∩ t) x ↔ ContDiffWithinAt π•œ n f s x :=
@@ -532,6 +572,7 @@ theorem contDiffWithinAt_inter (h : t ∈ 𝓝 x) :
   contDiffWithinAt_inter' (mem_nhdsWithin_of_mem_nhds h)
 #align cont_diff_within_at_inter contDiffWithinAt_inter
 
+#print contDiffWithinAt_insert /-
 theorem contDiffWithinAt_insert {y : E} :
     ContDiffWithinAt π•œ n f (insert y s) x ↔ ContDiffWithinAt π•œ n f s x :=
   by
@@ -540,15 +581,18 @@ theorem contDiffWithinAt_insert {y : E} :
   Β· simp_rw [insert_eq_of_mem (mem_insert _ _)]
   simp_rw [insert_comm x y, nhdsWithin_insert_of_ne h]
 #align cont_diff_within_at_insert contDiffWithinAt_insert
+-/
 
 alias contDiffWithinAt_insert ↔ ContDiffWithinAt.of_insert ContDiffWithinAt.insert'
 #align cont_diff_within_at.of_insert ContDiffWithinAt.of_insert
 #align cont_diff_within_at.insert' ContDiffWithinAt.insert'
 
+#print ContDiffWithinAt.insert /-
 theorem ContDiffWithinAt.insert (h : ContDiffWithinAt π•œ n f s x) :
     ContDiffWithinAt π•œ n f (insert x s) x :=
   h.insert'
 #align cont_diff_within_at.insert ContDiffWithinAt.insert
+-/
 
 /-- If a function is `C^n` within a set at a point, with `n β‰₯ 1`, then it is differentiable
 within this set at this point. -/
@@ -585,7 +629,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
     Β· convert self_mem_nhdsWithin
       have : x ∈ insert x s := by simp
       exact insert_eq_of_mem (mem_of_mem_nhdsWithin this hu)
-    Β· rw [hasFtaylorSeriesUpToOn_succ_iff_right] at Hp
+    Β· rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp
       exact Hp.2.2.of_le hm
   · rintro ⟨u, hu, f', f'_eq_deriv, Hf'⟩
     rw [contDiffWithinAt_nat]
@@ -594,7 +638,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
     Β· apply Filter.inter_mem _ hu
       apply nhdsWithin_le_of_mem hu
       exact nhdsWithin_mono _ (subset_insert x u) hv
-    Β· rw [hasFtaylorSeriesUpToOn_succ_iff_right]
+    Β· rw [hasFTaylorSeriesUpToOn_succ_iff_right]
       refine' ⟨fun y hy => rfl, fun y hy => _, _⟩
       Β· change
           HasFDerivWithinAt (fun z => (continuousMultilinearCurryFin0 π•œ E F).symm (f z))
@@ -623,7 +667,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
 
 /-- A version of `cont_diff_within_at_succ_iff_has_fderiv_within_at` where all derivatives
   are taken within the same set. -/
-theorem contDiffWithinAt_succ_iff_has_fderiv_within_at' {n : β„•} :
+theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt' {n : β„•} :
     ContDiffWithinAt π•œ (n + 1 : β„•) f s x ↔
       βˆƒ u ∈ 𝓝[insert x s] x,
         u βŠ† insert x s ∧
@@ -645,13 +689,14 @@ theorem contDiffWithinAt_succ_iff_has_fderiv_within_at' {n : β„•} :
       insert_eq_of_mem (mem_insert _ _)]
     rintro ⟨u, hu, hus, f', huf', hf'⟩
     refine' ⟨u, hu, f', fun y hy => (huf' y hy).insert'.mono hus, hf'.insert.mono hus⟩
-#align cont_diff_within_at_succ_iff_has_fderiv_within_at' contDiffWithinAt_succ_iff_has_fderiv_within_at'
+#align cont_diff_within_at_succ_iff_has_fderiv_within_at' contDiffWithinAt_succ_iff_hasFDerivWithinAt'
 
 /-! ### Smooth functions within a set -/
 
 
 variable (π•œ)
 
+#print ContDiffOn /-
 /-- A function is continuously differentiable up to `n` on `s` if, for any point `x` in `s`, it
 admits continuous derivatives up to order `n` on a neighborhood of `x` in `s`.
 
@@ -661,38 +706,44 @@ depend on the finite order we consider).
 def ContDiffOn (n : β„•βˆž) (f : E β†’ F) (s : Set E) : Prop :=
   βˆ€ x ∈ s, ContDiffWithinAt π•œ n f s x
 #align cont_diff_on ContDiffOn
+-/
 
 variable {π•œ}
 
-theorem HasFtaylorSeriesUpToOn.contDiffOn {f' : E β†’ FormalMultilinearSeries π•œ E F}
-    (hf : HasFtaylorSeriesUpToOn n f f' s) : ContDiffOn π•œ n f s :=
+#print HasFTaylorSeriesUpToOn.contDiffOn /-
+theorem HasFTaylorSeriesUpToOn.contDiffOn {f' : E β†’ FormalMultilinearSeries π•œ E F}
+    (hf : HasFTaylorSeriesUpToOn n f f' s) : ContDiffOn π•œ n f s :=
   by
   intro x hx m hm
   use s
   simp only [Set.insert_eq_of_mem hx, self_mem_nhdsWithin, true_and_iff]
   exact ⟨f', hf.of_le hm⟩
-#align has_ftaylor_series_up_to_on.cont_diff_on HasFtaylorSeriesUpToOn.contDiffOn
+#align has_ftaylor_series_up_to_on.cont_diff_on HasFTaylorSeriesUpToOn.contDiffOn
+-/
 
+#print ContDiffOn.contDiffWithinAt /-
 theorem ContDiffOn.contDiffWithinAt (h : ContDiffOn π•œ n f s) (hx : x ∈ s) :
     ContDiffWithinAt π•œ n f s x :=
   h x hx
 #align cont_diff_on.cont_diff_within_at ContDiffOn.contDiffWithinAt
+-/
 
-theorem ContDiffWithinAt.cont_diff_on' {m : β„•} (hm : (m : β„•βˆž) ≀ n)
-    (h : ContDiffWithinAt π•œ n f s x) : βˆƒ u, IsOpen u ∧ x ∈ u ∧ ContDiffOn π•œ m f (insert x s ∩ u) :=
+theorem ContDiffWithinAt.contDiffOn' {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : ContDiffWithinAt π•œ n f s x) :
+    βˆƒ u, IsOpen u ∧ x ∈ u ∧ ContDiffOn π•œ m f (insert x s ∩ u) :=
   by
   rcases h m hm with ⟨t, ht, p, hp⟩
   rcases mem_nhdsWithin.1 ht with ⟨u, huo, hxu, hut⟩
   rw [inter_comm] at hut
   exact ⟨u, huo, hxu, (hp.mono hut).ContDiffOn⟩
-#align cont_diff_within_at.cont_diff_on' ContDiffWithinAt.cont_diff_on'
+#align cont_diff_within_at.cont_diff_on' ContDiffWithinAt.contDiffOn'
 
 theorem ContDiffWithinAt.contDiffOn {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : ContDiffWithinAt π•œ n f s x) :
     βˆƒ u ∈ 𝓝[insert x s] x, u βŠ† insert x s ∧ ContDiffOn π•œ m f u :=
-  let ⟨u, uo, xu, h⟩ := h.cont_diff_on' hm
+  let ⟨u, uo, xu, h⟩ := h.contDiffOn' hm
   ⟨_, inter_mem_nhdsWithin _ (uo.mem_nhds xu), inter_subset_left _ _, h⟩
 #align cont_diff_within_at.cont_diff_on ContDiffWithinAt.contDiffOn
 
+#print ContDiffWithinAt.eventually /-
 protected theorem ContDiffWithinAt.eventually {n : β„•} (h : ContDiffWithinAt π•œ n f s x) :
     βˆ€αΆ  y in 𝓝[insert x s] x, ContDiffWithinAt π•œ n f s y :=
   by
@@ -702,6 +753,7 @@ protected theorem ContDiffWithinAt.eventually {n : β„•} (h : ContDiffWithinAt 
   refine' this.mono fun y hy => (hd y hy.2).mono_of_mem _
   exact nhdsWithin_mono y (subset_insert _ _) hy.1
 #align cont_diff_within_at.eventually ContDiffWithinAt.eventually
+-/
 
 theorem ContDiffOn.of_le (h : ContDiffOn π•œ n f s) (hmn : m ≀ n) : ContDiffOn π•œ m f s := fun x hx =>
   (h x hx).of_le hmn
@@ -719,37 +771,51 @@ theorem contDiffOn_iff_forall_nat_le : ContDiffOn π•œ n f s ↔ βˆ€ m : β„•, 
   ⟨fun H m hm => H.of_le hm, fun H x hx m hm => H m hm x hx m le_rfl⟩
 #align cont_diff_on_iff_forall_nat_le contDiffOn_iff_forall_nat_le
 
+#print contDiffOn_top /-
 theorem contDiffOn_top : ContDiffOn π•œ ∞ f s ↔ βˆ€ n : β„•, ContDiffOn π•œ n f s :=
   contDiffOn_iff_forall_nat_le.trans <| by simp only [le_top, forall_prop_of_true]
 #align cont_diff_on_top contDiffOn_top
+-/
 
+#print contDiffOn_all_iff_nat /-
 theorem contDiffOn_all_iff_nat : (βˆ€ n, ContDiffOn π•œ n f s) ↔ βˆ€ n : β„•, ContDiffOn π•œ n f s :=
   by
   refine' ⟨fun H n => H n, _⟩
   rintro H (_ | n)
   exacts[contDiffOn_top.2 H, H n]
 #align cont_diff_on_all_iff_nat contDiffOn_all_iff_nat
+-/
 
+#print ContDiffOn.continuousOn /-
 theorem ContDiffOn.continuousOn (h : ContDiffOn π•œ n f s) : ContinuousOn f s := fun x hx =>
   (h x hx).ContinuousWithinAt
 #align cont_diff_on.continuous_on ContDiffOn.continuousOn
+-/
 
+#print ContDiffOn.congr /-
 theorem ContDiffOn.congr (h : ContDiffOn π•œ n f s) (h₁ : βˆ€ x ∈ s, f₁ x = f x) :
     ContDiffOn π•œ n f₁ s := fun x hx => (h x hx).congr h₁ (h₁ x hx)
 #align cont_diff_on.congr ContDiffOn.congr
+-/
 
+#print contDiffOn_congr /-
 theorem contDiffOn_congr (h₁ : βˆ€ x ∈ s, f₁ x = f x) : ContDiffOn π•œ n f₁ s ↔ ContDiffOn π•œ n f s :=
   ⟨fun H => H.congr fun x hx => (h₁ x hx).symm, fun H => H.congr hβ‚βŸ©
 #align cont_diff_on_congr contDiffOn_congr
+-/
 
+#print ContDiffOn.mono /-
 theorem ContDiffOn.mono (h : ContDiffOn π•œ n f s) {t : Set E} (hst : t βŠ† s) : ContDiffOn π•œ n f t :=
   fun x hx => (h x (hst hx)).mono hst
 #align cont_diff_on.mono ContDiffOn.mono
+-/
 
+#print ContDiffOn.congr_mono /-
 theorem ContDiffOn.congr_mono (hf : ContDiffOn π•œ n f s) (h₁ : βˆ€ x ∈ s₁, f₁ x = f x) (hs : s₁ βŠ† s) :
     ContDiffOn π•œ n f₁ s₁ :=
   (hf.mono hs).congr h₁
 #align cont_diff_on.congr_mono ContDiffOn.congr_mono
+-/
 
 /-- If a function is `C^n` on a set with `n β‰₯ 1`, then it is differentiable there. -/
 theorem ContDiffOn.differentiableOn (h : ContDiffOn π•œ n f s) (hn : 1 ≀ n) :
@@ -779,7 +845,7 @@ theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
     refine'
       ⟨u, hu, fun y => (continuousMultilinearCurryFin1 π•œ E F) (p y 1), fun y hy =>
         Hp.has_fderiv_within_at (WithTop.coe_le_coe.2 (Nat.le_add_left 1 n)) hy, _⟩
-    rw [hasFtaylorSeriesUpToOn_succ_iff_right] at Hp
+    rw [hasFTaylorSeriesUpToOn_succ_iff_right] at Hp
     intro z hz m hm
     refine' ⟨u, _, fun x : E => (p x).shift, Hp.2.2.of_le hm⟩
     convert self_mem_nhdsWithin
@@ -796,206 +862,241 @@ theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
 
 variable (π•œ)
 
+#print iteratedFDerivWithin /-
 /-- The `n`-th derivative of a function along a set, defined inductively by saying that the `n+1`-th
 derivative of `f` is the derivative of the `n`-th derivative of `f` along this set, together with
 an uncurrying step to see it as a multilinear map in `n+1` variables..
 -/
-noncomputable def iteratedFderivWithin (n : β„•) (f : E β†’ F) (s : Set E) : E β†’ E[Γ—n]β†’L[π•œ] F :=
+noncomputable def iteratedFDerivWithin (n : β„•) (f : E β†’ F) (s : Set E) : E β†’ E[Γ—n]β†’L[π•œ] F :=
   Nat.recOn n (fun x => ContinuousMultilinearMap.curry0 π•œ E (f x)) fun n rec x =>
     ContinuousLinearMap.uncurryLeft (fderivWithin π•œ rec s x)
-#align iterated_fderiv_within iteratedFderivWithin
+#align iterated_fderiv_within iteratedFDerivWithin
+-/
 
+#print ftaylorSeriesWithin /-
 /-- Formal Taylor series associated to a function within a set. -/
 def ftaylorSeriesWithin (f : E β†’ F) (s : Set E) (x : E) : FormalMultilinearSeries π•œ E F := fun n =>
-  iteratedFderivWithin π•œ n f s x
+  iteratedFDerivWithin π•œ n f s x
 #align ftaylor_series_within ftaylorSeriesWithin
+-/
 
 variable {π•œ}
 
+#print iteratedFDerivWithin_zero_apply /-
 @[simp]
-theorem iteratedFderivWithin_zero_apply (m : Fin 0 β†’ E) :
-    (iteratedFderivWithin π•œ 0 f s x : (Fin 0 β†’ E) β†’ F) m = f x :=
+theorem iteratedFDerivWithin_zero_apply (m : Fin 0 β†’ E) :
+    (iteratedFDerivWithin π•œ 0 f s x : (Fin 0 β†’ E) β†’ F) m = f x :=
   rfl
-#align iterated_fderiv_within_zero_apply iteratedFderivWithin_zero_apply
+#align iterated_fderiv_within_zero_apply iteratedFDerivWithin_zero_apply
+-/
 
-theorem iteratedFderivWithin_zero_eq_comp :
-    iteratedFderivWithin π•œ 0 f s = (continuousMultilinearCurryFin0 π•œ E F).symm ∘ f :=
+theorem iteratedFDerivWithin_zero_eq_comp :
+    iteratedFDerivWithin π•œ 0 f s = (continuousMultilinearCurryFin0 π•œ E F).symm ∘ f :=
   rfl
-#align iterated_fderiv_within_zero_eq_comp iteratedFderivWithin_zero_eq_comp
+#align iterated_fderiv_within_zero_eq_comp iteratedFDerivWithin_zero_eq_comp
 
+#print norm_iteratedFDerivWithin_zero /-
 @[simp]
-theorem norm_iteratedFderivWithin_zero : β€–iteratedFderivWithin π•œ 0 f s xβ€– = β€–f xβ€– := by
-  rw [iteratedFderivWithin_zero_eq_comp, LinearIsometryEquiv.norm_map]
-#align norm_iterated_fderiv_within_zero norm_iteratedFderivWithin_zero
+theorem norm_iteratedFDerivWithin_zero : β€–iteratedFDerivWithin π•œ 0 f s xβ€– = β€–f xβ€– := by
+  rw [iteratedFDerivWithin_zero_eq_comp, LinearIsometryEquiv.norm_map]
+#align norm_iterated_fderiv_within_zero norm_iteratedFDerivWithin_zero
+-/
 
-theorem iteratedFderivWithin_succ_apply_left {n : β„•} (m : Fin (n + 1) β†’ E) :
-    (iteratedFderivWithin π•œ (n + 1) f s x : (Fin (n + 1) β†’ E) β†’ F) m =
-      (fderivWithin π•œ (iteratedFderivWithin π•œ n f s) s x : E β†’ E[Γ—n]β†’L[π•œ] F) (m 0) (tail m) :=
+theorem iteratedFDerivWithin_succ_apply_left {n : β„•} (m : Fin (n + 1) β†’ E) :
+    (iteratedFDerivWithin π•œ (n + 1) f s x : (Fin (n + 1) β†’ E) β†’ F) m =
+      (fderivWithin π•œ (iteratedFDerivWithin π•œ n f s) s x : E β†’ E[Γ—n]β†’L[π•œ] F) (m 0) (tail m) :=
   rfl
-#align iterated_fderiv_within_succ_apply_left iteratedFderivWithin_succ_apply_left
+#align iterated_fderiv_within_succ_apply_left iteratedFDerivWithin_succ_apply_left
 
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
 and the derivative of the `n`-th derivative. -/
-theorem iteratedFderivWithin_succ_eq_comp_left {n : β„•} :
-    iteratedFderivWithin π•œ (n + 1) f s =
+theorem iteratedFDerivWithin_succ_eq_comp_left {n : β„•} :
+    iteratedFDerivWithin π•œ (n + 1) f s =
       continuousMultilinearCurryLeftEquiv π•œ (fun i : Fin (n + 1) => E) F ∘
-        fderivWithin π•œ (iteratedFderivWithin π•œ n f s) s :=
+        fderivWithin π•œ (iteratedFDerivWithin π•œ n f s) s :=
   rfl
-#align iterated_fderiv_within_succ_eq_comp_left iteratedFderivWithin_succ_eq_comp_left
+#align iterated_fderiv_within_succ_eq_comp_left iteratedFDerivWithin_succ_eq_comp_left
 
-theorem norm_fderivWithin_iteratedFderivWithin {n : β„•} :
-    β€–fderivWithin π•œ (iteratedFderivWithin π•œ n f s) s xβ€– = β€–iteratedFderivWithin π•œ (n + 1) f s xβ€– :=
-  by rw [iteratedFderivWithin_succ_eq_comp_left, LinearIsometryEquiv.norm_map]
-#align norm_fderiv_within_iterated_fderiv_within norm_fderivWithin_iteratedFderivWithin
+#print norm_fderivWithin_iteratedFDerivWithin /-
+theorem norm_fderivWithin_iteratedFDerivWithin {n : β„•} :
+    β€–fderivWithin π•œ (iteratedFDerivWithin π•œ n f s) s xβ€– = β€–iteratedFDerivWithin π•œ (n + 1) f s xβ€– :=
+  by rw [iteratedFDerivWithin_succ_eq_comp_left, LinearIsometryEquiv.norm_map]
+#align norm_fderiv_within_iterated_fderiv_within norm_fderivWithin_iteratedFDerivWithin
+-/
 
-theorem iteratedFderivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s)
+theorem iteratedFDerivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s)
     (m : Fin (n + 1) β†’ E) :
-    (iteratedFderivWithin π•œ (n + 1) f s x : (Fin (n + 1) β†’ E) β†’ F) m =
-      iteratedFderivWithin π•œ n (fun y => fderivWithin π•œ f s y) s x (init m) (m (last n)) :=
+    (iteratedFDerivWithin π•œ (n + 1) f s x : (Fin (n + 1) β†’ E) β†’ F) m =
+      iteratedFDerivWithin π•œ n (fun y => fderivWithin π•œ f s y) s x (init m) (m (last n)) :=
   by
   induction' n with n IH generalizing x
-  Β· rw [iteratedFderivWithin_succ_eq_comp_left, iteratedFderivWithin_zero_eq_comp,
-      iteratedFderivWithin_zero_apply, Function.comp_apply,
+  Β· rw [iteratedFDerivWithin_succ_eq_comp_left, iteratedFDerivWithin_zero_eq_comp,
+      iteratedFDerivWithin_zero_apply, Function.comp_apply,
       LinearIsometryEquiv.comp_fderivWithin _ (hs x hx)]
     rfl
   Β· let I := continuousMultilinearCurryRightEquiv' π•œ n E F
     have A :
       βˆ€ y ∈ s,
-        iteratedFderivWithin π•œ n.succ f s y =
-          (I ∘ iteratedFderivWithin π•œ n (fun y => fderivWithin π•œ f s y) s) y :=
+        iteratedFDerivWithin π•œ n.succ f s y =
+          (I ∘ iteratedFDerivWithin π•œ n (fun y => fderivWithin π•œ f s y) s) y :=
       by intro y hy; ext m; rw [@IH m y hy]; rfl
     calc
-      (iteratedFderivWithin π•œ (n + 2) f s x : (Fin (n + 2) β†’ E) β†’ F) m =
-          (fderivWithin π•œ (iteratedFderivWithin π•œ n.succ f s) s x : E β†’ E[Γ—n + 1]β†’L[π•œ] F) (m 0)
+      (iteratedFDerivWithin π•œ (n + 2) f s x : (Fin (n + 2) β†’ E) β†’ F) m =
+          (fderivWithin π•œ (iteratedFDerivWithin π•œ n.succ f s) s x : E β†’ E[Γ—n + 1]β†’L[π•œ] F) (m 0)
             (tail m) :=
         rfl
       _ =
-          (fderivWithin π•œ (I ∘ iteratedFderivWithin π•œ n (fderivWithin π•œ f s) s) s x :
+          (fderivWithin π•œ (I ∘ iteratedFDerivWithin π•œ n (fderivWithin π•œ f s) s) s x :
               E β†’ E[Γ—n + 1]β†’L[π•œ] F)
             (m 0) (tail m) :=
         by rw [fderivWithin_congr A (A x hx)]
       _ =
-          (I ∘ fderivWithin π•œ (iteratedFderivWithin π•œ n (fderivWithin π•œ f s) s) s x :
+          (I ∘ fderivWithin π•œ (iteratedFDerivWithin π•œ n (fderivWithin π•œ f s) s) s x :
               E β†’ E[Γ—n + 1]β†’L[π•œ] F)
             (m 0) (tail m) :=
         by rw [LinearIsometryEquiv.comp_fderivWithin _ (hs x hx)]; rfl
       _ =
-          (fderivWithin π•œ (iteratedFderivWithin π•œ n (fun y => fderivWithin π•œ f s y) s) s x :
+          (fderivWithin π•œ (iteratedFDerivWithin π•œ n (fun y => fderivWithin π•œ f s y) s) s x :
               E β†’ E[Γ—n]β†’L[π•œ] E β†’L[π•œ] F)
             (m 0) (init (tail m)) ((tail m) (last n)) :=
         rfl
       _ =
-          iteratedFderivWithin π•œ (Nat.succ n) (fun y => fderivWithin π•œ f s y) s x (init m)
+          iteratedFDerivWithin π•œ (Nat.succ n) (fun y => fderivWithin π•œ f s y) s x (init m)
             (m (last (n + 1))) :=
-        by rw [iteratedFderivWithin_succ_apply_left, tail_init_eq_init_tail]; rfl
+        by rw [iteratedFDerivWithin_succ_apply_left, tail_init_eq_init_tail]; rfl
       
-#align iterated_fderiv_within_succ_apply_right iteratedFderivWithin_succ_apply_right
+#align iterated_fderiv_within_succ_apply_right iteratedFDerivWithin_succ_apply_right
 
+#print iteratedFDerivWithin_succ_eq_comp_right /-
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
 and the `n`-th derivative of the derivative. -/
-theorem iteratedFderivWithin_succ_eq_comp_right {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) :
-    iteratedFderivWithin π•œ (n + 1) f s x =
+theorem iteratedFDerivWithin_succ_eq_comp_right {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) :
+    iteratedFDerivWithin π•œ (n + 1) f s x =
       (continuousMultilinearCurryRightEquiv' π•œ n E F ∘
-          iteratedFderivWithin π•œ n (fun y => fderivWithin π•œ f s y) s)
+          iteratedFDerivWithin π•œ n (fun y => fderivWithin π•œ f s y) s)
         x :=
-  by ext m; rw [iteratedFderivWithin_succ_apply_right hs hx]; rfl
-#align iterated_fderiv_within_succ_eq_comp_right iteratedFderivWithin_succ_eq_comp_right
+  by ext m; rw [iteratedFDerivWithin_succ_apply_right hs hx]; rfl
+#align iterated_fderiv_within_succ_eq_comp_right iteratedFDerivWithin_succ_eq_comp_right
+-/
 
-theorem norm_iteratedFderivWithin_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) :
-    β€–iteratedFderivWithin π•œ n (fderivWithin π•œ f s) s xβ€– = β€–iteratedFderivWithin π•œ (n + 1) f s xβ€– :=
-  by rw [iteratedFderivWithin_succ_eq_comp_right hs hx, LinearIsometryEquiv.norm_map]
-#align norm_iterated_fderiv_within_fderiv_within norm_iteratedFderivWithin_fderivWithin
+#print norm_iteratedFDerivWithin_fderivWithin /-
+theorem norm_iteratedFDerivWithin_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) :
+    β€–iteratedFDerivWithin π•œ n (fderivWithin π•œ f s) s xβ€– = β€–iteratedFDerivWithin π•œ (n + 1) f s xβ€– :=
+  by rw [iteratedFDerivWithin_succ_eq_comp_right hs hx, LinearIsometryEquiv.norm_map]
+#align norm_iterated_fderiv_within_fderiv_within norm_iteratedFDerivWithin_fderivWithin
+-/
 
 @[simp]
-theorem iteratedFderivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fin 1 β†’ E) :
-    (iteratedFderivWithin π•œ 1 f s x : (Fin 1 β†’ E) β†’ F) m = (fderivWithin π•œ f s x : E β†’ F) (m 0) :=
+theorem iteratedFDerivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fin 1 β†’ E) :
+    (iteratedFDerivWithin π•œ 1 f s x : (Fin 1 β†’ E) β†’ F) m = (fderivWithin π•œ f s x : E β†’ F) (m 0) :=
   by
-  simp only [iteratedFderivWithin_succ_apply_left, iteratedFderivWithin_zero_eq_comp,
+  simp only [iteratedFDerivWithin_succ_apply_left, iteratedFDerivWithin_zero_eq_comp,
     (continuousMultilinearCurryFin0 π•œ E F).symm.comp_fderivWithin h]
   rfl
-#align iterated_fderiv_within_one_apply iteratedFderivWithin_one_apply
+#align iterated_fderiv_within_one_apply iteratedFDerivWithin_one_apply
 
+#print Filter.EventuallyEq.iterated_fderiv_within' /-
 theorem Filter.EventuallyEq.iterated_fderiv_within' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
-    iteratedFderivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFderivWithin π•œ n f t :=
+    iteratedFDerivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f t :=
   by
   induction' n with n ihn
   Β· exact h.mono fun y hy => FunLike.ext _ _ fun _ => hy
   Β· have : fderivWithin π•œ _ t =αΆ [𝓝[s] x] fderivWithin π•œ _ t := ihn.fderiv_within' ht
     apply this.mono
     intro y hy
-    simp only [iteratedFderivWithin_succ_eq_comp_left, hy, (· ∘ ·)]
+    simp only [iteratedFDerivWithin_succ_eq_comp_left, hy, (· ∘ ·)]
 #align filter.eventually_eq.iterated_fderiv_within' Filter.EventuallyEq.iterated_fderiv_within'
+-/
 
-protected theorem Filter.EventuallyEq.iteratedFderivWithin (h : f₁ =αΆ [𝓝[s] x] f) (n : β„•) :
-    iteratedFderivWithin π•œ n f₁ s =αΆ [𝓝[s] x] iteratedFderivWithin π•œ n f s :=
+#print Filter.EventuallyEq.iteratedFDerivWithin /-
+protected theorem Filter.EventuallyEq.iteratedFDerivWithin (h : f₁ =αΆ [𝓝[s] x] f) (n : β„•) :
+    iteratedFDerivWithin π•œ n f₁ s =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f s :=
   h.iterated_fderiv_within' Subset.rfl n
-#align filter.eventually_eq.iterated_fderiv_within Filter.EventuallyEq.iteratedFderivWithin
+#align filter.eventually_eq.iterated_fderiv_within Filter.EventuallyEq.iteratedFDerivWithin
+-/
 
+#print Filter.EventuallyEq.iteratedFDerivWithin_eq /-
 /-- If two functions coincide in a neighborhood of `x` within a set `s` and at `x`, then their
 iterated differentials within this set at `x` coincide. -/
-theorem Filter.EventuallyEq.iteratedFderivWithin_eq (h : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x)
-    (n : β„•) : iteratedFderivWithin π•œ n f₁ s x = iteratedFderivWithin π•œ n f s x :=
+theorem Filter.EventuallyEq.iteratedFDerivWithin_eq (h : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x)
+    (n : β„•) : iteratedFDerivWithin π•œ n f₁ s x = iteratedFDerivWithin π•œ n f s x :=
   have : f₁ =αΆ [𝓝[insert x s] x] f := by simpa [eventually_eq, hx]
   (this.iterated_fderiv_within' (subset_insert _ _) n).self_of_nhdsWithin (mem_insert _ _)
-#align filter.eventually_eq.iterated_fderiv_within_eq Filter.EventuallyEq.iteratedFderivWithin_eq
+#align filter.eventually_eq.iterated_fderiv_within_eq Filter.EventuallyEq.iteratedFDerivWithin_eq
+-/
 
+#print iteratedFDerivWithin_congr /-
 /-- If two functions coincide on a set `s`, then their iterated differentials within this set
 coincide. See also `filter.eventually_eq.iterated_fderiv_within_eq` and
 `filter.eventually_eq.iterated_fderiv_within`. -/
-theorem iteratedFderivWithin_congr (hs : EqOn f₁ f s) (hx : x ∈ s) (n : β„•) :
-    iteratedFderivWithin π•œ n f₁ s x = iteratedFderivWithin π•œ n f s x :=
-  (hs.EventuallyEq.filter_mono inf_le_right).iteratedFderivWithin_eq (hs hx) _
-#align iterated_fderiv_within_congr iteratedFderivWithin_congr
+theorem iteratedFDerivWithin_congr (hs : EqOn f₁ f s) (hx : x ∈ s) (n : β„•) :
+    iteratedFDerivWithin π•œ n f₁ s x = iteratedFDerivWithin π•œ n f s x :=
+  (hs.EventuallyEq.filter_mono inf_le_right).iteratedFDerivWithin_eq (hs hx) _
+#align iterated_fderiv_within_congr iteratedFDerivWithin_congr
+-/
 
+#print Set.EqOn.iteratedFDerivWithin /-
 /-- If two functions coincide on a set `s`, then their iterated differentials within this set
 coincide. See also `filter.eventually_eq.iterated_fderiv_within_eq` and
 `filter.eventually_eq.iterated_fderiv_within`. -/
-protected theorem Set.EqOn.iteratedFderivWithin (hs : EqOn f₁ f s) (n : β„•) :
-    EqOn (iteratedFderivWithin π•œ n f₁ s) (iteratedFderivWithin π•œ n f s) s := fun x hx =>
-  iteratedFderivWithin_congr hs hx n
-#align set.eq_on.iterated_fderiv_within Set.EqOn.iteratedFderivWithin
+protected theorem Set.EqOn.iteratedFDerivWithin (hs : EqOn f₁ f s) (n : β„•) :
+    EqOn (iteratedFDerivWithin π•œ n f₁ s) (iteratedFDerivWithin π•œ n f s) s := fun x hx =>
+  iteratedFDerivWithin_congr hs hx n
+#align set.eq_on.iterated_fderiv_within Set.EqOn.iteratedFDerivWithin
+-/
 
-theorem iteratedFderivWithin_eventually_congr_set' (y : E) (h : s =αΆ [𝓝[{y}ᢜ] x] t) (n : β„•) :
-    iteratedFderivWithin π•œ n f s =αΆ [𝓝 x] iteratedFderivWithin π•œ n f t :=
+theorem iteratedFDerivWithin_eventually_congr_set' (y : E) (h : s =αΆ [𝓝[{y}ᢜ] x] t) (n : β„•) :
+    iteratedFDerivWithin π•œ n f s =αΆ [𝓝 x] iteratedFDerivWithin π•œ n f t :=
   by
   induction' n with n ihn generalizing x
   Β· rfl
   Β· refine' (eventually_nhds_nhdsWithin.2 h).mono fun y hy => _
-    simp only [iteratedFderivWithin_succ_eq_comp_left, (· ∘ ·)]
+    simp only [iteratedFDerivWithin_succ_eq_comp_left, (· ∘ ·)]
     rw [(ihn hy).fderivWithin_eq_nhds, fderivWithin_congr_set' _ hy]
-#align iterated_fderiv_within_eventually_congr_set' iteratedFderivWithin_eventually_congr_set'
+#align iterated_fderiv_within_eventually_congr_set' iteratedFDerivWithin_eventually_congr_set'
 
-theorem iteratedFderivWithin_eventually_congr_set (h : s =αΆ [𝓝 x] t) (n : β„•) :
-    iteratedFderivWithin π•œ n f s =αΆ [𝓝 x] iteratedFderivWithin π•œ n f t :=
-  iteratedFderivWithin_eventually_congr_set' x (h.filter_mono inf_le_left) n
-#align iterated_fderiv_within_eventually_congr_set iteratedFderivWithin_eventually_congr_set
+#print iteratedFDerivWithin_eventually_congr_set /-
+theorem iteratedFDerivWithin_eventually_congr_set (h : s =αΆ [𝓝 x] t) (n : β„•) :
+    iteratedFDerivWithin π•œ n f s =αΆ [𝓝 x] iteratedFDerivWithin π•œ n f t :=
+  iteratedFDerivWithin_eventually_congr_set' x (h.filter_mono inf_le_left) n
+#align iterated_fderiv_within_eventually_congr_set iteratedFDerivWithin_eventually_congr_set
+-/
 
-theorem iteratedFderivWithin_congr_set (h : s =αΆ [𝓝 x] t) (n : β„•) :
-    iteratedFderivWithin π•œ n f s x = iteratedFderivWithin π•œ n f t x :=
-  (iteratedFderivWithin_eventually_congr_set h n).self_of_nhds
-#align iterated_fderiv_within_congr_set iteratedFderivWithin_congr_set
+#print iteratedFDerivWithin_congr_set /-
+theorem iteratedFDerivWithin_congr_set (h : s =αΆ [𝓝 x] t) (n : β„•) :
+    iteratedFDerivWithin π•œ n f s x = iteratedFDerivWithin π•œ n f t x :=
+  (iteratedFDerivWithin_eventually_congr_set h n).self_of_nhds
+#align iterated_fderiv_within_congr_set iteratedFDerivWithin_congr_set
+-/
 
+#print iteratedFDerivWithin_inter' /-
 /-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
 `s` with a neighborhood of `x` within `s`. -/
-theorem iteratedFderivWithin_inter' {n : β„•} (hu : u ∈ 𝓝[s] x) :
-    iteratedFderivWithin π•œ n f (s ∩ u) x = iteratedFderivWithin π•œ n f s x :=
-  iteratedFderivWithin_congr_set (nhdsWithin_eq_iff_eventuallyEq.1 <| nhdsWithin_inter_of_mem' hu) _
-#align iterated_fderiv_within_inter' iteratedFderivWithin_inter'
+theorem iteratedFDerivWithin_inter' {n : β„•} (hu : u ∈ 𝓝[s] x) :
+    iteratedFDerivWithin π•œ n f (s ∩ u) x = iteratedFDerivWithin π•œ n f s x :=
+  iteratedFDerivWithin_congr_set (nhdsWithin_eq_iff_eventuallyEq.1 <| nhdsWithin_inter_of_mem' hu) _
+#align iterated_fderiv_within_inter' iteratedFDerivWithin_inter'
+-/
 
+#print iteratedFDerivWithin_inter /-
 /-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
 `s` with a neighborhood of `x`. -/
-theorem iteratedFderivWithin_inter {n : β„•} (hu : u ∈ 𝓝 x) :
-    iteratedFderivWithin π•œ n f (s ∩ u) x = iteratedFderivWithin π•œ n f s x :=
-  iteratedFderivWithin_inter' (mem_nhdsWithin_of_mem_nhds hu)
-#align iterated_fderiv_within_inter iteratedFderivWithin_inter
+theorem iteratedFDerivWithin_inter {n : β„•} (hu : u ∈ 𝓝 x) :
+    iteratedFDerivWithin π•œ n f (s ∩ u) x = iteratedFDerivWithin π•œ n f s x :=
+  iteratedFDerivWithin_inter' (mem_nhdsWithin_of_mem_nhds hu)
+#align iterated_fderiv_within_inter iteratedFDerivWithin_inter
+-/
 
+#print iteratedFDerivWithin_inter_open /-
 /-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
 `s` with an open set containing `x`. -/
-theorem iteratedFderivWithin_inter_open {n : β„•} (hu : IsOpen u) (hx : x ∈ u) :
-    iteratedFderivWithin π•œ n f (s ∩ u) x = iteratedFderivWithin π•œ n f s x :=
-  iteratedFderivWithin_inter (hu.mem_nhds hx)
-#align iterated_fderiv_within_inter_open iteratedFderivWithin_inter_open
+theorem iteratedFDerivWithin_inter_open {n : β„•} (hu : IsOpen u) (hx : x ∈ u) :
+    iteratedFDerivWithin π•œ n f (s ∩ u) x = iteratedFDerivWithin π•œ n f s x :=
+  iteratedFDerivWithin_inter (hu.mem_nhds hx)
+#align iterated_fderiv_within_inter_open iteratedFDerivWithin_inter_open
+-/
 
+#print contDiffOn_zero /-
 @[simp]
 theorem contDiffOn_zero : ContDiffOn π•œ 0 f s ↔ ContinuousOn f s :=
   by
@@ -1004,9 +1105,10 @@ theorem contDiffOn_zero : ContDiffOn π•œ 0 f s ↔ ContinuousOn f s :=
   have : (m : β„•βˆž) = 0 := le_antisymm hm bot_le
   rw [this]
   refine' ⟨insert x s, self_mem_nhdsWithin, ftaylorSeriesWithin π•œ f s, _⟩
-  rw [hasFtaylorSeriesUpToOn_zero_iff]
+  rw [hasFTaylorSeriesUpToOn_zero_iff]
   exact ⟨by rwa [insert_eq_of_mem hx], fun x hx => by simp [ftaylorSeriesWithin]⟩
 #align cont_diff_on_zero contDiffOn_zero
+-/
 
 theorem contDiffWithinAt_zero (hx : x ∈ s) :
     ContDiffWithinAt π•œ 0 f s x ↔ βˆƒ u ∈ 𝓝[s] x, ContinuousOn f (s ∩ u) :=
@@ -1016,7 +1118,7 @@ theorem contDiffWithinAt_zero (hx : x ∈ s) :
     obtain ⟨u, H, p, hp⟩ := h 0 (by norm_num)
     refine' ⟨u, _, _⟩
     Β· simpa [hx] using H
-    Β· simp only [WithTop.coe_zero, hasFtaylorSeriesUpToOn_zero_iff] at hp
+    Β· simp only [WithTop.coe_zero, hasFTaylorSeriesUpToOn_zero_iff] at hp
       exact hp.1.mono (inter_subset_right s u)
   · rintro ⟨u, H, hu⟩
     rw [← contDiffWithinAt_inter' H]
@@ -1026,31 +1128,32 @@ theorem contDiffWithinAt_zero (hx : x ∈ s) :
 
 /-- On a set with unique differentiability, any choice of iterated differential has to coincide
 with the one we have chosen in `iterated_fderiv_within π•œ m f s`. -/
-theorem HasFtaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
-    (h : HasFtaylorSeriesUpToOn n f p s) {m : β„•} (hmn : (m : β„•βˆž) ≀ n) (hs : UniqueDiffOn π•œ s)
-    (hx : x ∈ s) : p x m = iteratedFderivWithin π•œ m f s x :=
+theorem HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
+    (h : HasFTaylorSeriesUpToOn n f p s) {m : β„•} (hmn : (m : β„•βˆž) ≀ n) (hs : UniqueDiffOn π•œ s)
+    (hx : x ∈ s) : p x m = iteratedFDerivWithin π•œ m f s x :=
   by
   induction' m with m IH generalizing x
-  Β· rw [h.zero_eq' hx, iteratedFderivWithin_zero_eq_comp]
+  Β· rw [h.zero_eq' hx, iteratedFDerivWithin_zero_eq_comp]
   Β· have A : (m : β„•βˆž) < n := lt_of_lt_of_le (WithTop.coe_lt_coe.2 (lt_add_one m)) hmn
     have :
-      HasFDerivWithinAt (fun y : E => iteratedFderivWithin π•œ m f s y)
+      HasFDerivWithinAt (fun y : E => iteratedFDerivWithin π•œ m f s y)
         (ContinuousMultilinearMap.curryLeft (p x (Nat.succ m))) s x :=
       (h.fderiv_within m A x hx).congr (fun y hy => (IH (le_of_lt A) hy).symm)
         (IH (le_of_lt A) hx).symm
-    rw [iteratedFderivWithin_succ_eq_comp_left, Function.comp_apply, this.fderiv_within (hs x hx)]
+    rw [iteratedFDerivWithin_succ_eq_comp_left, Function.comp_apply, this.fderiv_within (hs x hx)]
     exact (ContinuousMultilinearMap.uncurry_curryLeft _).symm
-#align has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on HasFtaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
+#align has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
 
+#print ContDiffOn.ftaylorSeriesWithin /-
 /-- When a function is `C^n` in a set `s` of unique differentiability, it admits
 `ftaylor_series_within π•œ f s` as a Taylor series up to order `n` in `s`. -/
 theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s) :
-    HasFtaylorSeriesUpToOn n f (ftaylorSeriesWithin π•œ f s) s :=
+    HasFTaylorSeriesUpToOn n f (ftaylorSeriesWithin π•œ f s) s :=
   by
   constructor
   Β· intro x hx
     simp only [ftaylorSeriesWithin, ContinuousMultilinearMap.uncurry0_apply,
-      iteratedFderivWithin_zero_apply]
+      iteratedFDerivWithin_zero_apply]
   Β· intro m hm x hx
     rcases(h x hx) m.succ (ENat.add_one_le_of_lt hm) with ⟨u, hu, p, Hp⟩
     rw [insert_eq_of_mem hx] at hu
@@ -1058,15 +1161,15 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
     rw [inter_comm] at ho
     have : p x m.succ = ftaylorSeriesWithin π•œ f s x m.succ :=
       by
-      change p x m.succ = iteratedFderivWithin π•œ m.succ f s x
-      rw [← iteratedFderivWithin_inter_open o_open xo]
+      change p x m.succ = iteratedFDerivWithin π•œ m.succ f s x
+      rw [← iteratedFDerivWithin_inter_open o_open xo]
       exact (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hx, xo⟩
     rw [← this, ← hasFDerivWithinAt_inter (IsOpen.mem_nhds o_open xo)]
     have A : βˆ€ y ∈ s ∩ o, p y m = ftaylorSeriesWithin π•œ f s y m :=
       by
       rintro y ⟨hy, yo⟩
-      change p y m = iteratedFderivWithin π•œ m f s y
-      rw [← iteratedFderivWithin_inter_open o_open yo]
+      change p y m = iteratedFDerivWithin π•œ m f s y
+      rw [← iteratedFDerivWithin_inter_open o_open yo]
       exact
         (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn (WithTop.coe_le_coe.2 (Nat.le_succ m))
           (hs.inter o_open) ⟨hy, yo⟩
@@ -1084,16 +1187,17 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
     have A : βˆ€ y ∈ s ∩ o, p y m = ftaylorSeriesWithin π•œ f s y m :=
       by
       rintro y ⟨hy, yo⟩
-      change p y m = iteratedFderivWithin π•œ m f s y
-      rw [← iteratedFderivWithin_inter_open o_open yo]
+      change p y m = iteratedFDerivWithin π•œ m f s y
+      rw [← iteratedFDerivWithin_inter_open o_open yo]
       exact (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hy, yo⟩
     exact ((Hp.mono ho).cont m le_rfl).congr fun y hy => (A y hy).symm
 #align cont_diff_on.ftaylor_series_within ContDiffOn.ftaylorSeriesWithin
+-/
 
 theorem contDiffOn_of_continuousOn_differentiableOn
-    (Hcont : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (fun x => iteratedFderivWithin π•œ m f s x) s)
+    (Hcont : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (fun x => iteratedFDerivWithin π•œ m f s x) s)
     (Hdiff :
-      βˆ€ m : β„•, (m : β„•βˆž) < n β†’ DifferentiableOn π•œ (fun x => iteratedFderivWithin π•œ m f s x) s) :
+      βˆ€ m : β„•, (m : β„•βˆž) < n β†’ DifferentiableOn π•œ (fun x => iteratedFDerivWithin π•œ m f s x) s) :
     ContDiffOn π•œ n f s := by
   intro x hx m hm
   rw [insert_eq_of_mem hx]
@@ -1101,10 +1205,10 @@ theorem contDiffOn_of_continuousOn_differentiableOn
   constructor
   Β· intro y hy
     simp only [ftaylorSeriesWithin, ContinuousMultilinearMap.uncurry0_apply,
-      iteratedFderivWithin_zero_apply]
+      iteratedFDerivWithin_zero_apply]
   Β· intro k hk y hy
     convert(Hdiff k (lt_of_lt_of_le hk hm) y hy).HasFDerivWithinAt
-    simp only [ftaylorSeriesWithin, iteratedFderivWithin_succ_eq_comp_left,
+    simp only [ftaylorSeriesWithin, iteratedFDerivWithin_succ_eq_comp_left,
       ContinuousLinearEquiv.coe_apply, Function.comp_apply, coeFn_coeBase]
     exact ContinuousLinearMap.curry_uncurryLeft _
   Β· intro k hk
@@ -1112,26 +1216,26 @@ theorem contDiffOn_of_continuousOn_differentiableOn
 #align cont_diff_on_of_continuous_on_differentiable_on contDiffOn_of_continuousOn_differentiableOn
 
 theorem contDiffOn_of_differentiableOn
-    (h : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ DifferentiableOn π•œ (iteratedFderivWithin π•œ m f s) s) :
+    (h : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ DifferentiableOn π•œ (iteratedFDerivWithin π•œ m f s) s) :
     ContDiffOn π•œ n f s :=
   contDiffOn_of_continuousOn_differentiableOn (fun m hm => (h m hm).ContinuousOn) fun m hm =>
     h m (le_of_lt hm)
 #align cont_diff_on_of_differentiable_on contDiffOn_of_differentiableOn
 
-theorem ContDiffOn.continuousOn_iteratedFderivWithin {m : β„•} (h : ContDiffOn π•œ n f s)
-    (hmn : (m : β„•βˆž) ≀ n) (hs : UniqueDiffOn π•œ s) : ContinuousOn (iteratedFderivWithin π•œ m f s) s :=
+theorem ContDiffOn.continuousOn_iteratedFDerivWithin {m : β„•} (h : ContDiffOn π•œ n f s)
+    (hmn : (m : β„•βˆž) ≀ n) (hs : UniqueDiffOn π•œ s) : ContinuousOn (iteratedFDerivWithin π•œ m f s) s :=
   (h.ftaylorSeriesWithin hs).cont m hmn
-#align cont_diff_on.continuous_on_iterated_fderiv_within ContDiffOn.continuousOn_iteratedFderivWithin
+#align cont_diff_on.continuous_on_iterated_fderiv_within ContDiffOn.continuousOn_iteratedFDerivWithin
 
-theorem ContDiffOn.differentiableOn_iteratedFderivWithin {m : β„•} (h : ContDiffOn π•œ n f s)
+theorem ContDiffOn.differentiableOn_iteratedFDerivWithin {m : β„•} (h : ContDiffOn π•œ n f s)
     (hmn : (m : β„•βˆž) < n) (hs : UniqueDiffOn π•œ s) :
-    DifferentiableOn π•œ (iteratedFderivWithin π•œ m f s) s := fun x hx =>
+    DifferentiableOn π•œ (iteratedFDerivWithin π•œ m f s) s := fun x hx =>
   ((h.ftaylorSeriesWithin hs).fderivWithin m hmn x hx).DifferentiableWithinAt
-#align cont_diff_on.differentiable_on_iterated_fderiv_within ContDiffOn.differentiableOn_iteratedFderivWithin
+#align cont_diff_on.differentiable_on_iterated_fderiv_within ContDiffOn.differentiableOn_iteratedFDerivWithin
 
-theorem ContDiffWithinAt.differentiableWithinAt_iteratedFderivWithin {m : β„•}
+theorem ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin {m : β„•}
     (h : ContDiffWithinAt π•œ n f s x) (hmn : (m : β„•βˆž) < n) (hs : UniqueDiffOn π•œ (insert x s)) :
-    DifferentiableWithinAt π•œ (iteratedFderivWithin π•œ m f s) s x :=
+    DifferentiableWithinAt π•œ (iteratedFDerivWithin π•œ m f s) s x :=
   by
   rcases h.cont_diff_on' (ENat.add_one_le_of_lt hmn) with ⟨u, uo, xu, hu⟩
   set t := insert x s ∩ u
@@ -1141,25 +1245,26 @@ theorem ContDiffWithinAt.differentiableWithinAt_iteratedFderivWithin {m : β„•}
     rw [← inter_assoc, nhdsWithin_inter_of_mem', ← diff_eq_compl_inter, insert_diff_of_mem,
       diff_eq_compl_inter]
     exacts[rfl, mem_nhdsWithin_of_mem_nhds (uo.mem_nhds xu)]
-  have B : iteratedFderivWithin π•œ m f s =αΆ [𝓝 x] iteratedFderivWithin π•œ m f t :=
-    iteratedFderivWithin_eventually_congr_set' _ A.symm _
-  have C : DifferentiableWithinAt π•œ (iteratedFderivWithin π•œ m f t) t x :=
+  have B : iteratedFDerivWithin π•œ m f s =αΆ [𝓝 x] iteratedFDerivWithin π•œ m f t :=
+    iteratedFDerivWithin_eventually_congr_set' _ A.symm _
+  have C : DifferentiableWithinAt π•œ (iteratedFDerivWithin π•œ m f t) t x :=
     hu.differentiable_on_iterated_fderiv_within (Nat.cast_lt.2 m.lt_succ_self) (hs.inter uo) x
       ⟨mem_insert _ _, xu⟩
   rw [differentiableWithinAt_congr_set' _ A] at C
   exact C.congr_of_eventually_eq (B.filter_mono inf_le_left) B.self_of_nhds
-#align cont_diff_within_at.differentiable_within_at_iterated_fderiv_within ContDiffWithinAt.differentiableWithinAt_iteratedFderivWithin
+#align cont_diff_within_at.differentiable_within_at_iterated_fderiv_within ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin
 
 theorem contDiffOn_iff_continuousOn_differentiableOn (hs : UniqueDiffOn π•œ s) :
     ContDiffOn π•œ n f s ↔
-      (βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (fun x => iteratedFderivWithin π•œ m f s x) s) ∧
-        βˆ€ m : β„•, (m : β„•βˆž) < n β†’ DifferentiableOn π•œ (fun x => iteratedFderivWithin π•œ m f s x) s :=
+      (βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (fun x => iteratedFDerivWithin π•œ m f s x) s) ∧
+        βˆ€ m : β„•, (m : β„•βˆž) < n β†’ DifferentiableOn π•œ (fun x => iteratedFDerivWithin π•œ m f s x) s :=
   ⟨fun h =>
-    ⟨fun m hm => h.continuousOn_iteratedFderivWithin hm hs, fun m hm =>
-      h.differentiableOn_iteratedFderivWithin hm hs⟩,
+    ⟨fun m hm => h.continuousOn_iteratedFDerivWithin hm hs, fun m hm =>
+      h.differentiableOn_iteratedFDerivWithin hm hs⟩,
     fun h => contDiffOn_of_continuousOn_differentiableOn h.1 h.2⟩
 #align cont_diff_on_iff_continuous_on_differentiable_on contDiffOn_iff_continuousOn_differentiableOn
 
+#print contDiffOn_succ_of_fderivWithin /-
 theorem contDiffOn_succ_of_fderivWithin {n : β„•} (hf : DifferentiableOn π•œ f s)
     (h : ContDiffOn π•œ n (fun y => fderivWithin π•œ f s y) s) : ContDiffOn π•œ (n + 1 : β„•) f s :=
   by
@@ -1168,7 +1273,9 @@ theorem contDiffOn_succ_of_fderivWithin {n : β„•} (hf : DifferentiableOn π•œ f
   exact
     ⟨s, self_mem_nhdsWithin, fderivWithin π•œ f s, fun y hy => (hf y hy).HasFDerivWithinAt, h x hx⟩
 #align cont_diff_on_succ_of_fderiv_within contDiffOn_succ_of_fderivWithin
+-/
 
+#print contDiffOn_succ_iff_fderivWithin /-
 /-- A function is `C^(n + 1)` on a domain with unique derivatives if and only if it is
 differentiable there, and its derivative (expressed with `fderiv_within`) is `C^n`. -/
 theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
@@ -1190,7 +1297,9 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
     ((hff' y (ho hy)).mono ho).fderivWithin (hs.inter o_open y hy)
   rwa [fderivWithin_inter (o_open.mem_nhds hy.2)] at A
 #align cont_diff_on_succ_iff_fderiv_within contDiffOn_succ_iff_fderivWithin
+-/
 
+#print contDiffOn_succ_iff_has_fderiv_within /-
 theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ s) :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
       βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiffOn π•œ n f' s ∧ βˆ€ x, x ∈ s β†’ HasFDerivWithinAt f (f' x) s x :=
@@ -1201,8 +1310,10 @@ theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ
   refine' ⟨fun x hx => (h2 x hx).DifferentiableWithinAt, fun x hx => _⟩
   exact (h1 x hx).congr' (fun y hy => (h2 y hy).fderivWithin (hs y hy)) hx
 #align cont_diff_on_succ_iff_has_fderiv_within contDiffOn_succ_iff_has_fderiv_within
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]] -/
+#print contDiffOn_succ_iff_fderiv_of_open /-
 /-- A function is `C^(n + 1)` on an open domain if and only if it is
 differentiable there, and its derivative (expressed with `fderiv`) is `C^n`. -/
 theorem contDiffOn_succ_iff_fderiv_of_open {n : β„•} (hs : IsOpen s) :
@@ -1216,7 +1327,9 @@ theorem contDiffOn_succ_iff_fderiv_of_open {n : β„•} (hs : IsOpen s) :
   intro x hx
   exact fderivWithin_of_open hs hx
 #align cont_diff_on_succ_iff_fderiv_of_open contDiffOn_succ_iff_fderiv_of_open
+-/
 
+#print contDiffOn_top_iff_fderivWithin /-
 /-- A function is `C^∞` on a domain with unique derivatives if and only if it is differentiable
 there, and its derivative (expressed with `fderiv_within`) is `C^∞`. -/
 theorem contDiffOn_top_iff_fderivWithin (hs : UniqueDiffOn π•œ s) :
@@ -1234,8 +1347,10 @@ theorem contDiffOn_top_iff_fderivWithin (hs : UniqueDiffOn π•œ s) :
     apply ((contDiffOn_succ_iff_fderivWithin hs).2 ⟨h.1, h.2.of_le A⟩).of_le
     exact WithTop.coe_le_coe.2 (Nat.le_succ n)
 #align cont_diff_on_top_iff_fderiv_within contDiffOn_top_iff_fderivWithin
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]] -/
+#print contDiffOn_top_iff_fderiv_of_open /-
 /-- A function is `C^∞` on an open domain if and only if it is differentiable there, and its
 derivative (expressed with `fderiv`) is `C^∞`. -/
 theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
@@ -1248,6 +1363,7 @@ theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
   intro x hx
   exact fderivWithin_of_open hs hx
 #align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_open
+-/
 
 theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
     (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (fun y => fderivWithin π•œ f s y) s :=
@@ -1279,23 +1395,26 @@ theorem ContDiffOn.continuousOn_fderiv_of_open (h : ContDiffOn π•œ n f s) (hs :
 /-! ### Functions with a Taylor series on the whole space -/
 
 
+#print HasFTaylorSeriesUpTo /-
 /-- `has_ftaylor_series_up_to n f p` registers the fact that `p 0 = f` and `p (m+1)` is a
 derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a predicate analogous to
 `has_fderiv_at` but for higher order derivatives. -/
-structure HasFtaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F) :
+structure HasFTaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F) :
   Prop where
   zero_eq : βˆ€ x, (p x 0).uncurry0 = f x
   fderiv : βˆ€ (m : β„•) (hm : (m : β„•βˆž) < n), βˆ€ x, HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x
   cont : βˆ€ (m : β„•) (hm : (m : β„•βˆž) ≀ n), Continuous fun x => p x m
-#align has_ftaylor_series_up_to HasFtaylorSeriesUpTo
+#align has_ftaylor_series_up_to HasFTaylorSeriesUpTo
+-/
 
-theorem HasFtaylorSeriesUpTo.zero_eq' (h : HasFtaylorSeriesUpTo n f p) (x : E) :
+theorem HasFTaylorSeriesUpTo.zero_eq' (h : HasFTaylorSeriesUpTo n f p) (x : E) :
     p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) := by rw [← h.zero_eq x]; symm;
   exact ContinuousMultilinearMap.uncurry0_curry0 _
-#align has_ftaylor_series_up_to.zero_eq' HasFtaylorSeriesUpTo.zero_eq'
+#align has_ftaylor_series_up_to.zero_eq' HasFTaylorSeriesUpTo.zero_eq'
 
-theorem hasFtaylorSeriesUpToOn_univ_iff :
-    HasFtaylorSeriesUpToOn n f p univ ↔ HasFtaylorSeriesUpTo n f p :=
+#print hasFTaylorSeriesUpToOn_univ_iff /-
+theorem hasFTaylorSeriesUpToOn_univ_iff :
+    HasFTaylorSeriesUpToOn n f p univ ↔ HasFTaylorSeriesUpTo n f p :=
   by
   constructor
   Β· intro H
@@ -1316,114 +1435,139 @@ theorem hasFtaylorSeriesUpToOn_univ_iff :
     Β· intro m hm
       rw [← continuous_iff_continuousOn_univ]
       exact H.cont m hm
-#align has_ftaylor_series_up_to_on_univ_iff hasFtaylorSeriesUpToOn_univ_iff
+#align has_ftaylor_series_up_to_on_univ_iff hasFTaylorSeriesUpToOn_univ_iff
+-/
 
-theorem HasFtaylorSeriesUpTo.hasFtaylorSeriesUpToOn (h : HasFtaylorSeriesUpTo n f p) (s : Set E) :
-    HasFtaylorSeriesUpToOn n f p s :=
-  (hasFtaylorSeriesUpToOn_univ_iff.2 h).mono (subset_univ _)
-#align has_ftaylor_series_up_to.has_ftaylor_series_up_to_on HasFtaylorSeriesUpTo.hasFtaylorSeriesUpToOn
+#print HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn /-
+theorem HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn (h : HasFTaylorSeriesUpTo n f p) (s : Set E) :
+    HasFTaylorSeriesUpToOn n f p s :=
+  (hasFTaylorSeriesUpToOn_univ_iff.2 h).mono (subset_univ _)
+#align has_ftaylor_series_up_to.has_ftaylor_series_up_to_on HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn
+-/
 
-theorem HasFtaylorSeriesUpTo.ofLe (h : HasFtaylorSeriesUpTo n f p) (hmn : m ≀ n) :
-    HasFtaylorSeriesUpTo m f p := by rw [← hasFtaylorSeriesUpToOn_univ_iff] at h⊒; exact h.of_le hmn
-#align has_ftaylor_series_up_to.of_le HasFtaylorSeriesUpTo.ofLe
+theorem HasFTaylorSeriesUpTo.ofLe (h : HasFTaylorSeriesUpTo n f p) (hmn : m ≀ n) :
+    HasFTaylorSeriesUpTo m f p := by rw [← hasFTaylorSeriesUpToOn_univ_iff] at h⊒; exact h.of_le hmn
+#align has_ftaylor_series_up_to.of_le HasFTaylorSeriesUpTo.ofLe
 
-theorem HasFtaylorSeriesUpTo.continuous (h : HasFtaylorSeriesUpTo n f p) : Continuous f :=
+#print HasFTaylorSeriesUpTo.continuous /-
+theorem HasFTaylorSeriesUpTo.continuous (h : HasFTaylorSeriesUpTo n f p) : Continuous f :=
   by
-  rw [← hasFtaylorSeriesUpToOn_univ_iff] at h
+  rw [← hasFTaylorSeriesUpToOn_univ_iff] at h
   rw [continuous_iff_continuousOn_univ]
   exact h.continuous_on
-#align has_ftaylor_series_up_to.continuous HasFtaylorSeriesUpTo.continuous
+#align has_ftaylor_series_up_to.continuous HasFTaylorSeriesUpTo.continuous
+-/
 
-theorem hasFtaylorSeriesUpTo_zero_iff :
-    HasFtaylorSeriesUpTo 0 f p ↔ Continuous f ∧ βˆ€ x, (p x 0).uncurry0 = f x := by
+#print hasFTaylorSeriesUpTo_zero_iff /-
+theorem hasFTaylorSeriesUpTo_zero_iff :
+    HasFTaylorSeriesUpTo 0 f p ↔ Continuous f ∧ βˆ€ x, (p x 0).uncurry0 = f x := by
   simp [has_ftaylor_series_up_to_on_univ_iff.symm, continuous_iff_continuousOn_univ,
-    hasFtaylorSeriesUpToOn_zero_iff]
-#align has_ftaylor_series_up_to_zero_iff hasFtaylorSeriesUpTo_zero_iff
+    hasFTaylorSeriesUpToOn_zero_iff]
+#align has_ftaylor_series_up_to_zero_iff hasFTaylorSeriesUpTo_zero_iff
+-/
 
-theorem hasFtaylorSeriesUpTo_top_iff :
-    HasFtaylorSeriesUpTo ∞ f p ↔ βˆ€ n : β„•, HasFtaylorSeriesUpTo n f p := by
-  simp only [← hasFtaylorSeriesUpToOn_univ_iff, hasFtaylorSeriesUpToOn_top_iff]
-#align has_ftaylor_series_up_to_top_iff hasFtaylorSeriesUpTo_top_iff
+#print hasFTaylorSeriesUpTo_top_iff /-
+theorem hasFTaylorSeriesUpTo_top_iff :
+    HasFTaylorSeriesUpTo ∞ f p ↔ βˆ€ n : β„•, HasFTaylorSeriesUpTo n f p := by
+  simp only [← hasFTaylorSeriesUpToOn_univ_iff, hasFTaylorSeriesUpToOn_top_iff]
+#align has_ftaylor_series_up_to_top_iff hasFTaylorSeriesUpTo_top_iff
+-/
 
+#print hasFTaylorSeriesUpTo_top_iff' /-
 /-- In the case that `n = ∞` we don't need the continuity assumption in
 `has_ftaylor_series_up_to`. -/
-theorem hasFtaylorSeriesUpTo_top_iff' :
-    HasFtaylorSeriesUpTo ∞ f p ↔
+theorem hasFTaylorSeriesUpTo_top_iff' :
+    HasFTaylorSeriesUpTo ∞ f p ↔
       (βˆ€ x, (p x 0).uncurry0 = f x) ∧
         βˆ€ (m : β„•) (x), HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x :=
   by
-  simp only [← hasFtaylorSeriesUpToOn_univ_iff, hasFtaylorSeriesUpToOn_top_iff', mem_univ,
+  simp only [← hasFTaylorSeriesUpToOn_univ_iff, hasFTaylorSeriesUpToOn_top_iff', mem_univ,
     forall_true_left, hasFDerivWithinAt_univ]
-#align has_ftaylor_series_up_to_top_iff' hasFtaylorSeriesUpTo_top_iff'
+#align has_ftaylor_series_up_to_top_iff' hasFTaylorSeriesUpTo_top_iff'
+-/
 
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
-theorem HasFtaylorSeriesUpTo.hasFDerivAt (h : HasFtaylorSeriesUpTo n f p) (hn : 1 ≀ n) (x : E) :
+theorem HasFTaylorSeriesUpTo.hasFDerivAt (h : HasFTaylorSeriesUpTo n f p) (hn : 1 ≀ n) (x : E) :
     HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) x :=
   by
   rw [← hasFDerivWithinAt_univ]
-  exact (hasFtaylorSeriesUpToOn_univ_iff.2 h).HasFDerivWithinAt hn (mem_univ _)
-#align has_ftaylor_series_up_to.has_fderiv_at HasFtaylorSeriesUpTo.hasFDerivAt
+  exact (hasFTaylorSeriesUpToOn_univ_iff.2 h).HasFDerivWithinAt hn (mem_univ _)
+#align has_ftaylor_series_up_to.has_fderiv_at HasFTaylorSeriesUpTo.hasFDerivAt
 
-theorem HasFtaylorSeriesUpTo.differentiable (h : HasFtaylorSeriesUpTo n f p) (hn : 1 ≀ n) :
+theorem HasFTaylorSeriesUpTo.differentiable (h : HasFTaylorSeriesUpTo n f p) (hn : 1 ≀ n) :
     Differentiable π•œ f := fun x => (h.HasFDerivAt hn x).DifferentiableAt
-#align has_ftaylor_series_up_to.differentiable HasFtaylorSeriesUpTo.differentiable
+#align has_ftaylor_series_up_to.differentiable HasFTaylorSeriesUpTo.differentiable
 
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p.shift` is a Taylor series up to `n`
 for `p 1`, which is a derivative of `f`. -/
-theorem hasFtaylorSeriesUpTo_succ_iff_right {n : β„•} :
-    HasFtaylorSeriesUpTo (n + 1 : β„•) f p ↔
+theorem hasFTaylorSeriesUpTo_succ_iff_right {n : β„•} :
+    HasFTaylorSeriesUpTo (n + 1 : β„•) f p ↔
       (βˆ€ x, (p x 0).uncurry0 = f x) ∧
         (βˆ€ x, HasFDerivAt (fun y => p y 0) (p x 1).curryLeft x) ∧
-          HasFtaylorSeriesUpTo n (fun x => continuousMultilinearCurryFin1 π•œ E F (p x 1)) fun x =>
+          HasFTaylorSeriesUpTo n (fun x => continuousMultilinearCurryFin1 π•œ E F (p x 1)) fun x =>
             (p x).shift :=
   by
-  simp only [hasFtaylorSeriesUpToOn_succ_iff_right, ← hasFtaylorSeriesUpToOn_univ_iff, mem_univ,
+  simp only [hasFTaylorSeriesUpToOn_succ_iff_right, ← hasFTaylorSeriesUpToOn_univ_iff, mem_univ,
     forall_true_left, hasFDerivWithinAt_univ]
-#align has_ftaylor_series_up_to_succ_iff_right hasFtaylorSeriesUpTo_succ_iff_right
+#align has_ftaylor_series_up_to_succ_iff_right hasFTaylorSeriesUpTo_succ_iff_right
 
 /-! ### Smooth functions at a point -/
 
 
 variable (π•œ)
 
+#print ContDiffAt /-
 /-- A function is continuously differentiable up to `n` at a point `x` if, for any integer `k ≀ n`,
 there is a neighborhood of `x` where `f` admits derivatives up to order `n`, which are continuous.
 -/
 def ContDiffAt (n : β„•βˆž) (f : E β†’ F) (x : E) : Prop :=
   ContDiffWithinAt π•œ n f univ x
 #align cont_diff_at ContDiffAt
+-/
 
 variable {π•œ}
 
+#print contDiffWithinAt_univ /-
 theorem contDiffWithinAt_univ : ContDiffWithinAt π•œ n f univ x ↔ ContDiffAt π•œ n f x :=
   Iff.rfl
 #align cont_diff_within_at_univ contDiffWithinAt_univ
+-/
 
+#print contDiffAt_top /-
 theorem contDiffAt_top : ContDiffAt π•œ ∞ f x ↔ βˆ€ n : β„•, ContDiffAt π•œ n f x := by
   simp [← contDiffWithinAt_univ, contDiffWithinAt_top]
 #align cont_diff_at_top contDiffAt_top
+-/
 
+#print ContDiffAt.contDiffWithinAt /-
 theorem ContDiffAt.contDiffWithinAt (h : ContDiffAt π•œ n f x) : ContDiffWithinAt π•œ n f s x :=
   h.mono (subset_univ _)
 #align cont_diff_at.cont_diff_within_at ContDiffAt.contDiffWithinAt
+-/
 
+#print ContDiffWithinAt.contDiffAt /-
 theorem ContDiffWithinAt.contDiffAt (h : ContDiffWithinAt π•œ n f s x) (hx : s ∈ 𝓝 x) :
     ContDiffAt π•œ n f x := by rwa [ContDiffAt, ← contDiffWithinAt_inter hx, univ_inter]
 #align cont_diff_within_at.cont_diff_at ContDiffWithinAt.contDiffAt
+-/
 
+#print ContDiffAt.congr_of_eventuallyEq /-
 theorem ContDiffAt.congr_of_eventuallyEq (h : ContDiffAt π•œ n f x) (hg : f₁ =αΆ [𝓝 x] f) :
     ContDiffAt π•œ n f₁ x :=
   h.congr_of_eventually_eq' (by rwa [nhdsWithin_univ]) (mem_univ x)
 #align cont_diff_at.congr_of_eventually_eq ContDiffAt.congr_of_eventuallyEq
+-/
 
 theorem ContDiffAt.of_le (h : ContDiffAt π•œ n f x) (hmn : m ≀ n) : ContDiffAt π•œ m f x :=
   h.of_le hmn
 #align cont_diff_at.of_le ContDiffAt.of_le
 
+#print ContDiffAt.continuousAt /-
 theorem ContDiffAt.continuousAt (h : ContDiffAt π•œ n f x) : ContinuousAt f x := by
   simpa [continuousWithinAt_univ] using h.continuous_within_at
 #align cont_diff_at.continuous_at ContDiffAt.continuousAt
+-/
 
 /-- If a function is `C^n` with `n β‰₯ 1` at a point, then it is differentiable there. -/
 theorem ContDiffAt.differentiableAt (h : ContDiffAt π•œ n f x) (hn : 1 ≀ n) :
@@ -1452,72 +1596,94 @@ theorem contDiffAt_succ_iff_hasFDerivAt {n : β„•} :
     exact (h_fderiv x hxu).HasFDerivWithinAt
 #align cont_diff_at_succ_iff_has_fderiv_at contDiffAt_succ_iff_hasFDerivAt
 
+#print ContDiffAt.eventually /-
 protected theorem ContDiffAt.eventually {n : β„•} (h : ContDiffAt π•œ n f x) :
     βˆ€αΆ  y in 𝓝 x, ContDiffAt π•œ n f y := by simpa [nhdsWithin_univ] using h.eventually
 #align cont_diff_at.eventually ContDiffAt.eventually
+-/
 
 /-! ### Smooth functions -/
 
 
 variable (π•œ)
 
+#print ContDiff /-
 /-- A function is continuously differentiable up to `n` if it admits derivatives up to
 order `n`, which are continuous. Contrary to the case of definitions in domains (where derivatives
 might not be unique) we do not need to localize the definition in space or time.
 -/
 def ContDiff (n : β„•βˆž) (f : E β†’ F) : Prop :=
-  βˆƒ p : E β†’ FormalMultilinearSeries π•œ E F, HasFtaylorSeriesUpTo n f p
+  βˆƒ p : E β†’ FormalMultilinearSeries π•œ E F, HasFTaylorSeriesUpTo n f p
 #align cont_diff ContDiff
+-/
 
 variable {π•œ}
 
+#print HasFTaylorSeriesUpTo.contDiff /-
 /-- If `f` has a Taylor series up to `n`, then it is `C^n`. -/
-theorem HasFtaylorSeriesUpTo.contDiff {f' : E β†’ FormalMultilinearSeries π•œ E F}
-    (hf : HasFtaylorSeriesUpTo n f f') : ContDiff π•œ n f :=
+theorem HasFTaylorSeriesUpTo.contDiff {f' : E β†’ FormalMultilinearSeries π•œ E F}
+    (hf : HasFTaylorSeriesUpTo n f f') : ContDiff π•œ n f :=
   ⟨f', hf⟩
-#align has_ftaylor_series_up_to.cont_diff HasFtaylorSeriesUpTo.contDiff
+#align has_ftaylor_series_up_to.cont_diff HasFTaylorSeriesUpTo.contDiff
+-/
 
+#print contDiffOn_univ /-
 theorem contDiffOn_univ : ContDiffOn π•œ n f univ ↔ ContDiff π•œ n f :=
   by
   constructor
   Β· intro H
     use ftaylorSeriesWithin π•œ f univ
-    rw [← hasFtaylorSeriesUpToOn_univ_iff]
+    rw [← hasFTaylorSeriesUpToOn_univ_iff]
     exact H.ftaylor_series_within uniqueDiffOn_univ
   · rintro ⟨p, hp⟩ x hx m hm
     exact ⟨univ, Filter.univ_sets _, p, (hp.has_ftaylor_series_up_to_on univ).of_le hm⟩
 #align cont_diff_on_univ contDiffOn_univ
+-/
 
+#print contDiff_iff_contDiffAt /-
 theorem contDiff_iff_contDiffAt : ContDiff π•œ n f ↔ βˆ€ x, ContDiffAt π•œ n f x := by
   simp [← contDiffOn_univ, ContDiffOn, ContDiffAt]
 #align cont_diff_iff_cont_diff_at contDiff_iff_contDiffAt
+-/
 
+#print ContDiff.contDiffAt /-
 theorem ContDiff.contDiffAt (h : ContDiff π•œ n f) : ContDiffAt π•œ n f x :=
   contDiff_iff_contDiffAt.1 h x
 #align cont_diff.cont_diff_at ContDiff.contDiffAt
+-/
 
+#print ContDiff.contDiffWithinAt /-
 theorem ContDiff.contDiffWithinAt (h : ContDiff π•œ n f) : ContDiffWithinAt π•œ n f s x :=
   h.ContDiffAt.ContDiffWithinAt
 #align cont_diff.cont_diff_within_at ContDiff.contDiffWithinAt
+-/
 
+#print contDiff_top /-
 theorem contDiff_top : ContDiff π•œ ∞ f ↔ βˆ€ n : β„•, ContDiff π•œ n f := by
   simp [cont_diff_on_univ.symm, contDiffOn_top]
 #align cont_diff_top contDiff_top
+-/
 
+#print contDiff_all_iff_nat /-
 theorem contDiff_all_iff_nat : (βˆ€ n, ContDiff π•œ n f) ↔ βˆ€ n : β„•, ContDiff π•œ n f := by
   simp only [← contDiffOn_univ, contDiffOn_all_iff_nat]
 #align cont_diff_all_iff_nat contDiff_all_iff_nat
+-/
 
+#print ContDiff.contDiffOn /-
 theorem ContDiff.contDiffOn (h : ContDiff π•œ n f) : ContDiffOn π•œ n f s :=
   (contDiffOn_univ.2 h).mono (subset_univ _)
 #align cont_diff.cont_diff_on ContDiff.contDiffOn
+-/
 
+#print contDiff_zero /-
 @[simp]
 theorem contDiff_zero : ContDiff π•œ 0 f ↔ Continuous f :=
   by
   rw [← contDiffOn_univ, continuous_iff_continuousOn_univ]
   exact contDiffOn_zero
 #align cont_diff_zero contDiff_zero
+-/
 
 theorem contDiffAt_zero : ContDiffAt π•œ 0 f x ↔ βˆƒ u ∈ 𝓝 x, ContinuousOn f u := by
   rw [← contDiffWithinAt_univ]; simp [contDiffWithinAt_zero, nhdsWithin_univ]
@@ -1544,9 +1710,11 @@ theorem ContDiff.one_of_succ {n : β„•} (h : ContDiff π•œ (n + 1) f) : ContDiff
   h.of_le <| WithTop.coe_le_coe.mpr le_add_self
 #align cont_diff.one_of_succ ContDiff.one_of_succ
 
+#print ContDiff.continuous /-
 theorem ContDiff.continuous (h : ContDiff π•œ n f) : Continuous f :=
   contDiff_zero.1 (h.of_le bot_le)
 #align cont_diff.continuous ContDiff.continuous
+-/
 
 /-- If a function is `C^n` with `n β‰₯ 1`, then it is differentiable. -/
 theorem ContDiff.differentiable (h : ContDiff π•œ n f) (hn : 1 ≀ n) : Differentiable π•œ f :=
@@ -1557,6 +1725,7 @@ theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀
   simp_rw [← contDiffOn_univ]; exact contDiffOn_iff_forall_nat_le
 #align cont_diff_iff_forall_nat_le contDiff_iff_forall_nat_le
 
+#print contDiff_succ_iff_has_fderiv /-
 /-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
 theorem contDiff_succ_iff_has_fderiv {n : β„•} :
     ContDiff π•œ (n + 1 : β„•) f ↔
@@ -1565,190 +1734,216 @@ theorem contDiff_succ_iff_has_fderiv {n : β„•} :
   simp only [← contDiffOn_univ, ← hasFDerivWithinAt_univ,
     contDiffOn_succ_iff_has_fderiv_within uniqueDiffOn_univ, Set.mem_univ, forall_true_left]
 #align cont_diff_succ_iff_has_fderiv contDiff_succ_iff_has_fderiv
+-/
 
 /-! ### Iterated derivative -/
 
 
 variable (π•œ)
 
+#print iteratedFDeriv /-
 /-- The `n`-th derivative of a function, as a multilinear map, defined inductively. -/
-noncomputable def iteratedFderiv (n : β„•) (f : E β†’ F) : E β†’ E[Γ—n]β†’L[π•œ] F :=
+noncomputable def iteratedFDeriv (n : β„•) (f : E β†’ F) : E β†’ E[Γ—n]β†’L[π•œ] F :=
   Nat.recOn n (fun x => ContinuousMultilinearMap.curry0 π•œ E (f x)) fun n rec x =>
     ContinuousLinearMap.uncurryLeft (fderiv π•œ rec x)
-#align iterated_fderiv iteratedFderiv
+#align iterated_fderiv iteratedFDeriv
+-/
 
+#print ftaylorSeries /-
 /-- Formal Taylor series associated to a function within a set. -/
 def ftaylorSeries (f : E β†’ F) (x : E) : FormalMultilinearSeries π•œ E F := fun n =>
-  iteratedFderiv π•œ n f x
+  iteratedFDeriv π•œ n f x
 #align ftaylor_series ftaylorSeries
+-/
 
 variable {π•œ}
 
+#print iteratedFDeriv_zero_apply /-
 @[simp]
-theorem iteratedFderiv_zero_apply (m : Fin 0 β†’ E) :
-    (iteratedFderiv π•œ 0 f x : (Fin 0 β†’ E) β†’ F) m = f x :=
+theorem iteratedFDeriv_zero_apply (m : Fin 0 β†’ E) :
+    (iteratedFDeriv π•œ 0 f x : (Fin 0 β†’ E) β†’ F) m = f x :=
   rfl
-#align iterated_fderiv_zero_apply iteratedFderiv_zero_apply
+#align iterated_fderiv_zero_apply iteratedFDeriv_zero_apply
+-/
 
-theorem iteratedFderiv_zero_eq_comp :
-    iteratedFderiv π•œ 0 f = (continuousMultilinearCurryFin0 π•œ E F).symm ∘ f :=
+theorem iteratedFDeriv_zero_eq_comp :
+    iteratedFDeriv π•œ 0 f = (continuousMultilinearCurryFin0 π•œ E F).symm ∘ f :=
   rfl
-#align iterated_fderiv_zero_eq_comp iteratedFderiv_zero_eq_comp
+#align iterated_fderiv_zero_eq_comp iteratedFDeriv_zero_eq_comp
 
+#print norm_iteratedFDeriv_zero /-
 @[simp]
-theorem norm_iteratedFderiv_zero : β€–iteratedFderiv π•œ 0 f xβ€– = β€–f xβ€– := by
-  rw [iteratedFderiv_zero_eq_comp, LinearIsometryEquiv.norm_map]
-#align norm_iterated_fderiv_zero norm_iteratedFderiv_zero
+theorem norm_iteratedFDeriv_zero : β€–iteratedFDeriv π•œ 0 f xβ€– = β€–f xβ€– := by
+  rw [iteratedFDeriv_zero_eq_comp, LinearIsometryEquiv.norm_map]
+#align norm_iterated_fderiv_zero norm_iteratedFDeriv_zero
+-/
 
-theorem iteratedFderiv_with_zero_eq : iteratedFderivWithin π•œ 0 f s = iteratedFderiv π•œ 0 f := by ext;
+#print iteratedFDeriv_with_zero_eq /-
+theorem iteratedFDeriv_with_zero_eq : iteratedFDerivWithin π•œ 0 f s = iteratedFDeriv π•œ 0 f := by ext;
   rfl
-#align iterated_fderiv_with_zero_eq iteratedFderiv_with_zero_eq
+#align iterated_fderiv_with_zero_eq iteratedFDeriv_with_zero_eq
+-/
 
-theorem iteratedFderiv_succ_apply_left {n : β„•} (m : Fin (n + 1) β†’ E) :
-    (iteratedFderiv π•œ (n + 1) f x : (Fin (n + 1) β†’ E) β†’ F) m =
-      (fderiv π•œ (iteratedFderiv π•œ n f) x : E β†’ E[Γ—n]β†’L[π•œ] F) (m 0) (tail m) :=
+theorem iteratedFDeriv_succ_apply_left {n : β„•} (m : Fin (n + 1) β†’ E) :
+    (iteratedFDeriv π•œ (n + 1) f x : (Fin (n + 1) β†’ E) β†’ F) m =
+      (fderiv π•œ (iteratedFDeriv π•œ n f) x : E β†’ E[Γ—n]β†’L[π•œ] F) (m 0) (tail m) :=
   rfl
-#align iterated_fderiv_succ_apply_left iteratedFderiv_succ_apply_left
+#align iterated_fderiv_succ_apply_left iteratedFDeriv_succ_apply_left
 
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
 and the derivative of the `n`-th derivative. -/
-theorem iteratedFderiv_succ_eq_comp_left {n : β„•} :
-    iteratedFderiv π•œ (n + 1) f =
+theorem iteratedFDeriv_succ_eq_comp_left {n : β„•} :
+    iteratedFDeriv π•œ (n + 1) f =
       continuousMultilinearCurryLeftEquiv π•œ (fun i : Fin (n + 1) => E) F ∘
-        fderiv π•œ (iteratedFderiv π•œ n f) :=
+        fderiv π•œ (iteratedFDeriv π•œ n f) :=
   rfl
-#align iterated_fderiv_succ_eq_comp_left iteratedFderiv_succ_eq_comp_left
+#align iterated_fderiv_succ_eq_comp_left iteratedFDeriv_succ_eq_comp_left
 
 /-- Writing explicitly the derivative of the `n`-th derivative as the composition of a currying
 linear equiv, and the `n + 1`-th derivative. -/
-theorem fderiv_iteratedFderiv {n : β„•} :
-    fderiv π•œ (iteratedFderiv π•œ n f) =
+theorem fderiv_iteratedFDeriv {n : β„•} :
+    fderiv π•œ (iteratedFDeriv π•œ n f) =
       (continuousMultilinearCurryLeftEquiv π•œ (fun i : Fin (n + 1) => E) F).symm ∘
-        iteratedFderiv π•œ (n + 1) f :=
+        iteratedFDeriv π•œ (n + 1) f :=
   by
-  rw [iteratedFderiv_succ_eq_comp_left]
+  rw [iteratedFDeriv_succ_eq_comp_left]
   ext1 x
   simp only [Function.comp_apply, LinearIsometryEquiv.symm_apply_apply]
-#align fderiv_iterated_fderiv fderiv_iteratedFderiv
+#align fderiv_iterated_fderiv fderiv_iteratedFDeriv
 
-theorem HasCompactSupport.iteratedFderiv (hf : HasCompactSupport f) (n : β„•) :
-    HasCompactSupport (iteratedFderiv π•œ n f) :=
+theorem HasCompactSupport.iteratedFDeriv (hf : HasCompactSupport f) (n : β„•) :
+    HasCompactSupport (iteratedFDeriv π•œ n f) :=
   by
   induction' n with n IH
-  Β· rw [iteratedFderiv_zero_eq_comp]
+  Β· rw [iteratedFDeriv_zero_eq_comp]
     apply hf.comp_left
     exact LinearIsometryEquiv.map_zero _
-  Β· rw [iteratedFderiv_succ_eq_comp_left]
+  Β· rw [iteratedFDeriv_succ_eq_comp_left]
     apply (IH.fderiv π•œ).compLeft
     exact LinearIsometryEquiv.map_zero _
-#align has_compact_support.iterated_fderiv HasCompactSupport.iteratedFderiv
+#align has_compact_support.iterated_fderiv HasCompactSupport.iteratedFDeriv
 
-theorem norm_fderiv_iteratedFderiv {n : β„•} :
-    β€–fderiv π•œ (iteratedFderiv π•œ n f) xβ€– = β€–iteratedFderiv π•œ (n + 1) f xβ€– := by
-  rw [iteratedFderiv_succ_eq_comp_left, LinearIsometryEquiv.norm_map]
-#align norm_fderiv_iterated_fderiv norm_fderiv_iteratedFderiv
+#print norm_fderiv_iteratedFDeriv /-
+theorem norm_fderiv_iteratedFDeriv {n : β„•} :
+    β€–fderiv π•œ (iteratedFDeriv π•œ n f) xβ€– = β€–iteratedFDeriv π•œ (n + 1) f xβ€– := by
+  rw [iteratedFDeriv_succ_eq_comp_left, LinearIsometryEquiv.norm_map]
+#align norm_fderiv_iterated_fderiv norm_fderiv_iteratedFDeriv
+-/
 
-theorem iteratedFderivWithin_univ {n : β„•} :
-    iteratedFderivWithin π•œ n f univ = iteratedFderiv π•œ n f :=
+#print iteratedFDerivWithin_univ /-
+theorem iteratedFDerivWithin_univ {n : β„•} :
+    iteratedFDerivWithin π•œ n f univ = iteratedFDeriv π•œ n f :=
   by
   induction' n with n IH
   Β· ext x; simp
   Β· ext (x m)
-    rw [iteratedFderiv_succ_apply_left, iteratedFderivWithin_succ_apply_left, IH, fderivWithin_univ]
-#align iterated_fderiv_within_univ iteratedFderivWithin_univ
+    rw [iteratedFDeriv_succ_apply_left, iteratedFDerivWithin_succ_apply_left, IH, fderivWithin_univ]
+#align iterated_fderiv_within_univ iteratedFDerivWithin_univ
+-/
 
+#print iteratedFDerivWithin_of_isOpen /-
 /-- In an open set, the iterated derivative within this set coincides with the global iterated
 derivative. -/
-theorem iteratedFderivWithin_of_isOpen (n : β„•) (hs : IsOpen s) :
-    EqOn (iteratedFderivWithin π•œ n f s) (iteratedFderiv π•œ n f) s :=
+theorem iteratedFDerivWithin_of_isOpen (n : β„•) (hs : IsOpen s) :
+    EqOn (iteratedFDerivWithin π•œ n f s) (iteratedFDeriv π•œ n f) s :=
   by
   induction' n with n IH
   Β· intro x hx
     ext1 m
-    simp only [iteratedFderivWithin_zero_apply, iteratedFderiv_zero_apply]
+    simp only [iteratedFDerivWithin_zero_apply, iteratedFDeriv_zero_apply]
   Β· intro x hx
-    rw [iteratedFderiv_succ_eq_comp_left, iteratedFderivWithin_succ_eq_comp_left]
+    rw [iteratedFDeriv_succ_eq_comp_left, iteratedFDerivWithin_succ_eq_comp_left]
     dsimp
     congr 1
     rw [fderivWithin_of_open hs hx]
     apply Filter.EventuallyEq.fderiv_eq
     filter_upwards [hs.mem_nhds hx]
     exact IH
-#align iterated_fderiv_within_of_is_open iteratedFderivWithin_of_isOpen
+#align iterated_fderiv_within_of_is_open iteratedFDerivWithin_of_isOpen
+-/
 
+#print ftaylorSeriesWithin_univ /-
 theorem ftaylorSeriesWithin_univ : ftaylorSeriesWithin π•œ f univ = ftaylorSeries π•œ f :=
   by
   ext1 x; ext1 n
-  change iteratedFderivWithin π•œ n f univ x = iteratedFderiv π•œ n f x
-  rw [iteratedFderivWithin_univ]
+  change iteratedFDerivWithin π•œ n f univ x = iteratedFDeriv π•œ n f x
+  rw [iteratedFDerivWithin_univ]
 #align ftaylor_series_within_univ ftaylorSeriesWithin_univ
+-/
 
-theorem iteratedFderiv_succ_apply_right {n : β„•} (m : Fin (n + 1) β†’ E) :
-    (iteratedFderiv π•œ (n + 1) f x : (Fin (n + 1) β†’ E) β†’ F) m =
-      iteratedFderiv π•œ n (fun y => fderiv π•œ f y) x (init m) (m (last n)) :=
+theorem iteratedFDeriv_succ_apply_right {n : β„•} (m : Fin (n + 1) β†’ E) :
+    (iteratedFDeriv π•œ (n + 1) f x : (Fin (n + 1) β†’ E) β†’ F) m =
+      iteratedFDeriv π•œ n (fun y => fderiv π•œ f y) x (init m) (m (last n)) :=
   by
-  rw [← iteratedFderivWithin_univ, ← iteratedFderivWithin_univ, ← fderivWithin_univ]
-  exact iteratedFderivWithin_succ_apply_right uniqueDiffOn_univ (mem_univ _) _
-#align iterated_fderiv_succ_apply_right iteratedFderiv_succ_apply_right
+  rw [← iteratedFDerivWithin_univ, ← iteratedFDerivWithin_univ, ← fderivWithin_univ]
+  exact iteratedFDerivWithin_succ_apply_right uniqueDiffOn_univ (mem_univ _) _
+#align iterated_fderiv_succ_apply_right iteratedFDeriv_succ_apply_right
 
+#print iteratedFDeriv_succ_eq_comp_right /-
 /-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
 and the `n`-th derivative of the derivative. -/
-theorem iteratedFderiv_succ_eq_comp_right {n : β„•} :
-    iteratedFderiv π•œ (n + 1) f x =
-      (continuousMultilinearCurryRightEquiv' π•œ n E F ∘ iteratedFderiv π•œ n fun y => fderiv π•œ f y)
+theorem iteratedFDeriv_succ_eq_comp_right {n : β„•} :
+    iteratedFDeriv π•œ (n + 1) f x =
+      (continuousMultilinearCurryRightEquiv' π•œ n E F ∘ iteratedFDeriv π•œ n fun y => fderiv π•œ f y)
         x :=
-  by ext m; rw [iteratedFderiv_succ_apply_right]; rfl
-#align iterated_fderiv_succ_eq_comp_right iteratedFderiv_succ_eq_comp_right
+  by ext m; rw [iteratedFDeriv_succ_apply_right]; rfl
+#align iterated_fderiv_succ_eq_comp_right iteratedFDeriv_succ_eq_comp_right
+-/
 
-theorem norm_iteratedFderiv_fderiv {n : β„•} :
-    β€–iteratedFderiv π•œ n (fderiv π•œ f) xβ€– = β€–iteratedFderiv π•œ (n + 1) f xβ€– := by
-  rw [iteratedFderiv_succ_eq_comp_right, LinearIsometryEquiv.norm_map]
-#align norm_iterated_fderiv_fderiv norm_iteratedFderiv_fderiv
+#print norm_iteratedFDeriv_fderiv /-
+theorem norm_iteratedFDeriv_fderiv {n : β„•} :
+    β€–iteratedFDeriv π•œ n (fderiv π•œ f) xβ€– = β€–iteratedFDeriv π•œ (n + 1) f xβ€– := by
+  rw [iteratedFDeriv_succ_eq_comp_right, LinearIsometryEquiv.norm_map]
+#align norm_iterated_fderiv_fderiv norm_iteratedFDeriv_fderiv
+-/
 
 @[simp]
-theorem iteratedFderiv_one_apply (m : Fin 1 β†’ E) :
-    (iteratedFderiv π•œ 1 f x : (Fin 1 β†’ E) β†’ F) m = (fderiv π•œ f x : E β†’ F) (m 0) := by
-  rw [iteratedFderiv_succ_apply_right, iteratedFderiv_zero_apply]; rfl
-#align iterated_fderiv_one_apply iteratedFderiv_one_apply
+theorem iteratedFDeriv_one_apply (m : Fin 1 β†’ E) :
+    (iteratedFDeriv π•œ 1 f x : (Fin 1 β†’ E) β†’ F) m = (fderiv π•œ f x : E β†’ F) (m 0) := by
+  rw [iteratedFDeriv_succ_apply_right, iteratedFDeriv_zero_apply]; rfl
+#align iterated_fderiv_one_apply iteratedFDeriv_one_apply
 
+#print contDiff_iff_ftaylorSeries /-
 /-- When a function is `C^n` in a set `s` of unique differentiability, it admits
 `ftaylor_series_within π•œ f s` as a Taylor series up to order `n` in `s`. -/
 theorem contDiff_iff_ftaylorSeries :
-    ContDiff π•œ n f ↔ HasFtaylorSeriesUpTo n f (ftaylorSeries π•œ f) :=
+    ContDiff π•œ n f ↔ HasFTaylorSeriesUpTo n f (ftaylorSeries π•œ f) :=
   by
   constructor
-  Β· rw [← contDiffOn_univ, ← hasFtaylorSeriesUpToOn_univ_iff, ← ftaylorSeriesWithin_univ]
+  Β· rw [← contDiffOn_univ, ← hasFTaylorSeriesUpToOn_univ_iff, ← ftaylorSeriesWithin_univ]
     exact fun h => ContDiffOn.ftaylorSeriesWithin h uniqueDiffOn_univ
   Β· intro h; exact ⟨ftaylorSeries π•œ f, h⟩
 #align cont_diff_iff_ftaylor_series contDiff_iff_ftaylorSeries
+-/
 
 theorem contDiff_iff_continuous_differentiable :
     ContDiff π•œ n f ↔
-      (βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ Continuous fun x => iteratedFderiv π•œ m f x) ∧
-        βˆ€ m : β„•, (m : β„•βˆž) < n β†’ Differentiable π•œ fun x => iteratedFderiv π•œ m f x :=
+      (βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ Continuous fun x => iteratedFDeriv π•œ m f x) ∧
+        βˆ€ m : β„•, (m : β„•βˆž) < n β†’ Differentiable π•œ fun x => iteratedFDeriv π•œ m f x :=
   by
   simp [cont_diff_on_univ.symm, continuous_iff_continuousOn_univ, differentiable_on_univ.symm,
-    iteratedFderivWithin_univ, contDiffOn_iff_continuousOn_differentiableOn uniqueDiffOn_univ]
+    iteratedFDerivWithin_univ, contDiffOn_iff_continuousOn_differentiableOn uniqueDiffOn_univ]
 #align cont_diff_iff_continuous_differentiable contDiff_iff_continuous_differentiable
 
 /-- If `f` is `C^n` then its `m`-times iterated derivative is continuous for `m ≀ n`. -/
-theorem ContDiff.continuous_iteratedFderiv {m : β„•} (hm : (m : β„•βˆž) ≀ n) (hf : ContDiff π•œ n f) :
-    Continuous fun x => iteratedFderiv π•œ m f x :=
+theorem ContDiff.continuous_iteratedFDeriv {m : β„•} (hm : (m : β„•βˆž) ≀ n) (hf : ContDiff π•œ n f) :
+    Continuous fun x => iteratedFDeriv π•œ m f x :=
   (contDiff_iff_continuous_differentiable.mp hf).1 m hm
-#align cont_diff.continuous_iterated_fderiv ContDiff.continuous_iteratedFderiv
+#align cont_diff.continuous_iterated_fderiv ContDiff.continuous_iteratedFDeriv
 
 /-- If `f` is `C^n` then its `m`-times iterated derivative is differentiable for `m < n`. -/
-theorem ContDiff.differentiable_iteratedFderiv {m : β„•} (hm : (m : β„•βˆž) < n) (hf : ContDiff π•œ n f) :
-    Differentiable π•œ fun x => iteratedFderiv π•œ m f x :=
+theorem ContDiff.differentiable_iteratedFDeriv {m : β„•} (hm : (m : β„•βˆž) < n) (hf : ContDiff π•œ n f) :
+    Differentiable π•œ fun x => iteratedFDeriv π•œ m f x :=
   (contDiff_iff_continuous_differentiable.mp hf).2 m hm
-#align cont_diff.differentiable_iterated_fderiv ContDiff.differentiable_iteratedFderiv
+#align cont_diff.differentiable_iterated_fderiv ContDiff.differentiable_iteratedFDeriv
 
-theorem contDiff_of_differentiable_iteratedFderiv
-    (h : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ Differentiable π•œ (iteratedFderiv π•œ m f)) : ContDiff π•œ n f :=
+theorem contDiff_of_differentiable_iteratedFDeriv
+    (h : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ Differentiable π•œ (iteratedFDeriv π•œ m f)) : ContDiff π•œ n f :=
   contDiff_iff_continuous_differentiable.2
     ⟨fun m hm => (h m hm).Continuous, fun m hm => h m (le_of_lt hm)⟩
-#align cont_diff_of_differentiable_iterated_fderiv contDiff_of_differentiable_iteratedFderiv
+#align cont_diff_of_differentiable_iterated_fderiv contDiff_of_differentiable_iteratedFDeriv
 
+#print contDiff_succ_iff_fderiv /-
 /-- A function is `C^(n + 1)` if and only if it is differentiable,
 and its derivative (formulated in terms of `fderiv`) is `C^n`. -/
 theorem contDiff_succ_iff_fderiv {n : β„•} :
@@ -1756,11 +1951,15 @@ theorem contDiff_succ_iff_fderiv {n : β„•} :
   simp only [← contDiffOn_univ, ← differentiableOn_univ, ← fderivWithin_univ,
     contDiffOn_succ_iff_fderivWithin uniqueDiffOn_univ]
 #align cont_diff_succ_iff_fderiv contDiff_succ_iff_fderiv
+-/
 
+#print contDiff_one_iff_fderiv /-
 theorem contDiff_one_iff_fderiv : ContDiff π•œ 1 f ↔ Differentiable π•œ f ∧ Continuous (fderiv π•œ f) :=
   contDiff_succ_iff_fderiv.trans <| Iff.rfl.And contDiff_zero
 #align cont_diff_one_iff_fderiv contDiff_one_iff_fderiv
+-/
 
+#print contDiff_top_iff_fderiv /-
 /-- A function is `C^∞` if and only if it is differentiable,
 and its derivative (formulated in terms of `fderiv`) is `C^∞`. -/
 theorem contDiff_top_iff_fderiv :
@@ -1769,6 +1968,7 @@ theorem contDiff_top_iff_fderiv :
   simp only [← contDiffOn_univ, ← differentiableOn_univ, ← fderivWithin_univ]
   rw [contDiffOn_top_iff_fderivWithin uniqueDiffOn_univ]
 #align cont_diff_top_iff_fderiv contDiff_top_iff_fderiv
+-/
 
 theorem ContDiff.continuous_fderiv (h : ContDiff π•œ n f) (hn : 1 ≀ n) :
     Continuous fun x => fderiv π•œ f x :=
Diff
@@ -163,7 +163,7 @@ derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor ser
 
 noncomputable section
 
-open Classical BigOperators NNReal Topology Filter
+open scoped Classical BigOperators NNReal Topology Filter
 
 -- mathport name: «expr∞»
 local notation "∞" => (⊀ : β„•βˆž)
Diff
@@ -195,10 +195,7 @@ structure HasFtaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMul
 #align has_ftaylor_series_up_to_on HasFtaylorSeriesUpToOn
 
 theorem HasFtaylorSeriesUpToOn.zero_eq' (h : HasFtaylorSeriesUpToOn n f p s) {x : E} (hx : x ∈ s) :
-    p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) :=
-  by
-  rw [← h.zero_eq x hx]
-  symm
+    p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) := by rw [← h.zero_eq x hx]; symm;
   exact ContinuousMultilinearMap.uncurry0_curry0 _
 #align has_ftaylor_series_up_to_on.zero_eq' HasFtaylorSeriesUpToOn.zero_eq'
 
@@ -239,12 +236,8 @@ theorem hasFtaylorSeriesUpToOn_zero_iff :
       ⟨H.2, fun m hm => False.elim (not_le.2 hm bot_le), _⟩⟩
   intro m hm
   obtain rfl : m = 0 := by exact_mod_cast hm.antisymm (zero_le _)
-  have : βˆ€ x ∈ s, p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) :=
-    by
-    intro x hx
-    rw [← H.2 x hx]
-    symm
-    exact ContinuousMultilinearMap.uncurry0_curry0 _
+  have : βˆ€ x ∈ s, p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) := by intro x hx;
+    rw [← H.2 x hx]; symm; exact ContinuousMultilinearMap.uncurry0_curry0 _
   rw [continuousOn_congr this, LinearIsometryEquiv.comp_continuousOn_iff]
   exact H.1
 #align has_ftaylor_series_up_to_on_zero_iff hasFtaylorSeriesUpToOn_zero_iff
@@ -253,8 +246,7 @@ theorem hasFtaylorSeriesUpToOn_top_iff :
     HasFtaylorSeriesUpToOn ∞ f p s ↔ βˆ€ n : β„•, HasFtaylorSeriesUpToOn n f p s :=
   by
   constructor
-  Β· intro H n
-    exact H.of_le le_top
+  Β· intro H n; exact H.of_le le_top
   Β· intro H
     constructor
     Β· exact (H 0).zero_eq
@@ -283,11 +275,8 @@ series is a derivative of `f`. -/
 theorem HasFtaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
     (hx : x ∈ s) : HasFDerivWithinAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x :=
   by
-  have A : βˆ€ y ∈ s, f y = (continuousMultilinearCurryFin0 π•œ E F) (p y 0) :=
-    by
-    intro y hy
-    rw [← h.zero_eq y hy]
-    rfl
+  have A : βˆ€ y ∈ s, f y = (continuousMultilinearCurryFin0 π•œ E F) (p y 0) := by intro y hy;
+    rw [← h.zero_eq y hy]; rfl
   suffices H :
     HasFDerivWithinAt (fun y => continuousMultilinearCurryFin0 π•œ E F (p y 0))
       (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x
@@ -372,12 +361,9 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
   Β· intro H
     refine' ⟨H.zero_eq, H.fderiv_within 0 (WithTop.coe_lt_coe.2 (Nat.succ_pos n)), _⟩
     constructor
-    Β· intro x hx
-      rfl
+    Β· intro x hx; rfl
     Β· intro m(hm : (m : β„•βˆž) < n)x(hx : x ∈ s)
-      have A : (m.succ : β„•βˆž) < n.succ :=
-        by
-        rw [WithTop.coe_lt_coe] at hm⊒
+      have A : (m.succ : β„•βˆž) < n.succ := by rw [WithTop.coe_lt_coe] at hm⊒;
         exact nat.lt_succ_iff.mpr hm
       change
         HasFDerivWithinAt
@@ -391,9 +377,7 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
           (p x (Nat.succ (Nat.succ m))) (cons y v)
       rw [← cons_snoc_eq_snoc_cons, snoc_init_self]
     Β· intro m(hm : (m : β„•βˆž) ≀ n)
-      have A : (m.succ : β„•βˆž) ≀ n.succ :=
-        by
-        rw [WithTop.coe_le_coe] at hm⊒
+      have A : (m.succ : β„•βˆž) ≀ n.succ := by rw [WithTop.coe_le_coe] at hm⊒;
         exact nat.pred_le_iff.mp hm
       change
         ContinuousOn
@@ -406,9 +390,7 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
     Β· intro m(hm : (m : β„•βˆž) < n.succ)x(hx : x ∈ s)
       cases m
       Β· exact Hfderiv_zero x hx
-      Β· have A : (m : β„•βˆž) < n := by
-          rw [WithTop.coe_lt_coe] at hm⊒
-          exact Nat.lt_of_succ_lt_succ hm
+      Β· have A : (m : β„•βˆž) < n := by rw [WithTop.coe_lt_coe] at hm⊒; exact Nat.lt_of_succ_lt_succ hm
         have :
           HasFDerivWithinAt
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ)
@@ -426,9 +408,7 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
       Β· have : DifferentiableOn π•œ (fun x => p x 0) s := fun x hx =>
           (Hfderiv_zero x hx).DifferentiableWithinAt
         exact this.continuous_on
-      Β· have A : (m : β„•βˆž) ≀ n := by
-          rw [WithTop.coe_le_coe] at hm⊒
-          exact nat.lt_succ_iff.mp hm
+      Β· have A : (m : β„•βˆž) ≀ n := by rw [WithTop.coe_le_coe] at hm⊒; exact nat.lt_succ_iff.mp hm
         have :
           ContinuousOn
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ) s :=
@@ -883,11 +863,7 @@ theorem iteratedFderivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ
       βˆ€ y ∈ s,
         iteratedFderivWithin π•œ n.succ f s y =
           (I ∘ iteratedFderivWithin π•œ n (fun y => fderivWithin π•œ f s y) s) y :=
-      by
-      intro y hy
-      ext m
-      rw [@IH m y hy]
-      rfl
+      by intro y hy; ext m; rw [@IH m y hy]; rfl
     calc
       (iteratedFderivWithin π•œ (n + 2) f s x : (Fin (n + 2) β†’ E) β†’ F) m =
           (fderivWithin π•œ (iteratedFderivWithin π•œ n.succ f s) s x : E β†’ E[Γ—n + 1]β†’L[π•œ] F) (m 0)
@@ -902,9 +878,7 @@ theorem iteratedFderivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ
           (I ∘ fderivWithin π•œ (iteratedFderivWithin π•œ n (fderivWithin π•œ f s) s) s x :
               E β†’ E[Γ—n + 1]β†’L[π•œ] F)
             (m 0) (tail m) :=
-        by
-        rw [LinearIsometryEquiv.comp_fderivWithin _ (hs x hx)]
-        rfl
+        by rw [LinearIsometryEquiv.comp_fderivWithin _ (hs x hx)]; rfl
       _ =
           (fderivWithin π•œ (iteratedFderivWithin π•œ n (fun y => fderivWithin π•œ f s y) s) s x :
               E β†’ E[Γ—n]β†’L[π•œ] E β†’L[π•œ] F)
@@ -913,9 +887,7 @@ theorem iteratedFderivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ
       _ =
           iteratedFderivWithin π•œ (Nat.succ n) (fun y => fderivWithin π•œ f s y) s x (init m)
             (m (last (n + 1))) :=
-        by
-        rw [iteratedFderivWithin_succ_apply_left, tail_init_eq_init_tail]
-        rfl
+        by rw [iteratedFderivWithin_succ_apply_left, tail_init_eq_init_tail]; rfl
       
 #align iterated_fderiv_within_succ_apply_right iteratedFderivWithin_succ_apply_right
 
@@ -926,10 +898,7 @@ theorem iteratedFderivWithin_succ_eq_comp_right {n : β„•} (hs : UniqueDiffOn 
       (continuousMultilinearCurryRightEquiv' π•œ n E F ∘
           iteratedFderivWithin π•œ n (fun y => fderivWithin π•œ f s y) s)
         x :=
-  by
-  ext m
-  rw [iteratedFderivWithin_succ_apply_right hs hx]
-  rfl
+  by ext m; rw [iteratedFderivWithin_succ_apply_right hs hx]; rfl
 #align iterated_fderiv_within_succ_eq_comp_right iteratedFderivWithin_succ_eq_comp_right
 
 theorem norm_iteratedFderivWithin_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) :
@@ -1321,10 +1290,7 @@ structure HasFtaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMulti
 #align has_ftaylor_series_up_to HasFtaylorSeriesUpTo
 
 theorem HasFtaylorSeriesUpTo.zero_eq' (h : HasFtaylorSeriesUpTo n f p) (x : E) :
-    p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) :=
-  by
-  rw [← h.zero_eq x]
-  symm
+    p x 0 = (continuousMultilinearCurryFin0 π•œ E F).symm (f x) := by rw [← h.zero_eq x]; symm;
   exact ContinuousMultilinearMap.uncurry0_curry0 _
 #align has_ftaylor_series_up_to.zero_eq' HasFtaylorSeriesUpTo.zero_eq'
 
@@ -1358,10 +1324,7 @@ theorem HasFtaylorSeriesUpTo.hasFtaylorSeriesUpToOn (h : HasFtaylorSeriesUpTo n
 #align has_ftaylor_series_up_to.has_ftaylor_series_up_to_on HasFtaylorSeriesUpTo.hasFtaylorSeriesUpToOn
 
 theorem HasFtaylorSeriesUpTo.ofLe (h : HasFtaylorSeriesUpTo n f p) (hmn : m ≀ n) :
-    HasFtaylorSeriesUpTo m f p :=
-  by
-  rw [← hasFtaylorSeriesUpToOn_univ_iff] at h⊒
-  exact h.of_le hmn
+    HasFtaylorSeriesUpTo m f p := by rw [← hasFtaylorSeriesUpToOn_univ_iff] at h⊒; exact h.of_le hmn
 #align has_ftaylor_series_up_to.of_le HasFtaylorSeriesUpTo.ofLe
 
 theorem HasFtaylorSeriesUpTo.continuous (h : HasFtaylorSeriesUpTo n f p) : Continuous f :=
@@ -1556,10 +1519,8 @@ theorem contDiff_zero : ContDiff π•œ 0 f ↔ Continuous f :=
   exact contDiffOn_zero
 #align cont_diff_zero contDiff_zero
 
-theorem contDiffAt_zero : ContDiffAt π•œ 0 f x ↔ βˆƒ u ∈ 𝓝 x, ContinuousOn f u :=
-  by
-  rw [← contDiffWithinAt_univ]
-  simp [contDiffWithinAt_zero, nhdsWithin_univ]
+theorem contDiffAt_zero : ContDiffAt π•œ 0 f x ↔ βˆƒ u ∈ 𝓝 x, ContinuousOn f u := by
+  rw [← contDiffWithinAt_univ]; simp [contDiffWithinAt_zero, nhdsWithin_univ]
 #align cont_diff_at_zero contDiffAt_zero
 
 theorem contDiffAt_one_iff :
@@ -1592,10 +1553,8 @@ theorem ContDiff.differentiable (h : ContDiff π•œ n f) (hn : 1 ≀ n) : Differe
   differentiableOn_univ.1 <| (contDiffOn_univ.2 h).DifferentiableOn hn
 #align cont_diff.differentiable ContDiff.differentiable
 
-theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀ n β†’ ContDiff π•œ m f :=
-  by
-  simp_rw [← contDiffOn_univ]
-  exact contDiffOn_iff_forall_nat_le
+theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀ n β†’ ContDiff π•œ m f := by
+  simp_rw [← contDiffOn_univ]; exact contDiffOn_iff_forall_nat_le
 #align cont_diff_iff_forall_nat_le contDiff_iff_forall_nat_le
 
 /-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
@@ -1641,9 +1600,7 @@ theorem norm_iteratedFderiv_zero : β€–iteratedFderiv π•œ 0 f xβ€– = β€–f xβ€– :
   rw [iteratedFderiv_zero_eq_comp, LinearIsometryEquiv.norm_map]
 #align norm_iterated_fderiv_zero norm_iteratedFderiv_zero
 
-theorem iteratedFderiv_with_zero_eq : iteratedFderivWithin π•œ 0 f s = iteratedFderiv π•œ 0 f :=
-  by
-  ext
+theorem iteratedFderiv_with_zero_eq : iteratedFderivWithin π•œ 0 f s = iteratedFderiv π•œ 0 f := by ext;
   rfl
 #align iterated_fderiv_with_zero_eq iteratedFderiv_with_zero_eq
 
@@ -1695,8 +1652,7 @@ theorem iteratedFderivWithin_univ {n : β„•} :
     iteratedFderivWithin π•œ n f univ = iteratedFderiv π•œ n f :=
   by
   induction' n with n IH
-  Β· ext x
-    simp
+  Β· ext x; simp
   Β· ext (x m)
     rw [iteratedFderiv_succ_apply_left, iteratedFderivWithin_succ_apply_left, IH, fderivWithin_univ]
 #align iterated_fderiv_within_univ iteratedFderivWithin_univ
@@ -1741,10 +1697,7 @@ theorem iteratedFderiv_succ_eq_comp_right {n : β„•} :
     iteratedFderiv π•œ (n + 1) f x =
       (continuousMultilinearCurryRightEquiv' π•œ n E F ∘ iteratedFderiv π•œ n fun y => fderiv π•œ f y)
         x :=
-  by
-  ext m
-  rw [iteratedFderiv_succ_apply_right]
-  rfl
+  by ext m; rw [iteratedFderiv_succ_apply_right]; rfl
 #align iterated_fderiv_succ_eq_comp_right iteratedFderiv_succ_eq_comp_right
 
 theorem norm_iteratedFderiv_fderiv {n : β„•} :
@@ -1754,10 +1707,8 @@ theorem norm_iteratedFderiv_fderiv {n : β„•} :
 
 @[simp]
 theorem iteratedFderiv_one_apply (m : Fin 1 β†’ E) :
-    (iteratedFderiv π•œ 1 f x : (Fin 1 β†’ E) β†’ F) m = (fderiv π•œ f x : E β†’ F) (m 0) :=
-  by
-  rw [iteratedFderiv_succ_apply_right, iteratedFderiv_zero_apply]
-  rfl
+    (iteratedFderiv π•œ 1 f x : (Fin 1 β†’ E) β†’ F) m = (fderiv π•œ f x : E β†’ F) (m 0) := by
+  rw [iteratedFderiv_succ_apply_right, iteratedFderiv_zero_apply]; rfl
 #align iterated_fderiv_one_apply iteratedFderiv_one_apply
 
 /-- When a function is `C^n` in a set `s` of unique differentiability, it admits
@@ -1768,8 +1719,7 @@ theorem contDiff_iff_ftaylorSeries :
   constructor
   Β· rw [← contDiffOn_univ, ← hasFtaylorSeriesUpToOn_univ_iff, ← ftaylorSeriesWithin_univ]
     exact fun h => ContDiffOn.ftaylorSeriesWithin h uniqueDiffOn_univ
-  Β· intro h
-    exact ⟨ftaylorSeries π•œ f, h⟩
+  Β· intro h; exact ⟨ftaylorSeries π•œ f, h⟩
 #align cont_diff_iff_ftaylor_series contDiff_iff_ftaylorSeries
 
 theorem contDiff_iff_continuous_differentiable :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit e3fb84046afd187b710170887195d50bada934ee
+! leanprover-community/mathlib commit 3a69562db5a458db8322b190ec8d9a8bbd8a5b14
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -163,7 +163,7 @@ derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor ser
 
 noncomputable section
 
-open Classical BigOperators NNReal Topology
+open Classical BigOperators NNReal Topology Filter
 
 -- mathport name: «expr∞»
 local notation "∞" => (⊀ : β„•βˆž)
@@ -698,15 +698,19 @@ theorem ContDiffOn.contDiffWithinAt (h : ContDiffOn π•œ n f s) (hx : x ∈ s) :
   h x hx
 #align cont_diff_on.cont_diff_within_at ContDiffOn.contDiffWithinAt
 
+theorem ContDiffWithinAt.cont_diff_on' {m : β„•} (hm : (m : β„•βˆž) ≀ n)
+    (h : ContDiffWithinAt π•œ n f s x) : βˆƒ u, IsOpen u ∧ x ∈ u ∧ ContDiffOn π•œ m f (insert x s ∩ u) :=
+  by
+  rcases h m hm with ⟨t, ht, p, hp⟩
+  rcases mem_nhdsWithin.1 ht with ⟨u, huo, hxu, hut⟩
+  rw [inter_comm] at hut
+  exact ⟨u, huo, hxu, (hp.mono hut).ContDiffOn⟩
+#align cont_diff_within_at.cont_diff_on' ContDiffWithinAt.cont_diff_on'
+
 theorem ContDiffWithinAt.contDiffOn {m : β„•} (hm : (m : β„•βˆž) ≀ n) (h : ContDiffWithinAt π•œ n f s x) :
     βˆƒ u ∈ 𝓝[insert x s] x, u βŠ† insert x s ∧ ContDiffOn π•œ m f u :=
-  by
-  rcases h m hm with ⟨u, u_nhd, p, hp⟩
-  refine' ⟨u ∩ insert x s, Filter.inter_mem u_nhd self_mem_nhdsWithin, inter_subset_right _ _, _⟩
-  intro y hy m' hm'
-  refine' ⟨u ∩ insert x s, _, p, (hp.mono (inter_subset_left _ _)).of_le hm'⟩
-  convert self_mem_nhdsWithin
-  exact insert_eq_of_mem hy
+  let ⟨u, uo, xu, h⟩ := h.cont_diff_on' hm
+  ⟨_, inter_mem_nhdsWithin _ (uo.mem_nhds xu), inter_subset_left _ _, h⟩
 #align cont_diff_within_at.cont_diff_on ContDiffWithinAt.contDiffOn
 
 protected theorem ContDiffWithinAt.eventually {n : β„•} (h : ContDiffWithinAt π•œ n f s x) :
@@ -893,7 +897,7 @@ theorem iteratedFderivWithin_succ_apply_right {n : β„•} (hs : UniqueDiffOn π•œ
           (fderivWithin π•œ (I ∘ iteratedFderivWithin π•œ n (fderivWithin π•œ f s) s) s x :
               E β†’ E[Γ—n + 1]β†’L[π•œ] F)
             (m 0) (tail m) :=
-        by rw [fderivWithin_congr (hs x hx) A (A x hx)]
+        by rw [fderivWithin_congr A (A x hx)]
       _ =
           (I ∘ fderivWithin π•œ (iteratedFderivWithin π•œ n (fderivWithin π•œ f s) s) s x :
               E β†’ E[Γ—n + 1]β†’L[π•œ] F)
@@ -934,79 +938,95 @@ theorem norm_iteratedFderivWithin_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ
 #align norm_iterated_fderiv_within_fderiv_within norm_iteratedFderivWithin_fderivWithin
 
 @[simp]
-theorem iteratedFderivWithin_one_apply (hs : UniqueDiffOn π•œ s) (hx : x ∈ s) (m : Fin 1 β†’ E) :
+theorem iteratedFderivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fin 1 β†’ E) :
     (iteratedFderivWithin π•œ 1 f s x : (Fin 1 β†’ E) β†’ F) m = (fderivWithin π•œ f s x : E β†’ F) (m 0) :=
   by
-  rw [iteratedFderivWithin_succ_apply_right hs hx, iteratedFderivWithin_zero_apply]
+  simp only [iteratedFderivWithin_succ_apply_left, iteratedFderivWithin_zero_eq_comp,
+    (continuousMultilinearCurryFin0 π•œ E F).symm.comp_fderivWithin h]
   rfl
 #align iterated_fderiv_within_one_apply iteratedFderivWithin_one_apply
 
-/-- If two functions coincide on a set `s` of unique differentiability, then their iterated
-differentials within this set coincide. -/
-theorem iteratedFderivWithin_congr {n : β„•} (hs : UniqueDiffOn π•œ s) (hL : βˆ€ y ∈ s, f₁ y = f y)
-    (hx : x ∈ s) : iteratedFderivWithin π•œ n f₁ s x = iteratedFderivWithin π•œ n f s x :=
+theorem Filter.EventuallyEq.iterated_fderiv_within' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
+    iteratedFderivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFderivWithin π•œ n f t :=
   by
-  induction' n with n IH generalizing x
-  Β· ext m
-    simp [hL x hx]
-  Β· have :
-      fderivWithin π•œ (fun y => iteratedFderivWithin π•œ n f₁ s y) s x =
-        fderivWithin π•œ (fun y => iteratedFderivWithin π•œ n f s y) s x :=
-      fderivWithin_congr (hs x hx) (fun y hy => IH hy) (IH hx)
-    ext m
-    rw [iteratedFderivWithin_succ_apply_left, iteratedFderivWithin_succ_apply_left, this]
+  induction' n with n ihn
+  Β· exact h.mono fun y hy => FunLike.ext _ _ fun _ => hy
+  Β· have : fderivWithin π•œ _ t =αΆ [𝓝[s] x] fderivWithin π•œ _ t := ihn.fderiv_within' ht
+    apply this.mono
+    intro y hy
+    simp only [iteratedFderivWithin_succ_eq_comp_left, hy, (· ∘ ·)]
+#align filter.eventually_eq.iterated_fderiv_within' Filter.EventuallyEq.iterated_fderiv_within'
+
+protected theorem Filter.EventuallyEq.iteratedFderivWithin (h : f₁ =αΆ [𝓝[s] x] f) (n : β„•) :
+    iteratedFderivWithin π•œ n f₁ s =αΆ [𝓝[s] x] iteratedFderivWithin π•œ n f s :=
+  h.iterated_fderiv_within' Subset.rfl n
+#align filter.eventually_eq.iterated_fderiv_within Filter.EventuallyEq.iteratedFderivWithin
+
+/-- If two functions coincide in a neighborhood of `x` within a set `s` and at `x`, then their
+iterated differentials within this set at `x` coincide. -/
+theorem Filter.EventuallyEq.iteratedFderivWithin_eq (h : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x)
+    (n : β„•) : iteratedFderivWithin π•œ n f₁ s x = iteratedFderivWithin π•œ n f s x :=
+  have : f₁ =αΆ [𝓝[insert x s] x] f := by simpa [eventually_eq, hx]
+  (this.iterated_fderiv_within' (subset_insert _ _) n).self_of_nhdsWithin (mem_insert _ _)
+#align filter.eventually_eq.iterated_fderiv_within_eq Filter.EventuallyEq.iteratedFderivWithin_eq
+
+/-- If two functions coincide on a set `s`, then their iterated differentials within this set
+coincide. See also `filter.eventually_eq.iterated_fderiv_within_eq` and
+`filter.eventually_eq.iterated_fderiv_within`. -/
+theorem iteratedFderivWithin_congr (hs : EqOn f₁ f s) (hx : x ∈ s) (n : β„•) :
+    iteratedFderivWithin π•œ n f₁ s x = iteratedFderivWithin π•œ n f s x :=
+  (hs.EventuallyEq.filter_mono inf_le_right).iteratedFderivWithin_eq (hs hx) _
 #align iterated_fderiv_within_congr iteratedFderivWithin_congr
 
-/-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
-`s` with an open set containing `x`. -/
-theorem iteratedFderivWithin_inter_open {n : β„•} (hu : IsOpen u) (hs : UniqueDiffOn π•œ (s ∩ u))
-    (hx : x ∈ s ∩ u) : iteratedFderivWithin π•œ n f (s ∩ u) x = iteratedFderivWithin π•œ n f s x :=
-  by
-  induction' n with n IH generalizing x
-  Β· ext m
-    simp
-  Β· have A :
-      fderivWithin π•œ (fun y => iteratedFderivWithin π•œ n f (s ∩ u) y) (s ∩ u) x =
-        fderivWithin π•œ (fun y => iteratedFderivWithin π•œ n f s y) (s ∩ u) x :=
-      fderivWithin_congr (hs x hx) (fun y hy => IH hy) (IH hx)
-    have B :
-      fderivWithin π•œ (fun y => iteratedFderivWithin π•œ n f s y) (s ∩ u) x =
-        fderivWithin π•œ (fun y => iteratedFderivWithin π•œ n f s y) s x :=
-      fderivWithin_inter (IsOpen.mem_nhds hu hx.2)
-        ((uniqueDiffWithinAt_inter (IsOpen.mem_nhds hu hx.2)).1 (hs x hx))
-    ext m
-    rw [iteratedFderivWithin_succ_apply_left, iteratedFderivWithin_succ_apply_left, A, B]
-#align iterated_fderiv_within_inter_open iteratedFderivWithin_inter_open
+/-- If two functions coincide on a set `s`, then their iterated differentials within this set
+coincide. See also `filter.eventually_eq.iterated_fderiv_within_eq` and
+`filter.eventually_eq.iterated_fderiv_within`. -/
+protected theorem Set.EqOn.iteratedFderivWithin (hs : EqOn f₁ f s) (n : β„•) :
+    EqOn (iteratedFderivWithin π•œ n f₁ s) (iteratedFderivWithin π•œ n f s) s := fun x hx =>
+  iteratedFderivWithin_congr hs hx n
+#align set.eq_on.iterated_fderiv_within Set.EqOn.iteratedFderivWithin
+
+theorem iteratedFderivWithin_eventually_congr_set' (y : E) (h : s =αΆ [𝓝[{y}ᢜ] x] t) (n : β„•) :
+    iteratedFderivWithin π•œ n f s =αΆ [𝓝 x] iteratedFderivWithin π•œ n f t :=
+  by
+  induction' n with n ihn generalizing x
+  Β· rfl
+  Β· refine' (eventually_nhds_nhdsWithin.2 h).mono fun y hy => _
+    simp only [iteratedFderivWithin_succ_eq_comp_left, (· ∘ ·)]
+    rw [(ihn hy).fderivWithin_eq_nhds, fderivWithin_congr_set' _ hy]
+#align iterated_fderiv_within_eventually_congr_set' iteratedFderivWithin_eventually_congr_set'
+
+theorem iteratedFderivWithin_eventually_congr_set (h : s =αΆ [𝓝 x] t) (n : β„•) :
+    iteratedFderivWithin π•œ n f s =αΆ [𝓝 x] iteratedFderivWithin π•œ n f t :=
+  iteratedFderivWithin_eventually_congr_set' x (h.filter_mono inf_le_left) n
+#align iterated_fderiv_within_eventually_congr_set iteratedFderivWithin_eventually_congr_set
+
+theorem iteratedFderivWithin_congr_set (h : s =αΆ [𝓝 x] t) (n : β„•) :
+    iteratedFderivWithin π•œ n f s x = iteratedFderivWithin π•œ n f t x :=
+  (iteratedFderivWithin_eventually_congr_set h n).self_of_nhds
+#align iterated_fderiv_within_congr_set iteratedFderivWithin_congr_set
 
 /-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
 `s` with a neighborhood of `x` within `s`. -/
-theorem iteratedFderivWithin_inter' {n : β„•} (hu : u ∈ 𝓝[s] x) (hs : UniqueDiffOn π•œ s) (xs : x ∈ s) :
+theorem iteratedFderivWithin_inter' {n : β„•} (hu : u ∈ 𝓝[s] x) :
     iteratedFderivWithin π•œ n f (s ∩ u) x = iteratedFderivWithin π•œ n f s x :=
-  by
-  obtain ⟨v, v_open, xv, vu⟩ : βˆƒ v, IsOpen v ∧ x ∈ v ∧ v ∩ s βŠ† u := mem_nhdsWithin.1 hu
-  have A : s ∩ u ∩ v = s ∩ v :=
-    by
-    apply subset.antisymm (inter_subset_inter (inter_subset_left _ _) (subset.refl _))
-    exact fun y ⟨ys, yv⟩ => ⟨⟨ys, vu ⟨yv, ys⟩⟩, yv⟩
-  have : iteratedFderivWithin π•œ n f (s ∩ v) x = iteratedFderivWithin π•œ n f s x :=
-    iteratedFderivWithin_inter_open v_open (hs.inter v_open) ⟨xs, xv⟩
-  rw [← this]
-  have : iteratedFderivWithin π•œ n f (s ∩ u ∩ v) x = iteratedFderivWithin π•œ n f (s ∩ u) x :=
-    by
-    refine' iteratedFderivWithin_inter_open v_open _ ⟨⟨xs, vu ⟨xv, xs⟩⟩, xv⟩
-    rw [A]
-    exact hs.inter v_open
-  rw [A] at this
-  rw [← this]
+  iteratedFderivWithin_congr_set (nhdsWithin_eq_iff_eventuallyEq.1 <| nhdsWithin_inter_of_mem' hu) _
 #align iterated_fderiv_within_inter' iteratedFderivWithin_inter'
 
 /-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
 `s` with a neighborhood of `x`. -/
-theorem iteratedFderivWithin_inter {n : β„•} (hu : u ∈ 𝓝 x) (hs : UniqueDiffOn π•œ s) (xs : x ∈ s) :
+theorem iteratedFderivWithin_inter {n : β„•} (hu : u ∈ 𝓝 x) :
     iteratedFderivWithin π•œ n f (s ∩ u) x = iteratedFderivWithin π•œ n f s x :=
-  iteratedFderivWithin_inter' (mem_nhdsWithin_of_mem_nhds hu) hs xs
+  iteratedFderivWithin_inter' (mem_nhdsWithin_of_mem_nhds hu)
 #align iterated_fderiv_within_inter iteratedFderivWithin_inter
 
+/-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
+`s` with an open set containing `x`. -/
+theorem iteratedFderivWithin_inter_open {n : β„•} (hu : IsOpen u) (hx : x ∈ u) :
+    iteratedFderivWithin π•œ n f (s ∩ u) x = iteratedFderivWithin π•œ n f s x :=
+  iteratedFderivWithin_inter (hu.mem_nhds hx)
+#align iterated_fderiv_within_inter_open iteratedFderivWithin_inter_open
+
 @[simp]
 theorem contDiffOn_zero : ContDiffOn π•œ 0 f s ↔ ContinuousOn f s :=
   by
@@ -1070,14 +1090,14 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
     have : p x m.succ = ftaylorSeriesWithin π•œ f s x m.succ :=
       by
       change p x m.succ = iteratedFderivWithin π•œ m.succ f s x
-      rw [← iteratedFderivWithin_inter (IsOpen.mem_nhds o_open xo) hs hx]
+      rw [← iteratedFderivWithin_inter_open o_open xo]
       exact (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hx, xo⟩
     rw [← this, ← hasFDerivWithinAt_inter (IsOpen.mem_nhds o_open xo)]
     have A : βˆ€ y ∈ s ∩ o, p y m = ftaylorSeriesWithin π•œ f s y m :=
       by
       rintro y ⟨hy, yo⟩
       change p y m = iteratedFderivWithin π•œ m f s y
-      rw [← iteratedFderivWithin_inter (IsOpen.mem_nhds o_open yo) hs hy]
+      rw [← iteratedFderivWithin_inter_open o_open yo]
       exact
         (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn (WithTop.coe_le_coe.2 (Nat.le_succ m))
           (hs.inter o_open) ⟨hy, yo⟩
@@ -1096,7 +1116,7 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
       by
       rintro y ⟨hy, yo⟩
       change p y m = iteratedFderivWithin π•œ m f s y
-      rw [← iteratedFderivWithin_inter (IsOpen.mem_nhds o_open yo) hs hy]
+      rw [← iteratedFderivWithin_inter_open o_open yo]
       exact (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hy, yo⟩
     exact ((Hp.mono ho).cont m le_rfl).congr fun y hy => (A y hy).symm
 #align cont_diff_on.ftaylor_series_within ContDiffOn.ftaylorSeriesWithin
@@ -1140,20 +1160,35 @@ theorem ContDiffOn.differentiableOn_iteratedFderivWithin {m : β„•} (h : ContDiff
   ((h.ftaylorSeriesWithin hs).fderivWithin m hmn x hx).DifferentiableWithinAt
 #align cont_diff_on.differentiable_on_iterated_fderiv_within ContDiffOn.differentiableOn_iteratedFderivWithin
 
+theorem ContDiffWithinAt.differentiableWithinAt_iteratedFderivWithin {m : β„•}
+    (h : ContDiffWithinAt π•œ n f s x) (hmn : (m : β„•βˆž) < n) (hs : UniqueDiffOn π•œ (insert x s)) :
+    DifferentiableWithinAt π•œ (iteratedFderivWithin π•œ m f s) s x :=
+  by
+  rcases h.cont_diff_on' (ENat.add_one_le_of_lt hmn) with ⟨u, uo, xu, hu⟩
+  set t := insert x s ∩ u
+  have A : t =αΆ [𝓝[β‰ ] x] s :=
+    by
+    simp only [set_eventually_eq_iff_inf_principal, ← nhdsWithin_inter']
+    rw [← inter_assoc, nhdsWithin_inter_of_mem', ← diff_eq_compl_inter, insert_diff_of_mem,
+      diff_eq_compl_inter]
+    exacts[rfl, mem_nhdsWithin_of_mem_nhds (uo.mem_nhds xu)]
+  have B : iteratedFderivWithin π•œ m f s =αΆ [𝓝 x] iteratedFderivWithin π•œ m f t :=
+    iteratedFderivWithin_eventually_congr_set' _ A.symm _
+  have C : DifferentiableWithinAt π•œ (iteratedFderivWithin π•œ m f t) t x :=
+    hu.differentiable_on_iterated_fderiv_within (Nat.cast_lt.2 m.lt_succ_self) (hs.inter uo) x
+      ⟨mem_insert _ _, xu⟩
+  rw [differentiableWithinAt_congr_set' _ A] at C
+  exact C.congr_of_eventually_eq (B.filter_mono inf_le_left) B.self_of_nhds
+#align cont_diff_within_at.differentiable_within_at_iterated_fderiv_within ContDiffWithinAt.differentiableWithinAt_iteratedFderivWithin
+
 theorem contDiffOn_iff_continuousOn_differentiableOn (hs : UniqueDiffOn π•œ s) :
     ContDiffOn π•œ n f s ↔
       (βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (fun x => iteratedFderivWithin π•œ m f s x) s) ∧
         βˆ€ m : β„•, (m : β„•βˆž) < n β†’ DifferentiableOn π•œ (fun x => iteratedFderivWithin π•œ m f s x) s :=
-  by
-  constructor
-  Β· intro h
-    constructor
-    Β· intro m hm
-      exact h.continuous_on_iterated_fderiv_within hm hs
-    Β· intro m hm
-      exact h.differentiable_on_iterated_fderiv_within hm hs
-  Β· intro h
-    exact contDiffOn_of_continuousOn_differentiableOn h.1 h.2
+  ⟨fun h =>
+    ⟨fun m hm => h.continuousOn_iteratedFderivWithin hm hs, fun m hm =>
+      h.differentiableOn_iteratedFderivWithin hm hs⟩,
+    fun h => contDiffOn_of_continuousOn_differentiableOn h.1 h.2⟩
 #align cont_diff_on_iff_continuous_on_differentiable_on contDiffOn_iff_continuousOn_differentiableOn
 
 theorem contDiffOn_succ_of_fderivWithin {n : β„•} (hf : DifferentiableOn π•œ f s)
@@ -1184,7 +1219,7 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
   apply Filter.eventuallyEq_of_mem this fun y hy => _
   have A : fderivWithin π•œ f (s ∩ o) y = f' y :=
     ((hff' y (ho hy)).mono ho).fderivWithin (hs.inter o_open y hy)
-  rwa [fderivWithin_inter (IsOpen.mem_nhds o_open hy.2) (hs y hy.1)] at A
+  rwa [fderivWithin_inter (o_open.mem_nhds hy.2)] at A
 #align cont_diff_on_succ_iff_fderiv_within contDiffOn_succ_iff_fderivWithin
 
 theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ s) :
Diff
@@ -190,7 +190,7 @@ structure HasFtaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMul
   zero_eq : βˆ€ x ∈ s, (p x 0).uncurry0 = f x
   fderivWithin :
     βˆ€ (m : β„•) (hm : (m : β„•βˆž) < n),
-      βˆ€ x ∈ s, HasFderivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x
+      βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x
   cont : βˆ€ (m : β„•) (hm : (m : β„•βˆž) ≀ n), ContinuousOn (fun x => p x m) s
 #align has_ftaylor_series_up_to_on HasFtaylorSeriesUpToOn
 
@@ -269,7 +269,7 @@ theorem hasFtaylorSeriesUpToOn_top_iff :
 theorem hasFtaylorSeriesUpToOn_top_iff' :
     HasFtaylorSeriesUpToOn ∞ f p s ↔
       (βˆ€ x ∈ s, (p x 0).uncurry0 = f x) ∧
-        βˆ€ m : β„•, βˆ€ x ∈ s, HasFderivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x :=
+        βˆ€ m : β„•, βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x :=
   ⟨-- Everything except for the continuity is trivial:
   fun h => ⟨h.1, fun m => h.2 m (WithTop.coe_lt_top m)⟩, fun h =>
     ⟨h.1, fun m _ => h.2 m, fun m _ x hx =>
@@ -280,8 +280,8 @@ theorem hasFtaylorSeriesUpToOn_top_iff' :
 
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
-theorem HasFtaylorSeriesUpToOn.hasFderivWithinAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
-    (hx : x ∈ s) : HasFderivWithinAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x :=
+theorem HasFtaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
+    (hx : x ∈ s) : HasFDerivWithinAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x :=
   by
   have A : βˆ€ y ∈ s, f y = (continuousMultilinearCurryFin0 π•œ E F) (p y 0) :=
     by
@@ -289,10 +289,10 @@ theorem HasFtaylorSeriesUpToOn.hasFderivWithinAt (h : HasFtaylorSeriesUpToOn n f
     rw [← h.zero_eq y hy]
     rfl
   suffices H :
-    HasFderivWithinAt (fun y => continuousMultilinearCurryFin0 π•œ E F (p y 0))
+    HasFDerivWithinAt (fun y => continuousMultilinearCurryFin0 π•œ E F (p y 0))
       (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x
   Β· exact H.congr A (A x hx)
-  rw [LinearIsometryEquiv.comp_hasFderivWithinAt_iff']
+  rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
   have : ((0 : β„•) : β„•βˆž) < n := lt_of_lt_of_le (WithTop.coe_lt_coe.2 Nat.zero_lt_one) hn
   convert h.fderiv_within _ this x hx
   ext (y v)
@@ -301,32 +301,32 @@ theorem HasFtaylorSeriesUpToOn.hasFderivWithinAt (h : HasFtaylorSeriesUpToOn n f
   congr with i
   rw [Unique.eq_default i]
   rfl
-#align has_ftaylor_series_up_to_on.has_fderiv_within_at HasFtaylorSeriesUpToOn.hasFderivWithinAt
+#align has_ftaylor_series_up_to_on.has_fderiv_within_at HasFtaylorSeriesUpToOn.hasFDerivWithinAt
 
 theorem HasFtaylorSeriesUpToOn.differentiableOn (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n) :
-    DifferentiableOn π•œ f s := fun x hx => (h.HasFderivWithinAt hn hx).DifferentiableWithinAt
+    DifferentiableOn π•œ f s := fun x hx => (h.HasFDerivWithinAt hn hx).DifferentiableWithinAt
 #align has_ftaylor_series_up_to_on.differentiable_on HasFtaylorSeriesUpToOn.differentiableOn
 
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then the term
 of order `1` of this series is a derivative of `f` at `x`. -/
-theorem HasFtaylorSeriesUpToOn.hasFderivAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
-    (hx : s ∈ 𝓝 x) : HasFderivAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) x :=
-  (h.HasFderivWithinAt hn (mem_of_mem_nhds hx)).HasFderivAt hx
-#align has_ftaylor_series_up_to_on.has_fderiv_at HasFtaylorSeriesUpToOn.hasFderivAt
+theorem HasFtaylorSeriesUpToOn.hasFDerivAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
+    (hx : s ∈ 𝓝 x) : HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) x :=
+  (h.HasFDerivWithinAt hn (mem_of_mem_nhds hx)).HasFDerivAt hx
+#align has_ftaylor_series_up_to_on.has_fderiv_at HasFtaylorSeriesUpToOn.hasFDerivAt
 
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
 in a neighborhood of `x`, the term of order `1` of this series is a derivative of `f`. -/
-theorem HasFtaylorSeriesUpToOn.eventually_hasFderivAt (h : HasFtaylorSeriesUpToOn n f p s)
+theorem HasFtaylorSeriesUpToOn.eventually_hasFDerivAt (h : HasFtaylorSeriesUpToOn n f p s)
     (hn : 1 ≀ n) (hx : s ∈ 𝓝 x) :
-    βˆ€αΆ  y in 𝓝 x, HasFderivAt f (continuousMultilinearCurryFin1 π•œ E F (p y 1)) y :=
-  (eventually_eventually_nhds.2 hx).mono fun y hy => h.HasFderivAt hn hy
-#align has_ftaylor_series_up_to_on.eventually_has_fderiv_at HasFtaylorSeriesUpToOn.eventually_hasFderivAt
+    βˆ€αΆ  y in 𝓝 x, HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p y 1)) y :=
+  (eventually_eventually_nhds.2 hx).mono fun y hy => h.HasFDerivAt hn hy
+#align has_ftaylor_series_up_to_on.eventually_has_fderiv_at HasFtaylorSeriesUpToOn.eventually_hasFDerivAt
 
 /-- If a function has a Taylor series at order at least `1` on a neighborhood of `x`, then
 it is differentiable at `x`. -/
 theorem HasFtaylorSeriesUpToOn.differentiableAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
     (hx : s ∈ 𝓝 x) : DifferentiableAt π•œ f x :=
-  (h.HasFderivAt hn hx).DifferentiableAt
+  (h.HasFDerivAt hn hx).DifferentiableAt
 #align has_ftaylor_series_up_to_on.differentiable_at HasFtaylorSeriesUpToOn.differentiableAt
 
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p` is a Taylor series up to `n`, and
@@ -334,7 +334,7 @@ theorem HasFtaylorSeriesUpToOn.differentiableAt (h : HasFtaylorSeriesUpToOn n f
 theorem hasFtaylorSeriesUpToOn_succ_iff_left {n : β„•} :
     HasFtaylorSeriesUpToOn (n + 1) f p s ↔
       HasFtaylorSeriesUpToOn n f p s ∧
-        (βˆ€ x ∈ s, HasFderivWithinAt (fun y => p y n) (p x n.succ).curryLeft s x) ∧
+        (βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y n) (p x n.succ).curryLeft s x) ∧
           ContinuousOn (fun x => p x (n + 1)) s :=
   by
   constructor
@@ -364,7 +364,7 @@ for `p 1`, which is a derivative of `f`. -/
 theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
     HasFtaylorSeriesUpToOn (n + 1 : β„•) f p s ↔
       (βˆ€ x ∈ s, (p x 0).uncurry0 = f x) ∧
-        (βˆ€ x ∈ s, HasFderivWithinAt (fun y => p y 0) (p x 1).curryLeft s x) ∧
+        (βˆ€ x ∈ s, HasFDerivWithinAt (fun y => p y 0) (p x 1).curryLeft s x) ∧
           HasFtaylorSeriesUpToOn n (fun x => continuousMultilinearCurryFin1 π•œ E F (p x 1))
             (fun x => (p x).shift) s :=
   by
@@ -380,10 +380,10 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
         rw [WithTop.coe_lt_coe] at hm⊒
         exact nat.lt_succ_iff.mpr hm
       change
-        HasFderivWithinAt
+        HasFDerivWithinAt
           ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ)
           (p x m.succ.succ).curryRight.curryLeft s x
-      rw [LinearIsometryEquiv.comp_hasFderivWithinAt_iff']
+      rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
       convert H.fderiv_within _ A x hx
       ext (y v)
       change
@@ -410,11 +410,11 @@ theorem hasFtaylorSeriesUpToOn_succ_iff_right {n : β„•} :
           rw [WithTop.coe_lt_coe] at hm⊒
           exact Nat.lt_of_succ_lt_succ hm
         have :
-          HasFderivWithinAt
+          HasFDerivWithinAt
             ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ fun y : E => p y m.succ)
             ((p x).shift m.succ).curryLeft s x :=
           Htaylor.fderiv_within _ A x hx
-        rw [LinearIsometryEquiv.comp_hasFderivWithinAt_iff'] at this
+        rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff'] at this
         convert this
         ext (y v)
         change
@@ -588,11 +588,11 @@ theorem ContDiffWithinAt.differentiableWithinAt (h : ContDiffWithinAt π•œ n f s
 #align cont_diff_within_at.differentiable_within_at ContDiffWithinAt.differentiableWithinAt
 
 /-- A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`. -/
-theorem contDiffWithinAt_succ_iff_hasFderivWithinAt {n : β„•} :
+theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
     ContDiffWithinAt π•œ (n + 1 : β„•) f s x ↔
       βˆƒ u ∈ 𝓝[insert x s] x,
         βˆƒ f' : E β†’ E β†’L[π•œ] F,
-          (βˆ€ x ∈ u, HasFderivWithinAt f (f' x) u x) ∧ ContDiffWithinAt π•œ n f' u x :=
+          (βˆ€ x ∈ u, HasFDerivWithinAt f (f' x) u x) ∧ ContDiffWithinAt π•œ n f' u x :=
   by
   constructor
   Β· intro h
@@ -617,9 +617,9 @@ theorem contDiffWithinAt_succ_iff_hasFderivWithinAt {n : β„•} :
     Β· rw [hasFtaylorSeriesUpToOn_succ_iff_right]
       refine' ⟨fun y hy => rfl, fun y hy => _, _⟩
       Β· change
-          HasFderivWithinAt (fun z => (continuousMultilinearCurryFin0 π•œ E F).symm (f z))
+          HasFDerivWithinAt (fun z => (continuousMultilinearCurryFin0 π•œ E F).symm (f z))
             (FormalMultilinearSeries.unshift (p' y) (f y) 1).curryLeft (v ∩ u) y
-        rw [LinearIsometryEquiv.comp_hasFderivWithinAt_iff']
+        rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
         convert(f'_eq_deriv y hy.2).mono (inter_subset_right v u)
         rw [← Hp'.zero_eq y hy.1]
         ext z
@@ -639,7 +639,7 @@ theorem contDiffWithinAt_succ_iff_hasFderivWithinAt {n : β„•} :
                 (@snoc k (fun i : Fin k.succ => E) v y (last k)) =
               p' x k v y
           rw [snoc_last, init_snoc]
-#align cont_diff_within_at_succ_iff_has_fderiv_within_at contDiffWithinAt_succ_iff_hasFderivWithinAt
+#align cont_diff_within_at_succ_iff_has_fderiv_within_at contDiffWithinAt_succ_iff_hasFDerivWithinAt
 
 /-- A version of `cont_diff_within_at_succ_iff_has_fderiv_within_at` where all derivatives
   are taken within the same set. -/
@@ -648,7 +648,7 @@ theorem contDiffWithinAt_succ_iff_has_fderiv_within_at' {n : β„•} :
       βˆƒ u ∈ 𝓝[insert x s] x,
         u βŠ† insert x s ∧
           βˆƒ f' : E β†’ E β†’L[π•œ] F,
-            (βˆ€ x ∈ u, HasFderivWithinAt f (f' x) s x) ∧ ContDiffWithinAt π•œ n f' s x :=
+            (βˆ€ x ∈ u, HasFDerivWithinAt f (f' x) s x) ∧ ContDiffWithinAt π•œ n f' s x :=
   by
   refine' ⟨fun hf => _, _⟩
   · obtain ⟨u, hu, f', huf', hf'⟩ := cont_diff_within_at_succ_iff_has_fderiv_within_at.mp hf
@@ -661,7 +661,7 @@ theorem contDiffWithinAt_succ_iff_has_fderiv_within_at' {n : β„•} :
       refine' mem_of_superset _ (inter_subset_inter_left _ (subset_insert _ _))
       refine' inter_mem_nhdsWithin _ (hw.mem_nhds hy.2)
     Β· exact hf'.mono_of_mem (nhdsWithin_mono _ (subset_insert _ _) hu)
-  Β· rw [← contDiffWithinAt_insert, contDiffWithinAt_succ_iff_hasFderivWithinAt,
+  Β· rw [← contDiffWithinAt_insert, contDiffWithinAt_succ_iff_hasFDerivWithinAt,
       insert_eq_of_mem (mem_insert _ _)]
     rintro ⟨u, hu, hus, f', huf', hf'⟩
     refine' ⟨u, hu, f', fun y hy => (huf' y hy).insert'.mono hus, hf'.insert.mono hus⟩
@@ -783,11 +783,11 @@ theorem contDiffOn_of_locally_contDiffOn
 #align cont_diff_on_of_locally_cont_diff_on contDiffOn_of_locally_contDiffOn
 
 /-- A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`. -/
-theorem contDiffOn_succ_iff_hasFderivWithinAt {n : β„•} :
+theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
       βˆ€ x ∈ s,
         βˆƒ u ∈ 𝓝[insert x s] x,
-          βˆƒ f' : E β†’ E β†’L[π•œ] F, (βˆ€ x ∈ u, HasFderivWithinAt f (f' x) u x) ∧ ContDiffOn π•œ n f' u :=
+          βˆƒ f' : E β†’ E β†’L[π•œ] F, (βˆ€ x ∈ u, HasFDerivWithinAt f (f' x) u x) ∧ ContDiffOn π•œ n f' u :=
   by
   constructor
   Β· intro h x hx
@@ -801,11 +801,11 @@ theorem contDiffOn_succ_iff_hasFderivWithinAt {n : β„•} :
     convert self_mem_nhdsWithin
     exact insert_eq_of_mem hz
   Β· intro h x hx
-    rw [contDiffWithinAt_succ_iff_hasFderivWithinAt]
+    rw [contDiffWithinAt_succ_iff_hasFDerivWithinAt]
     rcases h x hx with ⟨u, u_nhbd, f', hu, hf'⟩
     have : x ∈ u := mem_of_mem_nhdsWithin (mem_insert _ _) u_nhbd
     exact ⟨u, u_nhbd, f', hu, hf' x this⟩
-#align cont_diff_on_succ_iff_has_fderiv_within_at contDiffOn_succ_iff_hasFderivWithinAt
+#align cont_diff_on_succ_iff_has_fderiv_within_at contDiffOn_succ_iff_hasFDerivWithinAt
 
 /-! ### Iterated derivative within a set -/
 
@@ -1045,7 +1045,7 @@ theorem HasFtaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
   Β· rw [h.zero_eq' hx, iteratedFderivWithin_zero_eq_comp]
   Β· have A : (m : β„•βˆž) < n := lt_of_lt_of_le (WithTop.coe_lt_coe.2 (lt_add_one m)) hmn
     have :
-      HasFderivWithinAt (fun y : E => iteratedFderivWithin π•œ m f s y)
+      HasFDerivWithinAt (fun y : E => iteratedFderivWithin π•œ m f s y)
         (ContinuousMultilinearMap.curryLeft (p x (Nat.succ m))) s x :=
       (h.fderiv_within m A x hx).congr (fun y hy => (IH (le_of_lt A) hy).symm)
         (IH (le_of_lt A) hx).symm
@@ -1072,7 +1072,7 @@ theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs : UniqueD
       change p x m.succ = iteratedFderivWithin π•œ m.succ f s x
       rw [← iteratedFderivWithin_inter (IsOpen.mem_nhds o_open xo) hs hx]
       exact (Hp.mono ho).eq_ftaylor_series_of_uniqueDiffOn le_rfl (hs.inter o_open) ⟨hx, xo⟩
-    rw [← this, ← hasFderivWithinAt_inter (IsOpen.mem_nhds o_open xo)]
+    rw [← this, ← hasFDerivWithinAt_inter (IsOpen.mem_nhds o_open xo)]
     have A : βˆ€ y ∈ s ∩ o, p y m = ftaylorSeriesWithin π•œ f s y m :=
       by
       rintro y ⟨hy, yo⟩
@@ -1114,7 +1114,7 @@ theorem contDiffOn_of_continuousOn_differentiableOn
     simp only [ftaylorSeriesWithin, ContinuousMultilinearMap.uncurry0_apply,
       iteratedFderivWithin_zero_apply]
   Β· intro k hk y hy
-    convert(Hdiff k (lt_of_lt_of_le hk hm) y hy).HasFderivWithinAt
+    convert(Hdiff k (lt_of_lt_of_le hk hm) y hy).HasFDerivWithinAt
     simp only [ftaylorSeriesWithin, iteratedFderivWithin_succ_eq_comp_left,
       ContinuousLinearEquiv.coe_apply, Function.comp_apply, coeFn_coeBase]
     exact ContinuousLinearMap.curry_uncurryLeft _
@@ -1160,9 +1160,9 @@ theorem contDiffOn_succ_of_fderivWithin {n : β„•} (hf : DifferentiableOn π•œ f
     (h : ContDiffOn π•œ n (fun y => fderivWithin π•œ f s y) s) : ContDiffOn π•œ (n + 1 : β„•) f s :=
   by
   intro x hx
-  rw [contDiffWithinAt_succ_iff_hasFderivWithinAt, insert_eq_of_mem hx]
+  rw [contDiffWithinAt_succ_iff_hasFDerivWithinAt, insert_eq_of_mem hx]
   exact
-    ⟨s, self_mem_nhdsWithin, fderivWithin π•œ f s, fun y hy => (hf y hy).HasFderivWithinAt, h x hx⟩
+    ⟨s, self_mem_nhdsWithin, fderivWithin π•œ f s, fun y hy => (hf y hy).HasFDerivWithinAt, h x hx⟩
 #align cont_diff_on_succ_of_fderiv_within contDiffOn_succ_of_fderivWithin
 
 /-- A function is `C^(n + 1)` on a domain with unique derivatives if and only if it is
@@ -1173,7 +1173,7 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
   by
   refine' ⟨fun H => _, fun h => contDiffOn_succ_of_fderivWithin h.1 h.2⟩
   refine' ⟨H.differentiable_on (WithTop.coe_le_coe.2 (Nat.le_add_left 1 n)), fun x hx => _⟩
-  rcases contDiffWithinAt_succ_iff_hasFderivWithinAt.1 (H x hx) with ⟨u, hu, f', hff', hf'⟩
+  rcases contDiffWithinAt_succ_iff_hasFDerivWithinAt.1 (H x hx) with ⟨u, hu, f', hff', hf'⟩
   rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
   rw [inter_comm, insert_eq_of_mem hx] at ho
   have := hf'.mono ho
@@ -1189,10 +1189,10 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
 
 theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ s) :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
-      βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiffOn π•œ n f' s ∧ βˆ€ x, x ∈ s β†’ HasFderivWithinAt f (f' x) s x :=
+      βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiffOn π•œ n f' s ∧ βˆ€ x, x ∈ s β†’ HasFDerivWithinAt f (f' x) s x :=
   by
   rw [contDiffOn_succ_iff_fderivWithin hs]
-  refine' ⟨fun h => ⟨fderivWithin π•œ f s, h.2, fun x hx => (h.1 x hx).HasFderivWithinAt⟩, fun h => _⟩
+  refine' ⟨fun h => ⟨fderivWithin π•œ f s, h.2, fun x hx => (h.1 x hx).HasFDerivWithinAt⟩, fun h => _⟩
   rcases h with ⟨f', h1, h2⟩
   refine' ⟨fun x hx => (h2 x hx).DifferentiableWithinAt, fun x hx => _⟩
   exact (h1 x hx).congr' (fun y hy => (h2 y hy).fderivWithin (hs y hy)) hx
@@ -1281,7 +1281,7 @@ derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a pred
 structure HasFtaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F) :
   Prop where
   zero_eq : βˆ€ x, (p x 0).uncurry0 = f x
-  fderiv : βˆ€ (m : β„•) (hm : (m : β„•βˆž) < n), βˆ€ x, HasFderivAt (fun y => p y m) (p x m.succ).curryLeft x
+  fderiv : βˆ€ (m : β„•) (hm : (m : β„•βˆž) < n), βˆ€ x, HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x
   cont : βˆ€ (m : β„•) (hm : (m : β„•βˆž) ≀ n), Continuous fun x => p x m
 #align has_ftaylor_series_up_to HasFtaylorSeriesUpTo
 
@@ -1301,7 +1301,7 @@ theorem hasFtaylorSeriesUpToOn_univ_iff :
     constructor
     Β· exact fun x => H.zero_eq x (mem_univ x)
     Β· intro m hm x
-      rw [← hasFderivWithinAt_univ]
+      rw [← hasFDerivWithinAt_univ]
       exact H.fderiv_within m hm x (mem_univ x)
     Β· intro m hm
       rw [continuous_iff_continuousOn_univ]
@@ -1310,7 +1310,7 @@ theorem hasFtaylorSeriesUpToOn_univ_iff :
     constructor
     Β· exact fun x hx => H.zero_eq x
     Β· intro m hm x hx
-      rw [hasFderivWithinAt_univ]
+      rw [hasFDerivWithinAt_univ]
       exact H.fderiv m hm x
     Β· intro m hm
       rw [← continuous_iff_continuousOn_univ]
@@ -1352,23 +1352,23 @@ theorem hasFtaylorSeriesUpTo_top_iff :
 theorem hasFtaylorSeriesUpTo_top_iff' :
     HasFtaylorSeriesUpTo ∞ f p ↔
       (βˆ€ x, (p x 0).uncurry0 = f x) ∧
-        βˆ€ (m : β„•) (x), HasFderivAt (fun y => p y m) (p x m.succ).curryLeft x :=
+        βˆ€ (m : β„•) (x), HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x :=
   by
   simp only [← hasFtaylorSeriesUpToOn_univ_iff, hasFtaylorSeriesUpToOn_top_iff', mem_univ,
-    forall_true_left, hasFderivWithinAt_univ]
+    forall_true_left, hasFDerivWithinAt_univ]
 #align has_ftaylor_series_up_to_top_iff' hasFtaylorSeriesUpTo_top_iff'
 
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
-theorem HasFtaylorSeriesUpTo.hasFderivAt (h : HasFtaylorSeriesUpTo n f p) (hn : 1 ≀ n) (x : E) :
-    HasFderivAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) x :=
+theorem HasFtaylorSeriesUpTo.hasFDerivAt (h : HasFtaylorSeriesUpTo n f p) (hn : 1 ≀ n) (x : E) :
+    HasFDerivAt f (continuousMultilinearCurryFin1 π•œ E F (p x 1)) x :=
   by
-  rw [← hasFderivWithinAt_univ]
-  exact (hasFtaylorSeriesUpToOn_univ_iff.2 h).HasFderivWithinAt hn (mem_univ _)
-#align has_ftaylor_series_up_to.has_fderiv_at HasFtaylorSeriesUpTo.hasFderivAt
+  rw [← hasFDerivWithinAt_univ]
+  exact (hasFtaylorSeriesUpToOn_univ_iff.2 h).HasFDerivWithinAt hn (mem_univ _)
+#align has_ftaylor_series_up_to.has_fderiv_at HasFtaylorSeriesUpTo.hasFDerivAt
 
 theorem HasFtaylorSeriesUpTo.differentiable (h : HasFtaylorSeriesUpTo n f p) (hn : 1 ≀ n) :
-    Differentiable π•œ f := fun x => (h.HasFderivAt hn x).DifferentiableAt
+    Differentiable π•œ f := fun x => (h.HasFDerivAt hn x).DifferentiableAt
 #align has_ftaylor_series_up_to.differentiable HasFtaylorSeriesUpTo.differentiable
 
 /-- `p` is a Taylor series of `f` up to `n+1` if and only if `p.shift` is a Taylor series up to `n`
@@ -1376,12 +1376,12 @@ for `p 1`, which is a derivative of `f`. -/
 theorem hasFtaylorSeriesUpTo_succ_iff_right {n : β„•} :
     HasFtaylorSeriesUpTo (n + 1 : β„•) f p ↔
       (βˆ€ x, (p x 0).uncurry0 = f x) ∧
-        (βˆ€ x, HasFderivAt (fun y => p y 0) (p x 1).curryLeft x) ∧
+        (βˆ€ x, HasFDerivAt (fun y => p y 0) (p x 1).curryLeft x) ∧
           HasFtaylorSeriesUpTo n (fun x => continuousMultilinearCurryFin1 π•œ E F (p x 1)) fun x =>
             (p x).shift :=
   by
   simp only [hasFtaylorSeriesUpToOn_succ_iff_right, ← hasFtaylorSeriesUpToOn_univ_iff, mem_univ,
-    forall_true_left, hasFderivWithinAt_univ]
+    forall_true_left, hasFDerivWithinAt_univ]
 #align has_ftaylor_series_up_to_succ_iff_right hasFtaylorSeriesUpTo_succ_iff_right
 
 /-! ### Smooth functions at a point -/
@@ -1434,11 +1434,11 @@ theorem ContDiffAt.differentiableAt (h : ContDiffAt π•œ n f x) (hn : 1 ≀ n) :
 #align cont_diff_at.differentiable_at ContDiffAt.differentiableAt
 
 /-- A function is `C^(n + 1)` at a point iff locally, it has a derivative which is `C^n`. -/
-theorem contDiffAt_succ_iff_hasFderivAt {n : β„•} :
+theorem contDiffAt_succ_iff_hasFDerivAt {n : β„•} :
     ContDiffAt π•œ (n + 1 : β„•) f x ↔
-      βˆƒ f' : E β†’ E β†’L[π•œ] F, (βˆƒ u ∈ 𝓝 x, βˆ€ x ∈ u, HasFderivAt f (f' x) x) ∧ ContDiffAt π•œ n f' x :=
+      βˆƒ f' : E β†’ E β†’L[π•œ] F, (βˆƒ u ∈ 𝓝 x, βˆ€ x ∈ u, HasFDerivAt f (f' x) x) ∧ ContDiffAt π•œ n f' x :=
   by
-  rw [← contDiffWithinAt_univ, contDiffWithinAt_succ_iff_hasFderivWithinAt]
+  rw [← contDiffWithinAt_univ, contDiffWithinAt_succ_iff_hasFDerivWithinAt]
   simp only [nhdsWithin_univ, exists_prop, mem_univ, insert_eq_of_mem]
   constructor
   · rintro ⟨u, H, f', h_fderiv, h_cont_diff⟩
@@ -1446,13 +1446,13 @@ theorem contDiffAt_succ_iff_hasFderivAt {n : β„•} :
     refine' ⟨f', ⟨t, _⟩, h_cont_diff.cont_diff_at H⟩
     refine' ⟨mem_nhds_iff.mpr ⟨t, subset.rfl, ht, hxt⟩, _⟩
     intro y hyt
-    refine' (h_fderiv y (htu hyt)).HasFderivAt _
+    refine' (h_fderiv y (htu hyt)).HasFDerivAt _
     exact mem_nhds_iff.mpr ⟨t, htu, ht, hyt⟩
   · rintro ⟨f', ⟨u, H, h_fderiv⟩, h_cont_diff⟩
     refine' ⟨u, H, f', _, h_cont_diff.cont_diff_within_at⟩
     intro x hxu
-    exact (h_fderiv x hxu).HasFderivWithinAt
-#align cont_diff_at_succ_iff_has_fderiv_at contDiffAt_succ_iff_hasFderivAt
+    exact (h_fderiv x hxu).HasFDerivWithinAt
+#align cont_diff_at_succ_iff_has_fderiv_at contDiffAt_succ_iff_hasFDerivAt
 
 protected theorem ContDiffAt.eventually {n : β„•} (h : ContDiffAt π•œ n f x) :
     βˆ€αΆ  y in 𝓝 x, ContDiffAt π•œ n f y := by simpa [nhdsWithin_univ] using h.eventually
@@ -1529,9 +1529,9 @@ theorem contDiffAt_zero : ContDiffAt π•œ 0 f x ↔ βˆƒ u ∈ 𝓝 x, Continuous
 
 theorem contDiffAt_one_iff :
     ContDiffAt π•œ 1 f x ↔
-      βˆƒ f' : E β†’ E β†’L[π•œ] F, βˆƒ u ∈ 𝓝 x, ContinuousOn f' u ∧ βˆ€ x ∈ u, HasFderivAt f (f' x) x :=
+      βˆƒ f' : E β†’ E β†’L[π•œ] F, βˆƒ u ∈ 𝓝 x, ContinuousOn f' u ∧ βˆ€ x ∈ u, HasFDerivAt f (f' x) x :=
   by
-  simp_rw [show (1 : β„•βˆž) = (0 + 1 : β„•) from (zero_add 1).symm, contDiffAt_succ_iff_hasFderivAt,
+  simp_rw [show (1 : β„•βˆž) = (0 + 1 : β„•) from (zero_add 1).symm, contDiffAt_succ_iff_hasFDerivAt,
     show ((0 : β„•) : β„•βˆž) = 0 from rfl, contDiffAt_zero,
     exists_mem_and_iff antitone_bforall antitone_continuousOn, and_comm']
 #align cont_diff_at_one_iff contDiffAt_one_iff
@@ -1566,9 +1566,9 @@ theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀
 /-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
 theorem contDiff_succ_iff_has_fderiv {n : β„•} :
     ContDiff π•œ (n + 1 : β„•) f ↔
-      βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiff π•œ n f' ∧ βˆ€ x, HasFderivAt f (f' x) x :=
+      βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiff π•œ n f' ∧ βˆ€ x, HasFDerivAt f (f' x) x :=
   by
-  simp only [← contDiffOn_univ, ← hasFderivWithinAt_univ,
+  simp only [← contDiffOn_univ, ← hasFDerivWithinAt_univ,
     contDiffOn_succ_iff_has_fderiv_within uniqueDiffOn_univ, Set.mem_univ, forall_true_left]
 #align cont_diff_succ_iff_has_fderiv contDiff_succ_iff_has_fderiv
 
Diff
@@ -4,11 +4,14 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
+! leanprover-community/mathlib commit e3fb84046afd187b710170887195d50bada934ee
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Analysis.Calculus.Fderiv
+import Mathbin.Analysis.Calculus.Fderiv.Add
+import Mathbin.Analysis.Calculus.Fderiv.Mul
+import Mathbin.Analysis.Calculus.Fderiv.Equiv
+import Mathbin.Analysis.Calculus.Fderiv.RestrictScalars
 import Mathbin.Analysis.Calculus.FormalMultilinearSeries
 
 /-!
Diff
@@ -4,14 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit 2cf3ee29d9361ee308a14a46d820a49b8856d041
+! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Calculus.Fderiv
-import Mathbin.Analysis.NormedSpace.Multilinear
 import Mathbin.Analysis.Calculus.FormalMultilinearSeries
-import Mathbin.Data.Enat.Basic
 
 /-!
 # Higher differentiability
Diff
@@ -167,7 +167,7 @@ open Classical BigOperators NNReal Topology
 -- mathport name: «expr∞»
 local notation "∞" => (⊀ : β„•βˆž)
 
-attribute [local instance]
+attribute [local instance 1001]
   NormedAddCommGroup.toAddCommGroup NormedSpace.toModule' AddCommGroup.toAddCommMonoid
 
 open Set Fin Filter Function
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit a493616c740a3252e4cd0e4d0851984946b7b268
+! leanprover-community/mathlib commit 2cf3ee29d9361ee308a14a46d820a49b8856d041
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -263,6 +263,20 @@ theorem hasFtaylorSeriesUpToOn_top_iff :
       apply (H m).cont m le_rfl
 #align has_ftaylor_series_up_to_on_top_iff hasFtaylorSeriesUpToOn_top_iff
 
+/-- In the case that `n = ∞` we don't need the continuity assumption in
+`has_ftaylor_series_up_to_on`. -/
+theorem hasFtaylorSeriesUpToOn_top_iff' :
+    HasFtaylorSeriesUpToOn ∞ f p s ↔
+      (βˆ€ x ∈ s, (p x 0).uncurry0 = f x) ∧
+        βˆ€ m : β„•, βˆ€ x ∈ s, HasFderivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x :=
+  ⟨-- Everything except for the continuity is trivial:
+  fun h => ⟨h.1, fun m => h.2 m (WithTop.coe_lt_top m)⟩, fun h =>
+    ⟨h.1, fun m _ => h.2 m, fun m _ x hx =>
+      (-- The continuity follows from the existence of a derivative:
+            h.2
+          m x hx).ContinuousWithinAt⟩⟩
+#align has_ftaylor_series_up_to_on_top_iff' hasFtaylorSeriesUpToOn_top_iff'
+
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
 theorem HasFtaylorSeriesUpToOn.hasFderivWithinAt (h : HasFtaylorSeriesUpToOn n f p s) (hn : 1 ≀ n)
@@ -1327,6 +1341,22 @@ theorem hasFtaylorSeriesUpTo_zero_iff :
     hasFtaylorSeriesUpToOn_zero_iff]
 #align has_ftaylor_series_up_to_zero_iff hasFtaylorSeriesUpTo_zero_iff
 
+theorem hasFtaylorSeriesUpTo_top_iff :
+    HasFtaylorSeriesUpTo ∞ f p ↔ βˆ€ n : β„•, HasFtaylorSeriesUpTo n f p := by
+  simp only [← hasFtaylorSeriesUpToOn_univ_iff, hasFtaylorSeriesUpToOn_top_iff]
+#align has_ftaylor_series_up_to_top_iff hasFtaylorSeriesUpTo_top_iff
+
+/-- In the case that `n = ∞` we don't need the continuity assumption in
+`has_ftaylor_series_up_to`. -/
+theorem hasFtaylorSeriesUpTo_top_iff' :
+    HasFtaylorSeriesUpTo ∞ f p ↔
+      (βˆ€ x, (p x 0).uncurry0 = f x) ∧
+        βˆ€ (m : β„•) (x), HasFderivAt (fun y => p y m) (p x m.succ).curryLeft x :=
+  by
+  simp only [← hasFtaylorSeriesUpToOn_univ_iff, hasFtaylorSeriesUpToOn_top_iff', mem_univ,
+    forall_true_left, hasFderivWithinAt_univ]
+#align has_ftaylor_series_up_to_top_iff' hasFtaylorSeriesUpTo_top_iff'
+
 /-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
 series is a derivative of `f`. -/
 theorem HasFtaylorSeriesUpTo.hasFderivAt (h : HasFtaylorSeriesUpTo n f p) (hn : 1 ≀ n) (x : E) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit 0a0b3b4148b35efb8b8a38118517c5a1d30d0e69
+! leanprover-community/mathlib commit a493616c740a3252e4cd0e4d0851984946b7b268
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -1172,6 +1172,17 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
   rwa [fderivWithin_inter (IsOpen.mem_nhds o_open hy.2) (hs y hy.1)] at A
 #align cont_diff_on_succ_iff_fderiv_within contDiffOn_succ_iff_fderivWithin
 
+theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ s) :
+    ContDiffOn π•œ (n + 1 : β„•) f s ↔
+      βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiffOn π•œ n f' s ∧ βˆ€ x, x ∈ s β†’ HasFderivWithinAt f (f' x) s x :=
+  by
+  rw [contDiffOn_succ_iff_fderivWithin hs]
+  refine' ⟨fun h => ⟨fderivWithin π•œ f s, h.2, fun x hx => (h.1 x hx).HasFderivWithinAt⟩, fun h => _⟩
+  rcases h with ⟨f', h1, h2⟩
+  refine' ⟨fun x hx => (h2 x hx).DifferentiableWithinAt, fun x hx => _⟩
+  exact (h1 x hx).congr' (fun y hy => (h2 y hy).fderivWithin (hs y hy)) hx
+#align cont_diff_on_succ_iff_has_fderiv_within contDiffOn_succ_iff_has_fderiv_within
+
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:73:14: unsupported tactic `congrm #[[expr «expr ∧ »(_, _)]] -/
 /-- A function is `C^(n + 1)` on an open domain if and only if it is
 differentiable there, and its derivative (expressed with `fderiv`) is `C^n`. -/
@@ -1521,6 +1532,15 @@ theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀
   exact contDiffOn_iff_forall_nat_le
 #align cont_diff_iff_forall_nat_le contDiff_iff_forall_nat_le
 
+/-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
+theorem contDiff_succ_iff_has_fderiv {n : β„•} :
+    ContDiff π•œ (n + 1 : β„•) f ↔
+      βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiff π•œ n f' ∧ βˆ€ x, HasFderivAt f (f' x) x :=
+  by
+  simp only [← contDiffOn_univ, ← hasFderivWithinAt_univ,
+    contDiffOn_succ_iff_has_fderiv_within uniqueDiffOn_univ, Set.mem_univ, forall_true_left]
+#align cont_diff_succ_iff_has_fderiv contDiff_succ_iff_has_fderiv
+
 /-! ### Iterated derivative -/
 
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit 284fdd2962e67d2932fa3a79ce19fcf92d38e228
+! leanprover-community/mathlib commit 0a0b3b4148b35efb8b8a38118517c5a1d30d0e69
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -669,6 +669,15 @@ def ContDiffOn (n : β„•βˆž) (f : E β†’ F) (s : Set E) : Prop :=
 
 variable {π•œ}
 
+theorem HasFtaylorSeriesUpToOn.contDiffOn {f' : E β†’ FormalMultilinearSeries π•œ E F}
+    (hf : HasFtaylorSeriesUpToOn n f f' s) : ContDiffOn π•œ n f s :=
+  by
+  intro x hx m hm
+  use s
+  simp only [Set.insert_eq_of_mem hx, self_mem_nhdsWithin, true_and_iff]
+  exact ⟨f', hf.of_le hm⟩
+#align has_ftaylor_series_up_to_on.cont_diff_on HasFtaylorSeriesUpToOn.contDiffOn
+
 theorem ContDiffOn.contDiffWithinAt (h : ContDiffOn π•œ n f s) (hx : x ∈ s) :
     ContDiffWithinAt π•œ n f s x :=
   h x hx
@@ -1422,6 +1431,12 @@ def ContDiff (n : β„•βˆž) (f : E β†’ F) : Prop :=
 
 variable {π•œ}
 
+/-- If `f` has a Taylor series up to `n`, then it is `C^n`. -/
+theorem HasFtaylorSeriesUpTo.contDiff {f' : E β†’ FormalMultilinearSeries π•œ E F}
+    (hf : HasFtaylorSeriesUpTo n f f') : ContDiff π•œ n f :=
+  ⟨f', hf⟩
+#align has_ftaylor_series_up_to.cont_diff HasFtaylorSeriesUpTo.contDiff
+
 theorem contDiffOn_univ : ContDiffOn π•œ n f univ ↔ ContDiff π•œ n f :=
   by
   constructor
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 
 ! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit dd6388c44e6f6b4547070b887c5905d5cfe6c9f8
+! leanprover-community/mathlib commit 284fdd2962e67d2932fa3a79ce19fcf92d38e228
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -613,6 +613,7 @@ theorem contDiffWithinAt_succ_iff_hasFderivWithinAt {n : β„•} :
             ((p' y 0) 0) z
         unfold_coes
         congr
+        decide
       Β· convert(Hp'.mono (inter_subset_left v u)).congr fun x hx => Hp'.zero_eq x hx.1
         Β· ext (x y)
           change p' x 0 (init (@snoc 0 (fun i : Fin 1 => E) 0 y)) y = p' x 0 0 y

Changes in mathlib4

mathlib3
mathlib4
chore: remove some unnecessary 'open BigOperators' (#11880)

Could we have an open linter, that checked for unused opened namespaces?

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

Diff
@@ -157,7 +157,7 @@ derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor ser
 noncomputable section
 
 open scoped Classical
-open BigOperators NNReal Topology Filter
+open NNReal Topology Filter
 
 local notation "∞" => (⊀ : β„•βˆž)
 
feat: when a function has a Taylor series, then its iterated derivative is given by the Taylor series (#11772)

We already have the localized version to a set, but not the global version.

Also rename the localized version to a better name.

Diff
@@ -995,7 +995,7 @@ theorem contDiffWithinAt_zero (hx : x ∈ s) :
 
 /-- On a set with unique differentiability, any choice of iterated differential has to coincide
 with the one we have chosen in `iteratedFDerivWithin π•œ m f s`. -/
-theorem HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
+theorem HasFTaylorSeriesUpToOn.eq_iteratedFDerivWithin_of_uniqueDiffOn
     (h : HasFTaylorSeriesUpToOn n f p s) {m : β„•} (hmn : (m : β„•βˆž) ≀ n) (hs : UniqueDiffOn π•œ s)
     (hx : x ∈ s) : p x m = iteratedFDerivWithin π•œ m f s x := by
   induction' m with m IH generalizing x
@@ -1008,7 +1008,10 @@ theorem HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
         (IH (le_of_lt A) hx).symm
     rw [iteratedFDerivWithin_succ_eq_comp_left, Function.comp_apply, this.fderivWithin (hs x hx)]
     exact (ContinuousMultilinearMap.uncurry_curryLeft _).symm
-#align has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn
+#align has_ftaylor_series_up_to_on.eq_ftaylor_series_of_unique_diff_on HasFTaylorSeriesUpToOn.eq_iteratedFDerivWithin_of_uniqueDiffOn
+
+@[deprecated] alias HasFTaylorSeriesUpToOn.eq_ftaylor_series_of_uniqueDiffOn :=
+  HasFTaylorSeriesUpToOn.eq_iteratedFDerivWithin_of_uniqueDiffOn -- 2024-03-28
 
 /-- When a function is `C^n` in a set `s` of unique differentiability, it admits
 `ftaylorSeriesWithin π•œ f s` as a Taylor series up to order `n` in `s`. -/
@@ -1604,6 +1607,13 @@ theorem iteratedFDerivWithin_univ {n : β„•} :
     rw [iteratedFDeriv_succ_apply_left, iteratedFDerivWithin_succ_apply_left, IH, fderivWithin_univ]
 #align iterated_fderiv_within_univ iteratedFDerivWithin_univ
 
+theorem HasFTaylorSeriesUpTo.eq_iteratedFDeriv
+    (h : HasFTaylorSeriesUpTo n f p) {m : β„•} (hmn : (m : β„•βˆž) ≀ n) (x : E) :
+    p x m = iteratedFDeriv π•œ m f x := by
+  rw [← iteratedFDerivWithin_univ]
+  rw [← hasFTaylorSeriesUpToOn_univ_iff] at h
+  exact h.eq_iteratedFDerivWithin_of_uniqueDiffOn hmn uniqueDiffOn_univ (mem_univ _)
+
 /-- In an open set, the iterated derivative within this set coincides with the global iterated
 derivative. -/
 theorem iteratedFDerivWithin_of_isOpen (n : β„•) (hs : IsOpen s) :
chore: classify new lemma porting notes (#11217)

Classifies by adding issue number #10756 to porting notes claiming anything semantically equivalent to:

  • "new lemma"
  • "added lemma"
Diff
@@ -1351,7 +1351,7 @@ theorem ContDiffWithinAt.contDiffAt (h : ContDiffWithinAt π•œ n f s x) (hx : s
     ContDiffAt π•œ n f x := by rwa [ContDiffAt, ← contDiffWithinAt_inter hx, univ_inter]
 #align cont_diff_within_at.cont_diff_at ContDiffWithinAt.contDiffAt
 
--- Porting note: new lemma
+-- Porting note (#10756): new lemma
 theorem ContDiffOn.contDiffAt (h : ContDiffOn π•œ n f s) (hx : s ∈ 𝓝 x) :
     ContDiffAt π•œ n f x :=
   (h _ (mem_of_mem_nhds hx)).contDiffAt hx
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -156,7 +156,8 @@ derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor ser
 
 noncomputable section
 
-open Classical BigOperators NNReal Topology Filter
+open scoped Classical
+open BigOperators NNReal Topology Filter
 
 local notation "∞" => (⊀ : β„•βˆž)
 
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -1350,7 +1350,7 @@ theorem ContDiffWithinAt.contDiffAt (h : ContDiffWithinAt π•œ n f s x) (hx : s
     ContDiffAt π•œ n f x := by rwa [ContDiffAt, ← contDiffWithinAt_inter hx, univ_inter]
 #align cont_diff_within_at.cont_diff_at ContDiffWithinAt.contDiffAt
 
--- porting note: new lemma
+-- Porting note: new lemma
 theorem ContDiffOn.contDiffAt (h : ContDiffOn π•œ n f s) (hx : s ∈ 𝓝 x) :
     ContDiffAt π•œ n f x :=
   (h _ (mem_of_mem_nhds hx)).contDiffAt hx
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -612,12 +612,12 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt' {n : β„•} :
       fun y hy => _, _⟩
     Β· refine' ((huf' y <| hwu hy).mono hwu).mono_of_mem _
       refine' mem_of_superset _ (inter_subset_inter_left _ (subset_insert _ _))
-      refine' inter_mem_nhdsWithin _ (hw.mem_nhds hy.2)
+      exact inter_mem_nhdsWithin _ (hw.mem_nhds hy.2)
     Β· exact hf'.mono_of_mem (nhdsWithin_mono _ (subset_insert _ _) hu)
   Β· rw [← contDiffWithinAt_insert, contDiffWithinAt_succ_iff_hasFDerivWithinAt,
       insert_eq_of_mem (mem_insert _ _)]
     rintro ⟨u, hu, hus, f', huf', hf'⟩
-    refine' ⟨u, hu, f', fun y hy => (huf' y hy).insert'.mono hus, hf'.insert.mono hus⟩
+    exact ⟨u, hu, f', fun y hy => (huf' y hy).insert'.mono hus, hf'.insert.mono hus⟩
 #align cont_diff_within_at_succ_iff_has_fderiv_within_at' contDiffWithinAt_succ_iff_hasFDerivWithinAt'
 
 /-! ### Smooth functions within a set -/
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -269,8 +269,7 @@ theorem HasFTaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFTaylorSeriesUpToOn n f
   have A : βˆ€ y ∈ s, f y = (continuousMultilinearCurryFin0 π•œ E F) (p y 0) := fun y hy ↦
     (h.zero_eq y hy).symm
   suffices H : HasFDerivWithinAt (continuousMultilinearCurryFin0 π•œ E F ∘ (p Β· 0))
-    (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x
-  Β· exact H.congr A (A x hx)
+    (continuousMultilinearCurryFin1 π•œ E F (p x 1)) s x from H.congr A (A x hx)
   rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
   have : ((0 : β„•) : β„•βˆž) < n := zero_lt_one.trans_le hn
   convert h.fderivWithin _ this x hx
@@ -343,8 +342,8 @@ theorem HasFTaylorSeriesUpToOn.shift_of_succ
   Β· intro x _
     rfl
   Β· intro m (hm : (m : β„•βˆž) < n) x (hx : x ∈ s)
-    have A : (m.succ : β„•βˆž) < n.succ
-    · rw [Nat.cast_lt] at hm ⊒
+    have A : (m.succ : β„•βˆž) < n.succ := by
+      rw [Nat.cast_lt] at hm ⊒
       exact Nat.succ_lt_succ hm
     change HasFDerivWithinAt ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm ∘ (p Β· m.succ))
       (p x m.succ.succ).curryRight.curryLeft s x
@@ -354,8 +353,8 @@ theorem HasFTaylorSeriesUpToOn.shift_of_succ
     change p x (m + 2) (snoc (cons y (init v)) (v (last _))) = p x (m + 2) (cons y v)
     rw [← cons_snoc_eq_snoc_cons, snoc_init_self]
   Β· intro m (hm : (m : β„•βˆž) ≀ n)
-    suffices A : ContinuousOn (p Β· (m + 1)) s
-    Β· exact ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm).continuous.comp_continuousOn A
+    suffices A : ContinuousOn (p Β· (m + 1)) s from
+      ((continuousMultilinearCurryRightEquiv' π•œ m E F).symm).continuous.comp_continuousOn A
     refine H.cont _ ?_
     rw [Nat.cast_le] at hm ⊒
     exact Nat.succ_le_succ hm
feat(Analysis.Calculus.FDeriv.Analytic + Analysis.Complex.TaylorSeries): Taylor series of holomorphic functions (#10087)

See here on Zulip.

This adds some general lemmas due to Junyan Xu, culminating in

theorem HasFPowerSeriesOnBall.hasSum_iteratedFDeriv {π•œ : Type*} [NontriviallyNormedField π•œ] {E : Type*}
    [ NormedAddCommGroup E] [NormedSpace π•œ E] {F : Type*} [NormedAddCommGroup F]
    [NormedSpace π•œ F] {p : FormalMultilinearSeries π•œ E F} {f : E β†’ F} {x : E} {r : ℝβ‰₯0∞}
    (h : HasFPowerSeriesOnBall f p x r) [CompleteSpace F] [CharZero π•œ] {y : E} (hy : y ∈ EMetric.ball 0 r) :+1:
    HasSum (fun n ↦ (n ! : π•œ)⁻¹‒ (iteratedFDeriv π•œ n f x) fun x ↦ y) (f (x + y))

and uses this to show that the Taylor series of a function that is complex differentiable on an open ball in β„‚ converges there to the function; similarly for functions that are holomorphic on all of β„‚:

lemma Complex.hasSum_taylorSeries_on_ball {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E]
    [CompleteSpace E] ⦃f : β„‚ β†’ E⦄ ⦃c : ℂ⦄ ⦃r : NNReal⦄ (hf : DifferentiableOn β„‚ f (Metric.ball c ↑r)) ⦃z : ℂ⦄
    (hz : z ∈ Metric.ball c ↑r) :
    HasSum (fun n ↦ (n ! : β„‚)⁻¹ β€’ (z - c) ^ n β€’ iteratedDeriv n f c) (f z)

lemma Complex.taylorSeries_eq_on_ball {E : Type*} [NormedAddCommGroup E] [NormedSpace β„‚ E]
    [CompleteSpace E] ⦃f : β„‚ β†’ E⦄ ⦃c : ℂ⦄ ⦃r : NNReal⦄ (hf : DifferentiableOn β„‚ f (Metric.ball c ↑r)) ⦃z : ℂ⦄
    (hz : z ∈ Metric.ball c ↑r) : 
    βˆ‘' (n : β„•), (n ! : β„‚)⁻¹ β€’ (z - c) ^ n β€’ iteratedDeriv n f c = f z

lemma Complex.taylorSeries_eq_on_ball' ⦃c : ℂ⦄ ⦃r : NNReal⦄ ⦃z : ℂ⦄ (hz : z ∈ Metric.ball c ↑r) {f : β„‚ β†’ β„‚}
    (hf : DifferentiableOn β„‚ f (Metric.ball c ↑r)) : 
    βˆ‘' (n : β„•), (n ! : β„‚)⁻¹ * iteratedDeriv n f c * (z - c) ^ n = f z

and similar lemmas for EMetric.balls and entire functions.

Diff
@@ -1520,7 +1520,7 @@ noncomputable def iteratedFDeriv (n : β„•) (f : E β†’ F) : E β†’ E[Γ—n]β†’L[π•œ
     ContinuousLinearMap.uncurryLeft (fderiv π•œ rec x)
 #align iterated_fderiv iteratedFDeriv
 
-/-- Formal Taylor series associated to a function within a set. -/
+/-- Formal Taylor series associated to a function. -/
 def ftaylorSeries (f : E β†’ F) (x : E) : FormalMultilinearSeries π•œ E F := fun n =>
   iteratedFDeriv π•œ n f x
 #align ftaylor_series ftaylorSeries
chore(*): rename FunLike to DFunLike (#9785)

This prepares for the introduction of a non-dependent synonym of FunLike, which helps a lot with keeping #8386 readable.

This is entirely search-and-replace in 680197f combined with manual fixes in 4145626, e900597 and b8428f8. The commands that generated this change:

sed -i 's/\bFunLike\b/DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoFunLike\b/toDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/import Mathlib.Data.DFunLike/import Mathlib.Data.FunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bHom_FunLike\b/Hom_DFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean     
sed -i 's/\binstFunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\bfunLike\b/instDFunLike/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean
sed -i 's/\btoo many metavariables to apply `fun_like.has_coe_to_fun`/too many metavariables to apply `DFunLike.hasCoeToFun`/g' {Archive,Counterexamples,Mathlib,test}/**/*.lean

Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>

Diff
@@ -891,7 +891,7 @@ theorem iteratedFDerivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fi
 theorem Filter.EventuallyEq.iteratedFDerivWithin' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
     iteratedFDerivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f t := by
   induction' n with n ihn
-  Β· exact h.mono fun y hy => FunLike.ext _ _ fun _ => hy
+  Β· exact h.mono fun y hy => DFunLike.ext _ _ fun _ => hy
   Β· have : fderivWithin π•œ _ t =αΆ [𝓝[s] x] fderivWithin π•œ _ t := ihn.fderivWithin' ht
     apply this.mono
     intro y hy
chore(*): fix more names (#9593)

Grep for ^[^#].*deriv_within and fix all occurrences.

Diff
@@ -892,7 +892,7 @@ theorem Filter.EventuallyEq.iteratedFDerivWithin' (h : f₁ =αΆ [𝓝[s] x] f) (
     iteratedFDerivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f t := by
   induction' n with n ihn
   Β· exact h.mono fun y hy => FunLike.ext _ _ fun _ => hy
-  Β· have : fderivWithin π•œ _ t =αΆ [𝓝[s] x] fderivWithin π•œ _ t := ihn.fderiv_within' ht
+  Β· have : fderivWithin π•œ _ t =αΆ [𝓝[s] x] fderivWithin π•œ _ t := ihn.fderivWithin' ht
     apply this.mono
     intro y hy
     simp only [iteratedFDerivWithin_succ_eq_comp_left, hy, (· ∘ ·)]
chore(ContDiffAt): fix several names (#9584)

Rename

  • Filter.EventuallyEq.iterated_fderiv_within' β†’ Filter.EventuallyEq.iteratedFDerivWithin'
  • contDiffOn_succ_iff_has_fderiv_within β†’ contDiffOn_succ_iff_hasFDerivWithin
  • contDiff_succ_iff_has_fderiv β†’ contDiff_succ_iff_hasFDerivAt
Diff
@@ -888,7 +888,7 @@ theorem iteratedFDerivWithin_one_apply (h : UniqueDiffWithinAt π•œ s x) (m : Fi
   rfl
 #align iterated_fderiv_within_one_apply iteratedFDerivWithin_one_apply
 
-theorem Filter.EventuallyEq.iterated_fderiv_within' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
+theorem Filter.EventuallyEq.iteratedFDerivWithin' (h : f₁ =αΆ [𝓝[s] x] f) (ht : t βŠ† s) (n : β„•) :
     iteratedFDerivWithin π•œ n f₁ t =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f t := by
   induction' n with n ihn
   Β· exact h.mono fun y hy => FunLike.ext _ _ fun _ => hy
@@ -896,11 +896,11 @@ theorem Filter.EventuallyEq.iterated_fderiv_within' (h : f₁ =αΆ [𝓝[s] x] f)
     apply this.mono
     intro y hy
     simp only [iteratedFDerivWithin_succ_eq_comp_left, hy, (· ∘ ·)]
-#align filter.eventually_eq.iterated_fderiv_within' Filter.EventuallyEq.iterated_fderiv_within'
+#align filter.eventually_eq.iterated_fderiv_within' Filter.EventuallyEq.iteratedFDerivWithin'
 
 protected theorem Filter.EventuallyEq.iteratedFDerivWithin (h : f₁ =αΆ [𝓝[s] x] f) (n : β„•) :
     iteratedFDerivWithin π•œ n f₁ s =αΆ [𝓝[s] x] iteratedFDerivWithin π•œ n f s :=
-  h.iterated_fderiv_within' Subset.rfl n
+  h.iteratedFDerivWithin' Subset.rfl n
 #align filter.eventually_eq.iterated_fderiv_within Filter.EventuallyEq.iteratedFDerivWithin
 
 /-- If two functions coincide in a neighborhood of `x` within a set `s` and at `x`, then their
@@ -908,7 +908,7 @@ iterated differentials within this set at `x` coincide. -/
 theorem Filter.EventuallyEq.iteratedFDerivWithin_eq (h : f₁ =αΆ [𝓝[s] x] f) (hx : f₁ x = f x)
     (n : β„•) : iteratedFDerivWithin π•œ n f₁ s x = iteratedFDerivWithin π•œ n f s x :=
   have : f₁ =αΆ [𝓝[insert x s] x] f := by simpa [EventuallyEq, hx]
-  (this.iterated_fderiv_within' (subset_insert _ _) n).self_of_nhdsWithin (mem_insert _ _)
+  (this.iteratedFDerivWithin' (subset_insert _ _) n).self_of_nhdsWithin (mem_insert _ _)
 #align filter.eventually_eq.iterated_fderiv_within_eq Filter.EventuallyEq.iteratedFDerivWithin_eq
 
 /-- If two functions coincide on a set `s`, then their iterated differentials within this set
@@ -1147,7 +1147,7 @@ theorem contDiffOn_succ_iff_fderivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
   rwa [fderivWithin_inter (o_open.mem_nhds hy.2)] at A
 #align cont_diff_on_succ_iff_fderiv_within contDiffOn_succ_iff_fderivWithin
 
-theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ s) :
+theorem contDiffOn_succ_iff_hasFDerivWithin {n : β„•} (hs : UniqueDiffOn π•œ s) :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
       βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiffOn π•œ n f' s ∧ βˆ€ x, x ∈ s β†’ HasFDerivWithinAt f (f' x) s x := by
   rw [contDiffOn_succ_iff_fderivWithin hs]
@@ -1155,7 +1155,7 @@ theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ
   rcases h with ⟨f', h1, h2⟩
   refine' ⟨fun x hx => (h2 x hx).differentiableWithinAt, fun x hx => _⟩
   exact (h1 x hx).congr' (fun y hy => (h2 y hy).fderivWithin (hs y hy)) hx
-#align cont_diff_on_succ_iff_has_fderiv_within contDiffOn_succ_iff_has_fderiv_within
+#align cont_diff_on_succ_iff_has_fderiv_within contDiffOn_succ_iff_hasFDerivWithin
 
 /-- A function is `C^(n + 1)` on an open domain if and only if it is
 differentiable there, and its derivative (expressed with `fderiv`) is `C^n`. -/
@@ -1502,12 +1502,12 @@ theorem contDiff_iff_forall_nat_le : ContDiff π•œ n f ↔ βˆ€ m : β„•, ↑m ≀
 #align cont_diff_iff_forall_nat_le contDiff_iff_forall_nat_le
 
 /-- A function is `C^(n+1)` iff it has a `C^n` derivative. -/
-theorem contDiff_succ_iff_has_fderiv {n : β„•} :
+theorem contDiff_succ_iff_hasFDerivAt {n : β„•} :
     ContDiff π•œ (n + 1 : β„•) f ↔
       βˆƒ f' : E β†’ E β†’L[π•œ] F, ContDiff π•œ n f' ∧ βˆ€ x, HasFDerivAt f (f' x) x := by
   simp only [← contDiffOn_univ, ← hasFDerivWithinAt_univ,
-    contDiffOn_succ_iff_has_fderiv_within uniqueDiffOn_univ, Set.mem_univ, forall_true_left]
-#align cont_diff_succ_iff_has_fderiv contDiff_succ_iff_has_fderiv
+    contDiffOn_succ_iff_hasFDerivWithin uniqueDiffOn_univ, Set.mem_univ, forall_true_left]
+#align cont_diff_succ_iff_has_fderiv contDiff_succ_iff_hasFDerivAt
 
 /-! ### Iterated derivative -/
 
doc(FormalMultilinearSeries): clarify relationship between shift, sum, derivative and Taylor series (#9373)

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -180,7 +180,10 @@ variable {π•œ : Type u} [NontriviallyNormedField π•œ] {E : Type uE} [NormedAdd
 
 /-- `HasFTaylorSeriesUpToOn n f p s` registers the fact that `p 0 = f` and `p (m+1)` is a
 derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a predicate analogous to
-`HasFDerivWithinAt` but for higher order derivatives. -/
+`HasFDerivWithinAt` but for higher order derivatives.
+
+Notice that `p` does not sum up to `f` on the diagonal (`FormalMultilinearSeries.sum`), even if
+`f` is analytic and `n = ∞`: an additional `1/m!` factor on the `m`th term is necessary for that. -/
 structure HasFTaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F)
   (s : Set E) : Prop where
   zero_eq : βˆ€ x ∈ s, (p x 0).uncurry0 = f x
@@ -1218,7 +1221,10 @@ theorem ContDiffOn.continuousOn_fderiv_of_isOpen (h : ContDiffOn π•œ n f s) (hs
 
 /-- `HasFTaylorSeriesUpTo n f p` registers the fact that `p 0 = f` and `p (m+1)` is a
 derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a predicate analogous to
-`HasFDerivAt` but for higher order derivatives. -/
+`HasFDerivAt` but for higher order derivatives.
+
+Notice that `p` does not sum up to `f` on the diagonal (`FormalMultilinearSeries.sum`), even if
+`f` is analytic and `n = ∞`: an addition `1/m!` factor on the `m`th term is necessary for that. -/
 structure HasFTaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F) :
   Prop where
   zero_eq : βˆ€ x, (p x 0).uncurry0 = f x
chore(*): use βˆƒ x ∈ s, _ instead of βˆƒ (x) (_ : x ∈ s), _ (#9215)

Follow-up #9184

Diff
@@ -1222,8 +1222,8 @@ derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a pred
 structure HasFTaylorSeriesUpTo (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F) :
   Prop where
   zero_eq : βˆ€ x, (p x 0).uncurry0 = f x
-  fderiv : βˆ€ (m : β„•) (_ : (m : β„•βˆž) < n), βˆ€ x, HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x
-  cont : βˆ€ (m : β„•) (_ : (m : β„•βˆž) ≀ n), Continuous fun x => p x m
+  fderiv : βˆ€ m : β„•, (m : β„•βˆž) < n β†’ βˆ€ x, HasFDerivAt (fun y => p y m) (p x m.succ).curryLeft x
+  cont : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ Continuous fun x => p x m
 #align has_ftaylor_series_up_to HasFTaylorSeriesUpTo
 
 theorem HasFTaylorSeriesUpTo.zero_eq' (h : HasFTaylorSeriesUpTo n f p) (x : E) :
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
@@ -1156,12 +1156,12 @@ theorem contDiffOn_succ_iff_has_fderiv_within {n : β„•} (hs : UniqueDiffOn π•œ
 
 /-- A function is `C^(n + 1)` on an open domain if and only if it is
 differentiable there, and its derivative (expressed with `fderiv`) is `C^n`. -/
-theorem contDiffOn_succ_iff_fderiv_of_open {n : β„•} (hs : IsOpen s) :
+theorem contDiffOn_succ_iff_fderiv_of_isOpen {n : β„•} (hs : IsOpen s) :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
       DifferentiableOn π•œ f s ∧ ContDiffOn π•œ n (fun y => fderiv π•œ f y) s := by
   rw [contDiffOn_succ_iff_fderivWithin hs.uniqueDiffOn]
   exact Iff.rfl.and (contDiffOn_congr fun x hx ↦ fderivWithin_of_isOpen hs hx)
-#align cont_diff_on_succ_iff_fderiv_of_open contDiffOn_succ_iff_fderiv_of_open
+#align cont_diff_on_succ_iff_fderiv_of_open contDiffOn_succ_iff_fderiv_of_isOpen
 
 /-- A function is `C^∞` on a domain with unique derivatives if and only if it is differentiable
 there, and its derivative (expressed with `fderivWithin`) is `C^∞`. -/
@@ -1182,11 +1182,11 @@ theorem contDiffOn_top_iff_fderivWithin (hs : UniqueDiffOn π•œ s) :
 
 /-- A function is `C^∞` on an open domain if and only if it is differentiable there, and its
 derivative (expressed with `fderiv`) is `C^∞`. -/
-theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
+theorem contDiffOn_top_iff_fderiv_of_isOpen (hs : IsOpen s) :
     ContDiffOn π•œ ∞ f s ↔ DifferentiableOn π•œ f s ∧ ContDiffOn π•œ ∞ (fun y => fderiv π•œ f y) s := by
   rw [contDiffOn_top_iff_fderivWithin hs.uniqueDiffOn]
   exact Iff.rfl.and <| contDiffOn_congr fun x hx ↦ fderivWithin_of_isOpen hs hx
-#align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_open
+#align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_isOpen
 
 protected theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
     (hmn : m + 1 ≀ n) : ContDiffOn π•œ m (fun y => fderivWithin π•œ f s y) s := by
@@ -1199,20 +1199,20 @@ protected theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : Uni
     exact ((contDiffOn_succ_iff_fderivWithin hs).1 (hf.of_le hmn)).2
 #align cont_diff_on.fderiv_within ContDiffOn.fderivWithin
 
-theorem ContDiffOn.fderiv_of_open (hf : ContDiffOn π•œ n f s) (hs : IsOpen s) (hmn : m + 1 ≀ n) :
+theorem ContDiffOn.fderiv_of_isOpen (hf : ContDiffOn π•œ n f s) (hs : IsOpen s) (hmn : m + 1 ≀ n) :
     ContDiffOn π•œ m (fun y => fderiv π•œ f y) s :=
   (hf.fderivWithin hs.uniqueDiffOn hmn).congr fun _ hx => (fderivWithin_of_isOpen hs hx).symm
-#align cont_diff_on.fderiv_of_open ContDiffOn.fderiv_of_open
+#align cont_diff_on.fderiv_of_open ContDiffOn.fderiv_of_isOpen
 
 theorem ContDiffOn.continuousOn_fderivWithin (h : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
     (hn : 1 ≀ n) : ContinuousOn (fun x => fderivWithin π•œ f s x) s :=
   ((contDiffOn_succ_iff_fderivWithin hs).1 (h.of_le hn)).2.continuousOn
 #align cont_diff_on.continuous_on_fderiv_within ContDiffOn.continuousOn_fderivWithin
 
-theorem ContDiffOn.continuousOn_fderiv_of_open (h : ContDiffOn π•œ n f s) (hs : IsOpen s)
+theorem ContDiffOn.continuousOn_fderiv_of_isOpen (h : ContDiffOn π•œ n f s) (hs : IsOpen s)
     (hn : 1 ≀ n) : ContinuousOn (fun x => fderiv π•œ f x) s :=
-  ((contDiffOn_succ_iff_fderiv_of_open hs).1 (h.of_le hn)).2.continuousOn
-#align cont_diff_on.continuous_on_fderiv_of_open ContDiffOn.continuousOn_fderiv_of_open
+  ((contDiffOn_succ_iff_fderiv_of_isOpen hs).1 (h.of_le hn)).2.continuousOn
+#align cont_diff_on.continuous_on_fderiv_of_open ContDiffOn.continuousOn_fderiv_of_isOpen
 
 /-! ### Functions with a Taylor series on the whole space -/
 
feat(Calculus/ContDiff): add ContDiffAt.contDiffOn (#8600)
Diff
@@ -1369,6 +1369,10 @@ theorem ContDiffAt.differentiableAt (h : ContDiffAt π•œ n f x) (hn : 1 ≀ n) :
   simpa [hn, differentiableWithinAt_univ] using h.differentiableWithinAt
 #align cont_diff_at.differentiable_at ContDiffAt.differentiableAt
 
+nonrec lemma ContDiffAt.contDiffOn {m : β„•} (h : ContDiffAt π•œ n f x) (hm : m ≀ n) :
+    βˆƒ u ∈ 𝓝 x, ContDiffOn π•œ m f u := by
+  simpa [nhdsWithin_univ] using h.contDiffOn hm
+
 /-- A function is `C^(n + 1)` at a point iff locally, it has a derivative which is `C^n`. -/
 theorem contDiffAt_succ_iff_hasFDerivAt {n : β„•} :
     ContDiffAt π•œ (n + 1 : β„•) f x ↔
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

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

Diff
@@ -226,7 +226,7 @@ theorem hasFTaylorSeriesUpToOn_zero_iff :
     HasFTaylorSeriesUpToOn 0 f p s ↔ ContinuousOn f s ∧ βˆ€ x ∈ s, (p x 0).uncurry0 = f x := by
   refine ⟨fun H => ⟨H.continuousOn, H.zero_eq⟩, fun H =>
       ⟨H.2, fun m hm => False.elim (not_le.2 hm bot_le), fun m hm ↦ ?_⟩⟩
-  obtain rfl : m = 0 := by exact_mod_cast hm.antisymm (zero_le _)
+  obtain rfl : m = 0 := mod_cast hm.antisymm (zero_le _)
   have : EqOn (p Β· 0) ((continuousMultilinearCurryFin0 π•œ E F).symm ∘ f) s := fun x hx ↦
     (continuousMultilinearCurryFin0 π•œ E F).eq_symm_apply.2 (H.2 x hx)
   rw [continuousOn_congr this, LinearIsometryEquiv.comp_continuousOn_iff]
chore: cleanup imports of Analysis.Calculus.ContDiff (#8354)

Not moving anything around this time, just postponing imports.

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

Diff
@@ -3,8 +3,6 @@ Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
 -/
-import Mathlib.Analysis.Calculus.FDeriv.Add
-import Mathlib.Analysis.Calculus.FDeriv.Mul
 import Mathlib.Analysis.Calculus.FDeriv.Equiv
 import Mathlib.Analysis.Calculus.FormalMultilinearSeries
 
fix: attribute [simp] ... in -> attribute [local simp] ... in (#7678)

Mathlib.Logic.Unique contains the line attribute [simp] eq_iff_true_of_subsingleton in ...:

https://github.com/leanprover-community/mathlib4/blob/96a11c7aac574c00370c2b3dab483cb676405c5d/Mathlib/Logic/Unique.lean#L255-L256

Despite what the in part may imply, this adds the lemma to the simp set "globally", including for downstream files; it is likely that attribute [local simp] eq_iff_true_of_subsingleton in ... was meant instead (or maybe scoped simp, but I think "scoped" refers to the current namespace). Indeed, the relevant lemma is not marked with @[simp] for possible slowness: https://github.com/leanprover/std4/blob/846e9e1d6bb534774d1acd2dc430e70987da3c18/Std/Logic.lean#L749. Adding it to the simp set causes the example at https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Regression.20in.20simp to slow down.

This PR changes this and fixes the relevant downstream simps. There was also one ocurrence of attribute [simp] FullSubcategory.comp_def FullSubcategory.id_def in in Mathlib.CategoryTheory.Monoidal.Subcategory but that was much easier to fix.

https://github.com/leanprover-community/mathlib4/blob/bc49eb9ba756a233370b4b68bcdedd60402f71ed/Mathlib/CategoryTheory/Monoidal/Subcategory.lean#L118-L119

Diff
@@ -587,7 +587,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
         change ((p' y 0) (init (@cons 0 (fun _ => E) z 0))) (@cons 0 (fun _ => E) z 0 (last 0)) =
           ((p' y 0) 0) z
         congr
-        norm_num
+        norm_num [eq_iff_true_of_subsingleton]
       Β· convert (Hp'.mono (inter_subset_left v u)).congr fun x hx => Hp'.zero_eq x hx.1 using 1
         Β· ext x y
           change p' x 0 (init (@snoc 0 (fun _ : Fin 1 => E) 0 y)) y = p' x 0 0 y
chore: move Analysis/ContDiff to Analysis/ContDiff/Basic to make room for splitting (#8337)

No changes to content, or splitting, just a rename so there is room for more files.

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

Diff
@@ -6,7 +6,6 @@ Authors: SΓ©bastien GouΓ«zel
 import Mathlib.Analysis.Calculus.FDeriv.Add
 import Mathlib.Analysis.Calculus.FDeriv.Mul
 import Mathlib.Analysis.Calculus.FDeriv.Equiv
-import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
 import Mathlib.Analysis.Calculus.FormalMultilinearSeries
 
 #align_import analysis.calculus.cont_diff_def from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14"
feat: lemmas analogous to fderiv_within_of_isOpen (#8057)
  • from the project towards Sard's theorem

Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>

Diff
@@ -1163,7 +1163,7 @@ theorem contDiffOn_succ_iff_fderiv_of_open {n : β„•} (hs : IsOpen s) :
     ContDiffOn π•œ (n + 1 : β„•) f s ↔
       DifferentiableOn π•œ f s ∧ ContDiffOn π•œ n (fun y => fderiv π•œ f y) s := by
   rw [contDiffOn_succ_iff_fderivWithin hs.uniqueDiffOn]
-  exact Iff.rfl.and (contDiffOn_congr fun x hx ↦ fderivWithin_of_open hs hx)
+  exact Iff.rfl.and (contDiffOn_congr fun x hx ↦ fderivWithin_of_isOpen hs hx)
 #align cont_diff_on_succ_iff_fderiv_of_open contDiffOn_succ_iff_fderiv_of_open
 
 /-- A function is `C^∞` on a domain with unique derivatives if and only if it is differentiable
@@ -1188,7 +1188,7 @@ derivative (expressed with `fderiv`) is `C^∞`. -/
 theorem contDiffOn_top_iff_fderiv_of_open (hs : IsOpen s) :
     ContDiffOn π•œ ∞ f s ↔ DifferentiableOn π•œ f s ∧ ContDiffOn π•œ ∞ (fun y => fderiv π•œ f y) s := by
   rw [contDiffOn_top_iff_fderivWithin hs.uniqueDiffOn]
-  exact Iff.rfl.and <| contDiffOn_congr fun x hx ↦ fderivWithin_of_open hs hx
+  exact Iff.rfl.and <| contDiffOn_congr fun x hx ↦ fderivWithin_of_isOpen hs hx
 #align cont_diff_on_top_iff_fderiv_of_open contDiffOn_top_iff_fderiv_of_open
 
 protected theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
@@ -1204,7 +1204,7 @@ protected theorem ContDiffOn.fderivWithin (hf : ContDiffOn π•œ n f s) (hs : Uni
 
 theorem ContDiffOn.fderiv_of_open (hf : ContDiffOn π•œ n f s) (hs : IsOpen s) (hmn : m + 1 ≀ n) :
     ContDiffOn π•œ m (fun y => fderiv π•œ f y) s :=
-  (hf.fderivWithin hs.uniqueDiffOn hmn).congr fun _ hx => (fderivWithin_of_open hs hx).symm
+  (hf.fderivWithin hs.uniqueDiffOn hmn).congr fun _ hx => (fderivWithin_of_isOpen hs hx).symm
 #align cont_diff_on.fderiv_of_open ContDiffOn.fderiv_of_open
 
 theorem ContDiffOn.continuousOn_fderivWithin (h : ContDiffOn π•œ n f s) (hs : UniqueDiffOn π•œ s)
@@ -1609,7 +1609,7 @@ theorem iteratedFDerivWithin_of_isOpen (n : β„•) (hs : IsOpen s) :
     rw [iteratedFDeriv_succ_eq_comp_left, iteratedFDerivWithin_succ_eq_comp_left]
     dsimp
     congr 1
-    rw [fderivWithin_of_open hs hx]
+    rw [fderivWithin_of_isOpen hs hx]
     apply Filter.EventuallyEq.fderiv_eq
     filter_upwards [hs.mem_nhds hx]
     exact IH
chore: missing spaces after rcases, convert and congrm (#7725)

Replace rcases( with rcases (. Same thing for convert( and congrm(. No other change.

Diff
@@ -742,7 +742,7 @@ theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : β„•} :
         (βˆ€ x ∈ u, HasFDerivWithinAt f (f' x) u x) ∧ ContDiffOn π•œ n f' u := by
   constructor
   Β· intro h x hx
-    rcases(h x hx) n.succ le_rfl with ⟨u, hu, p, Hp⟩
+    rcases (h x hx) n.succ le_rfl with ⟨u, hu, p, Hp⟩
     refine'
       ⟨u, hu, fun y => (continuousMultilinearCurryFin1 π•œ E F) (p y 1), fun y hy =>
         Hp.hasFDerivWithinAt (WithTop.coe_le_coe.2 (Nat.le_add_left 1 n)) hy, _⟩
@@ -1019,7 +1019,7 @@ protected theorem ContDiffOn.ftaylorSeriesWithin (h : ContDiffOn π•œ n f s) (hs
     simp only [ftaylorSeriesWithin, ContinuousMultilinearMap.uncurry0_apply,
       iteratedFDerivWithin_zero_apply]
   Β· intro m hm x hx
-    rcases(h x hx) m.succ (ENat.add_one_le_of_lt hm) with ⟨u, hu, p, Hp⟩
+    rcases (h x hx) m.succ (ENat.add_one_le_of_lt hm) with ⟨u, hu, p, Hp⟩
     rw [insert_eq_of_mem hx] at hu
     rcases mem_nhdsWithin.1 hu with ⟨o, o_open, xo, ho⟩
     rw [inter_comm] at ho
chore(Topology/SubsetProperties): rename isCompact_of_isClosed_subset (#7298)

As discussed on Zulip.

Co-authored-by: grunweg <grunweg@posteo.de>

Diff
@@ -1580,7 +1580,7 @@ theorem support_iteratedFDeriv_subset (n : β„•) : support (iteratedFDeriv π•œ n
 
 theorem HasCompactSupport.iteratedFDeriv (hf : HasCompactSupport f) (n : β„•) :
     HasCompactSupport (iteratedFDeriv π•œ n f) :=
-  isCompact_of_isClosed_subset hf isClosed_closure (tsupport_iteratedFDeriv_subset n)
+  hf.of_isClosed_subset isClosed_closure (tsupport_iteratedFDeriv_subset n)
 #align has_compact_support.iterated_fderiv HasCompactSupport.iteratedFDeriv
 
 theorem norm_fderiv_iteratedFDeriv {n : β„•} :
chore: rename isBoundedBilinearMapApply to isBoundedBilinearMap_apply (#6963)
Diff
@@ -1714,7 +1714,7 @@ theorem ContDiff.continuous_fderiv (h : ContDiff π•œ n f) (hn : 1 ≀ n) :
 continuous. -/
 theorem ContDiff.continuous_fderiv_apply (h : ContDiff π•œ n f) (hn : 1 ≀ n) :
     Continuous fun p : E Γ— E => (fderiv π•œ f p.1 : E β†’ F) p.2 :=
-  have A : Continuous fun q : (E β†’L[π•œ] F) Γ— E => q.1 q.2 := isBoundedBilinearMapApply.continuous
+  have A : Continuous fun q : (E β†’L[π•œ] F) Γ— E => q.1 q.2 := isBoundedBilinearMap_apply.continuous
   have B : Continuous fun p : E Γ— E => (fderiv π•œ f p.1, p.2) :=
     ((h.continuous_fderiv hn).comp continuous_fst).prod_mk continuous_snd
   A.comp B
feat: patch for new alias command (#6172)
Diff
@@ -524,7 +524,7 @@ theorem contDiffWithinAt_insert {y : E} :
   simp_rw [ContDiffWithinAt, insert_comm x y, nhdsWithin_insert_of_ne h]
 #align cont_diff_within_at_insert contDiffWithinAt_insert
 
-alias contDiffWithinAt_insert ↔ ContDiffWithinAt.of_insert ContDiffWithinAt.insert'
+alias ⟨ContDiffWithinAt.of_insert, ContDiffWithinAt.insert'⟩ := contDiffWithinAt_insert
 #align cont_diff_within_at.of_insert ContDiffWithinAt.of_insert
 #align cont_diff_within_at.insert' ContDiffWithinAt.insert'
 
feat: n-th derivative of C^{n+p} map is C^p (#6101)
Diff
@@ -813,6 +813,14 @@ theorem iteratedFDerivWithin_succ_eq_comp_left {n : β„•} :
   rfl
 #align iterated_fderiv_within_succ_eq_comp_left iteratedFDerivWithin_succ_eq_comp_left
 
+theorem fderivWithin_iteratedFDerivWithin {s : Set E} {n : β„•} :
+    fderivWithin π•œ (iteratedFDerivWithin π•œ n f s) s =
+      (continuousMultilinearCurryLeftEquiv π•œ (fun _ : Fin (n + 1) => E) F).symm ∘
+        iteratedFDerivWithin π•œ (n + 1) f s := by
+  rw [iteratedFDerivWithin_succ_eq_comp_left]
+  ext1 x
+  simp only [Function.comp_apply, LinearIsometryEquiv.symm_apply_apply]
+
 theorem norm_fderivWithin_iteratedFDerivWithin {n : β„•} :
     β€–fderivWithin π•œ (iteratedFDerivWithin π•œ n f s) s xβ€– =
       β€–iteratedFDerivWithin π•œ (n + 1) f s xβ€– := by
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,11 +2,6 @@
 Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: SΓ©bastien GouΓ«zel
-
-! This file was ported from Lean 3 source module analysis.calculus.cont_diff_def
-! leanprover-community/mathlib commit 3a69562db5a458db8322b190ec8d9a8bbd8a5b14
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Calculus.FDeriv.Add
 import Mathlib.Analysis.Calculus.FDeriv.Mul
@@ -14,6 +9,8 @@ import Mathlib.Analysis.Calculus.FDeriv.Equiv
 import Mathlib.Analysis.Calculus.FDeriv.RestrictScalars
 import Mathlib.Analysis.Calculus.FormalMultilinearSeries
 
+#align_import analysis.calculus.cont_diff_def from "leanprover-community/mathlib"@"3a69562db5a458db8322b190ec8d9a8bbd8a5b14"
+
 /-!
 # Higher differentiability
 
feat(Analysis.Calculus.ContDiffDef): support of iterated derivative (#5915)

We already had that the iterated derivative of a compactly supported function is compactly supported, this just makes it a bit more precise by iterating support_fderiv_subset.

Diff
@@ -1561,15 +1561,21 @@ theorem fderiv_iteratedFDeriv {n : β„•} :
   simp only [Function.comp_apply, LinearIsometryEquiv.symm_apply_apply]
 #align fderiv_iterated_fderiv fderiv_iteratedFDeriv
 
-theorem HasCompactSupport.iteratedFDeriv (hf : HasCompactSupport f) (n : β„•) :
-    HasCompactSupport (iteratedFDeriv π•œ n f) := by
+theorem tsupport_iteratedFDeriv_subset (n : β„•) : tsupport (iteratedFDeriv π•œ n f) βŠ† tsupport f := by
   induction' n with n IH
   Β· rw [iteratedFDeriv_zero_eq_comp]
-    apply hf.comp_left
-    exact LinearIsometryEquiv.map_zero _
+    exact closure_minimal ((support_comp_subset (LinearIsometryEquiv.map_zero _) _).trans
+      subset_closure) isClosed_closure
   Β· rw [iteratedFDeriv_succ_eq_comp_left]
-    apply (IH.fderiv π•œ).comp_left
-    exact LinearIsometryEquiv.map_zero _
+    exact closure_minimal ((support_comp_subset (LinearIsometryEquiv.map_zero _) _).trans
+      ((support_fderiv_subset π•œ).trans IH)) isClosed_closure
+
+theorem support_iteratedFDeriv_subset (n : β„•) : support (iteratedFDeriv π•œ n f) βŠ† tsupport f :=
+  subset_closure.trans (tsupport_iteratedFDeriv_subset n)
+
+theorem HasCompactSupport.iteratedFDeriv (hf : HasCompactSupport f) (n : β„•) :
+    HasCompactSupport (iteratedFDeriv π•œ n f) :=
+  isCompact_of_isClosed_subset hf isClosed_closure (tsupport_iteratedFDeriv_subset n)
 #align has_compact_support.iterated_fderiv HasCompactSupport.iteratedFDeriv
 
 theorem norm_fderiv_iteratedFDeriv {n : β„•} :
chore: bump to nightly-2023-07-01 (#5409)

Open in Gitpod

Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -166,8 +166,11 @@ open Classical BigOperators NNReal Topology Filter
 
 local notation "∞" => (⊀ : β„•βˆž)
 
+/-
+Porting note: These lines are not required in Mathlib4.
 attribute [local instance 1001]
   NormedAddCommGroup.toAddCommGroup NormedSpace.toModule' AddCommGroup.toAddCommMonoid
+-/
 
 open Set Fin Filter Function
 
feat: supporting lemmas for port of ContMDiff (#5428)

Instead of fixing a proof "as is", I'm golfing it and moving parts of it to lemmas.

Diff
@@ -513,12 +513,15 @@ theorem contDiffWithinAt_inter (h : t ∈ 𝓝 x) :
   contDiffWithinAt_inter' (mem_nhdsWithin_of_mem_nhds h)
 #align cont_diff_within_at_inter contDiffWithinAt_inter
 
+theorem contDiffWithinAt_insert_self :
+    ContDiffWithinAt π•œ n f (insert x s) x ↔ ContDiffWithinAt π•œ n f s x := by
+  simp_rw [ContDiffWithinAt, insert_idem]
+
 theorem contDiffWithinAt_insert {y : E} :
     ContDiffWithinAt π•œ n f (insert y s) x ↔ ContDiffWithinAt π•œ n f s x := by
-  simp_rw [ContDiffWithinAt]
   rcases eq_or_ne x y with (rfl | h)
-  Β· simp_rw [insert_eq_of_mem (mem_insert _ _)]
-  simp_rw [insert_comm x y, nhdsWithin_insert_of_ne h]
+  Β· exact contDiffWithinAt_insert_self
+  simp_rw [ContDiffWithinAt, insert_comm x y, nhdsWithin_insert_of_ne h]
 #align cont_diff_within_at_insert contDiffWithinAt_insert
 
 alias contDiffWithinAt_insert ↔ ContDiffWithinAt.of_insert ContDiffWithinAt.insert'
chore: clean up spacing around at and goals (#5387)

Changes are of the form

  • some_tactic at h⊒ -> some_tactic at h ⊒
  • some_tactic at h -> some_tactic at h
Diff
@@ -1253,7 +1253,8 @@ theorem HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn (h : HasFTaylorSeriesUpTo n
 #align has_ftaylor_series_up_to.has_ftaylor_series_up_to_on HasFTaylorSeriesUpTo.hasFTaylorSeriesUpToOn
 
 theorem HasFTaylorSeriesUpTo.ofLe (h : HasFTaylorSeriesUpTo n f p) (hmn : m ≀ n) :
-    HasFTaylorSeriesUpTo m f p := by rw [← hasFTaylorSeriesUpToOn_univ_iff] at h⊒; exact h.of_le hmn
+    HasFTaylorSeriesUpTo m f p := by
+  rw [← hasFTaylorSeriesUpToOn_univ_iff] at h ⊒; exact h.of_le hmn
 #align has_ftaylor_series_up_to.of_le HasFTaylorSeriesUpTo.ofLe
 
 theorem HasFTaylorSeriesUpTo.continuous (h : HasFTaylorSeriesUpTo n f p) : Continuous f := by
chore: remove superfluous parentheses in calls to ext (#5258)

Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -386,7 +386,7 @@ theorem hasFTaylorSeriesUpToOn_succ_iff_right {n : β„•} :
             ((p x).shift m.succ).curryLeft s x := Htaylor.fderivWithin _ A x hx
         rw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff'] at this
         convert this
-        ext (y v)
+        ext y v
         change
           (p x (Nat.succ (Nat.succ m))) (cons y v) =
             (p x m.succ.succ) (snoc (cons y (init v)) (v (last _)))
@@ -1575,7 +1575,7 @@ theorem iteratedFDerivWithin_univ {n : β„•} :
     iteratedFDerivWithin π•œ n f univ = iteratedFDeriv π•œ n f := by
   induction' n with n IH
   Β· ext x; simp
-  Β· ext (x m)
+  Β· ext x m
     rw [iteratedFDeriv_succ_apply_left, iteratedFDerivWithin_succ_apply_left, IH, fderivWithin_univ]
 #align iterated_fderiv_within_univ iteratedFDerivWithin_univ
 
chore: add links to issue for rw regressions (#5167)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -577,6 +577,7 @@ theorem contDiffWithinAt_succ_iff_hasFDerivWithinAt {n : β„•} :
           HasFDerivWithinAt (fun z => (continuousMultilinearCurryFin0 π•œ E F).symm (f z))
             (FormalMultilinearSeries.unshift (p' y) (f y) 1).curryLeft (v ∩ u) y
         -- Porting note: needed `erw` here.
+        -- https://github.com/leanprover-community/mathlib4/issues/5164
         erw [LinearIsometryEquiv.comp_hasFDerivWithinAt_iff']
         convert (f'_eq_deriv y hy.2).mono (inter_subset_right v u)
         rw [← Hp'.zero_eq y hy.1]
chore: add space after exacts (#4945)

Too often tempted to change these during other PRs, so doing a mass edit here.

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au>

Diff
@@ -693,7 +693,7 @@ theorem contDiffOn_top : ContDiffOn π•œ ∞ f s ↔ βˆ€ n : β„•, ContDiffOn 
 theorem contDiffOn_all_iff_nat : (βˆ€ n, ContDiffOn π•œ n f s) ↔ βˆ€ n : β„•, ContDiffOn π•œ n f s := by
   refine' ⟨fun H n => H n, _⟩
   rintro H (_ | n)
-  exacts[contDiffOn_top.2 H, H n]
+  exacts [contDiffOn_top.2 H, H n]
 #align cont_diff_on_all_iff_nat contDiffOn_all_iff_nat
 
 theorem ContDiffOn.continuousOn (h : ContDiffOn π•œ n f s) : ContinuousOn f s := fun x hx =>
@@ -1087,7 +1087,7 @@ theorem ContDiffWithinAt.differentiableWithinAt_iteratedFDerivWithin {m : β„•}
     simp only [set_eventuallyEq_iff_inf_principal, ← nhdsWithin_inter']
     rw [← inter_assoc, nhdsWithin_inter_of_mem', ← diff_eq_compl_inter, insert_diff_of_mem,
       diff_eq_compl_inter]
-    exacts[rfl, mem_nhdsWithin_of_mem_nhds (uo.mem_nhds xu)]
+    exacts [rfl, mem_nhdsWithin_of_mem_nhds (uo.mem_nhds xu)]
   have B : iteratedFDerivWithin π•œ m f s =αΆ [𝓝 x] iteratedFDerivWithin π•œ m f t :=
     iteratedFDerivWithin_eventually_congr_set' _ A.symm _
   have C : DifferentiableWithinAt π•œ (iteratedFDerivWithin π•œ m f t) t x :=
feat: port Analysis.Calculus.BumpFunctionInner (#4745)
Diff
@@ -1335,6 +1335,11 @@ theorem ContDiffWithinAt.contDiffAt (h : ContDiffWithinAt π•œ n f s x) (hx : s
     ContDiffAt π•œ n f x := by rwa [ContDiffAt, ← contDiffWithinAt_inter hx, univ_inter]
 #align cont_diff_within_at.cont_diff_at ContDiffWithinAt.contDiffAt
 
+-- porting note: new lemma
+theorem ContDiffOn.contDiffAt (h : ContDiffOn π•œ n f s) (hx : s ∈ 𝓝 x) :
+    ContDiffAt π•œ n f x :=
+  (h _ (mem_of_mem_nhds hx)).contDiffAt hx
+
 theorem ContDiffAt.congr_of_eventuallyEq (h : ContDiffAt π•œ n f x) (hg : f₁ =αΆ [𝓝 x] f) :
     ContDiffAt π•œ n f₁ x :=
   h.congr_of_eventually_eq' (by rwa [nhdsWithin_univ]) (mem_univ x)
chore: fix some names (#4564)
  • Protect HasFTaylorSeriesUpToOn.fderivWithin, IsBoundedBilinearMap.fderiv, and IsBoundedBilinearMap.fderivWithin.

  • Rename

    • isBoundedBilinearMapSmul -> isBoundedBilinearMap_smul;
    • isBoundedBilinearMapMul -> isBoundedBilinearMap_mul;
    • isBoundedBilinearMapComp -> isBoundedBilinearMap_comp;
    • isBoundedBilinearMapSmulRight -> isBoundedBilinearMap_smulRight;
    • isBoundedBilinearMapCompMultilinear -> isBoundedBilinearMap_compMultilinear;
    • ContinuousLinearMap.mulLeftRightIsBoundedBilinear -> ContinuousLinearMap.mulLeftRight_isBoundedBilinear;
    • nhdsWithin_eq_nhds_within' -> nhdsWithin_eq_nhdsWithin';
    • ContinuousWithinAt.preimage_mem_nhds_within' -> ContinuousWithinAt.preimage_mem_nhdsWithin'.

Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -187,7 +187,7 @@ derivative of `p m` for `m < n`, and is continuous for `m ≀ n`. This is a pred
 structure HasFTaylorSeriesUpToOn (n : β„•βˆž) (f : E β†’ F) (p : E β†’ FormalMultilinearSeries π•œ E F)
   (s : Set E) : Prop where
   zero_eq : βˆ€ x ∈ s, (p x 0).uncurry0 = f x
-  fderivWithin : βˆ€ m : β„•, (m : β„•βˆž) < n β†’ βˆ€ x ∈ s,
+  protected fderivWithin : βˆ€ m : β„•, (m : β„•βˆž) < n β†’ βˆ€ x ∈ s,
     HasFDerivWithinAt (p Β· m) (p x m.succ).curryLeft s x
   cont : βˆ€ m : β„•, (m : β„•βˆž) ≀ n β†’ ContinuousOn (p Β· m) s
 #align has_ftaylor_series_up_to_on HasFTaylorSeriesUpToOn
feat: port Analysis.Calculus.ContDiffDef (#4256)

Co-authored-by: @semorrison

Dependencies 10 + 682

683 files ported (98.6%)
304554 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