analysis.calculus.fderiv_analyticMathlib.Analysis.Calculus.FDeriv.Analytic

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -5,7 +5,7 @@ Authors: Yury Kudryashov
 -/
 import Analysis.Analytic.Basic
 import Analysis.Calculus.Deriv.Basic
-import Analysis.Calculus.ContDiffDef
+import Analysis.Calculus.ContDiff.Defs
 
 #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
 
@@ -127,7 +127,7 @@ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBal
   · apply A.congr
     intro z hz
     dsimp
-    rw [← h.fderiv_eq, add_sub_cancel'_right]
+    rw [← h.fderiv_eq, add_sub_cancel]
     simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
   suffices B :
     HasFPowerSeriesOnBall (fun z => p.change_origin (z - x) 1) (p.change_origin_series 1) x r
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
-import Mathbin.Analysis.Analytic.Basic
-import Mathbin.Analysis.Calculus.Deriv.Basic
-import Mathbin.Analysis.Calculus.ContDiffDef
+import Analysis.Analytic.Basic
+import Analysis.Calculus.Deriv.Basic
+import Analysis.Calculus.ContDiffDef
 
 #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module analysis.calculus.fderiv_analytic
-! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Analytic.Basic
 import Mathbin.Analysis.Calculus.Deriv.Basic
 import Mathbin.Analysis.Calculus.ContDiffDef
 
+#align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"36938f775671ff28bea1c0310f1608e4afbb22e0"
+
 /-!
 # Frechet derivatives of analytic functions.
 
Diff
@@ -39,6 +39,7 @@ variable {p : FormalMultilinearSeries 𝕜 E F} {r : ℝ≥0∞}
 
 variable {f : E → F} {x : E} {s : Set E}
 
+#print HasFPowerSeriesAt.hasStrictFDerivAt /-
 theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) :
     HasStrictFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
   by
@@ -47,50 +48,70 @@ theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) :
   refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _
   rw [_root_.id, sub_self, norm_zero]
 #align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt
+-/
 
+#print HasFPowerSeriesAt.hasFDerivAt /-
 theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) :
     HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
   h.HasStrictFDerivAt.HasFDerivAt
 #align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt
+-/
 
+#print HasFPowerSeriesAt.differentiableAt /-
 theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt 𝕜 f x :=
   h.HasFDerivAt.DifferentiableAt
 #align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt
+-/
 
+#print AnalyticAt.differentiableAt /-
 theorem AnalyticAt.differentiableAt : AnalyticAt 𝕜 f x → DifferentiableAt 𝕜 f x
   | ⟨p, hp⟩ => hp.DifferentiableAt
 #align analytic_at.differentiable_at AnalyticAt.differentiableAt
+-/
 
+#print AnalyticAt.differentiableWithinAt /-
 theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt 𝕜 f x) : DifferentiableWithinAt 𝕜 f s x :=
   h.DifferentiableAt.DifferentiableWithinAt
 #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt
+-/
 
+#print HasFPowerSeriesAt.fderiv_eq /-
 theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) :
     fderiv 𝕜 f x = continuousMultilinearCurryFin1 𝕜 E F (p 1) :=
   h.HasFDerivAt.fderiv
 #align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq
+-/
 
+#print HasFPowerSeriesOnBall.differentiableOn /-
 theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F]
     (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn 𝕜 f (EMetric.ball x r) := fun y hy =>
   (h.analyticAt_of_mem hy).DifferentiableWithinAt
 #align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn
+-/
 
+#print AnalyticOn.differentiableOn /-
 theorem AnalyticOn.differentiableOn (h : AnalyticOn 𝕜 f s) : DifferentiableOn 𝕜 f s := fun y hy =>
   (h y hy).DifferentiableWithinAt
 #align analytic_on.differentiable_on AnalyticOn.differentiableOn
+-/
 
+#print HasFPowerSeriesOnBall.hasFDerivAt /-
 theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r)
     {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
     HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)) (x + y) :=
   (h.changeOrigin hy).HasFPowerSeriesAt.HasFDerivAt
 #align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt
+-/
 
+#print HasFPowerSeriesOnBall.fderiv_eq /-
 theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r)
     {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
     fderiv 𝕜 f (x + y) = continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1) :=
   (h.HasFDerivAt hy).fderiv
 #align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq
+-/
 
+#print HasFPowerSeriesOnBall.fderiv /-
 /-- If a function has a power series on a ball, then so does its derivative. -/
 theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) :
     HasFPowerSeriesOnBall (fderiv 𝕜 f)
@@ -122,7 +143,9 @@ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBal
           h.r_le).comp_sub
       x
 #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv
+-/
 
+#print AnalyticOn.fderiv /-
 /-- If a function is analytic on a set `s`, so is its Fréchet derivative. -/
 theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) : AnalyticOn 𝕜 (fderiv 𝕜 f) s :=
   by
@@ -130,7 +153,9 @@ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) : Analytic
   rcases h y hy with ⟨p, r, hp⟩
   exact hp.fderiv.analytic_at
 #align analytic_on.fderiv AnalyticOn.fderiv
+-/
 
+#print AnalyticOn.iteratedFDeriv /-
 /-- If a function is analytic on a set `s`, so are its successive Fréchet derivative. -/
 theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n : ℕ) :
     AnalyticOn 𝕜 (iteratedFDeriv 𝕜 n f) s :=
@@ -144,7 +169,9 @@ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n
               F).toContinuousLinearEquiv.toContinuousLinearMap.comp_analyticOn
     exact IH.fderiv
 #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv
+-/
 
+#print AnalyticOn.contDiffOn /-
 /-- An analytic function is infinitely differentiable. -/
 theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : ℕ∞} :
     ContDiffOn 𝕜 n f s := by
@@ -162,6 +189,7 @@ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : 
     intro x hx
     exact iteratedFDerivWithin_of_isOpen _ t_open hx
 #align analytic_on.cont_diff_on AnalyticOn.contDiffOn
+-/
 
 end fderiv
 
@@ -171,20 +199,26 @@ variable {p : FormalMultilinearSeries 𝕜 𝕜 F} {r : ℝ≥0∞}
 
 variable {f : 𝕜 → F} {x : 𝕜} {s : Set 𝕜}
 
+#print HasFPowerSeriesAt.hasStrictDerivAt /-
 protected theorem HasFPowerSeriesAt.hasStrictDerivAt (h : HasFPowerSeriesAt f p x) :
     HasStrictDerivAt f (p 1 fun _ => 1) x :=
   h.HasStrictFDerivAt.HasStrictDerivAt
 #align has_fpower_series_at.has_strict_deriv_at HasFPowerSeriesAt.hasStrictDerivAt
+-/
 
+#print HasFPowerSeriesAt.hasDerivAt /-
 protected theorem HasFPowerSeriesAt.hasDerivAt (h : HasFPowerSeriesAt f p x) :
     HasDerivAt f (p 1 fun _ => 1) x :=
   h.HasStrictDerivAt.HasDerivAt
 #align has_fpower_series_at.has_deriv_at HasFPowerSeriesAt.hasDerivAt
+-/
 
+#print HasFPowerSeriesAt.deriv /-
 protected theorem HasFPowerSeriesAt.deriv (h : HasFPowerSeriesAt f p x) :
     deriv f x = p 1 fun _ => 1 :=
   h.HasDerivAt.deriv
 #align has_fpower_series_at.deriv HasFPowerSeriesAt.deriv
+-/
 
 #print AnalyticOn.deriv /-
 /-- If a function is analytic on a set `s`, so is its derivative. -/
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module analysis.calculus.fderiv_analytic
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
+! leanprover-community/mathlib commit 36938f775671ff28bea1c0310f1608e4afbb22e0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Analysis.Calculus.ContDiffDef
 /-!
 # Frechet derivatives of analytic functions.
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 A function expressible as a power series at a point has a Frechet derivative there.
 Also the special case in terms of `deriv` when the domain is 1-dimensional.
 -/
Diff
@@ -183,11 +183,14 @@ protected theorem HasFPowerSeriesAt.deriv (h : HasFPowerSeriesAt f p x) :
   h.HasDerivAt.deriv
 #align has_fpower_series_at.deriv HasFPowerSeriesAt.deriv
 
+#print AnalyticOn.deriv /-
 /-- If a function is analytic on a set `s`, so is its derivative. -/
 theorem AnalyticOn.deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) : AnalyticOn 𝕜 (deriv f) s :=
   (ContinuousLinearMap.apply 𝕜 F (1 : 𝕜)).comp_analyticOn h.fderiv
 #align analytic_on.deriv AnalyticOn.deriv
