doc-next-gen

Mathlib.Analysis.Analytic.Basic

Module docstring

{"# Analytic functions

A function is analytic in one dimension around 0 if it can be written as a converging power series Σ pₙ zⁿ. This definition can be extended to any dimension (even in infinite dimension) by requiring that pₙ is a continuous n-multilinear map. In general, pₙ is not unique (in two dimensions, taking p₂ (x, y) (x', y') = x y' or y x' gives the same map when applied to a vector (x, y) (x, y)). A way to guarantee uniqueness is to take a symmetric pₙ, but this is not always possible in nonzero characteristic (in characteristic 2, the previous example has no symmetric representative). Therefore, we do not insist on symmetry or uniqueness in the definition, and we only require the existence of a converging series.

The general framework is important to say that the exponential map on bounded operators on a Banach space is analytic, as well as the inverse on invertible operators.

Main definitions

Let p be a formal multilinear series from E to F, i.e., p n is a multilinear map on E^n for n : ℕ.

  • p.radius: the largest r : ℝ≥0∞ such that ‖p n‖ * r^n grows subexponentially.
  • p.le_radius_of_bound, p.le_radius_of_bound_nnreal, p.le_radius_of_isBigO: if ‖p n‖ * r ^ n is bounded above, then r ≤ p.radius;
  • p.isLittleO_of_lt_radius, p.norm_mul_pow_le_mul_pow_of_lt_radius, p.isLittleO_one_of_lt_radius, p.norm_mul_pow_le_of_lt_radius, p.nnnorm_mul_pow_le_of_lt_radius: if r < p.radius, then ‖p n‖ * r ^ n tends to zero exponentially;
  • p.lt_radius_of_isBigO: if r ≠ 0 and ‖p n‖ * r ^ n = O(a ^ n) for some -1 < a < 1, then r < p.radius;
  • p.partialSum n x: the sum ∑_{i = 0}^{n-1} pᵢ xⁱ.
  • p.sum x: the sum ∑'_{i = 0}^{∞} pᵢ xⁱ.

Additionally, let f be a function from E to F.

  • HasFPowerSeriesOnBall f p x r: on the ball of center x with radius r, f (x + y) = ∑'_n pₙ yⁿ.
  • HasFPowerSeriesAt f p x: on some ball of center x with positive radius, holds HasFPowerSeriesOnBall f p x r.
  • AnalyticAt 𝕜 f x: there exists a power series p such that holds HasFPowerSeriesAt f p x.
  • AnalyticOnNhd 𝕜 f s: the function f is analytic at every point of s.

We also define versions of HasFPowerSeriesOnBall, AnalyticAt, and AnalyticOnNhd restricted to a set, similar to ContinuousWithinAt. See Mathlib.Analysis.Analytic.Within for basic properties.

  • AnalyticWithinAt 𝕜 f s x means a power series at x converges to f on 𝓝[s ∪ {x}] x.
  • AnalyticOn 𝕜 f s t means ∀ x ∈ t, AnalyticWithinAt 𝕜 f s x.

We develop the basic properties of these notions, notably: * If a function admits a power series, it is continuous (see HasFPowerSeriesOnBall.continuousOn and HasFPowerSeriesAt.continuousAt and AnalyticAt.continuousAt). * In a complete space, the sum of a formal power series with positive radius is well defined on the disk of convergence, see FormalMultilinearSeries.hasFPowerSeriesOnBall.

Implementation details

We only introduce the radius of convergence of a power series, as p.radius. For a power series in finitely many dimensions, there is a finer (directional, coordinate-dependent) notion, describing the polydisk of convergence. This notion is more specific, and not necessary to build the general theory. We do not define it here. ","### The radius of a formal multilinear series ","### Expanding a function as a power series ","### HasFPowerSeriesOnBall and HasFPowerSeriesWithinOnBall ","### Analytic functions ","### Composition with linear maps ","### Relation between analytic function and the partial sums of its power series "}

FormalMultilinearSeries.sum definition
(p : FormalMultilinearSeries 𝕜 E F) (x : E) : F
Full source
/-- Given a formal multilinear series `p` and a vector `x`, then `p.sum x` is the sum `Σ pₙ xⁿ`. A
priori, it only behaves well when `‖x‖ < p.radius`. -/
protected def sum (p : FormalMultilinearSeries 𝕜 E F) (x : E) : F :=
  ∑' n : ℕ, p n fun _ => x
Sum of a formal multilinear series
Informal description
Given a formal multilinear series \( p \) from \( E \) to \( F \) and a vector \( x \in E \), the sum \( p.\text{sum} \, x \) is defined as the infinite series \( \sum_{n=0}^\infty p_n (x, \dots, x) \), where \( p_n \) is the \( n \)-th multilinear map in the series \( p \). This sum is well-defined when \( \|x\| < p.\text{radius} \), ensuring convergence.
FormalMultilinearSeries.partialSum definition
(p : FormalMultilinearSeries 𝕜 E F) (n : ℕ) (x : E) : F
Full source
/-- Given a formal multilinear series `p` and a vector `x`, then `p.partialSum n x` is the sum
`Σ pₖ xᵏ` for `k ∈ {0,..., n-1}`. -/
def partialSum (p : FormalMultilinearSeries 𝕜 E F) (n : ) (x : E) : F :=
  ∑ k ∈ Finset.range n, p k fun _ : Fin k => x
Partial sum of a formal multilinear series
Informal description
Given a formal multilinear series \( p \) from \( E \) to \( F \) and a vector \( x \in E \), the partial sum \( p.\text{partialSum} \, n \, x \) is defined as the finite sum \( \sum_{k=0}^{n-1} p_k (x, \dots, x) \), where \( p_k \) is the \( k \)-th multilinear map in the series \( p \).
FormalMultilinearSeries.partialSum_continuous theorem
(p : FormalMultilinearSeries 𝕜 E F) (n : ℕ) : Continuous (p.partialSum n)
Full source
/-- The partial sums of a formal multilinear series are continuous. -/
theorem partialSum_continuous (p : FormalMultilinearSeries 𝕜 E F) (n : ) :
    Continuous (p.partialSum n) := by
  unfold partialSum
  fun_prop
Continuity of Partial Sums of a Formal Multilinear Series
Informal description
For any formal multilinear series \( p \) from \( E \) to \( F \) and any natural number \( n \), the partial sum function \( x \mapsto \sum_{k=0}^{n-1} p_k (x, \dots, x) \) is continuous on \( E \).
FormalMultilinearSeries.radius definition
(p : FormalMultilinearSeries 𝕜 E F) : ℝ≥0∞
Full source
/-- The radius of a formal multilinear series is the largest `r` such that the sum `Σ ‖pₙ‖ ‖y‖ⁿ`
converges for all `‖y‖ < r`. This implies that `Σ pₙ yⁿ` converges for all `‖y‖ < r`, but these
definitions are *not* equivalent in general. -/
def radius (p : FormalMultilinearSeries 𝕜 E F) : ℝ≥0∞ :=
  ⨆ (r : ℝ≥0) (C : ℝ) (_ : ∀ n, ‖p n‖ * (r : ℝ) ^ n ≤ C), (r : ℝ≥0∞)
Radius of convergence of a formal multilinear series
Informal description
The radius of convergence of a formal multilinear series \( p \) is the supremum of all nonnegative real numbers \( r \) for which there exists a constant \( C \) such that for every \( n \), the norm \( \|p_n\| \cdot r^n \) is bounded by \( C \). Here, \( p_n \) denotes the \( n \)-th multilinear map in the series \( p \).
FormalMultilinearSeries.le_radius_of_bound theorem
(C : ℝ) {r : ℝ≥0} (h : ∀ n : ℕ, ‖p n‖ * (r : ℝ) ^ n ≤ C) : (r : ℝ≥0∞) ≤ p.radius
Full source
/-- If `‖pₙ‖ rⁿ` is bounded in `n`, then the radius of `p` is at least `r`. -/
theorem le_radius_of_bound (C : ) {r : ℝ≥0} (h : ∀ n : , ‖p n‖ * (r : ) ^ n ≤ C) :
    (r : ℝ≥0∞) ≤ p.radius :=
  le_iSup_of_le r <| le_iSup_of_le C <| le_iSup (fun _ => (r : ℝ≥0∞)) h
Lower Bound on Radius of Convergence via Uniform Boundedness
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$. If there exists a constant $C \in \mathbb{R}$ and a nonnegative real number $r$ such that for every natural number $n$, the norm $\|p_n\| \cdot r^n \leq C$, then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.le_radius_of_bound_nnreal theorem
(C : ℝ≥0) {r : ℝ≥0} (h : ∀ n : ℕ, ‖p n‖₊ * r ^ n ≤ C) : (r : ℝ≥0∞) ≤ p.radius
Full source
/-- If `‖pₙ‖ rⁿ` is bounded in `n`, then the radius of `p` is at least `r`. -/
theorem le_radius_of_bound_nnreal (C : ℝ≥0) {r : ℝ≥0} (h : ∀ n : , ‖p n‖₊ * r ^ n ≤ C) :
    (r : ℝ≥0∞) ≤ p.radius :=
  p.le_radius_of_bound C fun n => mod_cast h n
Lower Bound on Radius of Convergence via Nonnegative Uniform Boundedness
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$. If there exists a nonnegative real constant $C$ and a nonnegative real number $r$ such that for every natural number $n$, the norm $\|p_n\| \cdot r^n \leq C$, then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.le_radius_of_isBigO theorem
(h : (fun n => ‖p n‖ * (r : ℝ) ^ n) =O[atTop] fun _ => (1 : ℝ)) : ↑r ≤ p.radius
Full source
/-- If `‖pₙ‖ rⁿ = O(1)`, as `n → ∞`, then the radius of `p` is at least `r`. -/
theorem le_radius_of_isBigO (h : (fun n => ‖p n‖ * (r : ℝ) ^ n) =O[atTop] fun _ => (1 : ℝ)) :
    ↑r ≤ p.radius :=
  Exists.elim (isBigO_one_nat_atTop_iff.1 h) fun C hC =>
    p.le_radius_of_bound C fun n => (le_abs_self _).trans (hC n)
Lower Bound on Radius of Convergence via Big-O Condition
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ and let $r \geq 0$. If the sequence $\|p_n\| \cdot r^n$ is bounded (i.e., $\|p_n\| r^n = O(1)$ as $n \to \infty$), then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.le_radius_of_eventually_le theorem
(C) (h : ∀ᶠ n in atTop, ‖p n‖ * (r : ℝ) ^ n ≤ C) : ↑r ≤ p.radius
Full source
theorem le_radius_of_eventually_le (C) (h : ∀ᶠ n in atTop, ‖p n‖ * (r : ℝ) ^ n ≤ C) :
    ↑r ≤ p.radius :=
  p.le_radius_of_isBigO <| IsBigO.of_bound C <| h.mono fun n hn => by simpa
Lower Bound on Radius of Convergence via Eventual Boundedness
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ and let $r \geq 0$. If there exists a constant $C$ such that for all sufficiently large $n$, the norms satisfy $\|p_n\| \cdot r^n \leq C$, then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.le_radius_of_summable_nnnorm theorem
(h : Summable fun n => ‖p n‖₊ * r ^ n) : ↑r ≤ p.radius
Full source
theorem le_radius_of_summable_nnnorm (h : Summable fun n => ‖p n‖₊ * r ^ n) : ↑r ≤ p.radius :=
  p.le_radius_of_bound_nnreal (∑' n, ‖p n‖₊ * r ^ n) fun _ => h.le_tsum' _
Lower Bound on Radius of Convergence via Summability of Norms
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ and let $r \geq 0$. If the series $\sum_{n=0}^\infty \|p_n\| \cdot r^n$ is summable, then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.le_radius_of_summable theorem
(h : Summable fun n => ‖p n‖ * (r : ℝ) ^ n) : ↑r ≤ p.radius
Full source
theorem le_radius_of_summable (h : Summable fun n => ‖p n‖ * (r : ) ^ n) : ↑r ≤ p.radius :=
  p.le_radius_of_summable_nnnorm <| by
    simp only [← coe_nnnorm] at h
    exact mod_cast h
Lower Bound on Radius of Convergence via Summability of Norms
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ and let $r \geq 0$. If the series $\sum_{n=0}^\infty \|p_n\| \cdot r^n$ is summable, then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO theorem
(h : ∀ r : ℝ≥0, (fun n => ‖p n‖ * (r : ℝ) ^ n) =O[atTop] fun _ => (1 : ℝ)) : p.radius = ∞
Full source
theorem radius_eq_top_of_forall_nnreal_isBigO
    (h : ∀ r : ℝ≥0, (fun n => ‖p n‖ * (r : ℝ) ^ n) =O[atTop] fun _ => (1 : ℝ)) : p.radius =  :=
  ENNReal.eq_top_of_forall_nnreal_le fun r => p.le_radius_of_isBigO (h r)
Infinite Radius of Convergence under Uniform Big-O Condition
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$. If for every nonnegative real number $r$, the sequence $\|p_n\| \cdot r^n$ is bounded (i.e., $\|p_n\| r^n = O(1)$ as $n \to \infty$), then the radius of convergence of $p$ is infinite, i.e., $p.\text{radius} = \infty$.
FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero theorem
(h : ∀ᶠ n in atTop, p n = 0) : p.radius = ∞
Full source
theorem radius_eq_top_of_eventually_eq_zero (h : ∀ᶠ n in atTop, p n = 0) : p.radius =  :=
  p.radius_eq_top_of_forall_nnreal_isBigO fun r =>
    (isBigO_zero _ _).congr' (h.mono fun n hn => by simp [hn]) EventuallyEq.rfl
Infinite Radius of Convergence for Eventually Zero Series
Informal description
If a formal multilinear series $p$ is eventually zero (i.e., $p_n = 0$ for all sufficiently large $n$), then its radius of convergence is infinite, i.e., $\text{radius}(p) = \infty$.
FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero theorem
(n : ℕ) (hn : ∀ m, p (m + n) = 0) : p.radius = ∞
Full source
theorem radius_eq_top_of_forall_image_add_eq_zero (n : ) (hn : ∀ m, p (m + n) = 0) :
    p.radius =  :=
  p.radius_eq_top_of_eventually_eq_zero <|
    mem_atTop_sets.2 ⟨n, fun _ hk => tsub_add_cancel_of_le hk ▸ hn _⟩
Infinite Radius of Convergence for Series with Eventually Zero Tail
Informal description
For any natural number $n$, if a formal multilinear series $p$ satisfies $p_{m+n} = 0$ for all natural numbers $m$, then the radius of convergence of $p$ is infinite, i.e., $\text{radius}(p) = \infty$.
FormalMultilinearSeries.constFormalMultilinearSeries_radius theorem
{v : F} : (constFormalMultilinearSeries 𝕜 E v).radius = ⊤
Full source
@[simp]
theorem constFormalMultilinearSeries_radius {v : F} :
    (constFormalMultilinearSeries 𝕜 E v).radius =  :=
  (constFormalMultilinearSeries 𝕜 E v).radius_eq_top_of_forall_image_add_eq_zero 1
    (by simp [constFormalMultilinearSeries])
Infinite Radius of Convergence for Constant Formal Multilinear Series
Informal description
For any vector $v$ in a normed space $F$, the radius of convergence of the constant formal multilinear series (where each term is the constant multilinear map returning $v$) is infinite, i.e., $\text{radius}(\text{constFormalMultilinearSeries}_{\mathbb{K},E}(v)) = \infty$.
FormalMultilinearSeries.zero_radius theorem
: (0 : FormalMultilinearSeries 𝕜 E F).radius = ∞
Full source
/-- `0` has infinite radius of convergence -/
@[simp] lemma zero_radius : (0 : FormalMultilinearSeries 𝕜 E F).radius =  := by
  rw [← constFormalMultilinearSeries_zero]
  exact constFormalMultilinearSeries_radius
Infinite Radius of Convergence for Zero Formal Multilinear Series
Informal description
The zero formal multilinear series has infinite radius of convergence, i.e., $\text{radius}(0) = \infty$.
FormalMultilinearSeries.isLittleO_of_lt_radius theorem
(h : ↑r < p.radius) : ∃ a ∈ Ioo (0 : ℝ) 1, (fun n => ‖p n‖ * (r : ℝ) ^ n) =o[atTop] (a ^ ·)
Full source
/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` tends to zero exponentially:
for some `0 < a < 1`, `‖p n‖ rⁿ = o(aⁿ)`. -/
theorem isLittleO_of_lt_radius (h : ↑r < p.radius) :
    ∃ a ∈ Ioo (0 : ℝ) 1, (fun n => ‖p n‖ * (r : ℝ) ^ n) =o[atTop] (a ^ ·) := by
  have := (TFAE_exists_lt_isLittleO_pow (fun n => ‖p n‖ * (r : ) ^ n) 1).out 1 4
  rw [this]
  -- Porting note: was
  -- rw [(TFAE_exists_lt_isLittleO_pow (fun n => ‖p n‖ * (r : ℝ) ^ n) 1).out 1 4]
  simp only [radius, lt_iSup_iff] at h
  rcases h with ⟨t, C, hC, rt⟩
  rw [ENNReal.coe_lt_coe, ← NNReal.coe_lt_coe] at rt
  have : 0 < (t : ) := r.coe_nonneg.trans_lt rt
  rw [← div_lt_one this] at rt
  refine ⟨_, rt, C, Or.inr zero_lt_one, fun n => ?_⟩
  calc
    |‖p n‖ * (r : ℝ) ^ n| = ‖p n‖ * (t : ) ^ n * (r / t : ) ^ n := by
      field_simp [mul_right_comm, abs_mul]
    _ ≤ C * (r / t : ) ^ n := by gcongr; apply hC
Exponential decay of coefficients for $r$ within radius of convergence: $\|p_n\| r^n = o(a^n)$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any real number $r$ such that $0 < r < R$, there exists $a \in (0,1)$ such that the sequence $\|p_n\| r^n$ is $o(a^n)$ as $n \to \infty$.
FormalMultilinearSeries.isLittleO_one_of_lt_radius theorem
(h : ↑r < p.radius) : (fun n => ‖p n‖ * (r : ℝ) ^ n) =o[atTop] (fun _ => 1 : ℕ → ℝ)
Full source
/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ = o(1)`. -/
theorem isLittleO_one_of_lt_radius (h : ↑r < p.radius) :
    (fun n => ‖p n‖ * (r : ℝ) ^ n) =o[atTop] (fun _ => 1 : ℕ → ℝ) :=
  let ⟨_, ha, hp⟩ := p.isLittleO_of_lt_radius h
  hp.trans <| (isLittleO_pow_pow_of_lt_left ha.1.le ha.2).congr (fun _ => rfl) one_pow
Coefficients decay to zero within radius: $\|p_n\| r^n = o(1)$ for $r < R$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any real number $r$ such that $0 < r < R$, the sequence $\|p_n\| r^n$ tends to zero as $n \to \infty$, i.e., $\|p_n\| r^n = o(1)$.
FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius theorem
(h : ↑r < p.radius) : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ n, ‖p n‖ * (r : ℝ) ^ n ≤ C * a ^ n
Full source
/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` tends to zero exponentially:
for some `0 < a < 1` and `C > 0`, `‖p n‖ * r ^ n ≤ C * a ^ n`. -/
theorem norm_mul_pow_le_mul_pow_of_lt_radius (h : ↑r < p.radius) :
    ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ n, ‖p n‖ * (r : ℝ) ^ n ≤ C * a ^ n := by
  have := ((TFAE_exists_lt_isLittleO_pow (fun n => ‖p n‖ * (r : ) ^ n) 1).out 1 5).mp
    (p.isLittleO_of_lt_radius h)
  rcases this with ⟨a, ha, C, hC, H⟩
  exact ⟨a, ha, C, hC, fun n => (le_abs_self _).trans (H n)⟩
Exponential Bound for Coefficients Within Radius: $\|p_n\| r^n \leq C a^n$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any real number $r$ such that $0 < r < R$, there exist $a \in (0,1)$ and $C > 0$ such that for all $n \in \mathbb{N}$, the inequality $\|p_n\| r^n \leq C a^n$ holds.
FormalMultilinearSeries.lt_radius_of_isBigO theorem
(h₀ : r ≠ 0) {a : ℝ} (ha : a ∈ Ioo (-1 : ℝ) 1) (hp : (fun n => ‖p n‖ * (r : ℝ) ^ n) =O[atTop] (a ^ ·)) : ↑r < p.radius
Full source
/-- If `r ≠ 0` and `‖pₙ‖ rⁿ = O(aⁿ)` for some `-1 < a < 1`, then `r < p.radius`. -/
theorem lt_radius_of_isBigO (h₀ : r ≠ 0) {a : } (ha : a ∈ Ioo (-1 : ℝ) 1)
    (hp : (fun n => ‖p n‖ * (r : ℝ) ^ n) =O[atTop] (a ^ ·)) : ↑r < p.radius := by
  have := ((TFAE_exists_lt_isLittleO_pow (fun n => ‖p n‖ * (r : ) ^ n) 1).out 2 5)
  rcases this.mp ⟨a, ha, hp⟩ with ⟨a, ha, C, hC, hp⟩
  rw [← pos_iff_ne_zero, ← NNReal.coe_pos] at h₀
  lift a to ℝ≥0 using ha.1.le
  have : (r : ) < r / a := by
    simpa only [div_one] using (div_lt_div_iff_of_pos_left h₀ zero_lt_one ha.1).2 ha.2
  norm_cast at this
  rw [← ENNReal.coe_lt_coe] at this
  refine this.trans_le (p.le_radius_of_bound C fun n => ?_)
  rw [NNReal.coe_div, div_pow, ← mul_div_assoc, div_le_iff₀ (pow_pos ha.1 n)]
  exact (le_abs_self _).trans (hp n)
Radius Comparison via Big-O: $\|p_n\| r^n = O(a^n) \implies r < p.\text{radius}$ when $a \in (-1,1)$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $p.\text{radius}$. If $r \neq 0$ and there exists $a \in (-1,1)$ such that $\|p_n\| r^n = O(a^n)$ as $n \to \infty$, then $r < p.\text{radius}$.
FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius theorem
(p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h : (r : ℝ≥0∞) < p.radius) : ∃ C > 0, ∀ n, ‖p n‖ * (r : ℝ) ^ n ≤ C
Full source
/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` is bounded. -/
theorem norm_mul_pow_le_of_lt_radius (p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0}
    (h : (r : ℝ≥0∞) < p.radius) : ∃ C > 0, ∀ n, ‖p n‖ * (r : ℝ) ^ n ≤ C :=
  let ⟨_, ha, C, hC, h⟩ := p.norm_mul_pow_le_mul_pow_of_lt_radius h
  ⟨C, hC, fun n => (h n).trans <| mul_le_of_le_one_right hC.lt.le (pow_le_one₀ ha.1.le ha.2.le)⟩
Boundedness of Coefficients Within Radius: $\|p_n\| r^n \leq C$ for $r < R$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any nonnegative real number $r$ such that $r < R$, there exists a constant $C > 0$ such that for all $n \in \mathbb{N}$, the inequality $\|p_n\| \cdot r^n \leq C$ holds.
FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius theorem
(p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h0 : 0 < r) (h : (r : ℝ≥0∞) < p.radius) : ∃ C > 0, ∀ n, ‖p n‖ ≤ C / (r : ℝ) ^ n
Full source
/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` is bounded. -/
theorem norm_le_div_pow_of_pos_of_lt_radius (p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0}
    (h0 : 0 < r) (h : (r : ℝ≥0∞) < p.radius) : ∃ C > 0, ∀ n, ‖p n‖ ≤ C / (r : ℝ) ^ n :=
  let ⟨C, hC, hp⟩ := p.norm_mul_pow_le_of_lt_radius h
  ⟨C, hC, fun n => Iff.mpr (le_div_iff₀ (pow_pos h0 _)) (hp n)⟩
Coefficient Bound in Terms of Inverse Powers: $\|p_n\| \leq C/r^n$ for $0 < r < R$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any positive real number $r$ such that $0 < r < R$, there exists a constant $C > 0$ such that for all $n \in \mathbb{N}$, the norm of the $n$-th coefficient satisfies $\|p_n\| \leq \frac{C}{r^n}$.
FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius theorem
(p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h : (r : ℝ≥0∞) < p.radius) : ∃ C > 0, ∀ n, ‖p n‖₊ * r ^ n ≤ C
Full source
/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ` is bounded. -/
theorem nnnorm_mul_pow_le_of_lt_radius (p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0}
    (h : (r : ℝ≥0∞) < p.radius) : ∃ C > 0, ∀ n, ‖p n‖₊ * r ^ n ≤ C :=
  let ⟨C, hC, hp⟩ := p.norm_mul_pow_le_of_lt_radius h
  ⟨⟨C, hC.lt.le⟩, hC, mod_cast hp⟩
Boundedness of Coefficients Within Radius: $\|p_n\| r^n \leq C$ for $r < R$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any nonnegative real number $r$ such that $r < R$, there exists a constant $C > 0$ such that for all $n \in \mathbb{N}$, the inequality $\|p_n\| \cdot r^n \leq C$ holds, where $\|p_n\|$ denotes the operator norm of the $n$-th multilinear map $p_n$.
FormalMultilinearSeries.le_radius_of_tendsto theorem
(p : FormalMultilinearSeries 𝕜 E F) {l : ℝ} (h : Tendsto (fun n => ‖p n‖ * (r : ℝ) ^ n) atTop (𝓝 l)) : ↑r ≤ p.radius
Full source
theorem le_radius_of_tendsto (p : FormalMultilinearSeries 𝕜 E F) {l : }
    (h : Tendsto (fun n => ‖p n‖ * (r : ) ^ n) atTop (𝓝 l)) : ↑r ≤ p.radius :=
  p.le_radius_of_isBigO (h.isBigO_one _)
Lower Bound on Radius of Convergence via Limit Condition
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ and let $r \geq 0$. If the sequence $\|p_n\| \cdot r^n$ converges to a finite limit $l \in \mathbb{R}$ as $n \to \infty$, then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.le_radius_of_summable_norm theorem
(p : FormalMultilinearSeries 𝕜 E F) (hs : Summable fun n => ‖p n‖ * (r : ℝ) ^ n) : ↑r ≤ p.radius
Full source
theorem le_radius_of_summable_norm (p : FormalMultilinearSeries 𝕜 E F)
    (hs : Summable fun n => ‖p n‖ * (r : ) ^ n) : ↑r ≤ p.radius :=
  p.le_radius_of_tendsto hs.tendsto_atTop_zero
Summability of Norm Series Implies Lower Bound on Radius of Convergence
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ and let $r \geq 0$. If the series $\sum_{n=0}^\infty \|p_n\| \cdot r^n$ is summable, then the radius of convergence of $p$ satisfies $r \leq p.\text{radius}$.
FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm theorem
(p : FormalMultilinearSeries 𝕜 E F) {x : E} (h : p.radius < ‖x‖₊) : ¬Summable fun n => ‖p n‖ * ‖x‖ ^ n
Full source
theorem not_summable_norm_of_radius_lt_nnnorm (p : FormalMultilinearSeries 𝕜 E F) {x : E}
    (h : p.radius < ‖x‖₊) : ¬Summable fun n => ‖p n‖ * ‖x‖ ^ n :=
  fun hs => not_le_of_lt h (p.le_radius_of_summable_norm hs)
Non-summability of Norm Series Beyond Radius of Convergence
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ and let $x \in E$. If the radius of convergence $p.\text{radius}$ is strictly less than the norm $\|x\|$, then the series $\sum_{n=0}^\infty \|p_n\| \cdot \|x\|^n$ is not summable.
FormalMultilinearSeries.summable_norm_mul_pow theorem
(p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h : ↑r < p.radius) : Summable fun n : ℕ => ‖p n‖ * (r : ℝ) ^ n
Full source
theorem summable_norm_mul_pow (p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h : ↑r < p.radius) :
    Summable fun n :  => ‖p n‖ * (r : ) ^ n := by
  obtain ⟨a, ha : a ∈ Ioo (0 : ℝ) 1, C, - : 0 < C, hp⟩ := p.norm_mul_pow_le_mul_pow_of_lt_radius h
  exact .of_nonneg_of_le (fun n => mul_nonneg (norm_nonneg _) (pow_nonneg r.coe_nonneg _))
    hp ((summable_geometric_of_lt_one ha.1.le ha.2).mul_left _)
Summability of $\sum \|p_n\| r^n$ within radius of convergence
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any nonnegative real number $r$ such that $r < R$, the series $\sum_{n=0}^\infty \|p_n\| r^n$ is summable.
FormalMultilinearSeries.summable_norm_apply theorem
(p : FormalMultilinearSeries 𝕜 E F) {x : E} (hx : x ∈ EMetric.ball (0 : E) p.radius) : Summable fun n : ℕ => ‖p n fun _ => x‖
Full source
theorem summable_norm_apply (p : FormalMultilinearSeries 𝕜 E F) {x : E}
    (hx : x ∈ EMetric.ball (0 : E) p.radius) : Summable fun n :  => ‖p n fun _ => x‖ := by
  rw [mem_emetric_ball_zero_iff] at hx
  refine .of_nonneg_of_le
    (fun _ ↦ norm_nonneg _) (fun n ↦ ((p n).le_opNorm _).trans_eq ?_) (p.summable_norm_mul_pow hx)
  simp
Summability of Norm Series for Multilinear Maps Within Radius of Convergence
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any $x \in E$ such that $\|x\| < R$, the series $\sum_{n=0}^\infty \|p_n(\underbrace{x, \dots, x}_{n \text{ times}})\|$ is summable.
FormalMultilinearSeries.summable_nnnorm_mul_pow theorem
(p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h : ↑r < p.radius) : Summable fun n : ℕ => ‖p n‖₊ * r ^ n
Full source
theorem summable_nnnorm_mul_pow (p : FormalMultilinearSeries 𝕜 E F) {r : ℝ≥0} (h : ↑r < p.radius) :
    Summable fun n :  => ‖p n‖₊ * r ^ n := by
  rw [← NNReal.summable_coe]
  push_cast
  exact p.summable_norm_mul_pow h
Summability of $\sum \|p_n\|_{\mathbb{R}_{\geq 0}} r^n$ within radius of convergence
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any nonnegative real number $r$ such that $r < R$, the series $\sum_{n=0}^\infty \|p_n\|_{\mathbb{R}_{\geq 0}} r^n$ is summable, where $\|p_n\|_{\mathbb{R}_{\geq 0}}$ denotes the nonnegative real norm of the $n$-th multilinear map in the series.
FormalMultilinearSeries.summable theorem
[CompleteSpace F] (p : FormalMultilinearSeries 𝕜 E F) {x : E} (hx : x ∈ EMetric.ball (0 : E) p.radius) : Summable fun n : ℕ => p n fun _ => x
Full source
protected theorem summable [CompleteSpace F] (p : FormalMultilinearSeries 𝕜 E F) {x : E}
    (hx : x ∈ EMetric.ball (0 : E) p.radius) : Summable fun n :  => p n fun _ => x :=
  (p.summable_norm_apply hx).of_norm
Absolute Convergence of Formal Multilinear Series Within Radius of Convergence
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, with $F$ complete. Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$. For any $x \in E$ such that $\|x\| < R$, the series $\sum_{n=0}^\infty p_n(x, \dots, x)$ converges absolutely in $F$.
FormalMultilinearSeries.radius_eq_top_of_summable_norm theorem
(p : FormalMultilinearSeries 𝕜 E F) (hs : ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n) : p.radius = ∞
Full source
theorem radius_eq_top_of_summable_norm (p : FormalMultilinearSeries 𝕜 E F)
    (hs : ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ) ^ n) : p.radius =  :=
  ENNReal.eq_top_of_forall_nnreal_le fun r => p.le_radius_of_summable_norm (hs r)
Infinite Radius of Convergence for Summable Norm Series
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$. If for every nonnegative real number $r$, the series $\sum_{n=0}^\infty \|p_n\| \cdot r^n$ is summable, then the radius of convergence of $p$ is infinite, i.e., $p.\text{radius} = \infty$.
FormalMultilinearSeries.radius_eq_top_iff_summable_norm theorem
(p : FormalMultilinearSeries 𝕜 E F) : p.radius = ∞ ↔ ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n
Full source
theorem radius_eq_top_iff_summable_norm (p : FormalMultilinearSeries 𝕜 E F) :
    p.radius = ∞ ↔ ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n := by
  constructor
  · intro h r
    obtain ⟨a, ha : a ∈ Ioo (0 : ℝ) 1, C, - : 0 < C, hp⟩ := p.norm_mul_pow_le_mul_pow_of_lt_radius
      (show (r : ℝ≥0∞) < p.radius from h.symmENNReal.coe_lt_top)
    refine .of_norm_bounded
      (fun n ↦ (C : ) * a ^ n) ((summable_geometric_of_lt_one ha.1.le ha.2).mul_left _) fun n ↦ ?_
    specialize hp n
    rwa [Real.norm_of_nonneg (mul_nonneg (norm_nonneg _) (pow_nonneg r.coe_nonneg n))]
  · exact p.radius_eq_top_of_summable_norm
Characterization of Infinite Radius: $\text{radius}(p) = \infty \leftrightarrow \forall r \geq 0, \sum \|p_n\| r^n$ is summable
Informal description
For a formal multilinear series $p$ from $E$ to $F$, the radius of convergence $p.\text{radius}$ is infinite if and only if for every nonnegative real number $r$, the series $\sum_{n=0}^\infty \|p_n\| r^n$ is summable.
FormalMultilinearSeries.le_mul_pow_of_radius_pos theorem
(p : FormalMultilinearSeries 𝕜 E F) (h : 0 < p.radius) : ∃ (C r : _) (_ : 0 < C) (_ : 0 < r), ∀ n, ‖p n‖ ≤ C * r ^ n
Full source
/-- If the radius of `p` is positive, then `‖pₙ‖` grows at most geometrically. -/
theorem le_mul_pow_of_radius_pos (p : FormalMultilinearSeries 𝕜 E F) (h : 0 < p.radius) :
    ∃ (C r : _) (_ : 0 < C) (_ : 0 < r), ∀ n, ‖p n‖ ≤ C * r ^ n := by
  rcases ENNReal.lt_iff_exists_nnreal_btwn.1 h with ⟨r, r0, rlt⟩
  have rpos : 0 < (r : ) := by simp [ENNReal.coe_pos.1 r0]
  rcases norm_le_div_pow_of_pos_of_lt_radius p rpos rlt with ⟨C, Cpos, hCp⟩
  refine ⟨C, r⁻¹, Cpos, by simp only [inv_pos, rpos], fun n => ?_⟩
  rw [inv_pow, ← div_eq_mul_inv]
  exact hCp n
Geometric Growth Bound for Coefficients of Formal Power Series with Positive Radius
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with positive radius of convergence $R > 0$. Then there exist constants $C > 0$ and $0 < r < R$ such that for all $n \in \mathbb{N}$, the norm of the $n$-th coefficient satisfies $\|p_n\| \leq C \cdot r^n$.
FormalMultilinearSeries.radius_le_of_le theorem
{𝕜' E' F' : Type*} [NontriviallyNormedField 𝕜'] [NormedAddCommGroup E'] [NormedSpace 𝕜' E'] [NormedAddCommGroup F'] [NormedSpace 𝕜' F'] {p : FormalMultilinearSeries 𝕜 E F} {q : FormalMultilinearSeries 𝕜' E' F'} (h : ∀ n, ‖p n‖ ≤ ‖q n‖) : q.radius ≤ p.radius
Full source
lemma radius_le_of_le {𝕜' E' F' : Type*}
    [NontriviallyNormedField 𝕜'] [NormedAddCommGroup E'] [NormedSpace 𝕜' E']
    [NormedAddCommGroup F'] [NormedSpace 𝕜' F']
    {p : FormalMultilinearSeries 𝕜 E F} {q : FormalMultilinearSeries 𝕜' E' F'}
    (h : ∀ n, ‖p n‖‖q n‖) : q.radius ≤ p.radius := by
  apply le_of_forall_nnreal_lt (fun r hr ↦ ?_)
  rcases norm_mul_pow_le_of_lt_radius _ hr with ⟨C, -, hC⟩
  apply le_radius_of_bound _ C (fun n ↦ ?_)
  apply le_trans _ (hC n)
  gcongr
  exact h n
Comparison of Radii of Convergence: $\|p_n\| \leq \|q_n\| \implies r(q) \leq r(p)$
Informal description
Let $\mathbb{K}$ and $\mathbb{K}'$ be nontrivially normed fields, and let $E, F$ and $E', F'$ be normed spaces over $\mathbb{K}$ and $\mathbb{K}'$ respectively. Given two formal multilinear series $p$ from $E$ to $F$ and $q$ from $E'$ to $F'$, if for every $n \in \mathbb{N}$ the norm $\|p_n\|$ is bounded above by $\|q_n\|$, then the radius of convergence of $q$ is less than or equal to the radius of convergence of $p$.
FormalMultilinearSeries.min_radius_le_radius_add theorem
(p q : FormalMultilinearSeries 𝕜 E F) : min p.radius q.radius ≤ (p + q).radius
Full source
/-- The radius of the sum of two formal series is at least the minimum of their two radii. -/
theorem min_radius_le_radius_add (p q : FormalMultilinearSeries 𝕜 E F) :
    min p.radius q.radius ≤ (p + q).radius := by
  refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
  rw [lt_min_iff] at hr
  have := ((p.isLittleO_one_of_lt_radius hr.1).add (q.isLittleO_one_of_lt_radius hr.2)).isBigO
  refine (p + q).le_radius_of_isBigO ((isBigO_of_le _ fun n => ?_).trans this)
  rw [← add_mul, norm_mul, norm_mul, norm_norm]
  exact mul_le_mul_of_nonneg_right ((norm_add_le _ _).trans (le_abs_self _)) (norm_nonneg _)
Minimum Radius Bound for Sum of Formal Power Series: $\min(r(p), r(q)) \leq r(p + q)$
Informal description
For any two formal multilinear series $p$ and $q$ from $E$ to $F$ over a normed field $\mathbb{K}$, the minimum of their radii of convergence is less than or equal to the radius of convergence of their sum $p + q$. In other words, $\min(r(p), r(q)) \leq r(p + q)$.
FormalMultilinearSeries.radius_neg theorem
(p : FormalMultilinearSeries 𝕜 E F) : (-p).radius = p.radius
Full source
@[simp]
theorem radius_neg (p : FormalMultilinearSeries 𝕜 E F) : (-p).radius = p.radius := by
  simp only [radius, neg_apply, norm_neg]
Radius of convergence is preserved under negation: $r(-p) = r(p)$
Informal description
For any formal multilinear series $p$ over a normed field $\mathbb{K}$ and normed spaces $E$ and $F$, the radius of convergence of the series $-p$ is equal to the radius of convergence of $p$.
FormalMultilinearSeries.radius_le_smul theorem
{p : FormalMultilinearSeries 𝕜 E F} {c : 𝕜} : p.radius ≤ (c • p).radius
Full source
theorem radius_le_smul {p : FormalMultilinearSeries 𝕜 E F} {c : 𝕜} : p.radius ≤ (c • p).radius := by
  simp only [radius, smul_apply]
  refine iSup_mono fun r ↦ iSup_mono' fun C ↦ ⟨‖c‖ * C, iSup_mono' fun h ↦ ?_⟩
  simp only [le_refl, exists_prop, and_true]
  intro n
  rw [norm_smul c (p n), mul_assoc]
  gcongr
  exact h n
Radius Comparison: $r(p) \leq r(c \cdot p)$ for Scalar Multiplication of Formal Power Series
Informal description
For any formal multilinear series $p$ from $E$ to $F$ over a normed field $\mathbb{K}$ and any scalar $c \in \mathbb{K}$, the radius of convergence of $p$ is less than or equal to the radius of convergence of the scaled series $c \cdot p$.
FormalMultilinearSeries.radius_smul_eq theorem
(p : FormalMultilinearSeries 𝕜 E F) {c : 𝕜} (hc : c ≠ 0) : (c • p).radius = p.radius
Full source
theorem radius_smul_eq (p : FormalMultilinearSeries 𝕜 E F) {c : 𝕜} (hc : c ≠ 0) :
    (c • p).radius = p.radius := by
  apply eq_of_le_of_le _ radius_le_smul
  exact radius_le_smul.trans_eq (congr_arg _ <| inv_smul_smul₀ hc p)
Radius Invariance under Nonzero Scalar Multiplication: $r(c \cdot p) = r(p)$ for $c \neq 0$
Informal description
For any formal multilinear series $p$ from $E$ to $F$ over a normed field $\mathbb{K}$ and any nonzero scalar $c \in \mathbb{K}$, the radius of convergence of the scaled series $c \cdot p$ is equal to the radius of convergence of $p$.
FormalMultilinearSeries.radius_shift theorem
(p : FormalMultilinearSeries 𝕜 E F) : p.shift.radius = p.radius
Full source
@[simp]
theorem radius_shift (p : FormalMultilinearSeries 𝕜 E F) : p.shift.radius = p.radius := by
  simp only [radius, shift, Nat.succ_eq_add_one, ContinuousMultilinearMap.curryRight_norm]
  congr
  ext r
  apply eq_of_le_of_le
  · apply iSup_mono'
    intro C
    use ‖p 0‖ ⊔ (C * r)
    apply iSup_mono'
    intro h
    simp only [le_refl, le_sup_iff, exists_prop, and_true]
    intro n
    rcases n with - | m
    · simp
    right
    rw [pow_succ, ← mul_assoc]
    apply mul_le_mul_of_nonneg_right (h m) zero_le_coe
  · apply iSup_mono'
    intro C
    use ‖p 1‖ ⊔ C / r
    apply iSup_mono'
    intro h
    simp only [le_refl, le_sup_iff, exists_prop, and_true]
    intro n
    cases eq_zero_or_pos r with
    | inl hr =>
      rw [hr]
      cases n <;> simp
    | inr hr =>
      right
      rw [← NNReal.coe_pos] at hr
      specialize h (n + 1)
      rw [le_div_iff₀ hr]
      rwa [pow_succ, ← mul_assoc] at h
Radius Invariance under Shifting of Formal Multilinear Series: $r(p.\text{shift}) = r(p)$
Informal description
For any formal multilinear series $p$ from $E$ to $F$ over a normed field $\mathbb{K}$, the radius of convergence of the shifted series $p.\text{shift}$ is equal to the radius of convergence of $p$.
FormalMultilinearSeries.radius_unshift theorem
(p : FormalMultilinearSeries 𝕜 E (E →L[𝕜] F)) (z : F) : (p.unshift z).radius = p.radius
Full source
@[simp]
theorem radius_unshift (p : FormalMultilinearSeries 𝕜 E (E →L[𝕜] F)) (z : F) :
    (p.unshift z).radius = p.radius := by
  rw [← radius_shift, unshift_shift]
Radius Invariance under Unshifting: $r(p.\text{unshift}\, z) = r(p)$
Informal description
For any formal multilinear series $p$ from $E$ to the space of continuous linear maps from $E$ to $F$, and for any fixed element $z \in F$, the radius of convergence of the unshifted series $p.\text{unshift}\, z$ is equal to the radius of convergence of $p$.
FormalMultilinearSeries.hasSum theorem
[CompleteSpace F] (p : FormalMultilinearSeries 𝕜 E F) {x : E} (hx : x ∈ EMetric.ball (0 : E) p.radius) : HasSum (fun n : ℕ => p n fun _ => x) (p.sum x)
Full source
protected theorem hasSum [CompleteSpace F] (p : FormalMultilinearSeries 𝕜 E F) {x : E}
    (hx : x ∈ EMetric.ball (0 : E) p.radius) : HasSum (fun n :  => p n fun _ => x) (p.sum x) :=
  (p.summable hx).hasSum
Convergence of Formal Multilinear Series Within Radius of Convergence: \( \sum_{n=0}^\infty p_n(x, \dots, x) = p.\text{sum}\, x \) for \( \|x\| < R \)
Informal description
Let \( E \) and \( F \) be normed spaces over a field \( \mathbb{K} \), with \( F \) complete. Let \( p \) be a formal multilinear series from \( E \) to \( F \) with radius of convergence \( R \). For any \( x \in E \) such that \( \|x\| < R \), the series \( \sum_{n=0}^\infty p_n(x, \dots, x) \) converges to \( p.\text{sum}\, x \) in \( F \).
FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp theorem
(p : FormalMultilinearSeries 𝕜 E F) (f : F →L[𝕜] G) : p.radius ≤ (f.compFormalMultilinearSeries p).radius
Full source
theorem radius_le_radius_continuousLinearMap_comp (p : FormalMultilinearSeries 𝕜 E F)
    (f : F →L[𝕜] G) : p.radius ≤ (f.compFormalMultilinearSeries p).radius := by
  refine ENNReal.le_of_forall_nnreal_lt fun r hr => ?_
  apply le_radius_of_isBigO
  apply (IsBigO.trans_isLittleO _ (p.isLittleO_one_of_lt_radius hr)).isBigO
  refine IsBigO.mul (@IsBigOWith.isBigO _ _ _ _ _ ‖f‖ _ _ _ ?_) (isBigO_refl _ _)
  refine IsBigOWith.of_bound (Eventually.of_forall fun n => ?_)
  simpa only [norm_norm] using f.norm_compContinuousMultilinearMap_le (p n)
Radius of Convergence is Non-Decreasing Under Continuous Linear Composition: $R(p) \leq R(f \circ p)$
Informal description
Let $p$ be a formal multilinear series from $E$ to $F$ with radius of convergence $R$, and let $f \colon F \to G$ be a continuous linear map. Then the radius of convergence of the composed series $f \circ p$ is at least $R$, i.e., $R \leq \text{radius}(f \circ p)$.
HasFPowerSeriesOnBall structure
(f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E) (r : ℝ≥0∞)
Full source
/-- Given a function `f : E → F` and a formal multilinear series `p`, we say that `f` has `p` as
a power series on the ball of radius `r > 0` around `x` if `f (x + y) = ∑' pₙ yⁿ` for all `‖y‖ < r`.
-/
structure HasFPowerSeriesOnBall (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E) (r : ℝ≥0∞) :
    Prop where
  r_le : r ≤ p.radius
  r_pos : 0 < r
  hasSum :
    ∀ {y}, y ∈ EMetric.ball (0 : E) rHasSum (fun n :  => p n fun _ : Fin n => y) (f (x + y))
Power series expansion on a ball
Informal description
Given a function \( f : E \to F \) and a formal multilinear series \( p \), we say that \( f \) has \( p \) as a power series expansion on the ball of radius \( r > 0 \) centered at \( x \) if for all \( y \) with \( \|y\| < r \), the function \( f \) satisfies \( f(x + y) = \sum_{n=0}^\infty p_n y^n \), where \( p_n \) is the \( n \)-th multilinear term of the series \( p \).
HasFPowerSeriesWithinOnBall structure
(f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E) (x : E) (r : ℝ≥0∞)
Full source
/-- Analogue of `HasFPowerSeriesOnBall` where convergence is required only on a set `s`. We also
require convergence at `x` as the behavior of this notion is very bad otherwise. -/
structure HasFPowerSeriesWithinOnBall (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E)
    (x : E) (r : ℝ≥0∞) : Prop where
  /-- `p` converges on `ball 0 r` -/
  r_le : r ≤ p.radius
  /-- The radius of convergence is positive -/
  r_pos : 0 < r
  /-- `p converges to f` within `s` -/
  hasSum : ∀ {y}, x + y ∈ insert x sy ∈ EMetric.ball (0 : E) rHasSum (fun n :  => p n fun _ : Fin n => y) (f (x + y))
Converging power series representation within a set and ball
Informal description
The structure `HasFPowerSeriesWithinOnBall` represents a function \( f : E \to F \) that can be expressed as a converging power series \( \sum_{n=0}^\infty p_n(y) \) for \( y \) in a ball of radius \( r \) centered at \( x \), but only for points \( y \) that also lie within a specified set \( s \subseteq E \). Here, \( p \) is a formal multilinear series from \( E \) to \( F \), and the convergence is required to hold on the intersection of the ball and the set \( s \cup \{x\} \).
HasFPowerSeriesAt definition
(f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E)
Full source
/-- Given a function `f : E → F` and a formal multilinear series `p`, we say that `f` has `p` as
a power series around `x` if `f (x + y) = ∑' pₙ yⁿ` for all `y` in a neighborhood of `0`. -/
def HasFPowerSeriesAt (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (x : E) :=
  ∃ r, HasFPowerSeriesOnBall f p x r
Power series expansion at a point
Informal description
A function \( f : E \to F \) has a power series expansion at a point \( x \in E \) if there exists a formal multilinear series \( p \) and a positive radius \( r \) such that \( f(x + y) = \sum_{n=0}^\infty p_n(y) \) for all \( y \) in the ball of radius \( r \) centered at \( 0 \).
HasFPowerSeriesWithinAt definition
(f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E) (x : E)
Full source
/-- Analogue of `HasFPowerSeriesAt` where convergence is required only on a set `s`. -/
def HasFPowerSeriesWithinAt (f : E → F) (p : FormalMultilinearSeries 𝕜 E F) (s : Set E) (x : E) :=
  ∃ r, HasFPowerSeriesWithinOnBall f p s x r
Power series expansion within a set at a point
Informal description
A function \( f : E \to F \) has a power series expansion within a set \( s \) at a point \( x \in E \) if there exists a formal multilinear series \( p \) and a positive radius \( r \) such that \( f \) can be expressed as the sum of the series \( \sum_{n=0}^\infty p_n(y) \) for all \( y \) in the intersection of the ball of radius \( r \) centered at \( x \) and the set \( s \cup \{x\} \).
AnalyticAt definition
(f : E → F) (x : E)
Full source
/-- Given a function `f : E → F`, we say that `f` is analytic at `x` if it admits a convergent power
series expansion around `x`. -/
@[fun_prop]
def AnalyticAt (f : E → F) (x : E) :=
  ∃ p : FormalMultilinearSeries 𝕜 E F, HasFPowerSeriesAt f p x
Analytic function at a point
Informal description
A function \( f : E \to F \) is called *analytic at a point* \( x \in E \) if there exists a formal multilinear series \( p \) such that \( f \) admits a convergent power series expansion around \( x \), i.e., \( f(x + y) = \sum_{n=0}^\infty p_n(y) \) for all \( y \) in some neighborhood of \( 0 \).
AnalyticWithinAt definition
(f : E → F) (s : Set E) (x : E) : Prop
Full source
/-- `f` is analytic within `s` at `x` if it has a power series at `x` that converges on `𝓝[s] x` -/
def AnalyticWithinAt (f : E → F) (s : Set E) (x : E) : Prop :=
  ∃ p : FormalMultilinearSeries 𝕜 E F, HasFPowerSeriesWithinAt f p s x
Analyticity within a set at a point
Informal description
A function \( f : E \to F \) is analytic within a set \( s \) at a point \( x \in E \) if there exists a formal multilinear series \( p \) such that \( f \) has a power series expansion within \( s \) at \( x \) represented by \( p \). This means that \( f \) can be expressed as the sum of the series \( \sum_{n=0}^\infty p_n(y) \) for all \( y \) in a neighborhood of \( x \) intersected with \( s \cup \{x\} \).
AnalyticOnNhd definition
(f : E → F) (s : Set E)
Full source
/-- Given a function `f : E → F`, we say that `f` is analytic on a set `s` if it is analytic around
every point of `s`. -/
def AnalyticOnNhd (f : E → F) (s : Set E) :=
  ∀ x, x ∈ sAnalyticAt 𝕜 f x
Analytic function on a neighborhood of a set
Informal description
A function \( f : E \to F \) is called *analytic on a neighborhood of a set \( s \)* if for every point \( x \in s \), the function \( f \) is analytic at \( x \). This means that around each point \( x \in s \), there exists a formal multilinear series \( p \) such that \( f \) admits a convergent power series expansion \( f(x + y) = \sum_{n=0}^\infty p_n(y) \) for all \( y \) in some neighborhood of \( 0 \).
AnalyticOn definition
(f : E → F) (s : Set E) : Prop
Full source
/-- `f` is analytic within `s` if it is analytic within `s` at each point of `s`.  Note that
this is weaker than `AnalyticOnNhd 𝕜 f s`, as `f` is allowed to be arbitrary outside `s`. -/
def AnalyticOn (f : E → F) (s : Set E) : Prop :=
  ∀ x ∈ s, AnalyticWithinAt 𝕜 f s x
Analytic function on a set
Informal description
A function \( f : E \to F \) is analytic on a set \( s \subseteq E \) if for every point \( x \in s \), the function \( f \) is analytic within \( s \) at \( x \). This means that at each point \( x \in s \), there exists a formal multilinear series \( p \) such that \( f \) can be expressed as the sum of the series \( \sum_{n=0}^\infty p_n(y) \) for all \( y \) in a neighborhood of \( x \) intersected with \( s \cup \{x\} \).
HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem
(hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x
Full source
theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) :
    HasFPowerSeriesAt f p x :=
  ⟨r, hf⟩
Power Series Expansion on Ball Implies Expansion at Point
Informal description
If a function \( f : E \to F \) has a power series expansion \( p \) on a ball of radius \( r > 0 \) centered at \( x \), then \( f \) has a power series expansion at \( x \).
HasFPowerSeriesAt.analyticAt theorem
(hf : HasFPowerSeriesAt f p x) : AnalyticAt 𝕜 f x
Full source
theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt 𝕜 f x :=
  ⟨p, hf⟩
Power series expansion implies analyticity at a point
Informal description
If a function \( f : E \to F \) has a power series expansion \( p \) at a point \( x \in E \), then \( f \) is analytic at \( x \).
HasFPowerSeriesOnBall.analyticAt theorem
(hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt 𝕜 f x
Full source
theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt 𝕜 f x :=
  hf.hasFPowerSeriesAt.analyticAt
Power series expansion on a ball implies analyticity at a point
Informal description
If a function \( f : E \to F \) has a power series expansion \( p \) on a ball of radius \( r > 0 \) centered at \( x \), then \( f \) is analytic at \( x \).
HasFPowerSeriesWithinOnBall.hasFPowerSeriesWithinAt theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : HasFPowerSeriesWithinAt f p s x
Full source
theorem HasFPowerSeriesWithinOnBall.hasFPowerSeriesWithinAt
    (hf : HasFPowerSeriesWithinOnBall f p s x r) : HasFPowerSeriesWithinAt f p s x :=
  ⟨r, hf⟩
Power series convergence on a ball implies local power series expansion within a set
Informal description
If a function \( f : E \to F \) has a power series expansion \( \sum_{n=0}^\infty p_n(y) \) converging on the intersection of a ball \( B(x, r) \) and a set \( s \cup \{x\} \), then \( f \) has a power series expansion within the set \( s \) at the point \( x \).
HasFPowerSeriesWithinAt.analyticWithinAt theorem
(hf : HasFPowerSeriesWithinAt f p s x) : AnalyticWithinAt 𝕜 f s x
Full source
theorem HasFPowerSeriesWithinAt.analyticWithinAt (hf : HasFPowerSeriesWithinAt f p s x) :
    AnalyticWithinAt 𝕜 f s x := ⟨p, hf⟩
Power series expansion implies analyticity within a set at a point
Informal description
If a function \( f : E \to F \) has a power series expansion \( \sum_{n=0}^\infty p_n(y) \) within a set \( s \) at a point \( x \in E \), then \( f \) is analytic within \( s \) at \( x \).
HasFPowerSeriesWithinOnBall.analyticWithinAt theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : AnalyticWithinAt 𝕜 f s x
Full source
theorem HasFPowerSeriesWithinOnBall.analyticWithinAt (hf : HasFPowerSeriesWithinOnBall f p s x r) :
    AnalyticWithinAt 𝕜 f s x :=
  hf.hasFPowerSeriesWithinAt.analyticWithinAt
Power Series Expansion on a Ball Implies Analyticity Within a Set at a Point
Informal description
If a function \( f : E \to F \) has a converging power series expansion \( \sum_{n=0}^\infty p_n(y) \) on the intersection of a ball \( B(x, r) \) and a set \( s \cup \{x\} \), then \( f \) is analytic within the set \( s \) at the point \( x \).
HasFPowerSeriesOnBall.comp_sub theorem
(hf : HasFPowerSeriesOnBall f p x r) (y : E) : HasFPowerSeriesOnBall (fun z => f (z - y)) p (x + y) r
Full source
/-- If a function `f` has a power series `p` around `x`, then the function `z ↦ f (z - y)` has the
same power series around `x + y`. -/
theorem HasFPowerSeriesOnBall.comp_sub (hf : HasFPowerSeriesOnBall f p x r) (y : E) :
    HasFPowerSeriesOnBall (fun z => f (z - y)) p (x + y) r :=
  { r_le := hf.r_le
    r_pos := hf.r_pos
    hasSum := fun {z} hz => by
      convert hf.hasSum hz using 2
      abel }
Power series expansion under translation: $f(z - y)$ at $x + y$
Informal description
Let $f : E \to F$ have a power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$. Then for any $y \in E$, the function $z \mapsto f(z - y)$ has the same power series expansion $p$ on the ball of radius $r$ centered at $x + y$.
HasFPowerSeriesWithinOnBall.hasSum_sub theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) {y : E} (hy : y ∈ (insert x s) ∩ EMetric.ball x r) : HasSum (fun n : ℕ => p n fun _ => y - x) (f y)
Full source
theorem HasFPowerSeriesWithinOnBall.hasSum_sub (hf : HasFPowerSeriesWithinOnBall f p s x r) {y : E}
    (hy : y ∈ (insert x s) ∩ EMetric.ball x r) :
    HasSum (fun n :  => p n fun _ => y - x) (f y) := by
  have : y - x ∈ EMetric.ball (0 : E) r := by simpa [edist_eq_enorm_sub] using hy.2
  have := hf.hasSum (by simpa only [add_sub_cancel] using hy.1) this
  simpa only [add_sub_cancel]
Convergence of Power Series Expansion Within a Set and Ball
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ within a set $s \subseteq E$ and a ball of radius $r$ centered at $x \in E$. For any point $y$ in the intersection of the ball and the set $s \cup \{x\}$, the series $\sum_{n=0}^\infty p_n(y - x, \dots, y - x)$ converges to $f(y)$, where $p_n$ is the $n$-th multilinear term of the series $p$.
HasFPowerSeriesOnBall.hasSum_sub theorem
(hf : HasFPowerSeriesOnBall f p x r) {y : E} (hy : y ∈ EMetric.ball x r) : HasSum (fun n : ℕ => p n fun _ => y - x) (f y)
Full source
theorem HasFPowerSeriesOnBall.hasSum_sub (hf : HasFPowerSeriesOnBall f p x r) {y : E}
    (hy : y ∈ EMetric.ball x r) : HasSum (fun n :  => p n fun _ => y - x) (f y) := by
  have : y - x ∈ EMetric.ball (0 : E) r := by simpa [edist_eq_enorm_sub] using hy
  simpa only [add_sub_cancel] using hf.hasSum this
Convergence of Power Series Expansion on a Ball
Informal description
Let $f : E \to F$ have a power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$. For any $y$ in the ball $\{y \in E \mid \|y - x\| < r\}$, the series $\sum_{n=0}^\infty p_n (y - x, \dots, y - x)$ converges to $f(y)$, where $p_n$ is the $n$-th multilinear term of the series $p$.
HasFPowerSeriesOnBall.radius_pos theorem
(hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius
Full source
theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius :=
  lt_of_lt_of_le hf.r_pos hf.r_le
Positive Radius of Convergence for Power Series Expansion on a Ball
Informal description
If a function $f : E \to F$ has a power series expansion $p$ on a ball of radius $r > 0$ centered at $x \in E$, then the radius of convergence $p.\text{radius}$ of the formal multilinear series $p$ is strictly positive.
HasFPowerSeriesWithinOnBall.radius_pos theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : 0 < p.radius
Full source
theorem HasFPowerSeriesWithinOnBall.radius_pos (hf : HasFPowerSeriesWithinOnBall f p s x r) :
    0 < p.radius :=
  lt_of_lt_of_le hf.r_pos hf.r_le
Positive Radius of Convergence for Power Series Expansion Within a Set and Ball
Informal description
Let $f : E \to F$ be a function that has a power series expansion $p$ within a set $s$ and on a ball of radius $r > 0$ centered at $x \in E$. Then the radius of convergence $p.\text{radius}$ of the formal multilinear series $p$ is positive.
HasFPowerSeriesAt.radius_pos theorem
(hf : HasFPowerSeriesAt f p x) : 0 < p.radius
Full source
theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius :=
  let ⟨_, hr⟩ := hf
  hr.radius_pos
Positive Radius of Convergence for Power Series Expansion at a Point
Informal description
If a function $f : E \to F$ has a power series expansion $p$ at a point $x \in E$, then the radius of convergence $p.\text{radius}$ of the formal multilinear series $p$ is strictly positive.
HasFPowerSeriesWithinOnBall.of_le theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) (r'_pos : 0 < r') (hr : r' ≤ r) : HasFPowerSeriesWithinOnBall f p s x r'
Full source
theorem HasFPowerSeriesWithinOnBall.of_le
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (r'_pos : 0 < r') (hr : r' ≤ r) :
    HasFPowerSeriesWithinOnBall f p s x r' :=
  ⟨le_trans hr hf.1, r'_pos, fun hy h'y => hf.hasSum hy (EMetric.ball_subset_ball hr h'y)⟩
Power series expansion persists on smaller balls within a set
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on a ball of radius $r$ centered at $x$ within a set $s$. If $0 < r' \leq r$, then $f$ also has a power series expansion $p$ on the ball of radius $r'$ centered at $x$ within $s$.
HasFPowerSeriesOnBall.mono theorem
(hf : HasFPowerSeriesOnBall f p x r) (r'_pos : 0 < r') (hr : r' ≤ r) : HasFPowerSeriesOnBall f p x r'
Full source
theorem HasFPowerSeriesOnBall.mono (hf : HasFPowerSeriesOnBall f p x r) (r'_pos : 0 < r')
    (hr : r' ≤ r) : HasFPowerSeriesOnBall f p x r' :=
  ⟨le_trans hr hf.1, r'_pos, fun hy => hf.hasSum (EMetric.ball_subset_ball hr hy)⟩
Restriction of Power Series Expansion to Smaller Ball
Informal description
Let \( f : E \to F \) be a function with a power series expansion \( p \) on the ball of radius \( r \) centered at \( x \). For any \( 0 < r' \leq r \), the function \( f \) also has \( p \) as a power series expansion on the ball of radius \( r' \) centered at \( x \).
HasFPowerSeriesWithinOnBall.congr theorem
{f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} {s : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p s x r) (h' : EqOn g f (s ∩ EMetric.ball x r)) (h'' : g x = f x) : HasFPowerSeriesWithinOnBall g p s x r
Full source
lemma HasFPowerSeriesWithinOnBall.congr {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F}
    {s : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p s x r)
    (h' : EqOn g f (s ∩ EMetric.ball x r)) (h'' : g x = f x) :
    HasFPowerSeriesWithinOnBall g p s x r := by
  refine ⟨h.r_le, h.r_pos, ?_⟩
  intro y hy h'y
  convert h.hasSum hy h'y using 1
  simp only [mem_insert_iff, add_eq_left] at hy
  rcases hy with rfl | hy
  · simpa using h''
  · apply h'
    refine ⟨hy, ?_⟩
    simpa [edist_eq_enorm_sub] using h'y
Power Series Representation is Preserved Under Pointwise Equality on Intersection
Informal description
Let $f, g : E \to F$ be functions, $p$ a formal multilinear series from $E$ to $F$, $s \subseteq E$ a set, $x \in E$ a point, and $r \in \mathbb{R}_{\geq 0} \cup \{\infty\}$ a radius. If: 1. $f$ has a power series representation within $s$ on the ball of radius $r$ centered at $x$ (i.e., $f(x + y) = \sum_{n=0}^\infty p_n(y)$ for $y \in s \cap B(x, r)$), 2. $g$ coincides with $f$ on $s \cap B(x, r)$, 3. $g(x) = f(x)$, then $g$ also has the same power series representation within $s$ on the ball of radius $r$ centered at $x$.
HasFPowerSeriesWithinOnBall.congr' theorem
{f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} {s : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p s x r) (h' : EqOn g f (insert x s ∩ EMetric.ball x r)) : HasFPowerSeriesWithinOnBall g p s x r
Full source
/-- Variant of `HasFPowerSeriesWithinOnBall.congr` in which one requests equality on `insert x s`
instead of separating `x` and `s`. -/
lemma HasFPowerSeriesWithinOnBall.congr' {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F}
    {s : Set E} {x : E} {r : ℝ≥0∞} (h : HasFPowerSeriesWithinOnBall f p s x r)
    (h' : EqOn g f (insertinsert x s ∩ EMetric.ball x r)) :
    HasFPowerSeriesWithinOnBall g p s x r := by
  refine ⟨h.r_le, h.r_pos, fun {y} hy h'y ↦ ?_⟩
  convert h.hasSum hy h'y using 1
  exact h' ⟨hy, by simpa [edist_eq_enorm_sub] using h'y⟩
Power Series Expansion Preservation under Pointwise Equality on Inserted Set
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. Suppose $f$ has a power series expansion $\sum_{n=0}^\infty p_n(y)$ converging on the intersection of a set $s \subseteq E$ and a ball of radius $r$ centered at $x \in E$. If $g$ coincides with $f$ on the intersection of this ball and the set $\{x\} \cup s$, then $g$ also has the same power series expansion on $s$ within the ball of radius $r$ centered at $x$.
HasFPowerSeriesWithinAt.congr theorem
{f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} {s : Set E} {x : E} (h : HasFPowerSeriesWithinAt f p s x) (h' : g =ᶠ[𝓝[s] x] f) (h'' : g x = f x) : HasFPowerSeriesWithinAt g p s x
Full source
lemma HasFPowerSeriesWithinAt.congr {f g : E → F} {p : FormalMultilinearSeries 𝕜 E F} {s : Set E}
    {x : E} (h : HasFPowerSeriesWithinAt f p s x) (h' : g =ᶠ[𝓝[s] x] f) (h'' : g x = f x) :
    HasFPowerSeriesWithinAt g p s x := by
  rcases h with ⟨r, hr⟩
  obtain ⟨ε, εpos, hε⟩ : ∃ ε > 0, EMetric.ball x ε ∩ s ⊆ {y | g y = f y} :=
    EMetric.mem_nhdsWithin_iff.1 h'
  let r' := min r ε
  refine ⟨r', ?_⟩
  have := hr.of_le (r' := r') (by simp [r', εpos, hr.r_pos]) (min_le_left _ _)
  apply this.congr _ h''
  intro z hz
  exact hε ⟨EMetric.ball_subset_ball (min_le_right _ _) hz.2, hz.1⟩
Power Series Expansion is Preserved Under Local Equality Within a Set
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. Suppose $f$ has a power series expansion $\sum_{n=0}^\infty p_n(y)$ converging on a neighborhood of $x$ within $s \cup \{x\}$, where $s \subseteq E$ and $x \in E$. If: 1. $g$ coincides with $f$ on a neighborhood of $x$ within $s$, 2. $g(x) = f(x)$, then $g$ also has the same power series expansion on $s$ at $x$.
HasFPowerSeriesOnBall.congr theorem
(hf : HasFPowerSeriesOnBall f p x r) (hg : EqOn f g (EMetric.ball x r)) : HasFPowerSeriesOnBall g p x r
Full source
theorem HasFPowerSeriesOnBall.congr (hf : HasFPowerSeriesOnBall f p x r)
    (hg : EqOn f g (EMetric.ball x r)) : HasFPowerSeriesOnBall g p x r :=
  { r_le := hf.r_le
    r_pos := hf.r_pos
    hasSum := fun {y} hy => by
      convert hf.hasSum hy using 1
      apply hg.symm
      simpa [edist_eq_enorm_sub] using hy }
Power Series Expansion is Preserved Under Pointwise Equality on Ball
Informal description
Let $f, g : E \to F$ be functions and $p$ a formal multilinear series from $E$ to $F$. If $f$ has a power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$, and $f$ and $g$ coincide on this ball, then $g$ also has the same power series expansion $p$ on this ball.
HasFPowerSeriesAt.congr theorem
(hf : HasFPowerSeriesAt f p x) (hg : f =ᶠ[𝓝 x] g) : HasFPowerSeriesAt g p x
Full source
theorem HasFPowerSeriesAt.congr (hf : HasFPowerSeriesAt f p x) (hg : f =ᶠ[𝓝 x] g) :
    HasFPowerSeriesAt g p x := by
  rcases hf with ⟨r₁, h₁⟩
  rcases EMetric.mem_nhds_iff.mp hg with ⟨r₂, h₂pos, h₂⟩
  exact ⟨min r₁ r₂,
    (h₁.mono (lt_min h₁.r_pos h₂pos) inf_le_left).congr
      fun y hy => h₂ (EMetric.ball_subset_ball inf_le_right hy)⟩
Power Series Expansion is Preserved Under Local Equality at a Point
Informal description
Let \( f, g : E \to F \) be functions and \( p \) a formal multilinear series from \( E \) to \( F \). If \( f \) has a power series expansion \( p \) at \( x \in E \), and \( f \) and \( g \) are eventually equal in a neighborhood of \( x \), then \( g \) also has the same power series expansion \( p \) at \( x \).
HasFPowerSeriesWithinOnBall.unique theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) (hg : HasFPowerSeriesWithinOnBall g p s x r) : (insert x s ∩ EMetric.ball x r).EqOn f g
Full source
theorem HasFPowerSeriesWithinOnBall.unique (hf : HasFPowerSeriesWithinOnBall f p s x r)
    (hg : HasFPowerSeriesWithinOnBall g p s x r) :
    (insertinsert x s ∩ EMetric.ball x r).EqOn f g := fun _ hy ↦
  (hf.hasSum_sub hy).unique (hg.hasSum_sub hy)
Uniqueness of Power Series Expansion Within a Set and Ball
Informal description
Let $f, g : E \to F$ be two functions that admit the same power series expansion $p$ within a set $s \subseteq E$ and a ball of radius $r$ centered at $x \in E$. Then $f$ and $g$ coincide on the intersection of the ball and the set $s \cup \{x\}$.
HasFPowerSeriesOnBall.unique theorem
(hf : HasFPowerSeriesOnBall f p x r) (hg : HasFPowerSeriesOnBall g p x r) : (EMetric.ball x r).EqOn f g
Full source
theorem HasFPowerSeriesOnBall.unique (hf : HasFPowerSeriesOnBall f p x r)
    (hg : HasFPowerSeriesOnBall g p x r) : (EMetric.ball x r).EqOn f g := fun _ hy ↦
  (hf.hasSum_sub hy).unique (hg.hasSum_sub hy)
Uniqueness of Power Series Expansion on a Ball
Informal description
Let $f, g : E \to F$ be two functions that have the same formal power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$. Then $f$ and $g$ coincide on the entire ball $\{y \in E \mid \|y - x\| < r\}$.
HasFPowerSeriesWithinAt.eventually theorem
(hf : HasFPowerSeriesWithinAt f p s x) : ∀ᶠ r : ℝ≥0∞ in 𝓝[>] 0, HasFPowerSeriesWithinOnBall f p s x r
Full source
protected theorem HasFPowerSeriesWithinAt.eventually (hf : HasFPowerSeriesWithinAt f p s x) :
    ∀ᶠ r : ℝ≥0∞ in 𝓝[>] 0, HasFPowerSeriesWithinOnBall f p s x r :=
  let ⟨_, hr⟩ := hf
  mem_of_superset (Ioo_mem_nhdsGT hr.r_pos) fun _ hr' => hr.of_le hr'.1 hr'.2.le
Local Existence of Power Series Expansion Within a Set
Informal description
Let $f : E \to F$ be a function that has a power series expansion $p$ within a set $s \subseteq E$ at a point $x \in E$. Then, for all sufficiently small positive radii $r$ (i.e., $r \to 0^+$), the function $f$ has a power series expansion $p$ on the ball of radius $r$ centered at $x$ within the set $s$.
HasFPowerSeriesAt.eventually theorem
(hf : HasFPowerSeriesAt f p x) : ∀ᶠ r : ℝ≥0∞ in 𝓝[>] 0, HasFPowerSeriesOnBall f p x r
Full source
protected theorem HasFPowerSeriesAt.eventually (hf : HasFPowerSeriesAt f p x) :
    ∀ᶠ r : ℝ≥0∞ in 𝓝[>] 0, HasFPowerSeriesOnBall f p x r :=
  let ⟨_, hr⟩ := hf
  mem_of_superset (Ioo_mem_nhdsGT hr.r_pos) fun _ hr' => hr.mono hr'.1 hr'.2.le
Existence of Small Balls for Power Series Expansion
Informal description
Let \( f : E \to F \) be a function with a power series expansion \( p \) at a point \( x \in E \). Then, for all radii \( r > 0 \) sufficiently small, \( f \) has \( p \) as a power series expansion on the ball of radius \( r \) centered at \( x \).
HasFPowerSeriesOnBall.eventually_hasSum theorem
(hf : HasFPowerSeriesOnBall f p x r) : ∀ᶠ y in 𝓝 0, HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y))
Full source
theorem HasFPowerSeriesOnBall.eventually_hasSum (hf : HasFPowerSeriesOnBall f p x r) :
    ∀ᶠ y in 𝓝 0, HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y)) := by
  filter_upwards [EMetric.ball_mem_nhds (0 : E) hf.r_pos] using fun _ => hf.hasSum
Convergence of Power Series Expansion Near Zero
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$. Then, for all $y$ in a neighborhood of $0$, the series $\sum_{n=0}^\infty p_n(y, \dots, y)$ converges to $f(x + y)$, where $p_n$ is the $n$-th multilinear term of the series $p$.
HasFPowerSeriesAt.eventually_hasSum theorem
(hf : HasFPowerSeriesAt f p x) : ∀ᶠ y in 𝓝 0, HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y))
Full source
theorem HasFPowerSeriesAt.eventually_hasSum (hf : HasFPowerSeriesAt f p x) :
    ∀ᶠ y in 𝓝 0, HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y)) :=
  let ⟨_, hr⟩ := hf
  hr.eventually_hasSum
Convergence of Power Series Expansion Near Zero for Functions with Power Series at a Point
Informal description
Let \( f : E \to F \) be a function with a power series expansion \( p \) at a point \( x \in E \). Then, for all \( y \) in a neighborhood of \( 0 \), the series \( \sum_{n=0}^\infty p_n(y, \dots, y) \) converges to \( f(x + y) \), where \( p_n \) is the \( n \)-th multilinear term of the series \( p \).
HasFPowerSeriesOnBall.eventually_hasSum_sub theorem
(hf : HasFPowerSeriesOnBall f p x r) : ∀ᶠ y in 𝓝 x, HasSum (fun n : ℕ => p n fun _ : Fin n => y - x) (f y)
Full source
theorem HasFPowerSeriesOnBall.eventually_hasSum_sub (hf : HasFPowerSeriesOnBall f p x r) :
    ∀ᶠ y in 𝓝 x, HasSum (fun n : ℕ => p n fun _ : Fin n => y - x) (f y) := by
  filter_upwards [EMetric.ball_mem_nhds x hf.r_pos] with y using hf.hasSum_sub
Local Convergence of Power Series Expansion Around a Point
Informal description
Let $f : E \to F$ have a power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$. Then, for all $y$ in a neighborhood of $x$, the series $\sum_{n=0}^\infty p_n(y - x, \dots, y - x)$ converges to $f(y)$, where $p_n$ is the $n$-th multilinear term of the series $p$.
HasFPowerSeriesAt.eventually_hasSum_sub theorem
(hf : HasFPowerSeriesAt f p x) : ∀ᶠ y in 𝓝 x, HasSum (fun n : ℕ => p n fun _ : Fin n => y - x) (f y)
Full source
theorem HasFPowerSeriesAt.eventually_hasSum_sub (hf : HasFPowerSeriesAt f p x) :
    ∀ᶠ y in 𝓝 x, HasSum (fun n : ℕ => p n fun _ : Fin n => y - x) (f y) :=
  let ⟨_, hr⟩ := hf
  hr.eventually_hasSum_sub
Local Power Series Expansion Convergence Around a Point
Informal description
Let \( f : E \to F \) have a power series expansion \( p \) at a point \( x \in E \). Then, for all \( y \) in a neighborhood of \( x \), the series \( \sum_{n=0}^\infty p_n(y - x, \dots, y - x) \) converges to \( f(y) \), where \( p_n \) is the \( n \)-th multilinear term of the series \( p \).
HasFPowerSeriesOnBall.eventually_eq_zero theorem
(hf : HasFPowerSeriesOnBall f (0 : FormalMultilinearSeries 𝕜 E F) x r) : ∀ᶠ z in 𝓝 x, f z = 0
Full source
theorem HasFPowerSeriesOnBall.eventually_eq_zero
    (hf : HasFPowerSeriesOnBall f (0 : FormalMultilinearSeries 𝕜 E F) x r) :
    ∀ᶠ z in 𝓝 x, f z = 0 := by
  filter_upwards [hf.eventually_hasSum_sub] with z hz using hz.unique hasSum_zero
Vanishing of Functions with Zero Power Series Expansion
Informal description
Let $f : E \to F$ have the zero power series expansion on the ball of radius $r > 0$ centered at $x \in E$. Then $f$ is eventually zero in a neighborhood of $x$, i.e., there exists a neighborhood $U$ of $x$ such that $f(z) = 0$ for all $z \in U$.
HasFPowerSeriesAt.eventually_eq_zero theorem
(hf : HasFPowerSeriesAt f (0 : FormalMultilinearSeries 𝕜 E F) x) : ∀ᶠ z in 𝓝 x, f z = 0
Full source
theorem HasFPowerSeriesAt.eventually_eq_zero
    (hf : HasFPowerSeriesAt f (0 : FormalMultilinearSeries 𝕜 E F) x) : ∀ᶠ z in 𝓝 x, f z = 0 :=
  let ⟨_, hr⟩ := hf
  hr.eventually_eq_zero
Vanishing Property of Functions with Zero Power Series Expansion at a Point
Informal description
Let $f : E \to F$ have a power series expansion at $x \in E$ with the zero formal multilinear series. Then $f$ is eventually zero in a neighborhood of $x$, i.e., there exists a neighborhood $U$ of $x$ such that $f(z) = 0$ for all $z \in U$.
hasFPowerSeriesWithinOnBall_univ theorem
: HasFPowerSeriesWithinOnBall f p univ x r ↔ HasFPowerSeriesOnBall f p x r
Full source
@[simp] lemma hasFPowerSeriesWithinOnBall_univ :
    HasFPowerSeriesWithinOnBallHasFPowerSeriesWithinOnBall f p univ x r ↔ HasFPowerSeriesOnBall f p x r := by
  constructor
  · intro h
    refine ⟨h.r_le, h.r_pos, fun {y} m ↦ h.hasSum (by simp) m⟩
  · intro h
    exact ⟨h.r_le, h.r_pos, fun {y} _ m => h.hasSum m⟩
Equivalence of Power Series Expansion on Entire Space and Ball
Informal description
A function \( f : E \to F \) has a power series expansion \( p \) on the entire space \( E \) within a ball of radius \( r \) centered at \( x \) if and only if \( f \) has a power series expansion \( p \) on the ball of radius \( r \) centered at \( x \).
hasFPowerSeriesWithinAt_univ theorem
: HasFPowerSeriesWithinAt f p univ x ↔ HasFPowerSeriesAt f p x
Full source
@[simp] lemma hasFPowerSeriesWithinAt_univ :
    HasFPowerSeriesWithinAtHasFPowerSeriesWithinAt f p univ x ↔ HasFPowerSeriesAt f p x := by
  simp only [HasFPowerSeriesWithinAt, hasFPowerSeriesWithinOnBall_univ, HasFPowerSeriesAt]
Equivalence of Power Series Expansion on Entire Space and at a Point
Informal description
A function \( f : E \to F \) has a power series expansion within the entire space \( E \) at a point \( x \in E \) if and only if it has a power series expansion at \( x \).
HasFPowerSeriesWithinOnBall.mono theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) (h : t ⊆ s) : HasFPowerSeriesWithinOnBall f p t x r
Full source
lemma HasFPowerSeriesWithinOnBall.mono (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : t ⊆ s) :
    HasFPowerSeriesWithinOnBall f p t x r where
  r_le := hf.r_le
  r_pos := hf.r_pos
  hasSum hy h'y := hf.hasSum (insert_subset_insert h hy) h'y
Restriction of Power Series Expansion to Smaller Set
Informal description
Let $f : E \to F$ be a function that has a power series expansion $\sum_{n=0}^\infty p_n(y)$ within a set $s \subseteq E$ and a ball of radius $r$ centered at $x \in E$. If $t \subseteq s$, then $f$ also has the same power series expansion within $t$ and the same ball.
HasFPowerSeriesOnBall.hasFPowerSeriesWithinOnBall theorem
(hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesWithinOnBall f p s x r
Full source
lemma HasFPowerSeriesOnBall.hasFPowerSeriesWithinOnBall (hf : HasFPowerSeriesOnBall f p x r) :
    HasFPowerSeriesWithinOnBall f p s x r := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  exact hf.mono (subset_univ _)
Power series expansion on a ball implies expansion within any subset
Informal description
If a function $f : E \to F$ has a power series expansion $\sum_{n=0}^\infty p_n(y)$ on the ball of radius $r$ centered at $x \in E$, then for any subset $s \subseteq E$, $f$ also has the same power series expansion within $s$ on the same ball.
HasFPowerSeriesWithinAt.mono theorem
(hf : HasFPowerSeriesWithinAt f p s x) (h : t ⊆ s) : HasFPowerSeriesWithinAt f p t x
Full source
lemma HasFPowerSeriesWithinAt.mono (hf : HasFPowerSeriesWithinAt f p s x) (h : t ⊆ s) :
    HasFPowerSeriesWithinAt f p t x := by
  obtain ⟨r, hp⟩ := hf
  exact ⟨r, hp.mono h⟩
Restriction of Power Series Expansion to Smaller Set
Informal description
Let $f : E \to F$ be a function that has a power series expansion $\sum_{n=0}^\infty p_n(y)$ within a set $s \subseteq E$ at a point $x \in E$. If $t \subseteq s$, then $f$ also has the same power series expansion within $t$ at $x$.
HasFPowerSeriesAt.hasFPowerSeriesWithinAt theorem
(hf : HasFPowerSeriesAt f p x) : HasFPowerSeriesWithinAt f p s x
Full source
lemma HasFPowerSeriesAt.hasFPowerSeriesWithinAt (hf : HasFPowerSeriesAt f p x) :
    HasFPowerSeriesWithinAt f p s x := by
  rw [← hasFPowerSeriesWithinAt_univ] at hf
  apply hf.mono (subset_univ _)
Power Series Expansion at a Point Implies Expansion Within Any Subset
Informal description
If a function \( f : E \to F \) has a power series expansion \( p \) at a point \( x \in E \), then for any subset \( s \subseteq E \), \( f \) also has the power series expansion \( p \) within \( s \) at \( x \).
HasFPowerSeriesWithinAt.mono_of_mem_nhdsWithin theorem
(h : HasFPowerSeriesWithinAt f p s x) (hst : s ∈ 𝓝[t] x) : HasFPowerSeriesWithinAt f p t x
Full source
theorem HasFPowerSeriesWithinAt.mono_of_mem_nhdsWithin
    (h : HasFPowerSeriesWithinAt f p s x) (hst : s ∈ 𝓝[t] x) :
    HasFPowerSeriesWithinAt f p t x := by
  rcases h with ⟨r, hr⟩
  rcases EMetric.mem_nhdsWithin_iff.1 hst with ⟨r', r'_pos, hr'⟩
  refine ⟨min r r', ?_⟩
  have Z := hr.of_le (by simp [r'_pos, hr.r_pos]) (min_le_left r r')
  refine ⟨Z.r_le, Z.r_pos, fun {y} hy h'y ↦ ?_⟩
  apply Z.hasSum ?_ h'y
  simp only [mem_insert_iff, add_eq_left] at hy
  rcases hy with rfl | hy
  · simp
  apply mem_insert_of_mem _ (hr' ?_)
  simp only [EMetric.mem_ball, edist_eq_enorm_sub, sub_zero, lt_min_iff, mem_inter_iff,
    add_sub_cancel_left, hy, and_true] at h'y ⊢
  exact h'y.2
Power Series Expansion Persists in Larger Neighborhoods
Informal description
Let \( f : E \to F \) be a function with a power series expansion \( p \) within a set \( s \) at a point \( x \). If \( s \) is a neighborhood of \( x \) within another set \( t \), then \( f \) also has a power series expansion \( p \) within \( t \) at \( x \).
hasFPowerSeriesWithinOnBall_insert_self theorem
: HasFPowerSeriesWithinOnBall f p (insert x s) x r ↔ HasFPowerSeriesWithinOnBall f p s x r
Full source
@[simp] lemma hasFPowerSeriesWithinOnBall_insert_self :
    HasFPowerSeriesWithinOnBallHasFPowerSeriesWithinOnBall f p (insert x s) x r ↔ HasFPowerSeriesWithinOnBall f p s x r := by
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩  <;>
  exact ⟨h.r_le, h.r_pos, fun {y} ↦ by simpa only [insert_idem] using h.hasSum (y := y)⟩
Equivalence of Power Series Expansion with and without Insertion of Center Point
Informal description
For a function \( f : E \to F \) and a formal multilinear series \( p \) from \( E \) to \( F \), the following are equivalent: 1. \( f \) has a power series expansion \( p \) within the ball of radius \( r \) centered at \( x \) and restricted to the set \( s \cup \{x\} \). 2. \( f \) has a power series expansion \( p \) within the ball of radius \( r \) centered at \( x \) and restricted to the set \( s \).
hasFPowerSeriesWithinAt_insert theorem
{y : E} : HasFPowerSeriesWithinAt f p (insert y s) x ↔ HasFPowerSeriesWithinAt f p s x
Full source
@[simp] theorem hasFPowerSeriesWithinAt_insert {y : E} :
    HasFPowerSeriesWithinAtHasFPowerSeriesWithinAt f p (insert y s) x ↔ HasFPowerSeriesWithinAt f p s x := by
  rcases eq_or_ne x y with rfl | hy
  · simp [HasFPowerSeriesWithinAt]
  · refine ⟨fun h ↦ h.mono (subset_insert _ _), fun h ↦ ?_⟩
    apply HasFPowerSeriesWithinAt.mono_of_mem_nhdsWithin h
    rw [nhdsWithin_insert_of_ne hy]
    exact self_mem_nhdsWithin
Equivalence of Power Series Expansion with and without Insertion of Point $y$
Informal description
For a function $f \colon E \to F$ and a formal multilinear series $p$ from $E$ to $F$, the following are equivalent: 1. $f$ has a power series expansion $p$ within the set $s \cup \{y\}$ at the point $x \in E$. 2. $f$ has a power series expansion $p$ within the set $s$ at the point $x \in E$.
HasFPowerSeriesWithinOnBall.coeff_zero theorem
(hf : HasFPowerSeriesWithinOnBall f pf s x r) (v : Fin 0 → E) : pf 0 v = f x
Full source
theorem HasFPowerSeriesWithinOnBall.coeff_zero (hf : HasFPowerSeriesWithinOnBall f pf s x r)
    (v : Fin 0 → E) : pf 0 v = f x := by
  have v_eq : v = fun i => 0 := Subsingleton.elim _ _
  have zero_mem : (0 : E) ∈ EMetric.ball (0 : E) r := by simp [hf.r_pos]
  have : ∀ i, i ≠ 0 → (pf i fun _ => 0) = 0 := by
    intro i hi
    have : 0 < i := pos_iff_ne_zero.2 hi
    exact ContinuousMultilinearMap.map_coord_zero _ (⟨0, this⟩ : Fin i) rfl
  have A := (hf.hasSum (by simp) zero_mem).unique (hasSum_single _ this)
  simpa [v_eq] using A.symm
Zeroth Coefficient of Power Series Equals Function Value
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ within a ball of radius $r$ centered at $x$ and restricted to a set $s \subseteq E$. Then the zeroth coefficient of the power series $p$ evaluated at any $v : \text{Fin}\,0 \to E$ equals the value of $f$ at $x$, i.e., $p_0(v) = f(x)$.
HasFPowerSeriesOnBall.coeff_zero theorem
(hf : HasFPowerSeriesOnBall f pf x r) (v : Fin 0 → E) : pf 0 v = f x
Full source
theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf x r)
    (v : Fin 0 → E) : pf 0 v = f x := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  exact hf.coeff_zero v
Zeroth Coefficient of Power Series Equals Function Value at Center Point
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on a ball of radius $r$ centered at $x \in E$. Then the zeroth coefficient of the power series $p$ evaluated at any $v : \text{Fin}\,0 \to E$ equals the value of $f$ at $x$, i.e., $p_0(v) = f(x)$.
HasFPowerSeriesWithinAt.coeff_zero theorem
(hf : HasFPowerSeriesWithinAt f pf s x) (v : Fin 0 → E) : pf 0 v = f x
Full source
theorem HasFPowerSeriesWithinAt.coeff_zero (hf : HasFPowerSeriesWithinAt f pf s x) (v : Fin 0 → E) :
    pf 0 v = f x :=
  let ⟨_, hrf⟩ := hf
  hrf.coeff_zero v
Zeroth Coefficient of Power Series Equals Function Value at Point
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ within a set $s$ at a point $x \in E$. Then the zeroth coefficient of the power series $p$ evaluated at any $v : \text{Fin}\,0 \to E$ equals the value of $f$ at $x$, i.e., $p_0(v) = f(x)$.
HasFPowerSeriesAt.coeff_zero theorem
(hf : HasFPowerSeriesAt f pf x) (v : Fin 0 → E) : pf 0 v = f x
Full source
theorem HasFPowerSeriesAt.coeff_zero (hf : HasFPowerSeriesAt f pf x) (v : Fin 0 → E) :
    pf 0 v = f x :=
  let ⟨_, hrf⟩ := hf
  hrf.coeff_zero v
Zeroth Coefficient of Power Series Equals Function Value at Point
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ at a point $x \in E$. Then the zeroth coefficient of the power series $p$ evaluated at any $v : \text{Fin}\,0 \to E$ equals the value of $f$ at $x$, i.e., $p_0(v) = f(x)$.
analyticOn_empty theorem
: AnalyticOn 𝕜 f ∅
Full source
@[simp] theorem analyticOn_empty : AnalyticOn 𝕜 f  := by intro; simp
Analyticity on the Empty Set
Informal description
For any function \( f : E \to F \), the statement \( \text{AnalyticOn} \, \mathbb{K} \, f \, \emptyset \) holds, i.e., \( f \) is analytic on the empty set.
analyticOnNhd_empty theorem
: AnalyticOnNhd 𝕜 f ∅
Full source
@[simp] theorem analyticOnNhd_empty : AnalyticOnNhd 𝕜 f  := by intro; simp
Analyticity of the Empty Function on the Empty Set
Informal description
The empty function is analytic on a neighborhood of the empty set.
analyticOn_univ theorem
{f : E → F} : AnalyticOn 𝕜 f univ ↔ AnalyticOnNhd 𝕜 f univ
Full source
@[simp] lemma analyticOn_univ {f : E → F} :
    AnalyticOnAnalyticOn 𝕜 f univ ↔ AnalyticOnNhd 𝕜 f univ := by
  simp only [AnalyticOn, analyticWithinAt_univ, AnalyticOnNhd]
Equivalence of Global Analyticity and Local Analyticity on the Entire Space
Informal description
A function \( f : E \to F \) is analytic on the entire space \( E \) if and only if it is analytic on a neighborhood of every point in \( E \).
AnalyticWithinAt.mono theorem
(hf : AnalyticWithinAt 𝕜 f s x) (h : t ⊆ s) : AnalyticWithinAt 𝕜 f t x
Full source
lemma AnalyticWithinAt.mono (hf : AnalyticWithinAt 𝕜 f s x) (h : t ⊆ s) :
    AnalyticWithinAt 𝕜 f t x := by
  obtain ⟨p, hp⟩ := hf
  exact ⟨p, hp.mono h⟩
Restriction of Analyticity to Smaller Set
Informal description
Let $f : E \to F$ be a function that is analytic within a set $s \subseteq E$ at a point $x \in E$. If $t \subseteq s$, then $f$ is also analytic within $t$ at $x$.
AnalyticAt.analyticWithinAt theorem
(hf : AnalyticAt 𝕜 f x) : AnalyticWithinAt 𝕜 f s x
Full source
lemma AnalyticAt.analyticWithinAt (hf : AnalyticAt 𝕜 f x) : AnalyticWithinAt 𝕜 f s x := by
  rw [← analyticWithinAt_univ] at hf
  apply hf.mono (subset_univ _)
Analyticity at a Point Implies Analyticity Within Any Set at That Point
Informal description
If a function \( f : E \to F \) is analytic at a point \( x \in E \), then for any subset \( s \subseteq E \), \( f \) is analytic within \( s \) at \( x \).
AnalyticOnNhd.analyticOn theorem
(hf : AnalyticOnNhd 𝕜 f s) : AnalyticOn 𝕜 f s
Full source
lemma AnalyticOnNhd.analyticOn (hf : AnalyticOnNhd 𝕜 f s) : AnalyticOn 𝕜 f s :=
  fun x hx ↦ (hf x hx).analyticWithinAt
Analyticity on Neighborhood Implies Analyticity on Set
Informal description
If a function \( f : E \to F \) is analytic on a neighborhood of a set \( s \subseteq E \), then \( f \) is analytic on \( s \).
AnalyticWithinAt.congr_of_eventuallyEq theorem
{f g : E → F} {s : Set E} {x : E} (hf : AnalyticWithinAt 𝕜 f s x) (hs : g =ᶠ[𝓝[s] x] f) (hx : g x = f x) : AnalyticWithinAt 𝕜 g s x
Full source
lemma AnalyticWithinAt.congr_of_eventuallyEq {f g : E → F} {s : Set E} {x : E}
    (hf : AnalyticWithinAt 𝕜 f s x) (hs : g =ᶠ[𝓝[s] x] f) (hx : g x = f x) :
    AnalyticWithinAt 𝕜 g s x := by
  rcases hf with ⟨p, hp⟩
  exact ⟨p, hp.congr hs hx⟩
Preservation of Analyticity Under Local Equality Within a Set
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. Suppose $f$ is analytic within a set $s \subseteq E$ at a point $x \in E$. If: 1. $g$ coincides with $f$ on a neighborhood of $x$ within $s$, 2. $g(x) = f(x)$, then $g$ is also analytic within $s$ at $x$.
AnalyticWithinAt.congr_of_eventuallyEq_insert theorem
{f g : E → F} {s : Set E} {x : E} (hf : AnalyticWithinAt 𝕜 f s x) (hs : g =ᶠ[𝓝[insert x s] x] f) : AnalyticWithinAt 𝕜 g s x
Full source
lemma AnalyticWithinAt.congr_of_eventuallyEq_insert {f g : E → F} {s : Set E} {x : E}
    (hf : AnalyticWithinAt 𝕜 f s x) (hs : g =ᶠ[𝓝[insert x s] x] f) :
    AnalyticWithinAt 𝕜 g s x := by
  apply hf.congr_of_eventuallyEq (nhdsWithin_mono x (subset_insert x s) hs)
  apply mem_of_mem_nhdsWithin (mem_insert x s) hs
Preservation of Analyticity Under Local Equality on Inserted Neighborhood
Informal description
Let \( E \) and \( F \) be normed spaces over a field \( \mathbb{K} \), and let \( f, g : E \to F \) be functions. Suppose \( f \) is analytic within a set \( s \subseteq E \) at a point \( x \in E \). If \( g \) coincides with \( f \) on a neighborhood of \( x \) within \( s \cup \{x\} \), then \( g \) is also analytic within \( s \) at \( x \).
AnalyticWithinAt.congr theorem
{f g : E → F} {s : Set E} {x : E} (hf : AnalyticWithinAt 𝕜 f s x) (hs : EqOn g f s) (hx : g x = f x) : AnalyticWithinAt 𝕜 g s x
Full source
lemma AnalyticWithinAt.congr {f g : E → F} {s : Set E} {x : E}
    (hf : AnalyticWithinAt 𝕜 f s x) (hs : EqOn g f s) (hx : g x = f x) :
    AnalyticWithinAt 𝕜 g s x :=
  hf.congr_of_eventuallyEq hs.eventuallyEq_nhdsWithin hx
Preservation of Analyticity Under Pointwise and Setwise Equality
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. Suppose $f$ is analytic within a set $s \subseteq E$ at a point $x \in E$. If: 1. $g$ coincides with $f$ on $s$, 2. $g(x) = f(x)$, then $g$ is also analytic within $s$ at $x$.
AnalyticOn.congr theorem
{f g : E → F} {s : Set E} (hf : AnalyticOn 𝕜 f s) (hs : EqOn g f s) : AnalyticOn 𝕜 g s
Full source
lemma AnalyticOn.congr {f g : E → F} {s : Set E}
    (hf : AnalyticOn 𝕜 f s) (hs : EqOn g f s) :
    AnalyticOn 𝕜 g s :=
  fun x m ↦ (hf x m).congr hs (hs m)
Preservation of Analyticity on a Set Under Pointwise Equality
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. If $f$ is analytic on a set $s \subseteq E$ and $g$ coincides with $f$ on $s$, then $g$ is also analytic on $s$.
AnalyticAt.congr theorem
(hf : AnalyticAt 𝕜 f x) (hg : f =ᶠ[𝓝 x] g) : AnalyticAt 𝕜 g x
Full source
theorem AnalyticAt.congr (hf : AnalyticAt 𝕜 f x) (hg : f =ᶠ[𝓝 x] g) : AnalyticAt 𝕜 g x :=
  let ⟨_, hpf⟩ := hf
  (hpf.congr hg).analyticAt
Analyticity at a Point is Preserved Under Local Equality
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. If $f$ is analytic at a point $x \in E$ and $f$ and $g$ are eventually equal in a neighborhood of $x$, then $g$ is also analytic at $x$.
analyticAt_congr theorem
(h : f =ᶠ[𝓝 x] g) : AnalyticAt 𝕜 f x ↔ AnalyticAt 𝕜 g x
Full source
theorem analyticAt_congr (h : f =ᶠ[𝓝 x] g) : AnalyticAtAnalyticAt 𝕜 f x ↔ AnalyticAt 𝕜 g x :=
  ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩
Analyticity at a Point is Equivalent Under Local Equality
Informal description
For functions $f, g : E \to F$ between normed spaces over a field $\mathbb{K}$ and a point $x \in E$, if $f$ and $g$ are eventually equal in a neighborhood of $x$, then $f$ is analytic at $x$ if and only if $g$ is analytic at $x$.
AnalyticOnNhd.mono theorem
{s t : Set E} (hf : AnalyticOnNhd 𝕜 f t) (hst : s ⊆ t) : AnalyticOnNhd 𝕜 f s
Full source
theorem AnalyticOnNhd.mono {s t : Set E} (hf : AnalyticOnNhd 𝕜 f t) (hst : s ⊆ t) :
    AnalyticOnNhd 𝕜 f s :=
  fun z hz => hf z (hst hz)
Restriction of Analyticity to Smaller Set
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f : E \to F$ be a function. If $f$ is analytic on a neighborhood of a set $t \subseteq E$, and $s$ is a subset of $t$, then $f$ is also analytic on a neighborhood of $s$.
AnalyticOnNhd.congr' theorem
(hf : AnalyticOnNhd 𝕜 f s) (hg : f =ᶠ[𝓝ˢ s] g) : AnalyticOnNhd 𝕜 g s
Full source
theorem AnalyticOnNhd.congr' (hf : AnalyticOnNhd 𝕜 f s) (hg : f =ᶠ[𝓝ˢ s] g) :
    AnalyticOnNhd 𝕜 g s :=
  fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz)
Analyticity on Neighborhood of Set is Preserved Under Local Equality
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. If $f$ is analytic on a neighborhood of a set $s \subseteq E$ and $f$ and $g$ are eventually equal on a neighborhood of $s$, then $g$ is also analytic on a neighborhood of $s$.
analyticOnNhd_congr' theorem
(h : f =ᶠ[𝓝ˢ s] g) : AnalyticOnNhd 𝕜 f s ↔ AnalyticOnNhd 𝕜 g s
Full source
theorem analyticOnNhd_congr' (h : f =ᶠ[𝓝ˢ s] g) : AnalyticOnNhdAnalyticOnNhd 𝕜 f s ↔ AnalyticOnNhd 𝕜 g s :=
  ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩
Equivalence of Analyticity for Locally Equal Functions on Neighborhood of a Set
Informal description
For functions \( f, g : E \to F \) between normed spaces over a field \(\mathbb{K}\), if \( f \) and \( g \) are eventually equal on a neighborhood of a set \( s \subseteq E \), then \( f \) is analytic on a neighborhood of \( s \) if and only if \( g \) is analytic on a neighborhood of \( s \).
AnalyticOnNhd.congr theorem
(hs : IsOpen s) (hf : AnalyticOnNhd 𝕜 f s) (hg : s.EqOn f g) : AnalyticOnNhd 𝕜 g s
Full source
theorem AnalyticOnNhd.congr (hs : IsOpen s) (hf : AnalyticOnNhd 𝕜 f s) (hg : s.EqOn f g) :
    AnalyticOnNhd 𝕜 g s :=
  hf.congr' <| mem_nhdsSet_iff_forall.mpr
    (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩)
Analyticity on Open Set is Preserved Under Pointwise Equality
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. If $s \subseteq E$ is an open set, $f$ is analytic on a neighborhood of $s$, and $f$ and $g$ are equal on $s$, then $g$ is also analytic on a neighborhood of $s$.
analyticOnNhd_congr theorem
(hs : IsOpen s) (h : s.EqOn f g) : AnalyticOnNhd 𝕜 f s ↔ AnalyticOnNhd 𝕜 g s
Full source
theorem analyticOnNhd_congr (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOnNhdAnalyticOnNhd 𝕜 f s ↔
    AnalyticOnNhd 𝕜 g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩
Equivalence of Analyticity for Equal Functions on Open Sets
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, and let $f, g : E \to F$ be functions. If $s \subseteq E$ is an open set and $f$ and $g$ are equal on $s$, then $f$ is analytic on a neighborhood of $s$ if and only if $g$ is analytic on a neighborhood of $s$.
AnalyticWithinAt.mono_of_mem_nhdsWithin theorem
(h : AnalyticWithinAt 𝕜 f s x) (hst : s ∈ 𝓝[t] x) : AnalyticWithinAt 𝕜 f t x
Full source
theorem AnalyticWithinAt.mono_of_mem_nhdsWithin
    (h : AnalyticWithinAt 𝕜 f s x) (hst : s ∈ 𝓝[t] x) : AnalyticWithinAt 𝕜 f t x := by
  rcases h with ⟨p, hp⟩
  exact ⟨p, hp.mono_of_mem_nhdsWithin hst⟩
Analyticity Persists in Larger Neighborhoods
Informal description
Let \( f : E \to F \) be a function that is analytic within a set \( s \) at a point \( x \). If \( s \) is a neighborhood of \( x \) within another set \( t \), then \( f \) is also analytic within \( t \) at \( x \).
AnalyticOn.mono theorem
{f : E → F} {s t : Set E} (h : AnalyticOn 𝕜 f t) (hs : s ⊆ t) : AnalyticOn 𝕜 f s
Full source
lemma AnalyticOn.mono {f : E → F} {s t : Set E} (h : AnalyticOn 𝕜 f t)
    (hs : s ⊆ t) : AnalyticOn 𝕜 f s :=
  fun _ m ↦ (h _ (hs m)).mono hs
Restriction of Analyticity to Subset
Informal description
Let $f : E \to F$ be a function that is analytic on a set $t \subseteq E$. If $s \subseteq t$, then $f$ is also analytic on $s$.
analyticWithinAt_insert theorem
{f : E → F} {s : Set E} {x y : E} : AnalyticWithinAt 𝕜 f (insert y s) x ↔ AnalyticWithinAt 𝕜 f s x
Full source
@[simp] theorem analyticWithinAt_insert {f : E → F} {s : Set E} {x y : E} :
    AnalyticWithinAtAnalyticWithinAt 𝕜 f (insert y s) x ↔ AnalyticWithinAt 𝕜 f s x := by
  simp [AnalyticWithinAt]
Analyticity within a Set is Unaffected by Insertion of a Point
Informal description
For a function \( f : E \to F \), a set \( s \subseteq E \), and points \( x, y \in E \), the function \( f \) is analytic within the set \( \text{insert } y \text{ } s \) at \( x \) if and only if \( f \) is analytic within \( s \) at \( x \).
ContinuousLinearMap.comp_hasFPowerSeriesWithinOnBall theorem
(g : F →L[𝕜] G) (h : HasFPowerSeriesWithinOnBall f p s x r) : HasFPowerSeriesWithinOnBall (g ∘ f) (g.compFormalMultilinearSeries p) s x r
Full source
/-- If a function `f` has a power series `p` on a ball within a set and `g` is linear,
then `g ∘ f` has the power series `g ∘ p` on the same ball. -/
theorem ContinuousLinearMap.comp_hasFPowerSeriesWithinOnBall (g : F →L[𝕜] G)
    (h : HasFPowerSeriesWithinOnBall f p s x r) :
    HasFPowerSeriesWithinOnBall (g ∘ f) (g.compFormalMultilinearSeries p) s x r where
  r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _)
  r_pos := h.r_pos
  hasSum hy h'y := by
    simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply,
      ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using
      g.hasSum (h.hasSum hy h'y)
Composition with Continuous Linear Map Preserves Power Series Expansion Within Ball
Informal description
Let $E$, $F$, and $G$ be normed spaces over a field $\mathbb{K}$, and let $f : E \to F$ be a function that has a power series expansion $p$ on a ball of radius $r$ centered at $x$ within a set $s \subseteq E$. If $g : F \to G$ is a continuous linear map, then the composition $g \circ f$ has the power series expansion $g \circ p$ on the same ball within $s$.
ContinuousLinearMap.comp_hasFPowerSeriesOnBall theorem
(g : F →L[𝕜] G) (h : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesOnBall (g ∘ f) (g.compFormalMultilinearSeries p) x r
Full source
/-- If a function `f` has a power series `p` on a ball and `g` is linear, then `g ∘ f` has the
power series `g ∘ p` on the same ball. -/
theorem ContinuousLinearMap.comp_hasFPowerSeriesOnBall (g : F →L[𝕜] G)
    (h : HasFPowerSeriesOnBall f p x r) :
    HasFPowerSeriesOnBall (g ∘ f) (g.compFormalMultilinearSeries p) x r := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at h ⊢
  exact g.comp_hasFPowerSeriesWithinOnBall h
Composition with Continuous Linear Map Preserves Power Series Expansion on Ball
Informal description
Let $E$, $F$, and $G$ be normed spaces over a field $\mathbb{K}$, and let $f : E \to F$ be a function that has a power series expansion $p$ on a ball of radius $r$ centered at $x$. If $g : F \to G$ is a continuous linear map, then the composition $g \circ f$ has the power series expansion $g \circ p$ on the same ball.
ContinuousLinearMap.comp_analyticOn theorem
(g : F →L[𝕜] G) (h : AnalyticOn 𝕜 f s) : AnalyticOn 𝕜 (g ∘ f) s
Full source
/-- If a function `f` is analytic on a set `s` and `g` is linear, then `g ∘ f` is analytic
on `s`. -/
theorem ContinuousLinearMap.comp_analyticOn (g : F →L[𝕜] G) (h : AnalyticOn 𝕜 f s) :
    AnalyticOn 𝕜 (g ∘ f) s := by
  rintro x hx
  rcases h x hx with ⟨p, r, hp⟩
  exact ⟨g.compFormalMultilinearSeries p, r, g.comp_hasFPowerSeriesWithinOnBall hp⟩
Composition with Continuous Linear Map Preserves Analyticity on a Set
Informal description
Let $E$, $F$, and $G$ be normed spaces over a field $\mathbb{K}$, and let $f : E \to F$ be a function that is analytic on a set $s \subseteq E$. If $g : F \to G$ is a continuous linear map, then the composition $g \circ f$ is analytic on $s$.
ContinuousLinearMap.comp_analyticOnNhd theorem
{s : Set E} (g : F →L[𝕜] G) (h : AnalyticOnNhd 𝕜 f s) : AnalyticOnNhd 𝕜 (g ∘ f) s
Full source
/-- If a function `f` is analytic on a set `s` and `g` is linear, then `g ∘ f` is analytic
on `s`. -/
theorem ContinuousLinearMap.comp_analyticOnNhd
    {s : Set E} (g : F →L[𝕜] G) (h : AnalyticOnNhd 𝕜 f s) :
    AnalyticOnNhd 𝕜 (g ∘ f) s := by
  rintro x hx
  rcases h x hx with ⟨p, r, hp⟩
  exact ⟨g.compFormalMultilinearSeries p, r, g.comp_hasFPowerSeriesOnBall hp⟩
Composition with Continuous Linear Map Preserves Analyticity on Neighborhood of Set
Informal description
Let $E$, $F$, and $G$ be normed spaces over a field $\mathbb{K}$, and let $f : E \to F$ be a function that is analytic on a neighborhood of a set $s \subseteq E$. If $g : F \to G$ is a continuous linear map, then the composition $g \circ f$ is analytic on a neighborhood of $s$.
HasFPowerSeriesWithinOnBall.tendsto_partialSum theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) {y : E} (hy : y ∈ EMetric.ball (0 : E) r) (h'y : x + y ∈ insert x s) : Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y)))
Full source
theorem HasFPowerSeriesWithinOnBall.tendsto_partialSum
    (hf : HasFPowerSeriesWithinOnBall f p s x r) {y : E} (hy : y ∈ EMetric.ball (0 : E) r)
    (h'y : x + y ∈ insert x s) :
    Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y))) :=
  (hf.hasSum h'y hy).tendsto_sum_nat
Convergence of Partial Sums for Power Series Expansion Within a Set and Ball
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on a ball of radius $r$ centered at $x$, within a set $s \subseteq E$. For any $y \in E$ such that $\|y\| < r$ and $x + y \in s \cup \{x\}$, the sequence of partial sums $\sum_{k=0}^{n-1} p_k(y, \dots, y)$ converges to $f(x + y)$ as $n \to \infty$.
HasFPowerSeriesOnBall.tendsto_partialSum theorem
(hf : HasFPowerSeriesOnBall f p x r) {y : E} (hy : y ∈ EMetric.ball (0 : E) r) : Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y)))
Full source
theorem HasFPowerSeriesOnBall.tendsto_partialSum
    (hf : HasFPowerSeriesOnBall f p x r) {y : E} (hy : y ∈ EMetric.ball (0 : E) r) :
    Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y))) :=
  (hf.hasSum hy).tendsto_sum_nat
Convergence of Partial Sums for Power Series Expansion on a Ball
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$. Then for any $y \in E$ with $\|y\| < r$, the sequence of partial sums $\sum_{k=0}^n p_k y^k$ converges to $f(x + y)$ as $n \to \infty$.
HasFPowerSeriesAt.tendsto_partialSum theorem
(hf : HasFPowerSeriesAt f p x) : ∀ᶠ y in 𝓝 0, Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y)))
Full source
theorem HasFPowerSeriesAt.tendsto_partialSum
    (hf : HasFPowerSeriesAt f p x) :
    ∀ᶠ y in 𝓝 0, Tendsto (fun n => p.partialSum n y) atTop (𝓝 (f (x + y))) := by
  rcases hf with ⟨r, hr⟩
  filter_upwards [EMetric.ball_mem_nhds (0 : E) hr.r_pos] with y hy
  exact hr.tendsto_partialSum hy
Convergence of Partial Sums for Power Series Expansion at a Point
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ at a point $x \in E$. Then for all $y$ in some neighborhood of $0$, the sequence of partial sums $\sum_{k=0}^n p_k y^k$ converges to $f(x + y)$ as $n \to \infty$.
HasFPowerSeriesWithinOnBall.tendsto_partialSum_prod theorem
{y : E} (hf : HasFPowerSeriesWithinOnBall f p s x r) (hy : y ∈ EMetric.ball (0 : E) r) (h'y : x + y ∈ insert x s) : Tendsto (fun (z : ℕ × E) ↦ p.partialSum z.1 z.2) (atTop ×ˢ 𝓝 y) (𝓝 (f (x + y)))
Full source
/-- If a function admits a power series expansion within a ball, then the partial sums
`p.partialSum n z` converge to `f (x + y)` as `n → ∞` and `z → y`. Note that `x + z` doesn't need
to belong to the set where the power series expansion holds. -/
theorem HasFPowerSeriesWithinOnBall.tendsto_partialSum_prod {y : E}
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (hy : y ∈ EMetric.ball (0 : E) r)
    (h'y : x + y ∈ insert x s) :
    Tendsto (fun (z : ℕ × E) ↦ p.partialSum z.1 z.2) (atTop ×ˢ 𝓝 y) (𝓝 (f (x + y))) := by
  have A : Tendsto (fun (z : ℕ × E) ↦ p.partialSum z.1 y) (atTop ×ˢ 𝓝 y) (𝓝 (f (x + y))) := by
    apply (hf.tendsto_partialSum hy h'y).comp tendsto_fst
  suffices Tendsto (fun (z : ℕ × E) ↦ p.partialSum z.1 z.2 - p.partialSum z.1 y)
    (atTop ×ˢ 𝓝 y) (𝓝 0) by simpa using A.add this
  apply Metric.tendsto_nhds.2 (fun ε εpos ↦ ?_)
  obtain ⟨r', yr', r'r⟩ : ∃ (r' : ℝ≥0), ‖y‖₊ < r' ∧ r' < r := by
    simp [edist_zero_eq_enorm] at hy
    simpa using ENNReal.lt_iff_exists_nnreal_btwn.1 hy
  have yr'_2 : ‖y‖ < r' := by simpa [← coe_nnnorm] using yr'
  have S : Summable fun n ↦ ‖p n‖ * ↑r' ^ n := p.summable_norm_mul_pow (r'r.trans_le hf.r_le)
  obtain ⟨k, hk⟩ : ∃ k, ∑' (n : ℕ), ‖p (n + k)‖ * ↑r' ^ (n + k) < ε / 4 := by
    have : Tendsto (fun k ↦ ∑' n, ‖p (n + k)‖ * ↑r' ^ (n + k)) atTop (𝓝 0) := by
      apply _root_.tendsto_sum_nat_add (f := fun n ↦ ‖p n‖ * ↑r' ^ n)
    exact ((tendsto_order.1 this).2 _ (by linarith)).exists
  have A : ∀ᶠ (z : ℕ × E) in atTop ×ˢ 𝓝 y,
      dist (p.partialSum k z.2) (p.partialSum k y) < ε / 4 := by
    have : ContinuousAt (fun z ↦ p.partialSum k z) y := (p.partialSum_continuous k).continuousAt
    exact tendsto_snd (Metric.tendsto_nhds.1 this.tendsto (ε / 4) (by linarith))
  have B : ∀ᶠ (z : ℕ × E) in atTop ×ˢ 𝓝 y, ‖z.2‖₊ < r' := by
    suffices ∀ᶠ (z : E) in 𝓝 y, ‖z‖₊ < r' from tendsto_snd this
    have : Metric.ballMetric.ball 0 r' ∈ 𝓝 y := Metric.isOpen_ball.mem_nhds (by simpa using yr'_2)
    filter_upwards [this] with a ha using by simpa [← coe_nnnorm] using ha
  have C : ∀ᶠ (z : ℕ × E) in atTop ×ˢ 𝓝 y, k ≤ z.1 := tendsto_fst (Ici_mem_atTop _)
  filter_upwards [A, B, C]
  rintro ⟨n, z⟩ hz h'z hkn
  simp only [dist_eq_norm, sub_zero] at hz ⊢
  have I (w : E) (hw : ‖w‖₊ < r') : ‖∑ i ∈ Ico k n, p i (fun _ ↦ w)‖ ≤ ε / 4 := calc
    ‖∑ i ∈ Ico k n, p i (fun _ ↦ w)‖
    _ = ‖∑ i ∈ range (n - k), p (i + k) (fun _ ↦ w)‖ := by
        rw [sum_Ico_eq_sum_range]
        congr with i
        rw [add_comm k]
    _ ≤ ∑ i ∈ range (n - k), ‖p (i + k) (fun _ ↦ w)‖ := norm_sum_le _ _
    _ ≤ ∑ i ∈ range (n - k), ‖p (i + k)‖ * ‖w‖ ^ (i + k) := by
        gcongr with i _hi; exact ((p (i + k)).le_opNorm _).trans_eq (by simp)
    _ ≤ ∑ i ∈ range (n - k), ‖p (i + k)‖ * ↑r' ^ (i + k) := by
        gcongr with i _hi; simpa [← coe_nnnorm] using hw.le
    _ ≤ ∑' i, ‖p (i + k)‖ * ↑r' ^ (i + k) := by
        apply Summable.sum_le_tsum _ (fun i _hi ↦ by positivity)
        apply ((_root_.summable_nat_add_iff k).2 S)
    _ ≤ ε / 4 := hk.le
  calc
  ‖p.partialSum n z - p.partialSum n y‖
  _ = ‖∑ i ∈ range n, p i (fun _ ↦ z) - ∑ i ∈ range n, p i (fun _ ↦ y)‖ := rfl
  _ = ‖(∑ i ∈ range k, p i (fun _ ↦ z) + ∑ i ∈ Ico k n, p i (fun _ ↦ z))
        - (∑ i ∈ range k, p i (fun _ ↦ y) + ∑ i ∈ Ico k n, p i (fun _ ↦ y))‖ := by
    simp [sum_range_add_sum_Ico _ hkn]
  _ = ‖(p.partialSum k z - p.partialSum k y) + (∑ i ∈ Ico k n, p i (fun _ ↦ z))
        + (- ∑ i ∈ Ico k n, p i (fun _ ↦ y))‖ := by
    congr 1
    simp only [FormalMultilinearSeries.partialSum]
    abel
  _ ≤ ‖p.partialSum k z - p.partialSum k y‖ + ‖∑ i ∈ Ico k n, p i (fun _ ↦ z)‖
      + ‖- ∑ i ∈ Ico k n, p i (fun _ ↦ y)‖ := norm_add₃_le
  _ ≤ ε / 4 + ε / 4 + ε / 4 := by
    gcongr
    · exact I _ h'z
    · simp only [norm_neg]; exact I _ yr'
  _ < ε := by linarith
Double Limit Convergence of Partial Sums for Power Series Expansion Within a Set and Ball
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on a ball of radius $r$ centered at $x$, within a set $s \subseteq E$. For any $y \in E$ such that $\|y\| < r$ and $x + y \in s \cup \{x\}$, the double limit of partial sums satisfies: \[ \lim_{(n, z) \to (\infty, y)} \sum_{k=0}^{n-1} p_k(z, \dots, z) = f(x + y). \] Here, the limit is taken as $n \to \infty$ and $z \to y$ in the product topology of $\mathbb{N} \times E$.
HasFPowerSeriesOnBall.tendsto_partialSum_prod theorem
{y : E} (hf : HasFPowerSeriesOnBall f p x r) (hy : y ∈ EMetric.ball (0 : E) r) : Tendsto (fun (z : ℕ × E) ↦ p.partialSum z.1 z.2) (atTop ×ˢ 𝓝 y) (𝓝 (f (x + y)))
Full source
/-- If a function admits a power series on a ball, then the partial sums
`p.partialSum n z` converges to `f (x + y)` as `n → ∞` and `z → y`. -/
theorem HasFPowerSeriesOnBall.tendsto_partialSum_prod {y : E}
    (hf : HasFPowerSeriesOnBall f p x r) (hy : y ∈ EMetric.ball (0 : E) r) :
    Tendsto (fun (z : ℕ × E) ↦ p.partialSum z.1 z.2) (atTop ×ˢ 𝓝 y) (𝓝 (f (x + y))) :=
  (hf.hasFPowerSeriesWithinOnBall (s := univ)).tendsto_partialSum_prod hy (by simp)
Double Limit Convergence of Partial Sums for Power Series Expansion on a Ball
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on a ball of radius $r$ centered at $x \in E$. For any $y$ in the open ball $\{y \in E \mid \|y\| < r\}$, the double limit satisfies: \[ \lim_{(n, z) \to (\infty, y)} \sum_{k=0}^{n-1} p_k(z, \dots, z) = f(x + y), \] where the limit is taken as $n \to \infty$ and $z \to y$ in the product topology of $\mathbb{N} \times E$.
HasFPowerSeriesWithinOnBall.uniform_geometric_approx' theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n, x + y ∈ insert x s → ‖f (x + y) - p.partialSum n y‖ ≤ C * (a * (‖y‖ / r')) ^ n
Full source
/-- If a function admits a power series expansion, then it is exponentially close to the partial
sums of this power series on strict subdisks of the disk of convergence.

This version provides an upper estimate that decreases both in `‖y‖` and `n`. See also
`HasFPowerSeriesWithinOnBall.uniform_geometric_approx` for a weaker version. -/
theorem HasFPowerSeriesWithinOnBall.uniform_geometric_approx' {r' : ℝ≥0}
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) :
    ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n, x + y ∈ insert x s →
      ‖f (x + y) - p.partialSum n y‖ ≤ C * (a * (‖y‖ / r')) ^ n := by
  obtain ⟨a, ha, C, hC, hp⟩ : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ n, ‖p n‖ * (r' : ℝ) ^ n ≤ C * a ^ n :=
    p.norm_mul_pow_le_mul_pow_of_lt_radius (h.trans_le hf.r_le)
  refine ⟨a, ha, C / (1 - a), div_pos hC (sub_pos.2 ha.2), fun y hy n ys => ?_⟩
  have yr' : ‖y‖ < r' := by
    rw [ball_zero_eq] at hy
    exact hy
  have hr'0 : 0 < (r' : ) := (norm_nonneg _).trans_lt yr'
  have : y ∈ EMetric.ball (0 : E) r := by
    refine mem_emetric_ball_zero_iff.2 (lt_trans ?_ h)
    simpa [enorm] using yr'
  rw [norm_sub_rev, ← mul_div_right_comm]
  have ya : a * (‖y‖ / ↑r') ≤ a :=
    mul_le_of_le_one_right ha.1.le (div_le_one_of_le₀ yr'.le r'.coe_nonneg)
  suffices ‖p.partialSum n y - f (x + y)‖ ≤ C * (a * (‖y‖ / r')) ^ n / (1 - a * (‖y‖ / r')) by
    refine this.trans ?_
    have : 0 < a := ha.1
    gcongr
    apply_rules [sub_pos.2, ha.2]
  apply norm_sub_le_of_geometric_bound_of_hasSum (ya.trans_lt ha.2) _ (hf.hasSum ys this)
  intro n
  calc
    ‖(p n) fun _ : Fin n => y‖
    _ ≤ ‖p n‖ * ∏ _i : Fin n, ‖y‖ := ContinuousMultilinearMap.le_opNorm _ _
    _ = ‖p n‖ * (r' : ) ^ n * (‖y‖ / r') ^ n := by field_simp [mul_right_comm]
    _ ≤ C * a ^ n * (‖y‖ / r') ^ n := by gcongr ?_ * _; apply hp
    _ ≤ C * (a * (‖y‖ / r')) ^ n := by rw [mul_pow, mul_assoc]
Exponential Approximation of Analytic Functions by Partial Sums: $\|f(x + y) - S_n(y)\| \leq C \left(a \cdot \frac{\|y\|}{r'}\right)^n$
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, there exist constants $a \in (0,1)$ and $C > 0$ such that for all $y$ in the ball $\{y \in E \mid \|y\| < r'\}$ and all $n \in \mathbb{N}$, if $x + y \in s \cup \{x\}$, then the following inequality holds: \[ \|f(x + y) - p.\text{partialSum}_n(y)\| \leq C \left(a \cdot \frac{\|y\|}{r'}\right)^n. \]
HasFPowerSeriesOnBall.uniform_geometric_approx' theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r) (h : (r' : ℝ≥0∞) < r) : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n, ‖f (x + y) - p.partialSum n y‖ ≤ C * (a * (‖y‖ / r')) ^ n
Full source
/-- If a function admits a power series expansion, then it is exponentially close to the partial
sums of this power series on strict subdisks of the disk of convergence.

This version provides an upper estimate that decreases both in `‖y‖` and `n`. See also
`HasFPowerSeriesOnBall.uniform_geometric_approx` for a weaker version. -/
theorem HasFPowerSeriesOnBall.uniform_geometric_approx' {r' : ℝ≥0}
    (hf : HasFPowerSeriesOnBall f p x r) (h : (r' : ℝ≥0∞) < r) :
    ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n,
      ‖f (x + y) - p.partialSum n y‖ ≤ C * (a * (‖y‖ / r')) ^ n := by
   rw [← hasFPowerSeriesWithinOnBall_univ] at hf
   simpa using hf.uniform_geometric_approx' h
Exponential Approximation of Analytic Functions by Partial Sums: $\|f(x + y) - S_n(y)\| \leq C \left(a \cdot \frac{\|y\|}{r'}\right)^n$
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, there exist constants $a \in (0,1)$ and $C > 0$ such that for all $y$ in the ball $\{y \in E \mid \|y\| < r'\}$ and all $n \in \mathbb{N}$, the following inequality holds: \[ \|f(x + y) - p.\text{partialSum}_n(y)\| \leq C \left(a \cdot \frac{\|y\|}{r'}\right)^n. \]
HasFPowerSeriesWithinOnBall.uniform_geometric_approx theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n, x + y ∈ insert x s → ‖f (x + y) - p.partialSum n y‖ ≤ C * a ^ n
Full source
/-- If a function admits a power series expansion within a set in a ball, then it is exponentially
close to the partial sums of this power series on strict subdisks of the disk of convergence. -/
theorem HasFPowerSeriesWithinOnBall.uniform_geometric_approx {r' : ℝ≥0}
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) :
    ∃ a ∈ Ioo (0 : ℝ) 1,
      ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n, x + y ∈ insert x s →
      ‖f (x + y) - p.partialSum n y‖ ≤ C * a ^ n := by
  obtain ⟨a, ha, C, hC, hp⟩ : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n,
      x + y ∈ insert x s → ‖f (x + y) - p.partialSum n y‖ ≤ C * (a * (‖y‖ / r')) ^ n :=
    hf.uniform_geometric_approx' h
  refine ⟨a, ha, C, hC, fun y hy n ys => (hp y hy n ys).trans ?_⟩
  have yr' : ‖y‖ < r' := by rwa [ball_zero_eq] at hy
  have := ha.1.le -- needed to discharge a side goal on the next line
  gcongr
  exact mul_le_of_le_one_right ha.1.le (div_le_one_of_le₀ yr'.le r'.coe_nonneg)
Exponential Approximation of Analytic Functions by Partial Sums: $\|f(x + y) - S_n(y)\| \leq C \cdot a^n$
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, there exist constants $a \in (0,1)$ and $C > 0$ such that for all $y$ in the ball $\{y \in E \mid \|y\| < r'\}$ and all $n \in \mathbb{N}$, if $x + y \in s \cup \{x\}$, then the following inequality holds: \[ \|f(x + y) - p.\text{partialSum}_n(y)\| \leq C \cdot a^n. \]
HasFPowerSeriesOnBall.uniform_geometric_approx theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r) (h : (r' : ℝ≥0∞) < r) : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n, ‖f (x + y) - p.partialSum n y‖ ≤ C * a ^ n
Full source
/-- If a function admits a power series expansion, then it is exponentially close to the partial
sums of this power series on strict subdisks of the disk of convergence. -/
theorem HasFPowerSeriesOnBall.uniform_geometric_approx {r' : ℝ≥0}
    (hf : HasFPowerSeriesOnBall f p x r) (h : (r' : ℝ≥0∞) < r) :
    ∃ a ∈ Ioo (0 : ℝ) 1,
      ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n,
      ‖f (x + y) - p.partialSum n y‖ ≤ C * a ^ n := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa using hf.uniform_geometric_approx h
Exponential approximation of analytic functions by partial sums: $\|f(x+y) - S_n(y)\| \leq C a^n$
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, there exist constants $a \in (0,1)$ and $C > 0$ such that for all $y$ in the ball $\{y \in E \mid \|y\| < r'\}$ and all $n \in \mathbb{N}$, the following inequality holds: \[ \|f(x + y) - p.\text{partialSum}_n(y)\| \leq C \cdot a^n. \]
HasFPowerSeriesWithinAt.isBigO_sub_partialSum_pow theorem
(hf : HasFPowerSeriesWithinAt f p s x) (n : ℕ) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝[(x + ·) ⁻¹' insert x s] 0] fun y => ‖y‖ ^ n
Full source
/-- Taylor formula for an analytic function within a set, `IsBigO` version. -/
theorem HasFPowerSeriesWithinAt.isBigO_sub_partialSum_pow
    (hf : HasFPowerSeriesWithinAt f p s x) (n : ) :
    (fun y : E => f (x + y) - p.partialSum n y)
      =O[𝓝[(x + ·)⁻¹' insert x s] 0] fun y => ‖y‖ ^ n := by
  rcases hf with ⟨r, hf⟩
  rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hf.r_pos with ⟨r', r'0, h⟩
  obtain ⟨a, -, C, -, hp⟩ : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n,
      x + y ∈ insert x s → ‖f (x + y) - p.partialSum n y‖ ≤ C * (a * (‖y‖ / r')) ^ n :=
    hf.uniform_geometric_approx' h
  refine isBigO_iff.2 ⟨C * (a / r') ^ n, ?_⟩
  replace r'0 : 0 < (r' : ) := mod_cast r'0
  filter_upwards [inter_mem_nhdsWithin _ (Metric.ball_mem_nhds (0 : E) r'0)] with y hy
  simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div, div_pow]
    using hp y hy.2 n (by simpa using hy.1)
Taylor approximation error bound: $f(x+y) - S_n(y) = O(\|y\|^n)$ within a set
Informal description
Let $f : E \to F$ be a function that has a power series expansion $p$ within a set $s \subseteq E$ at a point $x \in E$. For any natural number $n$, the difference between $f(x + y)$ and the $n$-th partial sum $p.\text{partialSum}_n(y)$ is of order $O(\|y\|^n)$ as $y \to 0$ within the set $\{y \in E \mid x + y \in s \cup \{x\}\}$.
HasFPowerSeriesWithinOnBall.isBigO_image_sub_image_sub_deriv_principal theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) (hr : r' < r) : (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) =O[𝓟 (EMetric.ball (x, x) r' ∩ ((insert x s) ×ˢ (insert x s)))] fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖
Full source
/-- If `f` has formal power series `∑ n, pₙ` in a set, within a ball of radius `r`, then
for `y, z` in any smaller ball, the norm of the difference `f y - f z - p 1 (fun _ ↦ y - z)` is
bounded above by `C * (max ‖y - x‖ ‖z - x‖) * ‖y - z‖`. This lemma formulates this property
using `IsBigO` and `Filter.principal` on `E × E`. -/
theorem HasFPowerSeriesWithinOnBall.isBigO_image_sub_image_sub_deriv_principal
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (hr : r' < r) :
    (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2)
      =O[𝓟 (EMetric.ball (x, x) r' ∩ ((insert x s) ×ˢ (insert x s)))]
      fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖ := by
  lift r' to ℝ≥0 using ne_top_of_lt hr
  rcases (zero_le r').eq_or_lt with (rfl | hr'0)
  · simp only [ENNReal.coe_zero, EMetric.ball_zero, empty_inter, principal_empty, isBigO_bot]
  obtain ⟨a, ha, C, hC : 0 < C, hp⟩ :
      ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ n : ℕ, ‖p n‖ * (r' : ℝ) ^ n ≤ C * a ^ n :=
    p.norm_mul_pow_le_mul_pow_of_lt_radius (hr.trans_le hf.r_le)
  simp only [← le_div_iff₀ (pow_pos (NNReal.coe_pos.2 hr'0) _)] at hp
  set L : E × E → ℝ := fun y =>
    C * (a / r') ^ 2 * (‖y - (x, x)‖ * ‖y.1 - y.2‖) * (a / (1 - a) ^ 2 + 2 / (1 - a))
  have hL : ∀ y ∈ EMetric.ball (x, x) r' ∩ ((insert x s) ×ˢ (insert x s)),
      ‖f y.1 - f y.2 - p 1 fun _ => y.1 - y.2‖ ≤ L y := by
    intro y ⟨hy', ys⟩
    have hy : y ∈ EMetric.ball x r ×ˢ EMetric.ball x r := by
      rw [EMetric.ball_prod_same]
      exact EMetric.ball_subset_ball hr.le hy'
    set A : ℕ → F := fun n => (p n fun _ => y.1 - x) - p n fun _ => y.2 - x
    have hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) := by
      convert (hasSum_nat_add_iff' 2).2
        ((hf.hasSum_sub ⟨ys.1, hy.1⟩).sub (hf.hasSum_sub ⟨ys.2, hy.2⟩)) using 1
      rw [Finset.sum_range_succ, Finset.sum_range_one, hf.coeff_zero, hf.coeff_zero, sub_self,
        zero_add, ← Subsingleton.pi_single_eq (0 : Fin 1) (y.1 - x), Pi.single,
        ← Subsingleton.pi_single_eq (0 : Fin 1) (y.2 - x), Pi.single, ← (p 1).map_update_sub,
        ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right]
    rw [EMetric.mem_ball, edist_eq_enorm_sub, enorm_lt_coe] at hy'
    set B : ℕ → ℝ := fun n => C * (a / r') ^ 2 * (‖y - (x, x)‖ * ‖y.1 - y.2‖) * ((n + 2) * a ^ n)
    have hAB : ∀ n, ‖A (n + 2)‖ ≤ B n := fun n =>
      calc
        ‖A (n + 2)‖‖p (n + 2)‖ * ↑(n + 2) * ‖y - (x, x)‖ ^ (n + 1) * ‖y.1 - y.2‖ := by
          simpa only [Fintype.card_fin, pi_norm_const, Prod.norm_def, Pi.sub_def,
            Prod.fst_sub, Prod.snd_sub, sub_sub_sub_cancel_right] using
            (p <| n + 2).norm_image_sub_le (fun _ => y.1 - x) fun _ => y.2 - x
        _ = ‖p (n + 2)‖ * ‖y - (x, x)‖ ^ n * (↑(n + 2) * ‖y - (x, x)‖ * ‖y.1 - y.2‖) := by
          rw [pow_succ ‖y - (x, x)‖]
          ring
        _ ≤ C * a ^ (n + 2) / r' ^ (n + 2)
            * r' ^ n * (↑(n + 2) * ‖y - (x, x)‖ * ‖y.1 - y.2‖) := by
          have : 0 < a := ha.1
          gcongr
          · apply hp
          · apply hy'.le
        _ = B n := by
          field_simp [B, pow_succ]
          simp only [mul_assoc, mul_comm, mul_left_comm]
    have hBL : HasSum B (L y) := by
      apply HasSum.mul_left
      simp only [add_mul]
      have : ‖a‖ < 1 := by simp only [Real.norm_eq_abs, abs_of_pos ha.1, ha.2]
      rw [div_eq_mul_inv, div_eq_mul_inv]
      exact (hasSum_coe_mul_geometric_of_norm_lt_one this).add
          ((hasSum_geometric_of_norm_lt_one this).mul_left 2)
    exact hA.norm_le_of_bounded hBL hAB
  suffices L =O[𝓟 (EMetric.ball (x, x) r' ∩ ((insert x s) ×ˢ (insert x s)))]
      fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖ from
    .trans (.of_norm_eventuallyLE (eventually_principal.2 hL)) this
  simp_rw [L, mul_right_comm _ (_ * _)]
  exact (isBigO_refl _ _).const_mul_left _
Lipschitz-like bound for the difference of a function and its linear approximation in a ball with power series expansion
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ within a set $s \subseteq E$ and a ball of radius $r$ centered at $x \in E$. For any $r' < r$, the difference $f(y_1) - f(y_2) - p_1(y_1 - y_2)$ is bounded by $C \cdot \|(y_1, y_2) - (x, x)\| \cdot \|y_1 - y_2\|$ for all $(y_1, y_2)$ in the intersection of the ball of radius $r'$ centered at $(x, x)$ and the product set $(s \cup \{x\}) \times (s \cup \{x\})$, where $p_1$ is the first term of the power series $p$.
HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal theorem
(hf : HasFPowerSeriesOnBall f p x r) (hr : r' < r) : (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) =O[𝓟 (EMetric.ball (x, x) r')] fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖
Full source
/-- If `f` has formal power series `∑ n, pₙ` on a ball of radius `r`, then for `y, z` in any smaller
ball, the norm of the difference `f y - f z - p 1 (fun _ ↦ y - z)` is bounded above by
`C * (max ‖y - x‖ ‖z - x‖) * ‖y - z‖`. This lemma formulates this property using `IsBigO` and
`Filter.principal` on `E × E`. -/
theorem HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal
    (hf : HasFPowerSeriesOnBall f p x r) (hr : r' < r) :
    (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2)
      =O[𝓟 (EMetric.ball (x, x) r')] fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖ := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa using hf.isBigO_image_sub_image_sub_deriv_principal hr
Lipschitz-like bound for the difference of a function and its linear approximation in a ball with power series expansion
Informal description
Let \( f : E \to F \) be a function with a power series expansion \( p \) on a ball of radius \( r \) centered at \( x \). For any \( r' < r \), the difference \( f(y_1) - f(y_2) - p_1(y_1 - y_2) \) is bounded by \( C \cdot \|(y_1, y_2) - (x, x)\| \cdot \|y_1 - y_2\| \) for all \( (y_1, y_2) \) in the ball of radius \( r' \) centered at \( (x, x) \), where \( p_1 \) is the first term of the power series \( p \).
HasFPowerSeriesWithinOnBall.image_sub_sub_deriv_le theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) (hr : r' < r) : ∃ C, ∀ᵉ (y ∈ insert x s ∩ EMetric.ball x r') (z ∈ insert x s ∩ EMetric.ball x r'), ‖f y - f z - p 1 fun _ => y - z‖ ≤ C * max ‖y - x‖ ‖z - x‖ * ‖y - z‖
Full source
/-- If `f` has formal power series `∑ n, pₙ` within a set, on a ball of radius `r`, then for `y, z`
in any smaller ball, the norm of the difference `f y - f z - p 1 (fun _ ↦ y - z)` is bounded above
by `C * (max ‖y - x‖ ‖z - x‖) * ‖y - z‖`. -/
theorem HasFPowerSeriesWithinOnBall.image_sub_sub_deriv_le
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (hr : r' < r) :
    ∃ C, ∀ᵉ (y ∈ insert x s ∩ EMetric.ball x r') (z ∈ insert x s ∩ EMetric.ball x r'),
      ‖f y - f z - p 1 fun _ => y - z‖ ≤ C * max ‖y - x‖ ‖z - x‖ * ‖y - z‖ := by
  have := hf.isBigO_image_sub_image_sub_deriv_principal hr
  simp only [isBigO_principal, mem_inter_iff, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, mem_prod,
    norm_mul, Real.norm_eq_abs, abs_norm, and_imp, Prod.forall, mul_assoc] at this ⊢
  rcases this with ⟨C, hC⟩
  exact ⟨C, fun y ys hy z zs hz ↦ hC y z hy hz ys zs⟩
Lipschitz-like bound for the difference of a function and its linear approximation in a ball with power series expansion within a set
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ within a set $s \subseteq E$ on a ball of radius $r$ centered at $x \in E$. For any $r' < r$, there exists a constant $C > 0$ such that for all $y, z \in s \cup \{x\}$ in the ball of radius $r'$ centered at $x$, the following inequality holds: \[ \|f(y) - f(z) - p_1(y - z)\| \leq C \cdot \max(\|y - x\|, \|z - x\|) \cdot \|y - z\|, \] where $p_1$ is the first term of the power series $p$.
HasFPowerSeriesOnBall.image_sub_sub_deriv_le theorem
(hf : HasFPowerSeriesOnBall f p x r) (hr : r' < r) : ∃ C, ∀ᵉ (y ∈ EMetric.ball x r') (z ∈ EMetric.ball x r'), ‖f y - f z - p 1 fun _ => y - z‖ ≤ C * max ‖y - x‖ ‖z - x‖ * ‖y - z‖
Full source
/-- If `f` has formal power series `∑ n, pₙ` on a ball of radius `r`, then for `y, z` in any smaller
ball, the norm of the difference `f y - f z - p 1 (fun _ ↦ y - z)` is bounded above by
`C * (max ‖y - x‖ ‖z - x‖) * ‖y - z‖`. -/
theorem HasFPowerSeriesOnBall.image_sub_sub_deriv_le
    (hf : HasFPowerSeriesOnBall f p x r) (hr : r' < r) :
    ∃ C, ∀ᵉ (y ∈ EMetric.ball x r') (z ∈ EMetric.ball x r'),
      ‖f y - f z - p 1 fun _ => y - z‖ ≤ C * max ‖y - x‖ ‖z - x‖ * ‖y - z‖ := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa only [mem_univ, insert_eq_of_mem, univ_inter] using hf.image_sub_sub_deriv_le hr
Lipschitz-like bound for the difference of a function and its linear approximation in a ball with power series expansion
Informal description
Let \( f : E \to F \) be a function with a power series expansion \( p \) on a ball of radius \( r \) centered at \( x \). For any \( r' < r \), there exists a constant \( C > 0 \) such that for all \( y, z \) in the ball of radius \( r' \) centered at \( x \), the following inequality holds: \[ \|f(y) - f(z) - p_1(y - z)\| \leq C \cdot \max(\|y - x\|, \|z - x\|) \cdot \|y - z\|, \] where \( p_1 \) is the linear term of the power series \( p \).
HasFPowerSeriesWithinAt.isBigO_image_sub_norm_mul_norm_sub theorem
(hf : HasFPowerSeriesWithinAt f p s x) : (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) =O[𝓝[(insert x s) ×ˢ (insert x s)] (x, x)] fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖
Full source
/-- If `f` has formal power series `∑ n, pₙ` at `x` within a set `s`, then
`f y - f z - p 1 (fun _ ↦ y - z) = O(‖(y, z) - (x, x)‖ * ‖y - z‖)` as `(y, z) → (x, x)`
within `s × s`. -/
theorem HasFPowerSeriesWithinAt.isBigO_image_sub_norm_mul_norm_sub
    (hf : HasFPowerSeriesWithinAt f p s x) :
    (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2)
      =O[𝓝[(insert x s) ×ˢ (insert x s)] (x, x)] fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖ := by
  rcases hf with ⟨r, hf⟩
  rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hf.r_pos with ⟨r', r'0, h⟩
  refine (hf.isBigO_image_sub_image_sub_deriv_principal h).mono ?_
  rw [inter_comm]
  exact le_principal_iff.2 (inter_mem_nhdsWithin _ (EMetric.ball_mem_nhds _ r'0))
Lipschitz-like bound for the difference of a function and its linear approximation near a point with power series expansion
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ at a point $x$ within a set $s \subseteq E$. Then the difference $f(y) - f(z) - p_1(y - z)$ is bounded by $C \cdot \|(y, z) - (x, x)\| \cdot \|y - z\|$ as $(y, z)$ approaches $(x, x)$ within $(s \cup \{x\}) \times (s \cup \{x\})$, where $p_1$ is the linear term of the power series $p$.
HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub theorem
(hf : HasFPowerSeriesAt f p x) : (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) =O[𝓝 (x, x)] fun y => ‖y - (x, x)‖ * ‖y.1 - y.2‖
Full source
/-- If `f` has formal power series `∑ n, pₙ` at `x`, then
`f y - f z - p 1 (fun _ ↦ y - z) = O(‖(y, z) - (x, x)‖ * ‖y - z‖)` as `(y, z) → (x, x)`.
In particular, `f` is strictly differentiable at `x`. -/
theorem HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub (hf : HasFPowerSeriesAt f p x) :
    (fun y : E × E => f y.1 - f y.2 - p 1 fun _ => y.1 - y.2) =O[𝓝 (x, x)] fun y =>
      ‖y - (x, x)‖ * ‖y.1 - y.2‖ := by
  rw [← hasFPowerSeriesWithinAt_univ] at hf
  simpa using hf.isBigO_image_sub_norm_mul_norm_sub
Lipschitz-like bound for the difference of a function and its linear approximation near a point with power series expansion
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ at a point $x \in E$. Then the difference $f(y) - f(z) - p_1(y - z)$ is $O(\|(y, z) - (x, x)\| \cdot \|y - z\|)$ as $(y, z) \to (x, x)$, where $p_1$ is the linear term of the power series $p$. In particular, $f$ is strictly differentiable at $x$.
HasFPowerSeriesWithinOnBall.tendstoUniformlyOn theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) : TendstoUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop ((x + ·) ⁻¹' (insert x s) ∩ Metric.ball (0 : E) r')
Full source
/-- If a function admits a power series expansion within a set at `x`, then it is the uniform limit
of the partial sums of this power series on strict subdisks of the disk of convergence, i.e.,
`f (x + y)` is the uniform limit of `p.partialSum n y` there. -/
theorem HasFPowerSeriesWithinOnBall.tendstoUniformlyOn {r' : ℝ≥0}
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) :
    TendstoUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop
      ((x + ·)⁻¹' (insert x s)(x + ·)⁻¹' (insert x s) ∩ Metric.ball (0 : E) r') := by
  obtain ⟨a, ha, C, -, hp⟩ : ∃ a ∈ Ioo (0 : ℝ) 1, ∃ C > 0, ∀ y ∈ Metric.ball (0 : E) r', ∀ n,
    x + y ∈ insert x s → ‖f (x + y) - p.partialSum n y‖ ≤ C * a ^ n := hf.uniform_geometric_approx h
  refine Metric.tendstoUniformlyOn_iff.2 fun ε εpos => ?_
  have L : Tendsto (fun n => (C : ) * a ^ n) atTop (𝓝 ((C : ) * 0)) :=
    tendsto_const_nhds.mul (tendsto_pow_atTop_nhds_zero_of_lt_one ha.1.le ha.2)
  rw [mul_zero] at L
  refine (L.eventually (gt_mem_nhds εpos)).mono fun n hn y hy => ?_
  rw [dist_eq_norm]
  exact (hp y hy.2 n hy.1).trans_lt hn
Uniform Convergence of Partial Sums to Analytic Function on Subdisks
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, the sequence of partial sums $S_n(y) = \sum_{k=0}^{n-1} p_k(y, \dots, y)$ converges uniformly to $f(x + y)$ on the set $\{y \in E \mid \|y\| < r'\} \cap (x + \cdot)^{-1}(s \cup \{x\})$.
HasFPowerSeriesOnBall.tendstoUniformlyOn theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r) (h : (r' : ℝ≥0∞) < r) : TendstoUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop (Metric.ball (0 : E) r')
Full source
/-- If a function admits a power series expansion at `x`, then it is the uniform limit of the
partial sums of this power series on strict subdisks of the disk of convergence, i.e., `f (x + y)`
is the uniform limit of `p.partialSum n y` there. -/
theorem HasFPowerSeriesOnBall.tendstoUniformlyOn {r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r)
    (h : (r' : ℝ≥0∞) < r) :
    TendstoUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop
      (Metric.ball (0 : E) r') := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa using hf.tendstoUniformlyOn h
Uniform convergence of partial sums to analytic function on subdisks
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, the sequence of partial sums $S_n(y) = \sum_{k=0}^{n-1} p_k(y, \dots, y)$ converges uniformly to $f(x + y)$ on the ball $\{y \in E \mid \|y\| < r'\}$.
HasFPowerSeriesWithinOnBall.tendstoLocallyUniformlyOn theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : TendstoLocallyUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop ((x + ·) ⁻¹' (insert x s) ∩ EMetric.ball (0 : E) r)
Full source
/-- If a function admits a power series expansion within a set at `x`, then it is the locally
uniform limit of the partial sums of this power series on the disk of convergence, i.e., `f (x + y)`
is the locally uniform limit of `p.partialSum n y` there. -/
theorem HasFPowerSeriesWithinOnBall.tendstoLocallyUniformlyOn
    (hf : HasFPowerSeriesWithinOnBall f p s x r) :
    TendstoLocallyUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop
      ((x + ·)⁻¹' (insert x s)(x + ·)⁻¹' (insert x s) ∩ EMetric.ball (0 : E) r) := by
  intro u hu y hy
  rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hy.2 with ⟨r', yr', hr'⟩
  have : EMetric.ballEMetric.ball (0 : E) r' ∈ 𝓝 y := IsOpen.mem_nhds EMetric.isOpen_ball yr'
  refine ⟨(x + ·)⁻¹' (insert x s) ∩ EMetric.ball (0 : E) r', ?_, ?_⟩
  · rw [nhdsWithin_inter_of_mem']
    · exact inter_mem_nhdsWithin _ this
    · apply mem_nhdsWithin_of_mem_nhds
      apply Filter.mem_of_superset this (EMetric.ball_subset_ball hr'.le)
  · simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu
Local Uniform Convergence of Partial Sums to Analytic Function Within a Set
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. Then the sequence of partial sums $S_n(y) = \sum_{k=0}^{n-1} p_k(y, \dots, y)$ converges to $f(x + y)$ locally uniformly on the set $\{y \in E \mid \|y\| < r\} \cap (x + \cdot)^{-1}(s \cup \{x\})$.
HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn theorem
(hf : HasFPowerSeriesOnBall f p x r) : TendstoLocallyUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop (EMetric.ball (0 : E) r)
Full source
/-- If a function admits a power series expansion at `x`, then it is the locally uniform limit of
the partial sums of this power series on the disk of convergence, i.e., `f (x + y)`
is the locally uniform limit of `p.partialSum n y` there. -/
theorem HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn (hf : HasFPowerSeriesOnBall f p x r) :
    TendstoLocallyUniformlyOn (fun n y => p.partialSum n y) (fun y => f (x + y)) atTop
      (EMetric.ball (0 : E) r) := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa using hf.tendstoLocallyUniformlyOn
Local Uniform Convergence of Partial Sums to Analytic Function on Ball
Informal description
Let \( f : E \to F \) be a function that admits a power series expansion \( p \) centered at \( x \) with radius of convergence \( r > 0 \). Then the sequence of partial sums \( S_n(y) = \sum_{k=0}^{n-1} p_k(y, \dots, y) \) converges to \( f(x + y) \) locally uniformly on the ball \( \{ y \in E \mid \|y\| < r \} \).
HasFPowerSeriesWithinOnBall.tendstoUniformlyOn' theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) : TendstoUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop (insert x s ∩ Metric.ball (x : E) r')
Full source
/-- If a function admits a power series expansion within a set at `x`, then it is the uniform limit
of the partial sums of this power series on strict subdisks of the disk of convergence, i.e., `f y`
is the uniform limit of `p.partialSum n (y - x)` there. -/
theorem HasFPowerSeriesWithinOnBall.tendstoUniformlyOn' {r' : ℝ≥0}
    (hf : HasFPowerSeriesWithinOnBall f p s x r) (h : (r' : ℝ≥0∞) < r) :
    TendstoUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop
      (insertinsert x s ∩ Metric.ball (x : E) r') := by
  convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1
  · simp [Function.comp_def]
  · ext z
    simp [dist_eq_norm]
Uniform Convergence of Partial Sums to Analytic Function on Subdisks Within a Set
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, the sequence of partial sums $S_n(y) = \sum_{k=0}^{n-1} p_k(y - x, \dots, y - x)$ converges uniformly to $f(y)$ on the set $\{y \in E \mid \|y - x\| < r'\} \cap (s \cup \{x\})$.
HasFPowerSeriesOnBall.tendstoUniformlyOn' theorem
{r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r) (h : (r' : ℝ≥0∞) < r) : TendstoUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop (Metric.ball (x : E) r')
Full source
/-- If a function admits a power series expansion at `x`, then it is the uniform limit of the
partial sums of this power series on strict subdisks of the disk of convergence, i.e., `f y`
is the uniform limit of `p.partialSum n (y - x)` there. -/
theorem HasFPowerSeriesOnBall.tendstoUniformlyOn' {r' : ℝ≥0} (hf : HasFPowerSeriesOnBall f p x r)
    (h : (r' : ℝ≥0∞) < r) :
    TendstoUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop (Metric.ball (x : E) r') := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa using hf.tendstoUniformlyOn' h
Uniform convergence of partial sums to analytic function on subdisks
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$. For any $r' \in \mathbb{R}_{\geq 0}$ such that $r' < r$, the sequence of partial sums $S_n(y) = \sum_{k=0}^{n-1} p_k(y - x, \dots, y - x)$ converges uniformly to $f(y)$ on the ball $\{y \in E \mid \|y - x\| < r'\}$.
HasFPowerSeriesWithinOnBall.tendstoLocallyUniformlyOn' theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : TendstoLocallyUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop (insert x s ∩ EMetric.ball (x : E) r)
Full source
/-- If a function admits a power series expansion within a set at `x`, then it is the locally
uniform limit of the partial sums of this power series on the disk of convergence, i.e., `f y`
is the locally uniform limit of `p.partialSum n (y - x)` there. -/
theorem HasFPowerSeriesWithinOnBall.tendstoLocallyUniformlyOn'
    (hf : HasFPowerSeriesWithinOnBall f p s x r) :
    TendstoLocallyUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop
      (insertinsert x s ∩ EMetric.ball (x : E) r) := by
  have A : ContinuousOn (fun y : E => y - x) (insertinsert x s ∩ EMetric.ball (x : E) r) :=
    (continuous_id.sub continuous_const).continuousOn
  convert hf.tendstoLocallyUniformlyOn.comp (fun y : E => y - x) _ A using 1
  · ext z
    simp
  · intro z
    simp [edist_zero_eq_enorm, edist_eq_enorm_sub]
Local Uniform Convergence of Partial Sums to Analytic Function Within a Set and Ball
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. Then the sequence of partial sums $S_n(y) = \sum_{k=0}^{n-1} p_k(y - x, \dots, y - x)$ converges to $f(y)$ locally uniformly on the set $\{y \in E \mid \|y - x\| < r\} \cap (s \cup \{x\})$.
HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' theorem
(hf : HasFPowerSeriesOnBall f p x r) : TendstoLocallyUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop (EMetric.ball (x : E) r)
Full source
/-- If a function admits a power series expansion at `x`, then it is the locally uniform limit of
the partial sums of this power series on the disk of convergence, i.e., `f y`
is the locally uniform limit of `p.partialSum n (y - x)` there. -/
theorem HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' (hf : HasFPowerSeriesOnBall f p x r) :
    TendstoLocallyUniformlyOn (fun n y => p.partialSum n (y - x)) f atTop
      (EMetric.ball (x : E) r) := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa using hf.tendstoLocallyUniformlyOn'
Local Uniform Convergence of Partial Sums to Analytic Function on Ball of Convergence
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$. Then the sequence of partial sums $S_n(y) = \sum_{k=0}^{n-1} p_k(y - x, \dots, y - x)$ converges to $f(y)$ locally uniformly on the ball $\{y \in E \mid \|y - x\| < r\}$.
HasFPowerSeriesWithinOnBall.continuousOn theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : ContinuousOn f (insert x s ∩ EMetric.ball x r)
Full source
/-- If a function admits a power series expansion within a set on a ball, then it is
continuous there. -/
protected theorem HasFPowerSeriesWithinOnBall.continuousOn
    (hf : HasFPowerSeriesWithinOnBall f p s x r) :
    ContinuousOn f (insertinsert x s ∩ EMetric.ball x r) :=
  hf.tendstoLocallyUniformlyOn'.continuousOn <|
    Eventually.of_forall fun n =>
      ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn
Continuity of Analytic Functions Within a Set and Ball
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. Then $f$ is continuous on the intersection of the ball $\{y \in E \mid \|y - x\| < r\}$ with the set $s \cup \{x\}$.
HasFPowerSeriesOnBall.continuousOn theorem
(hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r)
Full source
/-- If a function admits a power series expansion on a ball, then it is continuous there. -/
protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) :
    ContinuousOn f (EMetric.ball x r) := by
  rw [← hasFPowerSeriesWithinOnBall_univ] at hf
  simpa using hf.continuousOn
Continuity of Analytic Functions on Their Ball of Convergence
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$. Then $f$ is continuous on the ball $\{y \in E \mid \|y - x\| < r\}$.
HasFPowerSeriesWithinOnBall.continuousWithinAt_insert theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : ContinuousWithinAt f (insert x s) x
Full source
protected theorem HasFPowerSeriesWithinOnBall.continuousWithinAt_insert
    (hf : HasFPowerSeriesWithinOnBall f p s x r) :
    ContinuousWithinAt f (insert x s) x := by
  apply (hf.continuousOn.continuousWithinAt (x := x) (by simp [hf.r_pos])).mono_of_mem_nhdsWithin
  exact inter_mem_nhdsWithin _ (EMetric.ball_mem_nhds x hf.r_pos)
Continuity at Center Point Within Extended Set for Analytic Functions
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. Then $f$ is continuous at $x$ within the set $s \cup \{x\}$.
HasFPowerSeriesWithinOnBall.continuousWithinAt theorem
(hf : HasFPowerSeriesWithinOnBall f p s x r) : ContinuousWithinAt f s x
Full source
protected theorem HasFPowerSeriesWithinOnBall.continuousWithinAt
    (hf : HasFPowerSeriesWithinOnBall f p s x r) :
    ContinuousWithinAt f s x :=
  hf.continuousWithinAt_insert.mono (subset_insert x s)
Continuity Within Set for Functions with Power Series Expansion
Informal description
Let $f : E \to F$ be a function that admits a power series expansion $p$ centered at $x$ with radius of convergence $r > 0$, valid within a set $s \subseteq E$. Then $f$ is continuous at $x$ within the set $s$.
HasFPowerSeriesWithinAt.continuousWithinAt_insert theorem
(hf : HasFPowerSeriesWithinAt f p s x) : ContinuousWithinAt f (insert x s) x
Full source
protected theorem HasFPowerSeriesWithinAt.continuousWithinAt_insert
    (hf : HasFPowerSeriesWithinAt f p s x) :
    ContinuousWithinAt f (insert x s) x := by
  rcases hf with ⟨r, hr⟩
  apply hr.continuousWithinAt_insert
Continuity at Center Point Within Extended Set for Functions with Power Series Expansion
Informal description
Let $f : E \to F$ be a function that has a power series expansion $p$ within a set $s$ at a point $x \in E$. Then $f$ is continuous at $x$ within the set $s \cup \{x\}$.
HasFPowerSeriesWithinAt.continuousWithinAt theorem
(hf : HasFPowerSeriesWithinAt f p s x) : ContinuousWithinAt f s x
Full source
protected theorem HasFPowerSeriesWithinAt.continuousWithinAt
    (hf : HasFPowerSeriesWithinAt f p s x) :
    ContinuousWithinAt f s x :=
  hf.continuousWithinAt_insert.mono (subset_insert x s)
Continuity within a set for functions with power series expansion
Informal description
Let $f : E \to F$ be a function that has a power series expansion $p$ within a set $s \subseteq E$ at a point $x \in E$. Then $f$ is continuous at $x$ within the set $s$.
HasFPowerSeriesAt.continuousAt theorem
(hf : HasFPowerSeriesAt f p x) : ContinuousAt f x
Full source
protected theorem HasFPowerSeriesAt.continuousAt (hf : HasFPowerSeriesAt f p x) :
    ContinuousAt f x :=
  let ⟨_, hr⟩ := hf
  hr.continuousOn.continuousAt (EMetric.ball_mem_nhds x hr.r_pos)
Continuity of Functions with Power Series Expansions at a Point
Informal description
If a function \( f : E \to F \) has a power series expansion at a point \( x \in E \), then \( f \) is continuous at \( x \).
AnalyticWithinAt.continuousWithinAt_insert theorem
(hf : AnalyticWithinAt 𝕜 f s x) : ContinuousWithinAt f (insert x s) x
Full source
protected theorem AnalyticWithinAt.continuousWithinAt_insert (hf : AnalyticWithinAt 𝕜 f s x) :
    ContinuousWithinAt f (insert x s) x :=
  let ⟨_, hp⟩ := hf
  hp.continuousWithinAt_insert
Continuity of Analytic Functions at Point within Extended Set
Informal description
Let $f : E \to F$ be a function that is analytic within a set $s \subseteq E$ at a point $x \in E$. Then $f$ is continuous at $x$ within the extended set $s \cup \{x\}$.
AnalyticWithinAt.continuousWithinAt theorem
(hf : AnalyticWithinAt 𝕜 f s x) : ContinuousWithinAt f s x
Full source
protected theorem AnalyticWithinAt.continuousWithinAt (hf : AnalyticWithinAt 𝕜 f s x) :
    ContinuousWithinAt f s x :=
  hf.continuousWithinAt_insert.mono (subset_insert x s)
Continuity of Analytic Functions within a Set at a Point
Informal description
Let $f : E \to F$ be a function that is analytic within a set $s \subseteq E$ at a point $x \in E$. Then $f$ is continuous at $x$ within the set $s$.
AnalyticAt.continuousAt theorem
(hf : AnalyticAt 𝕜 f x) : ContinuousAt f x
Full source
@[fun_prop]
protected theorem AnalyticAt.continuousAt (hf : AnalyticAt 𝕜 f x) : ContinuousAt f x :=
  let ⟨_, hp⟩ := hf
  hp.continuousAt
Continuity of Analytic Functions at a Point
Informal description
If a function \( f : E \to F \) is analytic at a point \( x \in E \), then \( f \) is continuous at \( x \).
AnalyticAt.eventually_continuousAt theorem
(hf : AnalyticAt 𝕜 f x) : ∀ᶠ y in 𝓝 x, ContinuousAt f y
Full source
protected theorem AnalyticAt.eventually_continuousAt (hf : AnalyticAt 𝕜 f x) :
    ∀ᶠ y in 𝓝 x, ContinuousAt f y := by
  rcases hf with ⟨g, r, hg⟩
  have : EMetric.ballEMetric.ball x r ∈ 𝓝 x := EMetric.ball_mem_nhds _ hg.r_pos
  filter_upwards [this] with y hy
  apply hg.continuousOn.continuousAt
  exact EMetric.isOpen_ball.mem_nhds hy
Local Continuity of Analytic Functions
Informal description
If a function \( f : E \to F \) is analytic at a point \( x \in E \), then \( f \) is continuous at every point in some neighborhood of \( x \).
AnalyticOnNhd.continuousOn theorem
{s : Set E} (hf : AnalyticOnNhd 𝕜 f s) : ContinuousOn f s
Full source
protected theorem AnalyticOnNhd.continuousOn {s : Set E} (hf : AnalyticOnNhd 𝕜 f s) :
    ContinuousOn f s :=
  fun x hx => (hf x hx).continuousAt.continuousWithinAt
Continuity of functions analytic on a neighborhood of a set
Informal description
If a function $f \colon E \to F$ is analytic on a neighborhood of a set $s \subseteq E$, then $f$ is continuous on $s$.
AnalyticOn.continuousOn theorem
{f : E → F} {s : Set E} (h : AnalyticOn 𝕜 f s) : ContinuousOn f s
Full source
protected lemma AnalyticOn.continuousOn {f : E → F} {s : Set E} (h : AnalyticOn 𝕜 f s) :
    ContinuousOn f s :=
  fun x m ↦ (h x m).continuousWithinAt
Continuity of Analytic Functions on a Set
Informal description
Let $f \colon E \to F$ be a function that is analytic on a set $s \subseteq E$. Then $f$ is continuous on $s$.
AnalyticOnNhd.continuous theorem
{f : E → F} (fa : AnalyticOnNhd 𝕜 f univ) : Continuous f
Full source
/-- Analytic everywhere implies continuous -/
theorem AnalyticOnNhd.continuous {f : E → F} (fa : AnalyticOnNhd 𝕜 f univ) : Continuous f := by
  rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn
Continuity of Everywhere Analytic Functions
Informal description
If a function \( f \colon E \to F \) is analytic on a neighborhood of every point in \( E \), then \( f \) is continuous on \( E \).
FormalMultilinearSeries.hasFPowerSeriesOnBall theorem
[CompleteSpace F] (p : FormalMultilinearSeries 𝕜 E F) (h : 0 < p.radius) : HasFPowerSeriesOnBall p.sum p 0 p.radius
Full source
/-- In a complete space, the sum of a converging power series `p` admits `p` as a power series.
This is not totally obvious as we need to check the convergence of the series. -/
protected theorem FormalMultilinearSeries.hasFPowerSeriesOnBall [CompleteSpace F]
    (p : FormalMultilinearSeries 𝕜 E F) (h : 0 < p.radius) :
    HasFPowerSeriesOnBall p.sum p 0 p.radius :=
  { r_le := le_rfl
    r_pos := h
    hasSum := fun hy => by
      rw [zero_add]
      exact p.hasSum hy }
Power Series Expansion of Sum in Complete Space: \( p.\text{sum} \) has \( p \) as its power series on \( B(0, R) \)
Informal description
Let \( E \) and \( F \) be normed spaces over a field \( \mathbb{K} \), with \( F \) complete. Let \( p \) be a formal multilinear series from \( E \) to \( F \) with positive radius of convergence \( R = p.\text{radius} > 0 \). Then the sum \( p.\text{sum} \) of the series \( p \) admits \( p \) as its power series expansion on the ball of radius \( R \) centered at \( 0 \), i.e., for all \( y \in E \) with \( \|y\| < R \), we have \( p.\text{sum}(y) = \sum_{n=0}^\infty p_n(y, \dots, y) \).
HasFPowerSeriesWithinOnBall.sum theorem
(h : HasFPowerSeriesWithinOnBall f p s x r) {y : E} (h'y : x + y ∈ insert x s) (hy : y ∈ EMetric.ball (0 : E) r) : f (x + y) = p.sum y
Full source
theorem HasFPowerSeriesWithinOnBall.sum (h : HasFPowerSeriesWithinOnBall f p s x r) {y : E}
    (h'y : x + y ∈ insert x s) (hy : y ∈ EMetric.ball (0 : E) r) : f (x + y) = p.sum y :=
  (h.hasSum h'y hy).tsum_eq.symm
Power Series Expansion within a Set and Ball
Informal description
Let $f : E \to F$ be a function with a converging power series expansion $p$ on a ball of radius $r$ centered at $x$, valid within a set $s \subseteq E$. For any $y \in E$ such that $x + y$ belongs to $s \cup \{x\}$ and $y$ lies in the open ball of radius $r$ centered at $0$, we have $f(x + y) = \sum_{n=0}^\infty p_n(y, \dots, y)$.
HasFPowerSeriesOnBall.sum theorem
(h : HasFPowerSeriesOnBall f p x r) {y : E} (hy : y ∈ EMetric.ball (0 : E) r) : f (x + y) = p.sum y
Full source
theorem HasFPowerSeriesOnBall.sum (h : HasFPowerSeriesOnBall f p x r) {y : E}
    (hy : y ∈ EMetric.ball (0 : E) r) : f (x + y) = p.sum y :=
  (h.hasSum hy).tsum_eq.symm
Power Series Expansion Formula on a Ball
Informal description
Let $f : E \to F$ be a function with a power series expansion $p$ on the ball of radius $r > 0$ centered at $x \in E$. Then for any $y \in E$ with $\|y\| < r$, we have $f(x + y) = \sum_{n=0}^\infty p_n(y, \dots, y)$, where $p_n$ is the $n$-th multilinear term of the series $p$.
FormalMultilinearSeries.continuousOn theorem
[CompleteSpace F] : ContinuousOn p.sum (EMetric.ball 0 p.radius)
Full source
/-- The sum of a converging power series is continuous in its disk of convergence. -/
protected theorem FormalMultilinearSeries.continuousOn [CompleteSpace F] :
    ContinuousOn p.sum (EMetric.ball 0 p.radius) := by
  rcases (zero_le p.radius).eq_or_lt with h | h
  · simp [← h, continuousOn_empty]
  · exact (p.hasFPowerSeriesOnBall h).continuousOn
Continuity of Power Series Sum in Its Disk of Convergence
Informal description
Let $E$ and $F$ be normed spaces over a field $\mathbb{K}$, with $F$ complete. For any formal multilinear series $p$ from $E$ to $F$, the sum function $p.\text{sum}$ is continuous on the open ball of radius $p.\text{radius}$ centered at $0$ in $E$.
hasFPowerSeriesAt_iff theorem
: HasFPowerSeriesAt f p z₀ ↔ ∀ᶠ z in 𝓝 0, HasSum (fun n => z ^ n • p.coeff n) (f (z₀ + z))
Full source
/-- A function `f : 𝕜 → E` has `p` as power series expansion at a point `z₀` iff it is the sum of
`p` in a neighborhood of `z₀`. This makes some proofs easier by hiding the fact that
`HasFPowerSeriesAt` depends on `p.radius`. -/
theorem hasFPowerSeriesAt_iff :
    HasFPowerSeriesAtHasFPowerSeriesAt f p z₀ ↔ ∀ᶠ z in 𝓝 0, HasSum (fun n => z ^ n • p.coeff n) (f (z₀ + z)) := by
  refine ⟨fun ⟨r, _, r_pos, h⟩ =>
    eventually_of_mem (EMetric.ball_mem_nhds 0 r_pos) fun _ => by simpa using h, ?_⟩
  simp only [Metric.eventually_nhds_iff]
  rintro ⟨r, r_pos, h⟩
  refine ⟨p.radius ⊓ r.toNNReal, by simp, ?_, ?_⟩
  · simp only [r_pos.lt, lt_inf_iff, ENNReal.coe_pos, Real.toNNReal_pos, and_true]
    obtain ⟨z, z_pos, le_z⟩ := NormedField.exists_norm_lt 𝕜 r_pos.lt
    have : (‖z‖₊ : ENNReal) ≤ p.radius := by
      simp only [dist_zero_right] at h
      apply FormalMultilinearSeries.le_radius_of_tendsto
      convert tendsto_norm.comp (h le_z).summable.tendsto_atTop_zero
      simp [norm_smul, mul_comm]
    refine lt_of_lt_of_le ?_ this
    simp only [ENNReal.coe_pos]
    exact zero_lt_iff.mpr (nnnorm_ne_zero_iff.mpr (norm_pos_iff.mp z_pos))
  · simp only [EMetric.mem_ball, lt_inf_iff, edist_lt_coe, apply_eq_pow_smul_coeff, and_imp,
      dist_zero_right] at h ⊢
    refine fun {y} _ hyr => h ?_
    simpa [nndist_eq_nnnorm, Real.lt_toNNReal_iff_coe_lt] using hyr
Equivalence of Power Series Expansion and Local Sum Convergence
Informal description
A function \( f : \mathbb{K} \to E \) has a formal power series expansion \( p \) at a point \( z_0 \) if and only if, for all \( z \) in a neighborhood of \( 0 \), the sum \( \sum_{n=0}^\infty z^n \cdot p_n \) converges to \( f(z_0 + z) \). Here, \( p_n \) denotes the \( n \)-th coefficient of the power series \( p \).
hasFPowerSeriesAt_iff' theorem
: HasFPowerSeriesAt f p z₀ ↔ ∀ᶠ z in 𝓝 z₀, HasSum (fun n => (z - z₀) ^ n • p.coeff n) (f z)
Full source
theorem hasFPowerSeriesAt_iff' :
    HasFPowerSeriesAtHasFPowerSeriesAt f p z₀ ↔ ∀ᶠ z in 𝓝 z₀, HasSum (fun n => (z - z₀) ^ n • p.coeff n) (f z) := by
  rw [← map_add_left_nhds_zero, eventually_map, hasFPowerSeriesAt_iff]
  simp_rw [add_sub_cancel_left]
Power Series Expansion Characterization at a Point
Informal description
A function \( f \) has a power series expansion \( p \) at a point \( z_0 \) if and only if, for all \( z \) in a neighborhood of \( z_0 \), the sum \( \sum_{n=0}^\infty (z - z_0)^n \cdot p_n \) converges to \( f(z) \), where \( p_n \) denotes the \( n \)-th coefficient of the power series \( p \).