+-/
 
+#print AnalyticOn.iterated_deriv /-
 /-- If a function is analytic on a set `s`, so are its successive derivatives. -/
 theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n : ℕ) :
     AnalyticOn 𝕜 ((deriv^[n]) f) s := by
@@ -195,6 +198,7 @@ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n
   · exact h
   · simpa only [Function.iterate_succ', Function.comp_apply] using IH.deriv
 #align analytic_on.iterated_deriv AnalyticOn.iterated_deriv
+-/
 
 end deriv
 
Diff
@@ -145,7 +145,7 @@ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n
 /-- An analytic function is infinitely differentiable. -/
 theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : ℕ∞} :
     ContDiffOn 𝕜 n f s := by
-  let t := { x | AnalyticAt 𝕜 f x }
+  let t := {x | AnalyticAt 𝕜 f x}
   suffices : ContDiffOn 𝕜 n f t; exact this.mono h
   have H : AnalyticOn 𝕜 f t := fun x hx => hx
   have t_open : IsOpen t := isOpen_analyticAt 𝕜 f
Diff
@@ -36,23 +36,23 @@ variable {p : FormalMultilinearSeries 𝕜 E F} {r : ℝ≥0∞}
 
 variable {f : E → F} {x : E} {s : Set E}
 
-theorem HasFpowerSeriesAt.hasStrictFDerivAt (h : HasFpowerSeriesAt f p x) :
+theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) :
     HasStrictFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
   by
   refine' h.is_O_image_sub_norm_mul_norm_sub.trans_is_o (is_o.of_norm_right _)
   refine' is_o_iff_exists_eq_mul.2 ⟨fun y => ‖y - (x, x)‖, _, eventually_eq.rfl⟩
   refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _
   rw [_root_.id, sub_self, norm_zero]
-#align has_fpower_series_at.has_strict_fderiv_at HasFpowerSeriesAt.hasStrictFDerivAt
+#align has_fpower_series_at.has_strict_fderiv_at HasFPowerSeriesAt.hasStrictFDerivAt
 
-theorem HasFpowerSeriesAt.hasFDerivAt (h : HasFpowerSeriesAt f p x) :
+theorem HasFPowerSeriesAt.hasFDerivAt (h : HasFPowerSeriesAt f p x) :
     HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
   h.HasStrictFDerivAt.HasFDerivAt
-#align has_fpower_series_at.has_fderiv_at HasFpowerSeriesAt.hasFDerivAt
+#align has_fpower_series_at.has_fderiv_at HasFPowerSeriesAt.hasFDerivAt
 
-theorem HasFpowerSeriesAt.differentiableAt (h : HasFpowerSeriesAt f p x) : DifferentiableAt 𝕜 f x :=
+theorem HasFPowerSeriesAt.differentiableAt (h : HasFPowerSeriesAt f p x) : DifferentiableAt 𝕜 f x :=
   h.HasFDerivAt.DifferentiableAt
-#align has_fpower_series_at.differentiable_at HasFpowerSeriesAt.differentiableAt
+#align has_fpower_series_at.differentiable_at HasFPowerSeriesAt.differentiableAt
 
 theorem AnalyticAt.differentiableAt : AnalyticAt 𝕜 f x → DifferentiableAt 𝕜 f x
   | ⟨p, hp⟩ => hp.DifferentiableAt
@@ -62,42 +62,42 @@ theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt 𝕜 f x) : Differenti
   h.DifferentiableAt.DifferentiableWithinAt
 #align analytic_at.differentiable_within_at AnalyticAt.differentiableWithinAt
 
-theorem HasFpowerSeriesAt.fderiv_eq (h : HasFpowerSeriesAt f p x) :
+theorem HasFPowerSeriesAt.fderiv_eq (h : HasFPowerSeriesAt f p x) :
     fderiv 𝕜 f x = continuousMultilinearCurryFin1 𝕜 E F (p 1) :=
   h.HasFDerivAt.fderiv
-#align has_fpower_series_at.fderiv_eq HasFpowerSeriesAt.fderiv_eq
+#align has_fpower_series_at.fderiv_eq HasFPowerSeriesAt.fderiv_eq
 
-theorem HasFpowerSeriesOnBall.differentiableOn [CompleteSpace F]
-    (h : HasFpowerSeriesOnBall f p x r) : DifferentiableOn 𝕜 f (EMetric.ball x r) := fun y hy =>
+theorem HasFPowerSeriesOnBall.differentiableOn [CompleteSpace F]
+    (h : HasFPowerSeriesOnBall f p x r) : DifferentiableOn 𝕜 f (EMetric.ball x r) := fun y hy =>
   (h.analyticAt_of_mem hy).DifferentiableWithinAt
-#align has_fpower_series_on_ball.differentiable_on HasFpowerSeriesOnBall.differentiableOn
+#align has_fpower_series_on_ball.differentiable_on HasFPowerSeriesOnBall.differentiableOn
 
 theorem AnalyticOn.differentiableOn (h : AnalyticOn 𝕜 f s) : DifferentiableOn 𝕜 f s := fun y hy =>
   (h y hy).DifferentiableWithinAt
 #align analytic_on.differentiable_on AnalyticOn.differentiableOn
 
-theorem HasFpowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFpowerSeriesOnBall f p x r)
+theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r)
     {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
     HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)) (x + y) :=
-  (h.changeOrigin hy).HasFpowerSeriesAt.HasFDerivAt
-#align has_fpower_series_on_ball.has_fderiv_at HasFpowerSeriesOnBall.hasFDerivAt
+  (h.changeOrigin hy).HasFPowerSeriesAt.HasFDerivAt
+#align has_fpower_series_on_ball.has_fderiv_at HasFPowerSeriesOnBall.hasFDerivAt
 
-theorem HasFpowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFpowerSeriesOnBall f p x r)
+theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r)
     {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
     fderiv 𝕜 f (x + y) = continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1) :=
   (h.HasFDerivAt hy).fderiv
-#align has_fpower_series_on_ball.fderiv_eq HasFpowerSeriesOnBall.fderiv_eq
+#align has_fpower_series_on_ball.fderiv_eq HasFPowerSeriesOnBall.fderiv_eq
 
 /-- If a function has a power series on a ball, then so does its derivative. -/
-theorem HasFpowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFpowerSeriesOnBall f p x r) :
-    HasFpowerSeriesOnBall (fderiv 𝕜 f)
+theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) :
+    HasFPowerSeriesOnBall (fderiv 𝕜 f)
       ((continuousMultilinearCurryFin1 𝕜 E F :
             (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F).compFormalMultilinearSeries
         (p.changeOriginSeries 1))
       x r :=
   by
   suffices A :
-    HasFpowerSeriesOnBall
+    HasFPowerSeriesOnBall
       (fun z => continuousMultilinearCurryFin1 𝕜 E F (p.change_origin (z - x) 1))
       ((continuousMultilinearCurryFin1 𝕜 E F :
             (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F).compFormalMultilinearSeries
@@ -109,16 +109,16 @@ theorem HasFpowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFpowerSeriesOnBal
     rw [← h.fderiv_eq, add_sub_cancel'_right]
     simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
   suffices B :
-    HasFpowerSeriesOnBall (fun z => p.change_origin (z - x) 1) (p.change_origin_series 1) x r
+    HasFPowerSeriesOnBall (fun z => p.change_origin (z - x) 1) (p.change_origin_series 1) x r
   exact
     (continuousMultilinearCurryFin1 𝕜 E
-              F).toContinuousLinearEquiv.toContinuousLinearMap.compHasFpowerSeriesOnBall
+              F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall
       B
   simpa using
     ((p.has_fpower_series_on_ball_change_origin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos
           h.r_le).comp_sub
       x
-#align has_fpower_series_on_ball.fderiv HasFpowerSeriesOnBall.fderiv
+#align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv
 
 /-- If a function is analytic on a set `s`, so is its Fréchet derivative. -/
 theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) : AnalyticOn 𝕜 (fderiv 𝕜 f) s :=
@@ -168,20 +168,20 @@ variable {p : FormalMultilinearSeries 𝕜 𝕜 F} {r : ℝ≥0∞}
 
 variable {f : 𝕜 → F} {x : 𝕜} {s : Set 𝕜}
 
-protected theorem HasFpowerSeriesAt.hasStrictDerivAt (h : HasFpowerSeriesAt f p x) :
+protected theorem HasFPowerSeriesAt.hasStrictDerivAt (h : HasFPowerSeriesAt f p x) :
     HasStrictDerivAt f (p 1 fun _ => 1) x :=
   h.HasStrictFDerivAt.HasStrictDerivAt
-#align has_fpower_series_at.has_strict_deriv_at HasFpowerSeriesAt.hasStrictDerivAt
+#align has_fpower_series_at.has_strict_deriv_at HasFPowerSeriesAt.hasStrictDerivAt
 
-protected theorem HasFpowerSeriesAt.hasDerivAt (h : HasFpowerSeriesAt f p x) :
+protected theorem HasFPowerSeriesAt.hasDerivAt (h : HasFPowerSeriesAt f p x) :
     HasDerivAt f (p 1 fun _ => 1) x :=
   h.HasStrictDerivAt.HasDerivAt
-#align has_fpower_series_at.has_deriv_at HasFpowerSeriesAt.hasDerivAt
+#align has_fpower_series_at.has_deriv_at HasFPowerSeriesAt.hasDerivAt
 
-protected theorem HasFpowerSeriesAt.deriv (h : HasFpowerSeriesAt f p x) :
+protected theorem HasFPowerSeriesAt.deriv (h : HasFPowerSeriesAt f p x) :
     deriv f x = p 1 fun _ => 1 :=
   h.HasDerivAt.deriv
-#align has_fpower_series_at.deriv HasFpowerSeriesAt.deriv
+#align has_fpower_series_at.deriv HasFPowerSeriesAt.deriv
 
 /-- If a function is analytic on a set `s`, so is its derivative. -/
 theorem AnalyticOn.deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) : AnalyticOn 𝕜 (deriv f) s :=
Diff
@@ -129,18 +129,18 @@ theorem AnalyticOn.fderiv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) : Analytic
 #align analytic_on.fderiv AnalyticOn.fderiv
 
 /-- If a function is analytic on a set `s`, so are its successive Fréchet derivative. -/
-theorem AnalyticOn.iteratedFderiv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n : ℕ) :
-    AnalyticOn 𝕜 (iteratedFderiv 𝕜 n f) s :=
+theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n : ℕ) :
+    AnalyticOn 𝕜 (iteratedFDeriv 𝕜 n f) s :=
   by
   induction' n with n IH
-  · rw [iteratedFderiv_zero_eq_comp]
+  · rw [iteratedFDeriv_zero_eq_comp]
     exact ((continuousMultilinearCurryFin0 𝕜 E F).symm : F →L[𝕜] E[×0]→L[𝕜] F).comp_analyticOn h
-  · rw [iteratedFderiv_succ_eq_comp_left]
+  · rw [iteratedFDeriv_succ_eq_comp_left]
     apply
       (continuousMultilinearCurryLeftEquiv 𝕜 (fun i : Fin (n + 1) => E)
               F).toContinuousLinearEquiv.toContinuousLinearMap.comp_analyticOn
     exact IH.fderiv
-#align analytic_on.iterated_fderiv AnalyticOn.iteratedFderiv
+#align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv
 
 /-- An analytic function is infinitely differentiable. -/
 theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : ℕ∞} :
@@ -153,11 +153,11 @@ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : 
   · intro m hm
     apply (H.iterated_fderiv m).ContinuousOn.congr
     intro x hx
-    exact iteratedFderivWithin_of_isOpen _ t_open hx
+    exact iteratedFDerivWithin_of_isOpen _ t_open hx
   · intro m hm
     apply (H.iterated_fderiv m).DifferentiableOn.congr
     intro x hx
-    exact iteratedFderivWithin_of_isOpen _ t_open hx
+    exact iteratedFDerivWithin_of_isOpen _ t_open hx
 #align analytic_on.cont_diff_on AnalyticOn.contDiffOn
 
 end fderiv
Diff
@@ -22,7 +22,7 @@ Also the special case in terms of `deriv` when the domain is 1-dimensional.
 
 open Filter Asymptotics
 
-open ENNReal
+open scoped ENNReal
 
 variable {𝕜 : Type _} [NontriviallyNormedField 𝕜]
 
Diff
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module analysis.calculus.fderiv_analytic
-! leanprover-community/mathlib commit 2c1d8ca2812b64f88992a5294ea3dba144755cd1
+! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.Analytic.Basic
-import Mathbin.Analysis.Calculus.Deriv
+import Mathbin.Analysis.Calculus.Deriv.Basic
 import Mathbin.Analysis.Calculus.ContDiffDef
 
 /-!
Diff
@@ -36,22 +36,22 @@ variable {p : FormalMultilinearSeries 𝕜 E F} {r : ℝ≥0∞}
 
 variable {f : E → F} {x : E} {s : Set E}
 
-theorem HasFpowerSeriesAt.hasStrictFderivAt (h : HasFpowerSeriesAt f p x) :
-    HasStrictFderivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
+theorem HasFpowerSeriesAt.hasStrictFDerivAt (h : HasFpowerSeriesAt f p x) :
+    HasStrictFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
   by
   refine' h.is_O_image_sub_norm_mul_norm_sub.trans_is_o (is_o.of_norm_right _)
   refine' is_o_iff_exists_eq_mul.2 ⟨fun y => ‖y - (x, x)‖, _, eventually_eq.rfl⟩
   refine' (continuous_id.sub continuous_const).norm.tendsto' _ _ _
   rw [_root_.id, sub_self, norm_zero]
-#align has_fpower_series_at.has_strict_fderiv_at HasFpowerSeriesAt.hasStrictFderivAt
+#align has_fpower_series_at.has_strict_fderiv_at HasFpowerSeriesAt.hasStrictFDerivAt
 
-theorem HasFpowerSeriesAt.hasFderivAt (h : HasFpowerSeriesAt f p x) :
-    HasFderivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
-  h.HasStrictFderivAt.HasFderivAt
-#align has_fpower_series_at.has_fderiv_at HasFpowerSeriesAt.hasFderivAt
+theorem HasFpowerSeriesAt.hasFDerivAt (h : HasFpowerSeriesAt f p x) :
+    HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p 1)) x :=
+  h.HasStrictFDerivAt.HasFDerivAt
+#align has_fpower_series_at.has_fderiv_at HasFpowerSeriesAt.hasFDerivAt
 
 theorem HasFpowerSeriesAt.differentiableAt (h : HasFpowerSeriesAt f p x) : DifferentiableAt 𝕜 f x :=
-  h.HasFderivAt.DifferentiableAt
+  h.HasFDerivAt.DifferentiableAt
 #align has_fpower_series_at.differentiable_at HasFpowerSeriesAt.differentiableAt
 
 theorem AnalyticAt.differentiableAt : AnalyticAt 𝕜 f x → DifferentiableAt 𝕜 f x
@@ -64,7 +64,7 @@ theorem AnalyticAt.differentiableWithinAt (h : AnalyticAt 𝕜 f x) : Differenti
 
 theorem HasFpowerSeriesAt.fderiv_eq (h : HasFpowerSeriesAt f p x) :
     fderiv 𝕜 f x = continuousMultilinearCurryFin1 𝕜 E F (p 1) :=
-  h.HasFderivAt.fderiv
+  h.HasFDerivAt.fderiv
 #align has_fpower_series_at.fderiv_eq HasFpowerSeriesAt.fderiv_eq
 
 theorem HasFpowerSeriesOnBall.differentiableOn [CompleteSpace F]
@@ -76,16 +76,16 @@ theorem AnalyticOn.differentiableOn (h : AnalyticOn 𝕜 f s) : DifferentiableOn
   (h y hy).DifferentiableWithinAt
 #align analytic_on.differentiable_on AnalyticOn.differentiableOn
 
-theorem HasFpowerSeriesOnBall.hasFderivAt [CompleteSpace F] (h : HasFpowerSeriesOnBall f p x r)
+theorem HasFpowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFpowerSeriesOnBall f p x r)
     {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
-    HasFderivAt f (continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)) (x + y) :=
-  (h.changeOrigin hy).HasFpowerSeriesAt.HasFderivAt
-#align has_fpower_series_on_ball.has_fderiv_at HasFpowerSeriesOnBall.hasFderivAt
+    HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)) (x + y) :=
+  (h.changeOrigin hy).HasFpowerSeriesAt.HasFDerivAt
+#align has_fpower_series_on_ball.has_fderiv_at HasFpowerSeriesOnBall.hasFDerivAt
 
 theorem HasFpowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFpowerSeriesOnBall f p x r)
     {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
     fderiv 𝕜 f (x + y) = continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1) :=
-  (h.HasFderivAt hy).fderiv
+  (h.HasFDerivAt hy).fderiv
 #align has_fpower_series_on_ball.fderiv_eq HasFpowerSeriesOnBall.fderiv_eq
 
 /-- If a function has a power series on a ball, then so does its derivative. -/
@@ -170,7 +170,7 @@ variable {f : 𝕜 → F} {x : 𝕜} {s : Set 𝕜}
 
 protected theorem HasFpowerSeriesAt.hasStrictDerivAt (h : HasFpowerSeriesAt f p x) :
     HasStrictDerivAt f (p 1 fun _ => 1) x :=
-  h.HasStrictFderivAt.HasStrictDerivAt
+  h.HasStrictFDerivAt.HasStrictDerivAt
 #align has_fpower_series_at.has_strict_deriv_at HasFpowerSeriesAt.hasStrictDerivAt
 
 protected theorem HasFpowerSeriesAt.hasDerivAt (h : HasFpowerSeriesAt f p x) :
Diff
@@ -4,13 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 
 ! This file was ported from Lean 3 source module analysis.calculus.fderiv_analytic
-! leanprover-community/mathlib commit 17ef379e997badd73e5eabb4d38f11919ab3c4b3
+! 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.Deriv
 import Mathbin.Analysis.Analytic.Basic
-import Mathbin.Analysis.Calculus.ContDiff
+import Mathbin.Analysis.Calculus.Deriv
+import Mathbin.Analysis.Calculus.ContDiffDef
 
 /-!
 # Frechet derivatives of analytic functions.
Diff
@@ -68,7 +68,7 @@ theorem HasFpowerSeriesAt.fderiv_eq (h : HasFpowerSeriesAt f p x) :
 #align has_fpower_series_at.fderiv_eq HasFpowerSeriesAt.fderiv_eq
 
 theorem HasFpowerSeriesOnBall.differentiableOn [CompleteSpace F]
-    (h : HasFpowerSeriesOnBall f p x r) : DifferentiableOn 𝕜 f (Emetric.ball x r) := fun y hy =>
+    (h : HasFpowerSeriesOnBall f p x r) : DifferentiableOn 𝕜 f (EMetric.ball x r) := fun y hy =>
   (h.analyticAt_of_mem hy).DifferentiableWithinAt
 #align has_fpower_series_on_ball.differentiable_on HasFpowerSeriesOnBall.differentiableOn
 
@@ -107,7 +107,7 @@ theorem HasFpowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFpowerSeriesOnBal
     intro z hz
     dsimp
     rw [← h.fderiv_eq, add_sub_cancel'_right]
-    simpa only [edist_eq_coe_nnnorm_sub, Emetric.mem_ball] using hz
+    simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
   suffices B :
     HasFpowerSeriesOnBall (fun z => p.change_origin (z - x) 1) (p.change_origin_series 1) x r
   exact
Diff
@@ -22,7 +22,7 @@ Also the special case in terms of `deriv` when the domain is 1-dimensional.
 
 open Filter Asymptotics
 
-open Ennreal
+open ENNReal
 
 variable {𝕜 : Type _} [NontriviallyNormedField 𝕜]
 

Changes in mathlib4

mathlib3
mathlib4
feat(Topology/Algebra/StrongTopology): introduce type synonym for abstract topologies on CLM (#11470)
Diff
@@ -366,10 +366,10 @@ variable (p : FormalMultilinearSeries 𝕜 E F)
 open Fintype ContinuousLinearMap in
 theorem derivSeries_apply_diag (n : ℕ) (x : E) :
     derivSeries p n (fun _ ↦ x) x = (n + 1) • p (n + 1) fun _ ↦ x := by
-  simp only [derivSeries, strongUniformity_topology_eq, compFormalMultilinearSeries_apply,
-    changeOriginSeries, compContinuousMultilinearMap_coe, ContinuousLinearEquiv.coe_coe,
-    LinearIsometryEquiv.coe_coe, Function.comp_apply, ContinuousMultilinearMap.sum_apply, map_sum,
-    coe_sum', Finset.sum_apply, continuousMultilinearCurryFin1_apply, Matrix.zero_empty]
+  simp only [derivSeries, compFormalMultilinearSeries_apply, changeOriginSeries,
+    compContinuousMultilinearMap_coe, ContinuousLinearEquiv.coe_coe, LinearIsometryEquiv.coe_coe,
+    Function.comp_apply, ContinuousMultilinearMap.sum_apply, map_sum, coe_sum', Finset.sum_apply,
+    continuousMultilinearCurryFin1_apply, Matrix.zero_empty]
   convert Finset.sum_const _
   · rw [Fin.snoc_zero, changeOriginSeriesTerm_apply, Finset.piecewise_same, add_comm]
   · rw [← card, card_subtype, ← Finset.powerset_univ, ← Finset.powersetCard_eq_filter,
style: replace '.-/' by '. -/' (#11938)

Purely automatic replacement. If this is in any way controversial; I'm happy to just close this PR.

Diff
@@ -180,7 +180,7 @@ variable {p : FormalMultilinearSeries 𝕜 E F} {r : ℝ≥0∞} {n : ℕ}
 variable {f : E → F} {x : E} {s : Set E}
 
 /-! The case of continuously polynomial functions. We get the same differentiability
-results as for analytic functions, but without the assumptions that `F` is complete.-/
+results as for analytic functions, but without the assumptions that `F` is complete. -/
 
 theorem HasFiniteFPowerSeriesOnBall.differentiableOn
     (h : HasFiniteFPowerSeriesOnBall f p x n r) : DifferentiableOn 𝕜 f (EMetric.ball x r) :=
chore: Rename mul-div cancellation lemmas (#11530)

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

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

| Statement | New name | Old name | |

Diff
@@ -94,7 +94,7 @@ theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBal
     simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1
       (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x
   dsimp only
-  rw [← h.fderiv_eq, add_sub_cancel'_right]
+  rw [← h.fderiv_eq, add_sub_cancel]
   simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
 #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv
 
@@ -207,7 +207,7 @@ protected theorem HasFiniteFPowerSeriesOnBall.fderiv
     simpa using
       ((p.hasFiniteFPowerSeriesOnBall_changeOrigin 1 h.finite).mono h.r_pos le_top).comp_sub x
   dsimp only
-  rw [← h.fderiv_eq, add_sub_cancel'_right]
+  rw [← h.fderiv_eq, add_sub_cancel]
   simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
 
 /-- If a function has a finite power series on a ball, then so does its derivative.
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -25,15 +25,12 @@ open scoped ENNReal
 universe u v
 
 variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
-
 variable {E : Type u} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
-
 variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
 
 section fderiv
 
 variable {p : FormalMultilinearSeries 𝕜 E F} {r : ℝ≥0∞}
-
 variable {f : E → F} {x : E} {s : Set E}
 
 theorem HasFPowerSeriesAt.hasStrictFDerivAt (h : HasFPowerSeriesAt f p x) :
@@ -146,7 +143,6 @@ end fderiv
 section deriv
 
 variable {p : FormalMultilinearSeries 𝕜 𝕜 F} {r : ℝ≥0∞}
-
 variable {f : 𝕜 → F} {x : 𝕜} {s : Set 𝕜}
 
 protected theorem HasFPowerSeriesAt.hasStrictDerivAt (h : HasFPowerSeriesAt f p x) :
@@ -181,7 +177,6 @@ end deriv
 section fderiv
 
 variable {p : FormalMultilinearSeries 𝕜 E F} {r : ℝ≥0∞} {n : ℕ}
-
 variable {f : E → F} {x : E} {s : Set E}
 
 /-! The case of continuously polynomial functions. We get the same differentiability
@@ -275,7 +270,6 @@ end fderiv
 section deriv
 
 variable {p : FormalMultilinearSeries 𝕜 𝕜 F} {r : ℝ≥0∞}
-
 variable {f : 𝕜 → F} {x : 𝕜} {s : Set 𝕜}
 
 /-- If a function is polynomial on a set `s`, so is its derivative. -/
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
@@ -338,7 +338,7 @@ theorem changeOrigin_toFormalMultilinearSeries [DecidableEq ι] :
     intro ⟨s, hs⟩
     have h : sᶜ.card = 1 := by rw [card_compl, hs, Fintype.card_fin, Nat.add_sub_cancel]
     obtain ⟨a, ha⟩ := card_eq_one.mp h
-    refine ⟨a, Subtype.ext (compl_eq_comm.mp ha)⟩
+    exact ⟨a, Subtype.ext (compl_eq_comm.mp ha)⟩
   rw [Function.comp_apply, Subtype.coe_mk, compl_singleton, piecewise_erase_univ,
     toFormalMultilinearSeries, dif_pos (Nat.add_sub_of_le Fintype.card_pos).symm]
   simp_rw [domDomCongr_apply, compContinuousLinearMap_apply, ContinuousLinearMap.proj_apply,
chore: tidy various files (#10311)
Diff
@@ -378,8 +378,8 @@ theorem derivSeries_apply_diag (n : ℕ) (x : E) :
     coe_sum', Finset.sum_apply, continuousMultilinearCurryFin1_apply, Matrix.zero_empty]
   convert Finset.sum_const _
   · rw [Fin.snoc_zero, changeOriginSeriesTerm_apply, Finset.piecewise_same, add_comm]
-  · erw [← card, card_subtype, ← Finset.powersetCard_eq_filter, Finset.card_powersetCard, ← card,
-      card_fin, eq_comm, add_comm, Nat.choose_succ_self_right]
+  · rw [← card, card_subtype, ← Finset.powerset_univ, ← Finset.powersetCard_eq_filter,
+      Finset.card_powersetCard, ← card, card_fin, eq_comm, add_comm, Nat.choose_succ_self_right]
 
 end FormalMultilinearSeries
 
@@ -415,7 +415,7 @@ theorem factorial_smul (n : ℕ) :
     n ! • p n (fun _ ↦ y) = iteratedFDeriv 𝕜 n f x (fun _ ↦ y) := by
   cases n
   · rw [factorial_zero, one_smul, h.iteratedFDeriv_zero_apply_diag]
-  · erw [factorial_succ, mul_comm, mul_smul, ← derivSeries_apply_diag, ← smul_apply,
+  · rw [factorial_succ, mul_comm, mul_smul, ← derivSeries_apply_diag, ← smul_apply,
       factorial_smul'.{_,u,v} _ h.fderiv, iteratedFDeriv_succ_apply_right]
     rfl
 
feat: define ContinuousMultilinearMap.linearDeriv and show it's the fderiv (#9846)

Co-authored-by: Sophie Morel

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com> Co-authored-by: morel <smorel@math.princeton.edu>

Diff
@@ -291,6 +291,80 @@ theorem CPolynomialOn.iterated_deriv (h : CPolynomialOn 𝕜 f s) (n : ℕ) :
 
 end deriv
 
+namespace ContinuousMultilinearMap
+
+variable {ι : Type*} {E : ι → Type*} [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)]
+  [Fintype ι] (f : ContinuousMultilinearMap 𝕜 E F)
+
+open FormalMultilinearSeries
+
+protected theorem hasFiniteFPowerSeriesOnBall :
+    HasFiniteFPowerSeriesOnBall f f.toFormalMultilinearSeries 0 (Fintype.card ι + 1) ⊤ :=
+  .mk' (fun m hm ↦ dif_neg (Nat.succ_le_iff.mp hm).ne) ENNReal.zero_lt_top fun y _ ↦ by
+    rw [Finset.sum_eq_single_of_mem _ (Finset.self_mem_range_succ _), zero_add]
+    · rw [toFormalMultilinearSeries, dif_pos rfl]; rfl
+    · intro m _ ne; rw [toFormalMultilinearSeries, dif_neg ne.symm]; rfl
+
+theorem changeOriginSeries_support {k l : ℕ} (h : k + l ≠ Fintype.card ι) :
+    f.toFormalMultilinearSeries.changeOriginSeries k l = 0 :=
+  Finset.sum_eq_zero fun _ _ ↦ by
+    simp_rw [FormalMultilinearSeries.changeOriginSeriesTerm,
+      toFormalMultilinearSeries, dif_neg h.symm, LinearIsometryEquiv.map_zero]
+
+variable {n : ℕ∞} (x : ∀ i, E i)
+
+open Finset in
+theorem changeOrigin_toFormalMultilinearSeries [DecidableEq ι] :
+    continuousMultilinearCurryFin1 𝕜 (∀ i, E i) F (f.toFormalMultilinearSeries.changeOrigin x 1) =
+    f.linearDeriv x := by
+  ext y
+  rw [continuousMultilinearCurryFin1_apply, linearDeriv_apply,
+      changeOrigin, FormalMultilinearSeries.sum]
+  cases isEmpty_or_nonempty ι
+  · have (l) : 1 + l ≠ Fintype.card ι := by
+      rw [add_comm, Fintype.card_eq_zero]; exact Nat.succ_ne_zero _
+    simp_rw [Fintype.sum_empty, changeOriginSeries_support _ (this _), zero_apply _, tsum_zero]; rfl
+  rw [tsum_eq_single (Fintype.card ι - 1), changeOriginSeries]; swap
+  · intro m hm
+    rw [Ne, eq_tsub_iff_add_eq_of_le (by exact Fintype.card_pos), add_comm] at hm
+    rw [f.changeOriginSeries_support hm, zero_apply]
+  rw [sum_apply, ContinuousMultilinearMap.sum_apply, Fin.snoc_zero]
+  simp_rw [changeOriginSeriesTerm_apply]
+  refine (Fintype.sum_bijective (?_ ∘ Fintype.equivFinOfCardEq (Nat.add_sub_of_le
+    Fintype.card_pos).symm) (.comp ?_ <| Equiv.bijective _) _ _ fun i ↦ ?_).symm
+  · exact (⟨{·}ᶜ, by
+      rw [card_compl, Fintype.card_fin, card_singleton, Nat.add_sub_cancel_left]⟩)
+  · use fun _ _ ↦ (singleton_injective <| compl_injective <| Subtype.ext_iff.mp ·)
+    intro ⟨s, hs⟩
+    have h : sᶜ.card = 1 := by rw [card_compl, hs, Fintype.card_fin, Nat.add_sub_cancel]
+    obtain ⟨a, ha⟩ := card_eq_one.mp h
+    refine ⟨a, Subtype.ext (compl_eq_comm.mp ha)⟩
+  rw [Function.comp_apply, Subtype.coe_mk, compl_singleton, piecewise_erase_univ,
+    toFormalMultilinearSeries, dif_pos (Nat.add_sub_of_le Fintype.card_pos).symm]
+  simp_rw [domDomCongr_apply, compContinuousLinearMap_apply, ContinuousLinearMap.proj_apply,
+    Function.update_apply, (Equiv.injective _).eq_iff, ite_apply]
+  congr; ext j
+  obtain rfl | hj := eq_or_ne j i
+  · rw [Function.update_same, if_pos rfl]
+  · rw [Function.update_noteq hj, if_neg hj]
+
+protected theorem hasFDerivAt [DecidableEq ι] : HasFDerivAt f (f.linearDeriv x) x := by
+  rw [← changeOrigin_toFormalMultilinearSeries]
+  convert f.hasFiniteFPowerSeriesOnBall.hasFDerivAt (y := x) ENNReal.coe_lt_top
+  rw [zero_add]
+
+lemma cPolynomialAt : CPolynomialAt 𝕜 f x :=
+  f.hasFiniteFPowerSeriesOnBall.cPolynomialAt_of_mem
+    (by simp only [Metric.emetric_ball_top, Set.mem_univ])
+
+lemma cPolyomialOn : CPolynomialOn 𝕜 f ⊤ := fun x _ ↦ f.cPolynomialAt x
+
+lemma contDiffAt : ContDiffAt 𝕜 n f x := (f.cPolynomialAt x).contDiffAt
+
+lemma contDiff : ContDiff 𝕜 n f := contDiff_iff_contDiffAt.mpr f.contDiffAt
+
+end ContinuousMultilinearMap
+
 namespace FormalMultilinearSeries
 
 variable (p : FormalMultilinearSeries 𝕜 E F)
@@ -320,7 +394,7 @@ theorem iteratedFDeriv_zero_apply_diag : iteratedFDeriv 𝕜 0 f x = p 0 := by
   ext
   convert (h.hasSum <| EMetric.mem_ball_self h.r_pos).tsum_eq.symm
   · rw [iteratedFDeriv_zero_apply, add_zero]
-  · rw [tsum_eq_single 0 <| fun n hn ↦ by haveI := NeZero.mk hn; exact (p n).map_zero]
+  · rw [tsum_eq_single 0 fun n hn ↦ by haveI := NeZero.mk hn; exact (p n).map_zero]
     exact congr(p 0 $(Subsingleton.elim _ _))
 
 open ContinuousLinearMap
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
@@ -22,11 +22,13 @@ open Filter Asymptotics
 
 open scoped ENNReal
 
+universe u v
+
 variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
 
-variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
+variable {E : Type u} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
 
-variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
+variable {F : Type v} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
 
 section fderiv
 
@@ -87,9 +89,7 @@ theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOn
 
 /-- If a function has a power series on a ball, then so does its derivative. -/
 theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) :
-    HasFPowerSeriesOnBall (fderiv 𝕜 f)
-      ((continuousMultilinearCurryFin1 𝕜 E F : (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F)
-        |>.compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by
+    HasFPowerSeriesOnBall (fderiv 𝕜 f) p.derivSeries x r := by
   refine .congr (f := fun z ↦ continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin (z - x) 1)) ?_
     fun z hz ↦ ?_
   · refine continuousMultilinearCurryFin1 𝕜 E F
@@ -204,9 +204,7 @@ theorem HasFiniteFPowerSeriesOnBall.fderiv_eq (h : HasFiniteFPowerSeriesOnBall f
 /-- If a function has a finite power series on a ball, then so does its derivative. -/
 protected theorem HasFiniteFPowerSeriesOnBall.fderiv
     (h : HasFiniteFPowerSeriesOnBall f p x (n + 1) r) :
-    HasFiniteFPowerSeriesOnBall (fderiv 𝕜 f)
-      ((continuousMultilinearCurryFin1 𝕜 E F : (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F)
-        |>.compFormalMultilinearSeries (p.changeOriginSeries 1)) x n r := by
+    HasFiniteFPowerSeriesOnBall (fderiv 𝕜 f) p.derivSeries x n r := by
   refine .congr (f := fun z ↦ continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin (z - x) 1)) ?_
     fun z hz ↦ ?_
   · refine continuousMultilinearCurryFin1 𝕜 E F
@@ -221,9 +219,7 @@ protected theorem HasFiniteFPowerSeriesOnBall.fderiv
 This is a variant of `HasFiniteFPowerSeriesOnBall.fderiv` where the degree of `f` is `< n`
 and not `< n + 1`. -/
 theorem HasFiniteFPowerSeriesOnBall.fderiv' (h : HasFiniteFPowerSeriesOnBall f p x n r) :
-    HasFiniteFPowerSeriesOnBall (fderiv 𝕜 f)
-      ((continuousMultilinearCurryFin1 𝕜 E F : (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F)
-        |>.compFormalMultilinearSeries (p.changeOriginSeries 1)) x (n - 1) r := by
+    HasFiniteFPowerSeriesOnBall (fderiv 𝕜 f) p.derivSeries x (n - 1) r := by
   obtain rfl | hn := eq_or_ne n 0
   · rw [zero_tsub]
     refine HasFiniteFPowerSeriesOnBall.bound_zero_of_eq_zero (fun y hy ↦ ?_) h.r_pos fun n ↦ ?_
@@ -294,3 +290,65 @@ theorem CPolynomialOn.iterated_deriv (h : CPolynomialOn 𝕜 f s) (n : ℕ) :
   · simpa only [Function.iterate_succ', Function.comp_apply] using IH.deriv
 
 end deriv
+
+namespace FormalMultilinearSeries
+
+variable (p : FormalMultilinearSeries 𝕜 E F)
+
+open Fintype ContinuousLinearMap in
+theorem derivSeries_apply_diag (n : ℕ) (x : E) :
+    derivSeries p n (fun _ ↦ x) x = (n + 1) • p (n + 1) fun _ ↦ x := by
+  simp only [derivSeries, strongUniformity_topology_eq, compFormalMultilinearSeries_apply,
+    changeOriginSeries, compContinuousMultilinearMap_coe, ContinuousLinearEquiv.coe_coe,
+    LinearIsometryEquiv.coe_coe, Function.comp_apply, ContinuousMultilinearMap.sum_apply, map_sum,
+    coe_sum', Finset.sum_apply, continuousMultilinearCurryFin1_apply, Matrix.zero_empty]
+  convert Finset.sum_const _
+  · rw [Fin.snoc_zero, changeOriginSeriesTerm_apply, Finset.piecewise_same, add_comm]
+  · erw [← card, card_subtype, ← Finset.powersetCard_eq_filter, Finset.card_powersetCard, ← card,
+      card_fin, eq_comm, add_comm, Nat.choose_succ_self_right]
+
+end FormalMultilinearSeries
+
+namespace HasFPowerSeriesOnBall
+
+open FormalMultilinearSeries ENNReal Nat
+
+variable {p : FormalMultilinearSeries 𝕜 E F} {f : E → F} {x : E} {r : ℝ≥0∞}
+  (h : HasFPowerSeriesOnBall f p x r) (y : E)
+
+theorem iteratedFDeriv_zero_apply_diag : iteratedFDeriv 𝕜 0 f x = p 0 := by
+  ext
+  convert (h.hasSum <| EMetric.mem_ball_self h.r_pos).tsum_eq.symm
+  · rw [iteratedFDeriv_zero_apply, add_zero]
+  · rw [tsum_eq_single 0 <| fun n hn ↦ by haveI := NeZero.mk hn; exact (p n).map_zero]
+    exact congr(p 0 $(Subsingleton.elim _ _))
+
+open ContinuousLinearMap
+
+private theorem factorial_smul' {n : ℕ} : ∀ {F : Type max u v} [NormedAddCommGroup F]
+    [NormedSpace 𝕜 F] [CompleteSpace F] {p : FormalMultilinearSeries 𝕜 E F}
+    {f : E → F}, HasFPowerSeriesOnBall f p x r →
+    n ! • p n (fun _ ↦ y) = iteratedFDeriv 𝕜 n f x (fun _ ↦ y) := by
+  induction' n with n ih <;> intro F _ _ _ p f h
+  · rw [factorial_zero, one_smul, h.iteratedFDeriv_zero_apply_diag]
+  · rw [factorial_succ, mul_comm, mul_smul, ← derivSeries_apply_diag, ← smul_apply,
+      ih h.fderiv, iteratedFDeriv_succ_apply_right]
+    rfl
+
+variable [CompleteSpace F]
+
+theorem factorial_smul (n : ℕ) :
+    n ! • p n (fun _ ↦ y) = iteratedFDeriv 𝕜 n f x (fun _ ↦ y) := by
+  cases n
+  · rw [factorial_zero, one_smul, h.iteratedFDeriv_zero_apply_diag]
+  · erw [factorial_succ, mul_comm, mul_smul, ← derivSeries_apply_diag, ← smul_apply,
+      factorial_smul'.{_,u,v} _ h.fderiv, iteratedFDeriv_succ_apply_right]
+    rfl
+
+theorem hasSum_iteratedFDeriv [CharZero 𝕜] {y : E} (hy : y ∈ EMetric.ball 0 r) :
+    HasSum (fun n ↦ (n ! : 𝕜)⁻¹ • iteratedFDeriv 𝕜 n f x fun _ ↦ y) (f (x + y)) := by
+  convert h.hasSum hy with n
+  rw [← h.factorial_smul y n, smul_comm, ← smul_assoc, nsmul_eq_mul,
+    mul_inv_cancel <| cast_ne_zero.mpr n.factorial_ne_zero, one_smul]
+
+end HasFPowerSeriesOnBall
chore: tidy various files (#9728)
Diff
@@ -119,7 +119,7 @@ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n
     -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined.
     convert ContinuousLinearMap.comp_analyticOn ?g IH.fderiv
     case g => exact ↑(continuousMultilinearCurryLeftEquiv 𝕜 (fun _ : Fin (n + 1) ↦ E) F)
-    rfl
+    simp
 #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv
 
 /-- An analytic function is infinitely differentiable. -/
@@ -254,7 +254,7 @@ theorem CPolynomialOn.iteratedFDeriv (h : CPolynomialOn 𝕜 f s) (n : ℕ) :
   · rw [iteratedFDeriv_succ_eq_comp_left]
     convert ContinuousLinearMap.comp_cPolynomialOn ?g IH.fderiv
     case g => exact ↑(continuousMultilinearCurryLeftEquiv 𝕜 (fun _ : Fin (n + 1) ↦ E) F)
-    rfl
+    simp
 
 /-- A polynomial function is infinitely differentiable. -/
 theorem CPolynomialOn.contDiffOn (h : CPolynomialOn 𝕜 f s) {n : ℕ∞} :
feat(Mathlib/Analysis/Analytic): continuously polynomial functions (#9269)

This defines "continuously polynomial" (shortened to "cpolynomial") functions as a special cases of analytic functions: they are the functions that admit a development as a finite formal multilinear series. Then we prove their basic properties. The point of doing is this is that finite series are always summable, so we can remove the completeness assumptions in some results about analytic functions (differentiability for example). Examples of continuously polynomial functions include continuous multilinear maps, and functions defined by polynomials.

Co-authored-by: smorel394 <67864981+smorel394@users.noreply.github.com> Co-authored-by: morel <smorel@math.princeton.edu>

Diff
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
 -/
 import Mathlib.Analysis.Analytic.Basic
+import Mathlib.Analysis.Analytic.CPolynomial
 import Mathlib.Analysis.Calculus.Deriv.Basic
 import Mathlib.Analysis.Calculus.ContDiff.Defs
 
@@ -87,32 +88,17 @@ theorem HasFPowerSeriesOnBall.fderiv_eq [CompleteSpace F] (h : HasFPowerSeriesOn
 /-- If a function has a power series on a ball, then so does its derivative. -/
 theorem HasFPowerSeriesOnBall.fderiv [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r) :
     HasFPowerSeriesOnBall (fderiv 𝕜 f)
-      ((continuousMultilinearCurryFin1 𝕜 E F :
-            (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F).compFormalMultilinearSeries
-        (p.changeOriginSeries 1))
-      x r := by
-  suffices A :
-    HasFPowerSeriesOnBall
-      (fun z => continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin (z - x) 1))
-      ((continuousMultilinearCurryFin1 𝕜 E F :
-            (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F).compFormalMultilinearSeries
-        (p.changeOriginSeries 1))
-      x r
-  · apply A.congr
-    intro z hz
-    dsimp
-    rw [← h.fderiv_eq, add_sub_cancel'_right]
-    simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
-  suffices B :
-    HasFPowerSeriesOnBall (fun z => p.changeOrigin (z - x) 1) (p.changeOriginSeries 1) x r
-  exact
-    (continuousMultilinearCurryFin1 𝕜 E
-              F).toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall
-      B
-  simpa using
-    ((p.hasFPowerSeriesOnBall_changeOrigin 1 (h.r_pos.trans_le h.r_le)).mono h.r_pos
-          h.r_le).comp_sub
-      x
+      ((continuousMultilinearCurryFin1 𝕜 E F : (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F)
+        |>.compFormalMultilinearSeries (p.changeOriginSeries 1)) x r := by
+  refine .congr (f := fun z ↦ continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin (z - x) 1)) ?_
+    fun z hz ↦ ?_
+  · refine continuousMultilinearCurryFin1 𝕜 E F
+      |>.toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFPowerSeriesOnBall ?_
+    simpa using ((p.hasFPowerSeriesOnBall_changeOrigin 1
+      (h.r_pos.trans_le h.r_le)).mono h.r_pos h.r_le).comp_sub x
+  dsimp only
+  rw [← h.fderiv_eq, add_sub_cancel'_right]
+  simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
 #align has_fpower_series_on_ball.fderiv HasFPowerSeriesOnBall.fderiv
 
 /-- If a function is analytic on a set `s`, so is its Fréchet derivative. -/
@@ -131,31 +117,23 @@ theorem AnalyticOn.iteratedFDeriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n
     exact ((continuousMultilinearCurryFin0 𝕜 E F).symm : F →L[𝕜] E[×0]→L[𝕜] F).comp_analyticOn h
   · rw [iteratedFDeriv_succ_eq_comp_left]
     -- Porting note: for reasons that I do not understand at all, `?g` cannot be inlined.
-    convert @ContinuousLinearMap.comp_analyticOn 𝕜 E
-      ?_ (ContinuousMultilinearMap 𝕜 (fun _ : Fin (n + 1) ↦ E) F)
-      ?_ ?_ ?_ ?_ ?_ ?_ ?_ ?_
-      s ?g IH.fderiv
-    case g =>
-      exact ↑(continuousMultilinearCurryLeftEquiv 𝕜 (fun _ : Fin (n + 1) => E) F)
+    convert ContinuousLinearMap.comp_analyticOn ?g IH.fderiv
+    case g => exact ↑(continuousMultilinearCurryLeftEquiv 𝕜 (fun _ : Fin (n + 1) ↦ E) F)
     rfl
 #align analytic_on.iterated_fderiv AnalyticOn.iteratedFDeriv
 
 /-- An analytic function is infinitely differentiable. -/
 theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : ℕ∞} :
-    ContDiffOn 𝕜 n f s := by
+    ContDiffOn 𝕜 n f s :=
   let t := { x | AnalyticAt 𝕜 f x }
-  suffices : ContDiffOn 𝕜 n f t; exact this.mono h
-  have H : AnalyticOn 𝕜 f t := fun x hx => hx
+  suffices ContDiffOn 𝕜 n f t from this.mono h
+  have H : AnalyticOn 𝕜 f t := fun _x hx ↦ hx
   have t_open : IsOpen t := isOpen_analyticAt 𝕜 f
-  apply contDiffOn_of_continuousOn_differentiableOn
-  · rintro m -
-    apply (H.iteratedFDeriv m).continuousOn.congr
-    intro x hx
-    exact iteratedFDerivWithin_of_isOpen _ t_open hx
-  · rintro m -
-    apply (H.iteratedFDeriv m).differentiableOn.congr
-    intro x hx
-    exact iteratedFDerivWithin_of_isOpen _ t_open hx
+  contDiffOn_of_continuousOn_differentiableOn
+    (fun m _ ↦ (H.iteratedFDeriv m).continuousOn.congr
+      fun  _ hx ↦ iteratedFDerivWithin_of_isOpen _ t_open hx)
+    (fun m _ ↦ (H.iteratedFDeriv m).differentiableOn.congr
+      fun _ hx ↦ iteratedFDerivWithin_of_isOpen _ t_open hx)
 #align analytic_on.cont_diff_on AnalyticOn.contDiffOn
 
 theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt 𝕜 f x) {n : ℕ∞} :
@@ -200,3 +178,119 @@ theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n
 #align analytic_on.iterated_deriv AnalyticOn.iterated_deriv
 
 end deriv
+section fderiv
+
+variable {p : FormalMultilinearSeries 𝕜 E F} {r : ℝ≥0∞} {n : ℕ}
+
+variable {f : E → F} {x : E} {s : Set E}
+
+/-! The case of continuously polynomial functions. We get the same differentiability
+results as for analytic functions, but without the assumptions that `F` is complete.-/
+
+theorem HasFiniteFPowerSeriesOnBall.differentiableOn
+    (h : HasFiniteFPowerSeriesOnBall f p x n r) : DifferentiableOn 𝕜 f (EMetric.ball x r) :=
+  fun _ hy ↦ (h.cPolynomialAt_of_mem hy).analyticAt.differentiableWithinAt
+
+theorem HasFiniteFPowerSeriesOnBall.hasFDerivAt (h : HasFiniteFPowerSeriesOnBall f p x n r)
+    {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
+    HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)) (x + y) :=
+  (h.changeOrigin hy).toHasFPowerSeriesOnBall.hasFPowerSeriesAt.hasFDerivAt
+
+theorem HasFiniteFPowerSeriesOnBall.fderiv_eq (h : HasFiniteFPowerSeriesOnBall f p x n r)
+    {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
+    fderiv 𝕜 f (x + y) = continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1) :=
+  (h.hasFDerivAt hy).fderiv
+
+/-- If a function has a finite power series on a ball, then so does its derivative. -/
+protected theorem HasFiniteFPowerSeriesOnBall.fderiv
+    (h : HasFiniteFPowerSeriesOnBall f p x (n + 1) r) :
+    HasFiniteFPowerSeriesOnBall (fderiv 𝕜 f)
+      ((continuousMultilinearCurryFin1 𝕜 E F : (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F)
+        |>.compFormalMultilinearSeries (p.changeOriginSeries 1)) x n r := by
+  refine .congr (f := fun z ↦ continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin (z - x) 1)) ?_
+    fun z hz ↦ ?_
+  · refine continuousMultilinearCurryFin1 𝕜 E F
+      |>.toContinuousLinearEquiv.toContinuousLinearMap.comp_hasFiniteFPowerSeriesOnBall ?_
+    simpa using
+      ((p.hasFiniteFPowerSeriesOnBall_changeOrigin 1 h.finite).mono h.r_pos le_top).comp_sub x
+  dsimp only
+  rw [← h.fderiv_eq, add_sub_cancel'_right]
+  simpa only [edist_eq_coe_nnnorm_sub, EMetric.mem_ball] using hz
+
+/-- If a function has a finite power series on a ball, then so does its derivative.
+This is a variant of `HasFiniteFPowerSeriesOnBall.fderiv` where the degree of `f` is `< n`
+and not `< n + 1`. -/
+theorem HasFiniteFPowerSeriesOnBall.fderiv' (h : HasFiniteFPowerSeriesOnBall f p x n r) :
+    HasFiniteFPowerSeriesOnBall (fderiv 𝕜 f)
+      ((continuousMultilinearCurryFin1 𝕜 E F : (E[×1]→L[𝕜] F) →L[𝕜] E →L[𝕜] F)
+        |>.compFormalMultilinearSeries (p.changeOriginSeries 1)) x (n - 1) r := by
+  obtain rfl | hn := eq_or_ne n 0
+  · rw [zero_tsub]
+    refine HasFiniteFPowerSeriesOnBall.bound_zero_of_eq_zero (fun y hy ↦ ?_) h.r_pos fun n ↦ ?_
+    · rw [Filter.EventuallyEq.fderiv_eq (f := fun _ ↦ 0)]
+      · rw [fderiv_const, Pi.zero_apply]
+      · exact Filter.eventuallyEq_iff_exists_mem.mpr ⟨EMetric.ball x r,
+          EMetric.isOpen_ball.mem_nhds hy, fun z hz ↦ by rw [h.eq_zero_of_bound_zero z hz]⟩
+    · apply ContinuousMultilinearMap.ext; intro a
+      change (continuousMultilinearCurryFin1 𝕜 E F) (p.changeOriginSeries 1 n a) = 0
+      rw [p.changeOriginSeries_finite_of_finite h.finite 1 (Nat.zero_le _)]
+      exact map_zero _
+  · rw [← Nat.succ_pred hn] at h
+    exact h.fderiv
+
+/-- If a function is polynomial on a set `s`, so is its Fréchet derivative. -/
+theorem CPolynomialOn.fderiv (h : CPolynomialOn 𝕜 f s) :
+    CPolynomialOn 𝕜 (fderiv 𝕜 f) s := by
+  intro y hy
+  rcases h y hy with ⟨p, r, n, hp⟩
+  exact hp.fderiv'.cPolynomialAt
+
+/-- If a function is polynomial on a set `s`, so are its successive Fréchet derivative. -/
+theorem CPolynomialOn.iteratedFDeriv (h : CPolynomialOn 𝕜 f s) (n : ℕ) :
+    CPolynomialOn 𝕜 (iteratedFDeriv 𝕜 n f) s := by
+  induction' n with n IH
+  · rw [iteratedFDeriv_zero_eq_comp]
+    exact ((continuousMultilinearCurryFin0 𝕜 E F).symm : F →L[𝕜] E[×0]→L[𝕜] F).comp_cPolynomialOn h
+  · rw [iteratedFDeriv_succ_eq_comp_left]
+    convert ContinuousLinearMap.comp_cPolynomialOn ?g IH.fderiv
+    case g => exact ↑(continuousMultilinearCurryLeftEquiv 𝕜 (fun _ : Fin (n + 1) ↦ E) F)
+    rfl
+
+/-- A polynomial function is infinitely differentiable. -/
+theorem CPolynomialOn.contDiffOn (h : CPolynomialOn 𝕜 f s) {n : ℕ∞} :
+    ContDiffOn 𝕜 n f s :=
+  let t := { x | CPolynomialAt 𝕜 f x }
+  suffices ContDiffOn 𝕜 n f t from this.mono h
+  have H : CPolynomialOn 𝕜 f t := fun _x hx ↦ hx
+  have t_open : IsOpen t := isOpen_cPolynomialAt 𝕜 f
+  contDiffOn_of_continuousOn_differentiableOn
+    (fun m _ ↦ (H.iteratedFDeriv m).continuousOn.congr
+      fun  _ hx ↦ iteratedFDerivWithin_of_isOpen _ t_open hx)
+    (fun m _ ↦ (H.iteratedFDeriv m).analyticOn.differentiableOn.congr
+      fun _ hx ↦ iteratedFDerivWithin_of_isOpen _ t_open hx)
+
+theorem CPolynomialAt.contDiffAt (h : CPolynomialAt 𝕜 f x) {n : ℕ∞} :
+    ContDiffAt 𝕜 n f x :=
+  let ⟨_, hs, hf⟩ := h.exists_mem_nhds_cPolynomialOn
+  hf.contDiffOn.contDiffAt hs
+
+end fderiv
+
+section deriv
+
+variable {p : FormalMultilinearSeries 𝕜 𝕜 F} {r : ℝ≥0∞}
+
+variable {f : 𝕜 → F} {x : 𝕜} {s : Set 𝕜}
+
+/-- If a function is polynomial on a set `s`, so is its derivative. -/
+protected theorem CPolynomialOn.deriv (h : CPolynomialOn 𝕜 f s) : CPolynomialOn 𝕜 (deriv f) s :=
+  (ContinuousLinearMap.apply 𝕜 F (1 : 𝕜)).comp_cPolynomialOn h.fderiv
+
+/-- If a function is polynomial on a set `s`, so are its successive derivatives. -/
+theorem CPolynomialOn.iterated_deriv (h : CPolynomialOn 𝕜 f s) (n : ℕ) :
+    CPolynomialOn 𝕜 (deriv^[n] f) s := by
+  induction' n with n IH
+  · exact h
+  · simpa only [Function.iterate_succ', Function.comp_apply] using IH.deriv
+
+end deriv
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
@@ -5,7 +5,7 @@ Authors: Yury Kudryashov
 -/
 import Mathlib.Analysis.Analytic.Basic
 import Mathlib.Analysis.Calculus.Deriv.Basic
-import Mathlib.Analysis.Calculus.ContDiffDef
+import Mathlib.Analysis.Calculus.ContDiff.Defs
 
 #align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
 
chore: banish Type _ and Sort _ (#6499)

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

This has nice performance benefits.

Diff
@@ -21,11 +21,11 @@ open Filter Asymptotics
 
 open scoped ENNReal
 
-variable {𝕜 : Type _} [NontriviallyNormedField 𝕜]
+variable {𝕜 : Type*} [NontriviallyNormedField 𝕜]
 
-variable {E : Type _} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
+variable {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E]
 
-variable {F : Type _} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
+variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F]
 
 section fderiv
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

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

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Yury Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury Kudryashov
-
-! This file was ported from Lean 3 source module analysis.calculus.fderiv_analytic
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.Analytic.Basic
 import Mathlib.Analysis.Calculus.Deriv.Basic
 import Mathlib.Analysis.Calculus.ContDiffDef
 
+#align_import analysis.calculus.fderiv_analytic from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
 /-!
 # Frechet derivatives of analytic functions.
 
feat: complex differentiable functions are continuously differentiable (#5629)
Diff
@@ -161,6 +161,11 @@ theorem AnalyticOn.contDiffOn [CompleteSpace F] (h : AnalyticOn 𝕜 f s) {n : 
     exact iteratedFDerivWithin_of_isOpen _ t_open hx
 #align analytic_on.cont_diff_on AnalyticOn.contDiffOn
 
+theorem AnalyticAt.contDiffAt [CompleteSpace F] (h : AnalyticAt 𝕜 f x) {n : ℕ∞} :
+    ContDiffAt 𝕜 n f x := by
+  obtain ⟨s, hs, hf⟩ := h.exists_mem_nhds_analyticOn
+  exact hf.contDiffOn.contDiffAt hs
+
 end fderiv
 
 section deriv
fix precedence of Nat.iterate (#5589)
Diff
@@ -191,7 +191,7 @@ theorem AnalyticOn.deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) : AnalyticO
 
 /-- If a function is analytic on a set `s`, so are its successive derivatives. -/
 theorem AnalyticOn.iterated_deriv [CompleteSpace F] (h : AnalyticOn 𝕜 f s) (n : ℕ) :
-    AnalyticOn 𝕜 ((_root_.deriv^[n]) f) s := by
+    AnalyticOn 𝕜 (_root_.deriv^[n] f) s := by
   induction' n with n IH
   · exact h
   · simpa only [Function.iterate_succ', Function.comp_apply] using IH.deriv
feat: port Analysis.Calculus.FDerivAnalytic (#4568)

Co-authored-by: Johan Commelin <johan@commelin.net>

Dependencies 10 + 686

687 files ported (98.6%)
306733 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