state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) n : β„• ⊒ C * (a * (a * a ^ n)) * ↑r' ^ n * ((↑n + 2) * β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (↑r' * ↑r') = C * (a * a) * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) * (↑r' * (↑r' * ↑r' ^ n))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [pow_succ]
simp only [mul_assoc, mul_comm, mul_left_comm]
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [pow_succ]
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n ⊒ β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2)
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [pow_succ] simp only [mul_assoc, mul_comm, mul_left_comm]
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n ⊒ HasSum B (L y)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [pow_succ] simp only [mul_assoc, mul_comm, mul_left_comm] have hBL : HasSum B (L y) := by
apply HasSum.mul_left
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [pow_succ] simp only [mul_assoc, mul_comm, mul_left_comm] have hBL : HasSum B (L y) := by
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n ⊒ HasSum (fun i => (↑i + 2) * a ^ i) (a / (1 - a) ^ 2 + 2 / (1 - a))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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]
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [pow_succ] simp only [mul_assoc, mul_comm, mul_left_comm] have hBL : HasSum B (L y) := by apply HasSum.mul_left
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n ⊒ HasSum (fun i => ↑i * a ^ i + 2 * a ^ i) (a / (1 - a) ^ 2 + 2 / (1 - a))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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]
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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]
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n ⊒ β€–aβ€– < 1
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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]
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n this : β€–aβ€– < 1 ⊒ HasSum (fun i => ↑i * a ^ i + 2 * a ^ i) (a / (1 - a) ^ 2 + 2 / (1 - a))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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]
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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]
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n this : β€–aβ€– < 1 ⊒ HasSum (fun i => ↑i * a ^ i + 2 * a ^ i) (a * ((1 - a) ^ 2)⁻¹ + 2 * (1 - a)⁻¹)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2)
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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]
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) y : E Γ— E hy' : β€–y - (x, x)β€–β‚Š < r' hy : y ∈ EMetric.ball x r Γ—Λ’ EMetric.ball x r A : β„• β†’ F := fun n => ((p n) fun x_1 => y.1 - x) - (p n) fun x_1 => y.2 - x hA : HasSum (fun n => A (n + 2)) (f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) B : β„• β†’ ℝ := fun n => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * ((↑n + 2) * a ^ n) hAB : βˆ€ (n : β„•), β€–A (n + 2)β€– ≀ B n hBL : HasSum B (L y) ⊒ β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2)
exact hA.norm_le_of_bounded hBL hAB
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2)
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case intro.inr.intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) hL : βˆ€ y ∈ EMetric.ball (x, x) ↑r', β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y ⊒ (fun y => f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) =O[π“Ÿ (EMetric.ball (x, x) ↑r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB
suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _)
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) hL : βˆ€ y ∈ EMetric.ball (x, x) ↑r', β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y this : L =O[π“Ÿ (EMetric.ball (x, x) ↑r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– ⊒ (fun y => f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) =O[π“Ÿ (EMetric.ball (x, x) ↑r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by
refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) hL : βˆ€ y ∈ EMetric.ball (x, x) ↑r', β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y this : L =O[π“Ÿ (EMetric.ball (x, x) ↑r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– y : E Γ— E hy : y ∈ EMetric.ball (x, x) ↑r' ⊒ β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ 1 * β€–L yβ€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this
rw [one_mul]
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) hL : βˆ€ y ∈ EMetric.ball (x, x) ↑r', β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y this : L =O[π“Ÿ (EMetric.ball (x, x) ↑r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– y : E Γ— E hy : y ∈ EMetric.ball (x, x) ↑r' ⊒ β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ β€–L yβ€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul]
exact (hL y hy).trans (le_abs_self _)
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul]
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case intro.inr.intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) hL : βˆ€ y ∈ EMetric.ball (x, x) ↑r', β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y ⊒ L =O[π“Ÿ (EMetric.ball (x, x) ↑r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _)
simp_rw [mul_right_comm _ (_ * _)]
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _)
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case intro.inr.intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 hr : ↑r' < r hr'0 : 0 < r' a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hC : 0 < C hp : βˆ€ (n : β„•), β€–p nβ€– ≀ C * a ^ n / ↑r' ^ n L : E Γ— E β†’ ℝ := fun y => C * (a / ↑r') ^ 2 * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–) * (a / (1 - a) ^ 2 + 2 / (1 - a)) hL : βˆ€ y ∈ EMetric.ball (x, x) ↑r', β€–f y.1 - f y.2 - (p 1) fun x => y.1 - y.2β€– ≀ L y ⊒ (fun y => C * (a / ↑r') ^ 2 * (a / (1 - a) ^ 2 + 2 / (1 - a)) * (β€–y - (x, x)β€– * β€–y.1 - y.2β€–)) =O[π“Ÿ (EMetric.ball (x, x) ↑r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`.
exact (isBigO_refl _ _).const_mul_left _
/-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`.
Mathlib.Analysis.Analytic.Basic.729_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ 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 x => y - zβ€– ≀ C * max β€–y - xβ€– β€–z - xβ€– * β€–y - zβ€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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
simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr
/-- 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
Mathlib.Analysis.Analytic.Basic.800_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesAt f p x ⊒ (fun y => f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) =O[𝓝 (x, x)] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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
rcases hf with ⟨r, hf⟩
/-- 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
Mathlib.Analysis.Analytic.Basic.812_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r✝ r' r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r ⊒ (fun y => f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) =O[𝓝 (x, x)] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 rcases hf with ⟨r, hf⟩
rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hf.r_pos with ⟨r', r'0, h⟩
/-- 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 rcases hf with ⟨r, hf⟩
Mathlib.Analysis.Analytic.Basic.812_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r✝ r'✝ r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 r'0 : 0 < ↑r' h : ↑r' < r ⊒ (fun y => f y.1 - f y.2 - (p 1) fun x => y.1 - y.2) =O[𝓝 (x, x)] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _
/-- 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 rcases hf with ⟨r, hf⟩ rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hf.r_pos with ⟨r', r'0, h⟩
Mathlib.Analysis.Analytic.Basic.812_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r✝ r'✝ r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r r' : ℝβ‰₯0 r'0 : 0 < ↑r' h : ↑r' < r ⊒ 𝓝 (x, x) ≀ π“Ÿ (EMetric.ball (x, x) ↑r')
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _
exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0)
/-- 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 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 _
Mathlib.Analysis.Analytic.Basic.812_0.jQw1fRSE1vGpOll
/-- 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β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r ⊒ TendstoUniformlyOn (fun n y => FormalMultilinearSeries.partialSum p n y) (fun y => f (x + y)) atTop (Metric.ball 0 ↑r')
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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
obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n
/-- 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
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r ⊒ βˆƒ a ∈ Ioo 0 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n case intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hp : βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n ⊒ TendstoUniformlyOn (fun n y => FormalMultilinearSeries.partialSum p n y) (fun y => f (x + y)) atTop (Metric.ball 0 ↑r')
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n
exact hf.uniform_geometric_approx h
/-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hp : βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n ⊒ TendstoUniformlyOn (fun n y => FormalMultilinearSeries.partialSum p n y) (fun y => f (x + y)) atTop (Metric.ball 0 ↑r')
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact hf.uniform_geometric_approx h
refine' Metric.tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => _
/-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact hf.uniform_geometric_approx h
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hp : βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n Ξ΅ : ℝ Ξ΅pos : Ξ΅ > 0 ⊒ βˆ€αΆ  (n : β„•) in atTop, βˆ€ x_1 ∈ Metric.ball 0 ↑r', dist (f (x + x_1)) (FormalMultilinearSeries.partialSum p n x_1) < Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 ha.1.le ha.2)
/-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact hf.uniform_geometric_approx h refine' Metric.tendstoUniformlyOn_iff.2 fun Ξ΅ Ξ΅pos => _
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hp : βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n Ξ΅ : ℝ Ξ΅pos : Ξ΅ > 0 L : Tendsto (fun n => C * a ^ n) atTop (𝓝 (C * 0)) ⊒ βˆ€αΆ  (n : β„•) in atTop, βˆ€ x_1 ∈ Metric.ball 0 ↑r', dist (f (x + x_1)) (FormalMultilinearSeries.partialSum p n x_1) < Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 ha.1.le ha.2)
rw [mul_zero] at L
/-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 ha.1.le ha.2)
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hp : βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n Ξ΅ : ℝ Ξ΅pos : Ξ΅ > 0 L : Tendsto (fun n => C * a ^ n) atTop (𝓝 0) ⊒ βˆ€αΆ  (n : β„•) in atTop, βˆ€ x_1 ∈ Metric.ball 0 ↑r', dist (f (x + x_1)) (FormalMultilinearSeries.partialSum p n x_1) < Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 ha.1.le ha.2) rw [mul_zero] at L
refine' (L.eventually (gt_mem_nhds Ξ΅pos)).mono fun n hn y hy => _
/-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 ha.1.le ha.2) rw [mul_zero] at L
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hp : βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n Ξ΅ : ℝ Ξ΅pos : Ξ΅ > 0 L : Tendsto (fun n => C * a ^ n) atTop (𝓝 0) n : β„• hn : C * a ^ n < Ξ΅ y : E hy : y ∈ Metric.ball 0 ↑r' ⊒ dist (f (x + y)) (FormalMultilinearSeries.partialSum p n y) < Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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]
/-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 ha.1.le ha.2) rw [mul_zero] at L refine' (L.eventually (gt_mem_nhds Ξ΅pos)).mono fun n hn y hy => _
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r a : ℝ ha : a ∈ Ioo 0 1 C : ℝ hp : βˆ€ y ∈ Metric.ball 0 ↑r', βˆ€ (n : β„•), β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– ≀ C * a ^ n Ξ΅ : ℝ Ξ΅pos : Ξ΅ > 0 L : Tendsto (fun n => C * a ^ n) atTop (𝓝 0) n : β„• hn : C * a ^ n < Ξ΅ y : E hy : y ∈ Metric.ball 0 ↑r' ⊒ β€–f (x + y) - FormalMultilinearSeries.partialSum p n yβ€– < Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn
/-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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]
Mathlib.Analysis.Analytic.Basic.825_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r ⊒ TendstoLocallyUniformlyOn (fun n y => FormalMultilinearSeries.partialSum p n y) (fun y => f (x + y)) atTop (EMetric.ball 0 r)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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
intro u hu x hx
/-- 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
Mathlib.Analysis.Analytic.Basic.844_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x✝ : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x✝ r u : Set (F Γ— F) hu : u ∈ uniformity F x : E hx : x ∈ EMetric.ball 0 r ⊒ βˆƒ t ∈ 𝓝[EMetric.ball 0 r] x, βˆ€αΆ  (n : β„•) in atTop, βˆ€ y ∈ t, ((fun y => f (x✝ + y)) y, (fun n y => FormalMultilinearSeries.partialSum p n y) n y) ∈ u
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx
rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩
/-- 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 intro u hu x hx
Mathlib.Analysis.Analytic.Basic.844_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
case intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x✝ : E r r'✝ : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x✝ r u : Set (F Γ— F) hu : u ∈ uniformity F x : E hx : x ∈ EMetric.ball 0 r r' : ℝβ‰₯0 xr' : edist x 0 < ↑r' hr' : ↑r' < r ⊒ βˆƒ t ∈ 𝓝[EMetric.ball 0 r] x, βˆ€αΆ  (n : β„•) in atTop, βˆ€ y ∈ t, ((fun y => f (x✝ + y)) y, (fun n y => FormalMultilinearSeries.partialSum p n y) n y) ∈ u
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩
have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr'
/-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩
Mathlib.Analysis.Analytic.Basic.844_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
case intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x✝ : E r r'✝ : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x✝ r u : Set (F Γ— F) hu : u ∈ uniformity F x : E hx : x ∈ EMetric.ball 0 r r' : ℝβ‰₯0 xr' : edist x 0 < ↑r' hr' : ↑r' < r this : EMetric.ball 0 ↑r' ∈ 𝓝 x ⊒ βˆƒ t ∈ 𝓝[EMetric.ball 0 r] x, βˆ€αΆ  (n : β„•) in atTop, βˆ€ y ∈ t, ((fun y => f (x✝ + y)) y, (fun n y => FormalMultilinearSeries.partialSum p n y) n y) ∈ u
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr'
refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩
/-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr'
Mathlib.Analysis.Analytic.Basic.844_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
case intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x✝ : E r r'✝ : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x✝ r u : Set (F Γ— F) hu : u ∈ uniformity F x : E hx : x ∈ EMetric.ball 0 r r' : ℝβ‰₯0 xr' : edist x 0 < ↑r' hr' : ↑r' < r this : EMetric.ball 0 ↑r' ∈ 𝓝 x ⊒ βˆ€αΆ  (n : β„•) in atTop, βˆ€ y ∈ EMetric.ball 0 ↑r', ((fun y => f (x✝ + y)) y, (fun n y => FormalMultilinearSeries.partialSum p n y) n y) ∈ u
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩
simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu
/-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩
Mathlib.Analysis.Analytic.Basic.844_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r ⊒ TendstoUniformlyOn (fun n y => FormalMultilinearSeries.partialSum p n (y - x)) f atTop (Metric.ball x ↑r')
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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
convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1
/-- 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
Mathlib.Analysis.Analytic.Basic.857_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case h.e'_6 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r ⊒ f = (fun y => f (x + y)) ∘ fun y => y - x
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β·
simp [(· ∘ ·)]
/-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β·
Mathlib.Analysis.Analytic.Basic.857_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case h.e'_8 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r ⊒ Metric.ball x ↑r' = (fun y => y - x) ⁻¹' Metric.ball 0 ↑r'
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β·
ext z
/-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β·
Mathlib.Analysis.Analytic.Basic.857_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
case h.e'_8.h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r'✝ : ℝβ‰₯0∞ r' : ℝβ‰₯0 hf : HasFPowerSeriesOnBall f p x r h : ↑r' < r z : E ⊒ z ∈ Metric.ball x ↑r' ↔ z ∈ (fun y => y - x) ⁻¹' Metric.ball 0 ↑r'
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z
simp [dist_eq_norm]
/-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z
Mathlib.Analysis.Analytic.Basic.857_0.jQw1fRSE1vGpOll
/-- 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')
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r ⊒ TendstoLocallyUniformlyOn (fun n y => FormalMultilinearSeries.partialSum p n (y - x)) f atTop (EMetric.ball x r)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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
have A : ContinuousOn (fun y : E => y - x) (EMetric.ball (x : E) r) := (continuous_id.sub continuous_const).continuousOn
/-- 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
Mathlib.Analysis.Analytic.Basic.869_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r A : ContinuousOn (fun y => y - x) (EMetric.ball x r) ⊒ TendstoLocallyUniformlyOn (fun n y => FormalMultilinearSeries.partialSum p n (y - x)) f atTop (EMetric.ball x r)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (EMetric.ball (x : E) r) := (continuous_id.sub continuous_const).continuousOn
convert hf.tendstoLocallyUniformlyOn.comp (fun y : E => y - x) _ A using 1
/-- 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 have A : ContinuousOn (fun y : E => y - x) (EMetric.ball (x : E) r) := (continuous_id.sub continuous_const).continuousOn
Mathlib.Analysis.Analytic.Basic.869_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
case h.e'_7 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r A : ContinuousOn (fun y => y - x) (EMetric.ball x r) ⊒ f = (fun y => f (x + y)) ∘ fun y => y - x
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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
/-- 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 have A : ContinuousOn (fun y : E => y - x) (EMetric.ball (x : E) r) := (continuous_id.sub continuous_const).continuousOn convert hf.tendstoLocallyUniformlyOn.comp (fun y : E => y - x) _ A using 1 Β·
Mathlib.Analysis.Analytic.Basic.869_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
case h.e'_7.h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r A : ContinuousOn (fun y => y - x) (EMetric.ball x r) z : E ⊒ f z = ((fun y => f (x + y)) ∘ fun y => y - x) z
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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
/-- 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 have A : ContinuousOn (fun y : E => y - x) (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
Mathlib.Analysis.Analytic.Basic.869_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r A : ContinuousOn (fun y => y - x) (EMetric.ball x r) ⊒ MapsTo (fun y => y - x) (EMetric.ball x r) (EMetric.ball 0 r)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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
/-- 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 have A : ContinuousOn (fun y : E => y - x) (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 Β·
Mathlib.Analysis.Analytic.Basic.869_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r A : ContinuousOn (fun y => y - x) (EMetric.ball x r) z : E ⊒ z ∈ EMetric.ball x r β†’ (fun y => y - x) z ∈ EMetric.ball 0 r
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub]
/-- 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 have A : ContinuousOn (fun y : E => y - x) (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
Mathlib.Analysis.Analytic.Basic.869_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f✝ g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ f : E β†’ F fa : AnalyticOn π•œ f univ ⊒ Continuous f
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by
rw [continuous_iff_continuousOn_univ]
/-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by
Mathlib.Analysis.Analytic.Basic.907_0.jQw1fRSE1vGpOll
/-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G f✝ g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ f : E β†’ F fa : AnalyticOn π•œ f univ ⊒ ContinuousOn f univ
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ];
exact fa.continuousOn
/-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ];
Mathlib.Analysis.Analytic.Basic.907_0.jQw1fRSE1vGpOll
/-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁷ : NontriviallyNormedField π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : NormedSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace π•œ F inst✝² : NormedAddCommGroup G inst✝¹ : NormedSpace π•œ G f g : E β†’ F p✝ pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F h : 0 < radius p y✝ : E hy : y✝ ∈ EMetric.ball 0 (radius p) ⊒ HasSum (fun n => (p n) fun x => y✝) (FormalMultilinearSeries.sum p (0 + y✝))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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]
/-- 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
Mathlib.Analysis.Analytic.Basic.911_0.jQw1fRSE1vGpOll
/-- 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
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁷ : NontriviallyNormedField π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : NormedSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace π•œ F inst✝² : NormedAddCommGroup G inst✝¹ : NormedSpace π•œ G f g : E β†’ F p✝ pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F h : 0 < radius p y✝ : E hy : y✝ ∈ EMetric.ball 0 (radius p) ⊒ HasSum (fun n => (p n) fun x => y✝) (FormalMultilinearSeries.sum p y✝)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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
/-- 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]
Mathlib.Analysis.Analytic.Basic.911_0.jQw1fRSE1vGpOll
/-- 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
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁷ : NontriviallyNormedField π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : NormedSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace π•œ F inst✝² : NormedAddCommGroup G inst✝¹ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ inst✝ : CompleteSpace F ⊒ ContinuousOn (FormalMultilinearSeries.sum p) (EMetric.ball 0 (radius p))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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
/-- 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
Mathlib.Analysis.Analytic.Basic.928_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
case inl π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁷ : NontriviallyNormedField π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : NormedSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace π•œ F inst✝² : NormedAddCommGroup G inst✝¹ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ inst✝ : CompleteSpace F h : 0 = radius p ⊒ ContinuousOn (FormalMultilinearSeries.sum p) (EMetric.ball 0 (radius p))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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]
/-- 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 Β·
Mathlib.Analysis.Analytic.Basic.928_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
case inr π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁷ : NontriviallyNormedField π•œ inst✝⁢ : NormedAddCommGroup E inst✝⁡ : NormedSpace π•œ E inst✝⁴ : NormedAddCommGroup F inst✝³ : NormedSpace π•œ F inst✝² : NormedAddCommGroup G inst✝¹ : NormedSpace π•œ G f g : E β†’ F p pf pg : FormalMultilinearSeries π•œ E F x : E r r' : ℝβ‰₯0∞ inst✝ : CompleteSpace F h : 0 < radius p ⊒ ContinuousOn (FormalMultilinearSeries.sum p) (EMetric.ball 0 (radius p))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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
/-- 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] Β·
Mathlib.Analysis.Analytic.Basic.928_0.jQw1fRSE1vGpOll
/-- 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)
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F h : (fun y => p fun x => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1) y : E ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by
obtain ⟨c, c_pos, hc⟩ := h.exists_pos
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F h : (fun y => p fun x => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1) y : E c : ℝ c_pos : c > 0 hc : IsBigOWith c (𝓝 0) (fun y => p fun x => y) fun y => β€–yβ€– ^ (n + 1) ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos
obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc)
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F h : (fun y => p fun x => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1) y : E c : ℝ c_pos : c > 0 hc : IsBigOWith c (𝓝 0) (fun y => p fun x => y) fun y => β€–yβ€– ^ (n + 1) t : Set E ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (n + 1)β€– t_open : IsOpen t z_mem : 0 ∈ t ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc)
obtain ⟨δ, δ_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc)
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F h : (fun y => p fun x => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1) y : E c : ℝ c_pos : c > 0 hc : IsBigOWith c (𝓝 0) (fun y => p fun x => y) fun y => β€–yβ€– ^ (n + 1) t : Set E ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (n + 1)β€– t_open : IsOpen t z_mem : 0 ∈ t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem
clear h hc z_mem
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F y : E c : ℝ c_pos : c > 0 t : Set E ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (n + 1)β€– t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem
cases' n with n
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.zero π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.zero + 1)β€– ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β·
exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self δ_pos)))
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β·
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.zero + 1)β€– ⊒ β€–p fun x => yβ€– = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff`
simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self δ_pos))
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff`
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β·
refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β·
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : y = 0 ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by
simpa only [hy] using p.map_zero
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : Β¬y = 0 ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _
replace hy := norm_pos_iff.mpr hy
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– ⊒ (p fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy
refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _))
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ ⊒ β€–p fun x => yβ€– ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _))
have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1))
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _))
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) ⊒ β€–p fun x => yβ€– ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1))
obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€)))
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1))
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) ⊒ β€–p fun x => yβ€– ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€)))
have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€)))
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) ⊒ β€–k β€’ yβ€– < Ξ΄
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by
rw [norm_smul]
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) ⊒ β€–kβ€– * β€–yβ€– < Ξ΄
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul]
exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul]
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ ⊒ β€–p fun x => yβ€– ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy
have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ ⊒ β€–p fun x => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (Nat.succ n + 1)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.`
simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁))
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.`
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ ⊒ c * β€–k β€’ yβ€– ^ (Nat.succ n + 1) = β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude.
simp only [norm_smul, mul_pow, Nat.succ_eq_add_one]
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude.
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ ⊒ c * (β€–kβ€– ^ (n + 1 + 1) * β€–yβ€– ^ (n + 1 + 1)) = β€–kβ€– ^ (n + 1) * (β€–kβ€– * (c * β€–yβ€– ^ (n + 1 + 1)))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous.
ring
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous.
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) ⊒ β€–p fun x => yβ€– ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring
have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case intro.intro.intro.intro.intro.intro.intro.succ.intro.intro π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) h₃ : β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)) < Ξ΅ ⊒ β€–p fun x => yβ€– ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€
calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) h₃ : β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)) < Ξ΅ ⊒ β€–p fun x => yβ€– = β€–k⁻¹ ^ Nat.succ nβ€– * β€–p fun x => k β€’ yβ€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by
simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y)
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) h₃ : β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)) < Ξ΅ ⊒ β€–k⁻¹ ^ Nat.succ nβ€– * β€–p fun x => k β€’ yβ€– ≀ β€–k⁻¹ ^ Nat.succ nβ€– * (β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by
gcongr
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) h₃ : β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)) < Ξ΅ ⊒ β€–k⁻¹ ^ Nat.succ nβ€– * (β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)))) = β€–(k⁻¹ * k) ^ Nat.succ nβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by
rw [← mul_assoc]
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) h₃ : β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)) < Ξ΅ ⊒ β€–k⁻¹ ^ Nat.succ nβ€– * β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) = β€–(k⁻¹ * k) ^ Nat.succ nβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)))
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc]
simp [norm_mul, mul_pow]
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc]
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) h₃ : β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)) < Ξ΅ ⊒ β€–(k⁻¹ * k) ^ Nat.succ nβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by
rw [inv_mul_cancel (norm_pos_iff.mp k_pos)]
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G y : E c : ℝ c_pos : c > 0 t : Set E t_open : IsOpen t Ξ΄ : ℝ Ξ΄_pos : Ξ΄ > 0 δΡ : Metric.ball 0 Ξ΄ βŠ† t n : β„• p : ContinuousMultilinearMap π•œ (fun i => E) F ht : βˆ€ x ∈ t, β€–p fun x_1 => xβ€– ≀ c * β€–β€–xβ€– ^ (Nat.succ n + 1)β€– hy : 0 < β€–yβ€– Ξ΅ : ℝ Ξ΅_pos : 0 < Ξ΅ hβ‚€ : 0 < c * β€–yβ€– ^ (Nat.succ n + 1) k : π•œ k_pos : 0 < β€–kβ€– k_norm : β€–kβ€– < min (Ξ΄ * β€–y‖⁻¹) (Ξ΅ * (c * β€–yβ€– ^ (Nat.succ n + 1))⁻¹) h₁ : β€–k β€’ yβ€– < Ξ΄ hβ‚‚ : β€–p fun x => k β€’ yβ€– ≀ β€–kβ€– ^ Nat.succ n * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) h₃ : β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1)) < Ξ΅ ⊒ β€–1 ^ Nat.succ nβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (Nat.succ n + 1))) ≀ 0 + Ξ΅
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)]
simpa using h₃.le
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)]
Mathlib.Analysis.Analytic.Basic.954_0.jQw1fRSE1vGpOll
theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n : β„• ⊒ βˆ€ (y : E), ((p n) fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by
refine' Nat.strong_induction_on n fun k hk => _
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 ⊒ βˆ€ (y : E), ((p k) fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _
have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k)))
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 ⊒ FormalMultilinearSeries.partialSum p (k + 1) = fun y => (p k) fun x => y
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by
funext z
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 z : E ⊒ FormalMultilinearSeries.partialSum p (k + 1) z = (p k) fun x => z
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z
refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case h.refine'_1 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 z : E b : β„• hb : b ∈ Finset.range (k + 1) hnb : b β‰  k ⊒ ((p b) fun x => z) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β·
have := Finset.mem_range_succ_iff.mp hb
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β·
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case h.refine'_1 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 z : E b : β„• hb : b ∈ Finset.range (k + 1) hnb : b β‰  k this : b ≀ k ⊒ ((p b) fun x => z) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb
simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply]
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
case h.refine'_2 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 z : E hn : k βˆ‰ Finset.range (k + 1) ⊒ ((p k) fun x => z) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β·
exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k)))
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β·
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E h : HasFPowerSeriesAt 0 p x n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 psum_eq : FormalMultilinearSeries.partialSum p (k + 1) = fun y => (p k) fun x => y ⊒ βˆ€ (y : E), ((p k) fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k)))
replace h := h.isBigO_sub_partialSum_pow k.succ
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k)))
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 psum_eq : FormalMultilinearSeries.partialSum p (k + 1) = fun y => (p k) fun x => y h : (fun y => OfNat.ofNat 0 (x + y) - FormalMultilinearSeries.partialSum p (Nat.succ k) y) =O[𝓝 0] fun y => β€–yβ€– ^ Nat.succ k ⊒ βˆ€ (y : E), ((p k) fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ
simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x : E n k : β„• hk : βˆ€ m < k, βˆ€ (y : E), ((p m) fun x => y) = 0 psum_eq : FormalMultilinearSeries.partialSum p (k + 1) = fun y => (p k) fun x => y h : (fun x => (p k) fun x_1 => x) =O[𝓝 0] fun y => β€–yβ€– ^ Nat.succ k ⊒ βˆ€ (y : E), ((p k) fun x => y) = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h
exact h.continuousMultilinearMap_apply_eq_zero
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h
Mathlib.Analysis.Analytic.Basic.1007_0.jQw1fRSE1vGpOll
/-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ π•œ E x : π•œ h : HasFPowerSeriesAt 0 p x ⊒ p = 0
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)`
funext n
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)`
Mathlib.Analysis.Analytic.Basic.1023_0.jQw1fRSE1vGpOll
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0
Mathlib_Analysis_Analytic_Basic
case h π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ π•œ E x : π•œ h : HasFPowerSeriesAt 0 p x n : β„• ⊒ p n = OfNat.ofNat 0 n
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n
ext x
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n
Mathlib.Analysis.Analytic.Basic.1023_0.jQw1fRSE1vGpOll
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0
Mathlib_Analysis_Analytic_Basic
case h.H π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ π•œ E x✝ : π•œ h : HasFPowerSeriesAt 0 p x✝ n : β„• x : Fin n β†’ π•œ ⊒ (p n) x = (OfNat.ofNat 0 n) x
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x
rw [← mkPiField_apply_one_eq_self (p n)]
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x
Mathlib.Analysis.Analytic.Basic.1023_0.jQw1fRSE1vGpOll
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0
Mathlib_Analysis_Analytic_Basic
case h.H π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ π•œ E x✝ : π•œ h : HasFPowerSeriesAt 0 p x✝ n : β„• x : Fin n β†’ π•œ ⊒ (ContinuousMultilinearMap.mkPiField π•œ (Fin n) ((p n) fun x => 1)) x = (OfNat.ofNat 0 n) x
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]`
have := Or.intro_right ?_ (h.apply_eq_zero n 1)
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]`
Mathlib.Analysis.Analytic.Basic.1023_0.jQw1fRSE1vGpOll
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0
Mathlib_Analysis_Analytic_Basic
case h.H.refine_2 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ π•œ E x✝ : π•œ h : HasFPowerSeriesAt 0 p x✝ n : β„• x : Fin n β†’ π•œ this : ?h.H.refine_1 ∨ ((p n) fun x => 1) = 0 ⊒ (ContinuousMultilinearMap.mkPiField π•œ (Fin n) ((p n) fun x => 1)) x = (OfNat.ofNat 0 n) x case h.H.refine_1 π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ π•œ E x✝ : π•œ h : HasFPowerSeriesAt 0 p x✝ n : β„• x : Fin n β†’ π•œ ⊒ Prop
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1)
simpa using this
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1)
Mathlib.Analysis.Analytic.Basic.1023_0.jQw1fRSE1vGpOll
/-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E f : π•œ β†’ E x : π•œ h₁ : HasFPowerSeriesAt f p₁ x hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x ⊒ HasFPowerSeriesAt 0 (p₁ - pβ‚‚) (?m.1184276 h₁ hβ‚‚)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1) simpa using this #align has_fpower_series_at.eq_zero HasFPowerSeriesAt.eq_zero /-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by
simpa only [sub_self] using h₁.sub hβ‚‚
/-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by
Mathlib.Analysis.Analytic.Basic.1035_0.jQw1fRSE1vGpOll
/-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l ⊒ ContinuousMultilinearMap π•œ (fun i => E) (ContinuousMultilinearMap π•œ (fun i => E) F)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1) simpa using this #align has_fpower_series_at.eq_zero HasFPowerSeriesAt.eq_zero /-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by simpa only [sub_self] using h₁.sub hβ‚‚)) #align has_fpower_series_at.eq_formal_multilinear_series HasFPowerSeriesAt.eq_formalMultilinearSeries theorem HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually {p q : FormalMultilinearSeries π•œ π•œ E} {f g : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hq : HasFPowerSeriesAt g q x) (heq : βˆ€αΆ  z in 𝓝 x, f z = g z) : p = q := (hp.congr heq).eq_formalMultilinearSeries hq #align has_fpower_series_at.eq_formal_multilinear_series_of_eventually HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually /-- A one-dimensional formal multilinear series representing a locally zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero_of_eventually {p : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hf : f =αΆ [𝓝 x] 0) : p = 0 := (hp.congr hf).eq_zero #align has_fpower_series_at.eq_zero_of_eventually HasFPowerSeriesAt.eq_zero_of_eventually /-- If a function `f : π•œ β†’ E` has two power series representations at `x`, then the given radii in which convergence is guaranteed may be interchanged. This can be useful when the formal multilinear series in one representation has a particularly nice form, but the other has a larger radius. -/ theorem HasFPowerSeriesOnBall.exchange_radius {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {r₁ rβ‚‚ : ℝβ‰₯0∞} {x : π•œ} (h₁ : HasFPowerSeriesOnBall f p₁ x r₁) (hβ‚‚ : HasFPowerSeriesOnBall f pβ‚‚ x rβ‚‚) : HasFPowerSeriesOnBall f p₁ x rβ‚‚ := hβ‚‚.hasFPowerSeriesAt.eq_formalMultilinearSeries h₁.hasFPowerSeriesAt β–Έ hβ‚‚ #align has_fpower_series_on_ball.exchange_radius HasFPowerSeriesOnBall.exchange_radius /-- If a function `f : π•œ β†’ E` has power series representation `p` on a ball of some radius and for each positive radius it has some power series representation, then `p` converges to `f` on the whole `π•œ`. -/ theorem HasFPowerSeriesOnBall.r_eq_top_of_exists {f : π•œ β†’ E} {r : ℝβ‰₯0∞} {x : π•œ} {p : FormalMultilinearSeries π•œ π•œ E} (h : HasFPowerSeriesOnBall f p x r) (h' : βˆ€ (r' : ℝβ‰₯0) (_ : 0 < r'), βˆƒ p' : FormalMultilinearSeries π•œ π•œ E, HasFPowerSeriesOnBall f p' x r') : HasFPowerSeriesOnBall f p x ∞ := { r_le := ENNReal.le_of_forall_pos_nnreal_lt fun r hr _ => let ⟨_, hp'⟩ := h' r hr (h.exchange_radius hp').r_le r_pos := ENNReal.coe_lt_top hasSum := fun {y} _ => let ⟨r', hr'⟩ := exists_gt β€–yβ€–β‚Š let ⟨_, hp'⟩ := h' r' hr'.ne_bot.bot_lt (h.exchange_radius hp').hasSum <| mem_emetric_ball_zero_iff.mpr (ENNReal.coe_lt_coe.2 hr') } #align has_fpower_series_on_ball.r_eq_top_of_exists HasFPowerSeriesOnBall.r_eq_top_of_exists end Uniqueness /-! ### Changing origin in a power series If a function is analytic in a disk `D(x, R)`, then it is analytic in any disk contained in that one. Indeed, one can write $$ f (x + y + z) = \sum_{n} p_n (y + z)^n = \sum_{n, k} \binom{n}{k} p_n y^{n-k} z^k = \sum_{k} \Bigl(\sum_{n} \binom{n}{k} p_n y^{n-k}\Bigr) z^k. $$ The corresponding power series has thus a `k`-th coefficient equal to $\sum_{n} \binom{n}{k} p_n y^{n-k}$. In the general case where `pβ‚™` is a multilinear map, this has to be interpreted suitably: instead of having a binomial coefficient, one should sum over all possible subsets `s` of `Fin n` of cardinal `k`, and attribute `z` to the indices in `s` and `y` to the indices outside of `s`. In this paragraph, we implement this. The new power series is called `p.changeOrigin y`. Then, we check its convergence and the fact that its sum coincides with the original sum. The outcome of this discussion is that the set of points where a function is analytic is open. -/ namespace FormalMultilinearSeries section variable (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} /-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by
let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by erw [Finset.card_compl, Fintype.card_fin, hs, add_tsub_cancel_right])
/-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by
Mathlib.Analysis.Analytic.Basic.1109_0.jQw1fRSE1vGpOll
/-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l ⊒ Finset.card sᢜ = ?m.1215608
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1) simpa using this #align has_fpower_series_at.eq_zero HasFPowerSeriesAt.eq_zero /-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by simpa only [sub_self] using h₁.sub hβ‚‚)) #align has_fpower_series_at.eq_formal_multilinear_series HasFPowerSeriesAt.eq_formalMultilinearSeries theorem HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually {p q : FormalMultilinearSeries π•œ π•œ E} {f g : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hq : HasFPowerSeriesAt g q x) (heq : βˆ€αΆ  z in 𝓝 x, f z = g z) : p = q := (hp.congr heq).eq_formalMultilinearSeries hq #align has_fpower_series_at.eq_formal_multilinear_series_of_eventually HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually /-- A one-dimensional formal multilinear series representing a locally zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero_of_eventually {p : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hf : f =αΆ [𝓝 x] 0) : p = 0 := (hp.congr hf).eq_zero #align has_fpower_series_at.eq_zero_of_eventually HasFPowerSeriesAt.eq_zero_of_eventually /-- If a function `f : π•œ β†’ E` has two power series representations at `x`, then the given radii in which convergence is guaranteed may be interchanged. This can be useful when the formal multilinear series in one representation has a particularly nice form, but the other has a larger radius. -/ theorem HasFPowerSeriesOnBall.exchange_radius {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {r₁ rβ‚‚ : ℝβ‰₯0∞} {x : π•œ} (h₁ : HasFPowerSeriesOnBall f p₁ x r₁) (hβ‚‚ : HasFPowerSeriesOnBall f pβ‚‚ x rβ‚‚) : HasFPowerSeriesOnBall f p₁ x rβ‚‚ := hβ‚‚.hasFPowerSeriesAt.eq_formalMultilinearSeries h₁.hasFPowerSeriesAt β–Έ hβ‚‚ #align has_fpower_series_on_ball.exchange_radius HasFPowerSeriesOnBall.exchange_radius /-- If a function `f : π•œ β†’ E` has power series representation `p` on a ball of some radius and for each positive radius it has some power series representation, then `p` converges to `f` on the whole `π•œ`. -/ theorem HasFPowerSeriesOnBall.r_eq_top_of_exists {f : π•œ β†’ E} {r : ℝβ‰₯0∞} {x : π•œ} {p : FormalMultilinearSeries π•œ π•œ E} (h : HasFPowerSeriesOnBall f p x r) (h' : βˆ€ (r' : ℝβ‰₯0) (_ : 0 < r'), βˆƒ p' : FormalMultilinearSeries π•œ π•œ E, HasFPowerSeriesOnBall f p' x r') : HasFPowerSeriesOnBall f p x ∞ := { r_le := ENNReal.le_of_forall_pos_nnreal_lt fun r hr _ => let ⟨_, hp'⟩ := h' r hr (h.exchange_radius hp').r_le r_pos := ENNReal.coe_lt_top hasSum := fun {y} _ => let ⟨r', hr'⟩ := exists_gt β€–yβ€–β‚Š let ⟨_, hp'⟩ := h' r' hr'.ne_bot.bot_lt (h.exchange_radius hp').hasSum <| mem_emetric_ball_zero_iff.mpr (ENNReal.coe_lt_coe.2 hr') } #align has_fpower_series_on_ball.r_eq_top_of_exists HasFPowerSeriesOnBall.r_eq_top_of_exists end Uniqueness /-! ### Changing origin in a power series If a function is analytic in a disk `D(x, R)`, then it is analytic in any disk contained in that one. Indeed, one can write $$ f (x + y + z) = \sum_{n} p_n (y + z)^n = \sum_{n, k} \binom{n}{k} p_n y^{n-k} z^k = \sum_{k} \Bigl(\sum_{n} \binom{n}{k} p_n y^{n-k}\Bigr) z^k. $$ The corresponding power series has thus a `k`-th coefficient equal to $\sum_{n} \binom{n}{k} p_n y^{n-k}$. In the general case where `pβ‚™` is a multilinear map, this has to be interpreted suitably: instead of having a binomial coefficient, one should sum over all possible subsets `s` of `Fin n` of cardinal `k`, and attribute `z` to the indices in `s` and `y` to the indices outside of `s`. In this paragraph, we implement this. The new power series is called `p.changeOrigin y`. Then, we check its convergence and the fact that its sum coincides with the original sum. The outcome of this discussion is that the set of points where a function is analytic is open. -/ namespace FormalMultilinearSeries section variable (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} /-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by
erw [Finset.card_compl, Fintype.card_fin, hs, add_tsub_cancel_right]
/-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by
Mathlib.Analysis.Analytic.Basic.1109_0.jQw1fRSE1vGpOll
/-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l a : ContinuousMultilinearMap π•œ (fun i => E) F ≃ₗᡒ[π•œ] ContinuousMultilinearMap π•œ (fun i => E) (ContinuousMultilinearMap π•œ (fun i => E) F) := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (_ : Finset.card sᢜ = k) ⊒ ContinuousMultilinearMap π•œ (fun i => E) (ContinuousMultilinearMap π•œ (fun i => E) F)
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1) simpa using this #align has_fpower_series_at.eq_zero HasFPowerSeriesAt.eq_zero /-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by simpa only [sub_self] using h₁.sub hβ‚‚)) #align has_fpower_series_at.eq_formal_multilinear_series HasFPowerSeriesAt.eq_formalMultilinearSeries theorem HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually {p q : FormalMultilinearSeries π•œ π•œ E} {f g : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hq : HasFPowerSeriesAt g q x) (heq : βˆ€αΆ  z in 𝓝 x, f z = g z) : p = q := (hp.congr heq).eq_formalMultilinearSeries hq #align has_fpower_series_at.eq_formal_multilinear_series_of_eventually HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually /-- A one-dimensional formal multilinear series representing a locally zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero_of_eventually {p : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hf : f =αΆ [𝓝 x] 0) : p = 0 := (hp.congr hf).eq_zero #align has_fpower_series_at.eq_zero_of_eventually HasFPowerSeriesAt.eq_zero_of_eventually /-- If a function `f : π•œ β†’ E` has two power series representations at `x`, then the given radii in which convergence is guaranteed may be interchanged. This can be useful when the formal multilinear series in one representation has a particularly nice form, but the other has a larger radius. -/ theorem HasFPowerSeriesOnBall.exchange_radius {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {r₁ rβ‚‚ : ℝβ‰₯0∞} {x : π•œ} (h₁ : HasFPowerSeriesOnBall f p₁ x r₁) (hβ‚‚ : HasFPowerSeriesOnBall f pβ‚‚ x rβ‚‚) : HasFPowerSeriesOnBall f p₁ x rβ‚‚ := hβ‚‚.hasFPowerSeriesAt.eq_formalMultilinearSeries h₁.hasFPowerSeriesAt β–Έ hβ‚‚ #align has_fpower_series_on_ball.exchange_radius HasFPowerSeriesOnBall.exchange_radius /-- If a function `f : π•œ β†’ E` has power series representation `p` on a ball of some radius and for each positive radius it has some power series representation, then `p` converges to `f` on the whole `π•œ`. -/ theorem HasFPowerSeriesOnBall.r_eq_top_of_exists {f : π•œ β†’ E} {r : ℝβ‰₯0∞} {x : π•œ} {p : FormalMultilinearSeries π•œ π•œ E} (h : HasFPowerSeriesOnBall f p x r) (h' : βˆ€ (r' : ℝβ‰₯0) (_ : 0 < r'), βˆƒ p' : FormalMultilinearSeries π•œ π•œ E, HasFPowerSeriesOnBall f p' x r') : HasFPowerSeriesOnBall f p x ∞ := { r_le := ENNReal.le_of_forall_pos_nnreal_lt fun r hr _ => let ⟨_, hp'⟩ := h' r hr (h.exchange_radius hp').r_le r_pos := ENNReal.coe_lt_top hasSum := fun {y} _ => let ⟨r', hr'⟩ := exists_gt β€–yβ€–β‚Š let ⟨_, hp'⟩ := h' r' hr'.ne_bot.bot_lt (h.exchange_radius hp').hasSum <| mem_emetric_ball_zero_iff.mpr (ENNReal.coe_lt_coe.2 hr') } #align has_fpower_series_on_ball.r_eq_top_of_exists HasFPowerSeriesOnBall.r_eq_top_of_exists end Uniqueness /-! ### Changing origin in a power series If a function is analytic in a disk `D(x, R)`, then it is analytic in any disk contained in that one. Indeed, one can write $$ f (x + y + z) = \sum_{n} p_n (y + z)^n = \sum_{n, k} \binom{n}{k} p_n y^{n-k} z^k = \sum_{k} \Bigl(\sum_{n} \binom{n}{k} p_n y^{n-k}\Bigr) z^k. $$ The corresponding power series has thus a `k`-th coefficient equal to $\sum_{n} \binom{n}{k} p_n y^{n-k}$. In the general case where `pβ‚™` is a multilinear map, this has to be interpreted suitably: instead of having a binomial coefficient, one should sum over all possible subsets `s` of `Fin n` of cardinal `k`, and attribute `z` to the indices in `s` and `y` to the indices outside of `s`. In this paragraph, we implement this. The new power series is called `p.changeOrigin y`. Then, we check its convergence and the fact that its sum coincides with the original sum. The outcome of this discussion is that the set of points where a function is analytic is open. -/ namespace FormalMultilinearSeries section variable (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} /-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by erw [Finset.card_compl, Fintype.card_fin, hs, add_tsub_cancel_right])
exact a (p (k + l))
/-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by erw [Finset.card_compl, Fintype.card_fin, hs, add_tsub_cancel_right])
Mathlib.Analysis.Analytic.Basic.1109_0.jQw1fRSE1vGpOll
/-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l ⊒ β€–changeOriginSeriesTerm p k l s hsβ€– = β€–p (k + l)β€–
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1) simpa using this #align has_fpower_series_at.eq_zero HasFPowerSeriesAt.eq_zero /-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by simpa only [sub_self] using h₁.sub hβ‚‚)) #align has_fpower_series_at.eq_formal_multilinear_series HasFPowerSeriesAt.eq_formalMultilinearSeries theorem HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually {p q : FormalMultilinearSeries π•œ π•œ E} {f g : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hq : HasFPowerSeriesAt g q x) (heq : βˆ€αΆ  z in 𝓝 x, f z = g z) : p = q := (hp.congr heq).eq_formalMultilinearSeries hq #align has_fpower_series_at.eq_formal_multilinear_series_of_eventually HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually /-- A one-dimensional formal multilinear series representing a locally zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero_of_eventually {p : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hf : f =αΆ [𝓝 x] 0) : p = 0 := (hp.congr hf).eq_zero #align has_fpower_series_at.eq_zero_of_eventually HasFPowerSeriesAt.eq_zero_of_eventually /-- If a function `f : π•œ β†’ E` has two power series representations at `x`, then the given radii in which convergence is guaranteed may be interchanged. This can be useful when the formal multilinear series in one representation has a particularly nice form, but the other has a larger radius. -/ theorem HasFPowerSeriesOnBall.exchange_radius {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {r₁ rβ‚‚ : ℝβ‰₯0∞} {x : π•œ} (h₁ : HasFPowerSeriesOnBall f p₁ x r₁) (hβ‚‚ : HasFPowerSeriesOnBall f pβ‚‚ x rβ‚‚) : HasFPowerSeriesOnBall f p₁ x rβ‚‚ := hβ‚‚.hasFPowerSeriesAt.eq_formalMultilinearSeries h₁.hasFPowerSeriesAt β–Έ hβ‚‚ #align has_fpower_series_on_ball.exchange_radius HasFPowerSeriesOnBall.exchange_radius /-- If a function `f : π•œ β†’ E` has power series representation `p` on a ball of some radius and for each positive radius it has some power series representation, then `p` converges to `f` on the whole `π•œ`. -/ theorem HasFPowerSeriesOnBall.r_eq_top_of_exists {f : π•œ β†’ E} {r : ℝβ‰₯0∞} {x : π•œ} {p : FormalMultilinearSeries π•œ π•œ E} (h : HasFPowerSeriesOnBall f p x r) (h' : βˆ€ (r' : ℝβ‰₯0) (_ : 0 < r'), βˆƒ p' : FormalMultilinearSeries π•œ π•œ E, HasFPowerSeriesOnBall f p' x r') : HasFPowerSeriesOnBall f p x ∞ := { r_le := ENNReal.le_of_forall_pos_nnreal_lt fun r hr _ => let ⟨_, hp'⟩ := h' r hr (h.exchange_radius hp').r_le r_pos := ENNReal.coe_lt_top hasSum := fun {y} _ => let ⟨r', hr'⟩ := exists_gt β€–yβ€–β‚Š let ⟨_, hp'⟩ := h' r' hr'.ne_bot.bot_lt (h.exchange_radius hp').hasSum <| mem_emetric_ball_zero_iff.mpr (ENNReal.coe_lt_coe.2 hr') } #align has_fpower_series_on_ball.r_eq_top_of_exists HasFPowerSeriesOnBall.r_eq_top_of_exists end Uniqueness /-! ### Changing origin in a power series If a function is analytic in a disk `D(x, R)`, then it is analytic in any disk contained in that one. Indeed, one can write $$ f (x + y + z) = \sum_{n} p_n (y + z)^n = \sum_{n, k} \binom{n}{k} p_n y^{n-k} z^k = \sum_{k} \Bigl(\sum_{n} \binom{n}{k} p_n y^{n-k}\Bigr) z^k. $$ The corresponding power series has thus a `k`-th coefficient equal to $\sum_{n} \binom{n}{k} p_n y^{n-k}$. In the general case where `pβ‚™` is a multilinear map, this has to be interpreted suitably: instead of having a binomial coefficient, one should sum over all possible subsets `s` of `Fin n` of cardinal `k`, and attribute `z` to the indices in `s` and `y` to the indices outside of `s`. In this paragraph, we implement this. The new power series is called `p.changeOrigin y`. Then, we check its convergence and the fact that its sum coincides with the original sum. The outcome of this discussion is that the set of points where a function is analytic is open. -/ namespace FormalMultilinearSeries section variable (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} /-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by erw [Finset.card_compl, Fintype.card_fin, hs, add_tsub_cancel_right]) exact a (p (k + l)) #align formal_multilinear_series.change_origin_series_term FormalMultilinearSeries.changeOriginSeriesTerm theorem changeOriginSeriesTerm_apply (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) (x y : E) : (p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y) = p (k + l) (s.piecewise (fun _ => x) fun _ => y) := ContinuousMultilinearMap.curryFinFinset_apply_const _ _ _ _ _ #align formal_multilinear_series.change_origin_series_term_apply FormalMultilinearSeries.changeOriginSeriesTerm_apply @[simp] theorem norm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€– = β€–p (k + l)β€– := by
simp only [changeOriginSeriesTerm, LinearIsometryEquiv.norm_map]
@[simp] theorem norm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€– = β€–p (k + l)β€– := by
Mathlib.Analysis.Analytic.Basic.1133_0.jQw1fRSE1vGpOll
@[simp] theorem norm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€– = β€–p (k + l)β€–
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l ⊒ β€–changeOriginSeriesTerm p k l s hsβ€–β‚Š = β€–p (k + l)β€–β‚Š
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1) simpa using this #align has_fpower_series_at.eq_zero HasFPowerSeriesAt.eq_zero /-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by simpa only [sub_self] using h₁.sub hβ‚‚)) #align has_fpower_series_at.eq_formal_multilinear_series HasFPowerSeriesAt.eq_formalMultilinearSeries theorem HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually {p q : FormalMultilinearSeries π•œ π•œ E} {f g : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hq : HasFPowerSeriesAt g q x) (heq : βˆ€αΆ  z in 𝓝 x, f z = g z) : p = q := (hp.congr heq).eq_formalMultilinearSeries hq #align has_fpower_series_at.eq_formal_multilinear_series_of_eventually HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually /-- A one-dimensional formal multilinear series representing a locally zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero_of_eventually {p : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hf : f =αΆ [𝓝 x] 0) : p = 0 := (hp.congr hf).eq_zero #align has_fpower_series_at.eq_zero_of_eventually HasFPowerSeriesAt.eq_zero_of_eventually /-- If a function `f : π•œ β†’ E` has two power series representations at `x`, then the given radii in which convergence is guaranteed may be interchanged. This can be useful when the formal multilinear series in one representation has a particularly nice form, but the other has a larger radius. -/ theorem HasFPowerSeriesOnBall.exchange_radius {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {r₁ rβ‚‚ : ℝβ‰₯0∞} {x : π•œ} (h₁ : HasFPowerSeriesOnBall f p₁ x r₁) (hβ‚‚ : HasFPowerSeriesOnBall f pβ‚‚ x rβ‚‚) : HasFPowerSeriesOnBall f p₁ x rβ‚‚ := hβ‚‚.hasFPowerSeriesAt.eq_formalMultilinearSeries h₁.hasFPowerSeriesAt β–Έ hβ‚‚ #align has_fpower_series_on_ball.exchange_radius HasFPowerSeriesOnBall.exchange_radius /-- If a function `f : π•œ β†’ E` has power series representation `p` on a ball of some radius and for each positive radius it has some power series representation, then `p` converges to `f` on the whole `π•œ`. -/ theorem HasFPowerSeriesOnBall.r_eq_top_of_exists {f : π•œ β†’ E} {r : ℝβ‰₯0∞} {x : π•œ} {p : FormalMultilinearSeries π•œ π•œ E} (h : HasFPowerSeriesOnBall f p x r) (h' : βˆ€ (r' : ℝβ‰₯0) (_ : 0 < r'), βˆƒ p' : FormalMultilinearSeries π•œ π•œ E, HasFPowerSeriesOnBall f p' x r') : HasFPowerSeriesOnBall f p x ∞ := { r_le := ENNReal.le_of_forall_pos_nnreal_lt fun r hr _ => let ⟨_, hp'⟩ := h' r hr (h.exchange_radius hp').r_le r_pos := ENNReal.coe_lt_top hasSum := fun {y} _ => let ⟨r', hr'⟩ := exists_gt β€–yβ€–β‚Š let ⟨_, hp'⟩ := h' r' hr'.ne_bot.bot_lt (h.exchange_radius hp').hasSum <| mem_emetric_ball_zero_iff.mpr (ENNReal.coe_lt_coe.2 hr') } #align has_fpower_series_on_ball.r_eq_top_of_exists HasFPowerSeriesOnBall.r_eq_top_of_exists end Uniqueness /-! ### Changing origin in a power series If a function is analytic in a disk `D(x, R)`, then it is analytic in any disk contained in that one. Indeed, one can write $$ f (x + y + z) = \sum_{n} p_n (y + z)^n = \sum_{n, k} \binom{n}{k} p_n y^{n-k} z^k = \sum_{k} \Bigl(\sum_{n} \binom{n}{k} p_n y^{n-k}\Bigr) z^k. $$ The corresponding power series has thus a `k`-th coefficient equal to $\sum_{n} \binom{n}{k} p_n y^{n-k}$. In the general case where `pβ‚™` is a multilinear map, this has to be interpreted suitably: instead of having a binomial coefficient, one should sum over all possible subsets `s` of `Fin n` of cardinal `k`, and attribute `z` to the indices in `s` and `y` to the indices outside of `s`. In this paragraph, we implement this. The new power series is called `p.changeOrigin y`. Then, we check its convergence and the fact that its sum coincides with the original sum. The outcome of this discussion is that the set of points where a function is analytic is open. -/ namespace FormalMultilinearSeries section variable (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} /-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by erw [Finset.card_compl, Fintype.card_fin, hs, add_tsub_cancel_right]) exact a (p (k + l)) #align formal_multilinear_series.change_origin_series_term FormalMultilinearSeries.changeOriginSeriesTerm theorem changeOriginSeriesTerm_apply (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) (x y : E) : (p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y) = p (k + l) (s.piecewise (fun _ => x) fun _ => y) := ContinuousMultilinearMap.curryFinFinset_apply_const _ _ _ _ _ #align formal_multilinear_series.change_origin_series_term_apply FormalMultilinearSeries.changeOriginSeriesTerm_apply @[simp] theorem norm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€– = β€–p (k + l)β€– := by simp only [changeOriginSeriesTerm, LinearIsometryEquiv.norm_map] #align formal_multilinear_series.norm_change_origin_series_term FormalMultilinearSeries.norm_changeOriginSeriesTerm @[simp] theorem nnnorm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€–β‚Š = β€–p (k + l)β€–β‚Š := by
simp only [changeOriginSeriesTerm, LinearIsometryEquiv.nnnorm_map]
@[simp] theorem nnnorm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€–β‚Š = β€–p (k + l)β€–β‚Š := by
Mathlib.Analysis.Analytic.Basic.1139_0.jQw1fRSE1vGpOll
@[simp] theorem nnnorm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€–β‚Š = β€–p (k + l)β€–β‚Š
Mathlib_Analysis_Analytic_Basic
π•œ : Type u_1 E : Type u_2 F : Type u_3 G : Type u_4 inst✝⁢ : NontriviallyNormedField π•œ inst✝⁡ : NormedAddCommGroup E inst✝⁴ : NormedSpace π•œ E inst✝³ : NormedAddCommGroup F inst✝² : NormedSpace π•œ F inst✝¹ : NormedAddCommGroup G inst✝ : NormedSpace π•œ G p : FormalMultilinearSeries π•œ E F x✝ y✝ : E r R : ℝβ‰₯0 k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l x y : E ⊒ β€–((changeOriginSeriesTerm p k l s hs) fun x_1 => x) fun x => yβ€–β‚Š ≀ β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l * β€–yβ€–β‚Š ^ k
/- Copyright (c) 2020 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.FormalMultilinearSeries import Mathlib.Analysis.SpecificLimits.Normed import Mathlib.Logic.Equiv.Fin import Mathlib.Topology.Algebra.InfiniteSum.Module #align_import analysis.analytic.basic from "leanprover-community/mathlib"@"32253a1a1071173b33dc7d6a218cf722c6feb514" /-! # 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`. * `AnalyticOn π•œ f s`: the function `f` is analytic at every point of `s`. 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`. * If a function admits a power series in a ball, then it is analytic at any point `y` of this ball, and the power series there can be expressed in terms of the initial power series `p` as `p.changeOrigin y`. See `HasFPowerSeriesOnBall.changeOrigin`. It follows in particular that the set of points at which a given function is analytic is open, see `isOpen_analyticAt`. ## 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. -/ noncomputable section variable {π•œ E F G : Type*} open Topology Classical BigOperators NNReal Filter ENNReal open Set Filter Asymptotics namespace FormalMultilinearSeries variable [Ring π•œ] [AddCommGroup E] [AddCommGroup F] [Module π•œ E] [Module π•œ F] variable [TopologicalSpace E] [TopologicalSpace F] variable [TopologicalAddGroup E] [TopologicalAddGroup F] variable [ContinuousConstSMul π•œ E] [ContinuousConstSMul π•œ F] /-- 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 #align formal_multilinear_series.sum FormalMultilinearSeries.sum /-- 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 in Finset.range n, p k fun _ : Fin k => x #align formal_multilinear_series.partial_sum FormalMultilinearSeries.partialSum /-- 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 -- Porting note: added continuity #align formal_multilinear_series.partial_sum_continuous FormalMultilinearSeries.partialSum_continuous end FormalMultilinearSeries /-! ### The radius of a formal multilinear series -/ variable [NontriviallyNormedField π•œ] [NormedAddCommGroup E] [NormedSpace π•œ E] [NormedAddCommGroup F] [NormedSpace π•œ F] [NormedAddCommGroup G] [NormedSpace π•œ G] namespace FormalMultilinearSeries variable (p : FormalMultilinearSeries π•œ E F) {r : ℝβ‰₯0} /-- 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∞) #align formal_multilinear_series.radius FormalMultilinearSeries.radius /-- 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 #align formal_multilinear_series.le_radius_of_bound FormalMultilinearSeries.le_radius_of_bound /-- 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 #align formal_multilinear_series.le_radius_of_bound_nnreal FormalMultilinearSeries.le_radius_of_bound_nnreal /-- 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.le_radius_of_is_O FormalMultilinearSeries.le_radius_of_isBigO 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 #align formal_multilinear_series.le_radius_of_eventually_le FormalMultilinearSeries.le_radius_of_eventually_le 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 _ => le_tsum' h _ #align formal_multilinear_series.le_radius_of_summable_nnnorm FormalMultilinearSeries.le_radius_of_summable_nnnorm 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 #align formal_multilinear_series.le_radius_of_summable FormalMultilinearSeries.le_radius_of_summable 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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.radius_eq_top_of_forall_nnreal_is_O FormalMultilinearSeries.radius_eq_top_of_forall_nnreal_isBigO 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 #align formal_multilinear_series.radius_eq_top_of_eventually_eq_zero FormalMultilinearSeries.radius_eq_top_of_eventually_eq_zero 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 _⟩ #align formal_multilinear_series.radius_eq_top_of_forall_image_add_eq_zero FormalMultilinearSeries.radius_eq_top_of_forall_image_add_eq_zero @[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]) #align formal_multilinear_series.const_formal_multilinear_series_radius FormalMultilinearSeries.constFormalMultilinearSeries_radius /-- 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 #align formal_multilinear_series.is_o_of_lt_radius FormalMultilinearSeries.isLittleO_of_lt_radius /-- 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 #align formal_multilinear_series.is_o_one_of_lt_radius FormalMultilinearSeries.isLittleO_one_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_mul_pow_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_mul_pow_of_lt_radius /-- 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 -- Porting note: moved out of `rcases` 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_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) set_option linter.uppercaseLean3 false in #align formal_multilinear_series.lt_radius_of_is_O FormalMultilinearSeries.lt_radius_of_isBigO /-- 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)⟩ #align formal_multilinear_series.norm_mul_pow_le_of_lt_radius FormalMultilinearSeries.norm_mul_pow_le_of_lt_radius /-- 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)⟩ #align formal_multilinear_series.norm_le_div_pow_of_pos_of_lt_radius FormalMultilinearSeries.norm_le_div_pow_of_pos_of_lt_radius /-- 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⟩ #align formal_multilinear_series.nnnorm_mul_pow_le_of_lt_radius FormalMultilinearSeries.nnnorm_mul_pow_le_of_lt_radius 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 _) #align formal_multilinear_series.le_radius_of_tendsto FormalMultilinearSeries.le_radius_of_tendsto 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 #align formal_multilinear_series.le_radius_of_summable_norm FormalMultilinearSeries.le_radius_of_summable_norm 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) #align formal_multilinear_series.not_summable_norm_of_radius_lt_nnnorm FormalMultilinearSeries.not_summable_norm_of_radius_lt_nnnorm 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_1 ha.1.le ha.2).mul_left _) #align formal_multilinear_series.summable_norm_mul_pow FormalMultilinearSeries.summable_norm_mul_pow 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_op_norm _).trans_eq _) (p.summable_norm_mul_pow hx) simp #align formal_multilinear_series.summable_norm_apply FormalMultilinearSeries.summable_norm_apply 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 #align formal_multilinear_series.summable_nnnorm_mul_pow FormalMultilinearSeries.summable_nnnorm_mul_pow 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 #align formal_multilinear_series.summable FormalMultilinearSeries.summable 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) #align formal_multilinear_series.radius_eq_top_of_summable_norm FormalMultilinearSeries.radius_eq_top_of_summable_norm 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.symm β–Έ ENNReal.coe_lt_top) refine' .of_norm_bounded (fun n => (C : ℝ) * a ^ n) ((summable_geometric_of_lt_1 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 #align formal_multilinear_series.radius_eq_top_iff_summable_norm FormalMultilinearSeries.radius_eq_top_iff_summable_norm /-- 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 : _) (hC : 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 => _⟩ -- Porting note: was `convert` rw [inv_pow, ← div_eq_mul_inv] exact hCp n #align formal_multilinear_series.le_mul_pow_of_radius_pos FormalMultilinearSeries.le_mul_pow_of_radius_pos /-- 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 _) #align formal_multilinear_series.min_radius_le_radius_add FormalMultilinearSeries.min_radius_le_radius_add @[simp] theorem radius_neg (p : FormalMultilinearSeries π•œ E F) : (-p).radius = p.radius := by simp only [radius, neg_apply, norm_neg] #align formal_multilinear_series.radius_neg FormalMultilinearSeries.radius_neg 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 #align formal_multilinear_series.has_sum FormalMultilinearSeries.hasSum 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) #align formal_multilinear_series.radius_le_radius_continuous_linear_map_comp FormalMultilinearSeries.radius_le_radius_continuousLinearMap_comp end FormalMultilinearSeries /-! ### Expanding a function as a power series -/ section variable {f g : E β†’ F} {p pf pg : FormalMultilinearSeries π•œ E F} {x : E} {r r' : ℝβ‰₯0∞} /-- 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) r β†’ HasSum (fun n : β„• => p n fun _ : Fin n => y) (f (x + y)) #align has_fpower_series_on_ball HasFPowerSeriesOnBall /-- 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 #align has_fpower_series_at HasFPowerSeriesAt variable (π•œ) /-- Given a function `f : E β†’ F`, we say that `f` is analytic at `x` if it admits a convergent power series expansion around `x`. -/ def AnalyticAt (f : E β†’ F) (x : E) := βˆƒ p : FormalMultilinearSeries π•œ E F, HasFPowerSeriesAt f p x #align analytic_at AnalyticAt /-- 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 AnalyticOn (f : E β†’ F) (s : Set E) := βˆ€ x, x ∈ s β†’ AnalyticAt π•œ f x #align analytic_on AnalyticOn variable {π•œ} theorem HasFPowerSeriesOnBall.hasFPowerSeriesAt (hf : HasFPowerSeriesOnBall f p x r) : HasFPowerSeriesAt f p x := ⟨r, hf⟩ #align has_fpower_series_on_ball.has_fpower_series_at HasFPowerSeriesOnBall.hasFPowerSeriesAt theorem HasFPowerSeriesAt.analyticAt (hf : HasFPowerSeriesAt f p x) : AnalyticAt π•œ f x := ⟨p, hf⟩ #align has_fpower_series_at.analytic_at HasFPowerSeriesAt.analyticAt theorem HasFPowerSeriesOnBall.analyticAt (hf : HasFPowerSeriesOnBall f p x r) : AnalyticAt π•œ f x := hf.hasFPowerSeriesAt.analyticAt #align has_fpower_series_on_ball.analytic_at HasFPowerSeriesOnBall.analyticAt 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_coe_nnnorm_sub] using hy } #align has_fpower_series_on_ball.congr HasFPowerSeriesOnBall.congr /-- 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 } #align has_fpower_series_on_ball.comp_sub HasFPowerSeriesOnBall.comp_sub 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_coe_nnnorm_sub] using hy simpa only [add_sub_cancel'_right] using hf.hasSum this #align has_fpower_series_on_ball.has_sum_sub HasFPowerSeriesOnBall.hasSum_sub theorem HasFPowerSeriesOnBall.radius_pos (hf : HasFPowerSeriesOnBall f p x r) : 0 < p.radius := lt_of_lt_of_le hf.r_pos hf.r_le #align has_fpower_series_on_ball.radius_pos HasFPowerSeriesOnBall.radius_pos theorem HasFPowerSeriesAt.radius_pos (hf : HasFPowerSeriesAt f p x) : 0 < p.radius := let ⟨_, hr⟩ := hf hr.radius_pos #align has_fpower_series_at.radius_pos HasFPowerSeriesAt.radius_pos 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)⟩ #align has_fpower_series_on_ball.mono HasFPowerSeriesOnBall.mono 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)⟩ #align has_fpower_series_at.congr HasFPowerSeriesAt.congr 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_nhdsWithin_Ioi (left_mem_Ico.2 hr.r_pos)) fun _ hr' => hr.mono hr'.1 hr'.2.le #align has_fpower_series_at.eventually HasFPowerSeriesAt.eventually 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 #align has_fpower_series_on_ball.eventually_has_sum HasFPowerSeriesOnBall.eventually_hasSum 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 #align has_fpower_series_at.eventually_has_sum HasFPowerSeriesAt.eventually_hasSum 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 #align has_fpower_series_on_ball.eventually_has_sum_sub HasFPowerSeriesOnBall.eventually_hasSum_sub 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 #align has_fpower_series_at.eventually_has_sum_sub HasFPowerSeriesAt.eventually_hasSum_sub 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 #align has_fpower_series_on_ball.eventually_eq_zero HasFPowerSeriesOnBall.eventually_eq_zero 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 #align has_fpower_series_at.eventually_eq_zero HasFPowerSeriesAt.eventually_eq_zero theorem hasFPowerSeriesOnBall_const {c : F} {e : E} : HasFPowerSeriesOnBall (fun _ => c) (constFormalMultilinearSeries π•œ E c) e ⊀ := by refine' ⟨by simp, WithTop.zero_lt_top, fun _ => hasSum_single 0 fun n hn => _⟩ simp [constFormalMultilinearSeries_apply hn] #align has_fpower_series_on_ball_const hasFPowerSeriesOnBall_const theorem hasFPowerSeriesAt_const {c : F} {e : E} : HasFPowerSeriesAt (fun _ => c) (constFormalMultilinearSeries π•œ E c) e := ⟨⊀, hasFPowerSeriesOnBall_const⟩ #align has_fpower_series_at_const hasFPowerSeriesAt_const theorem analyticAt_const {v : F} : AnalyticAt π•œ (fun _ => v) x := ⟨constFormalMultilinearSeries π•œ E v, hasFPowerSeriesAt_const⟩ #align analytic_at_const analyticAt_const theorem analyticOn_const {v : F} {s : Set E} : AnalyticOn π•œ (fun _ => v) s := fun _ _ => analyticAt_const #align analytic_on_const analyticOn_const theorem HasFPowerSeriesOnBall.add (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f + g) (pf + pg) x r := { r_le := le_trans (le_min_iff.2 ⟨hf.r_le, hg.r_le⟩) (pf.min_radius_le_radius_add pg) r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).add (hg.hasSum hy) } #align has_fpower_series_on_ball.add HasFPowerSeriesOnBall.add theorem HasFPowerSeriesAt.add (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f + g) (pf + pg) x := by rcases (hf.eventually.and hg.eventually).exists with ⟨r, hr⟩ exact ⟨r, hr.1.add hr.2⟩ #align has_fpower_series_at.add HasFPowerSeriesAt.add theorem AnalyticAt.congr (hf : AnalyticAt π•œ f x) (hg : f =αΆ [𝓝 x] g) : AnalyticAt π•œ g x := let ⟨_, hpf⟩ := hf (hpf.congr hg).analyticAt theorem analyticAt_congr (h : f =αΆ [𝓝 x] g) : AnalyticAt π•œ f x ↔ AnalyticAt π•œ g x := ⟨fun hf ↦ hf.congr h, fun hg ↦ hg.congr h.symm⟩ theorem AnalyticAt.add (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f + g) x := let ⟨_, hpf⟩ := hf let ⟨_, hqf⟩ := hg (hpf.add hqf).analyticAt #align analytic_at.add AnalyticAt.add theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) : HasFPowerSeriesOnBall (-f) (-pf) x r := { r_le := by rw [pf.radius_neg] exact hf.r_le r_pos := hf.r_pos hasSum := fun hy => (hf.hasSum hy).neg } #align has_fpower_series_on_ball.neg HasFPowerSeriesOnBall.neg theorem HasFPowerSeriesAt.neg (hf : HasFPowerSeriesAt f pf x) : HasFPowerSeriesAt (-f) (-pf) x := let ⟨_, hrf⟩ := hf hrf.neg.hasFPowerSeriesAt #align has_fpower_series_at.neg HasFPowerSeriesAt.neg theorem AnalyticAt.neg (hf : AnalyticAt π•œ f x) : AnalyticAt π•œ (-f) x := let ⟨_, hpf⟩ := hf hpf.neg.analyticAt #align analytic_at.neg AnalyticAt.neg theorem HasFPowerSeriesOnBall.sub (hf : HasFPowerSeriesOnBall f pf x r) (hg : HasFPowerSeriesOnBall g pg x r) : HasFPowerSeriesOnBall (f - g) (pf - pg) x r := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_on_ball.sub HasFPowerSeriesOnBall.sub theorem HasFPowerSeriesAt.sub (hf : HasFPowerSeriesAt f pf x) (hg : HasFPowerSeriesAt g pg x) : HasFPowerSeriesAt (f - g) (pf - pg) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align has_fpower_series_at.sub HasFPowerSeriesAt.sub theorem AnalyticAt.sub (hf : AnalyticAt π•œ f x) (hg : AnalyticAt π•œ g x) : AnalyticAt π•œ (f - g) x := by simpa only [sub_eq_add_neg] using hf.add hg.neg #align analytic_at.sub AnalyticAt.sub theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn π•œ f t) (hst : s βŠ† t) : AnalyticOn π•œ f s := fun z hz => hf z (hst hz) #align analytic_on.mono AnalyticOn.mono theorem AnalyticOn.congr' {s : Set E} (hf : AnalyticOn π•œ f s) (hg : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ g s := fun z hz => (hf z hz).congr (mem_nhdsSet_iff_forall.mp hg z hz) theorem analyticOn_congr' {s : Set E} (h : f =αΆ [𝓝˒ s] g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr' h, fun hg => hg.congr' h.symm⟩ theorem AnalyticOn.congr {s : Set E} (hs : IsOpen s) (hf : AnalyticOn π•œ f s) (hg : s.EqOn f g) : AnalyticOn π•œ g s := hf.congr' $ mem_nhdsSet_iff_forall.mpr (fun _ hz => eventuallyEq_iff_exists_mem.mpr ⟨s, hs.mem_nhds hz, hg⟩) theorem analyticOn_congr {s : Set E} (hs : IsOpen s) (h : s.EqOn f g) : AnalyticOn π•œ f s ↔ AnalyticOn π•œ g s := ⟨fun hf => hf.congr hs h, fun hg => hg.congr hs h.symm⟩ theorem AnalyticOn.add {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f + g) s := fun z hz => (hf z hz).add (hg z hz) #align analytic_on.add AnalyticOn.add theorem AnalyticOn.sub {s : Set E} (hf : AnalyticOn π•œ f s) (hg : AnalyticOn π•œ g s) : AnalyticOn π•œ (f - g) s := fun z hz => (hf z hz).sub (hg z hz) #align analytic_on.sub AnalyticOn.sub theorem HasFPowerSeriesOnBall.coeff_zero (hf : HasFPowerSeriesOnBall f pf 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 j => 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 zero_mem).unique (hasSum_single _ this) simpa [v_eq] using A.symm #align has_fpower_series_on_ball.coeff_zero HasFPowerSeriesOnBall.coeff_zero 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 #align has_fpower_series_at.coeff_zero HasFPowerSeriesAt.coeff_zero /-- 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 := { r_le := h.r_le.trans (p.radius_le_radius_continuousLinearMap_comp _) r_pos := h.r_pos hasSum := fun hy => by simpa only [ContinuousLinearMap.compFormalMultilinearSeries_apply, ContinuousLinearMap.compContinuousMultilinearMap_coe, Function.comp_apply] using g.hasSum (h.hasSum hy) } #align continuous_linear_map.comp_has_fpower_series_on_ball ContinuousLinearMap.comp_hasFPowerSeriesOnBall /-- 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 {s : Set E} (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_hasFPowerSeriesOnBall hp⟩ #align continuous_linear_map.comp_analytic_on ContinuousLinearMap.comp_analyticOn /-- 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 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 => _⟩ 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) exact mod_cast 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 this) intro n calc β€–(p n) fun _ : Fin n => yβ€– _ ≀ β€–p nβ€– * ∏ _i : Fin n, β€–yβ€– := ContinuousMultilinearMap.le_op_norm _ _ _ = β€–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] #align has_fpower_series_on_ball.uniform_geometric_approx' HasFPowerSeriesOnBall.uniform_geometric_approx' /-- 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 obtain ⟨a, ha, C, hC, hp⟩ : βˆƒ 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 := hf.uniform_geometric_approx' h refine' ⟨a, ha, C, hC, fun y hy n => (hp y hy n).trans _⟩ have yr' : β€–yβ€– < r' := by rwa [ball_zero_eq] at hy gcongr exacts [mul_nonneg ha.1.le (div_nonneg (norm_nonneg y) r'.coe_nonneg), mul_le_of_le_one_right ha.1.le (div_le_one_of_le yr'.le r'.coe_nonneg)] #align has_fpower_series_on_ball.uniform_geometric_approx HasFPowerSeriesOnBall.uniform_geometric_approx /-- Taylor formula for an analytic function, `IsBigO` version. -/ theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : β„•) : (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 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, β€–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' : ℝ); Β· exact mod_cast r'0 filter_upwards [Metric.ball_mem_nhds (0 : E) r'0] with y hy simpa [mul_pow, mul_div_assoc, mul_assoc, div_mul_eq_mul_div] using hp y hy n set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_sub_partial_sum_pow HasFPowerSeriesAt.isBigO_sub_partialSum_pow /-- 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 lift r' to ℝβ‰₯0 using ne_top_of_lt hr rcases (zero_le r').eq_or_lt with (rfl | hr'0) Β· simp only [isBigO_bot, EMetric.ball_zero, principal_empty, ENNReal.coe_zero] obtain ⟨a, ha, C, hC : 0 < C, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ n : β„•, β€–p nβ€– * (r' : ℝ) ^ n ≀ C * a ^ n exact 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', β€–f y.1 - f y.2 - p 1 fun _ => y.1 - y.2β€– ≀ L y := by intro y hy' 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 hy.1).sub (hf.hasSum_sub 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_sub, ← Pi.single, Subsingleton.pi_single_eq, sub_sub_sub_cancel_right] rw [EMetric.mem_ball, edist_eq_coe_nnnorm_sub, ENNReal.coe_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 -- porting note: `pi_norm_const` was `pi_norm_const (_ : E)` 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 -- porting note: the two `↑` in `↑r'` are new, without them, Lean fails to synthesize -- instances `HDiv ℝ ℝβ‰₯0 ?m` or `HMul ℝ ℝβ‰₯0 ?m` _ ≀ 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 -- porting note: in the original, `B` was in the `field_simp`, but now Lean does not -- accept it. The current proof works in Lean 4, but does not in Lean 3. field_simp [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_1 this).add -- porting note: was `convert`! ((hasSum_geometric_of_norm_lt_1 this).mul_left 2) exact hA.norm_le_of_bounded hBL hAB suffices L =O[π“Ÿ (EMetric.ball (x, x) r')] fun y => β€–y - (x, x)β€– * β€–y.1 - y.2β€– by refine' (IsBigO.of_bound 1 (eventually_principal.2 fun y hy => _)).trans this rw [one_mul] exact (hL y hy).trans (le_abs_self _) simp_rw [mul_right_comm _ (_ * _)] -- porting note: there was an `L` inside the `simp_rw`. exact (isBigO_refl _ _).const_mul_left _ set_option linter.uppercaseLean3 false in #align has_fpower_series_on_ball.is_O_image_sub_image_sub_deriv_principal HasFPowerSeriesOnBall.isBigO_image_sub_image_sub_deriv_principal /-- 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 simpa only [isBigO_principal, mul_assoc, norm_mul, norm_norm, Prod.forall, EMetric.mem_ball, Prod.edist_eq, max_lt_iff, and_imp, @forall_swap (_ < _) E] using hf.isBigO_image_sub_image_sub_deriv_principal hr #align has_fpower_series_on_ball.image_sub_sub_deriv_le HasFPowerSeriesOnBall.image_sub_sub_deriv_le /-- 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 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 _ exact le_principal_iff.2 (EMetric.ball_mem_nhds _ r'0) set_option linter.uppercaseLean3 false in #align has_fpower_series_at.is_O_image_sub_norm_mul_norm_sub HasFPowerSeriesAt.isBigO_image_sub_norm_mul_norm_sub /-- 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 obtain ⟨a, ha, C, -, hp⟩ : βˆƒ a ∈ Ioo (0 : ℝ) 1, βˆƒ C > 0, βˆ€ y ∈ Metric.ball (0 : E) r', βˆ€ n, β€–f (x + y) - p.partialSum n yβ€– ≀ C * a ^ n exact 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_0_of_lt_1 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 n).trans_lt hn #align has_fpower_series_on_ball.tendsto_uniformly_on HasFPowerSeriesOnBall.tendstoUniformlyOn /-- 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 intro u hu x hx rcases ENNReal.lt_iff_exists_nnreal_btwn.1 hx with ⟨r', xr', hr'⟩ have : EMetric.ball (0 : E) r' ∈ 𝓝 x := IsOpen.mem_nhds EMetric.isOpen_ball xr' refine' ⟨EMetric.ball (0 : E) r', mem_nhdsWithin_of_mem_nhds this, _⟩ simpa [Metric.emetric_ball_nnreal] using hf.tendstoUniformlyOn hr' u hu #align has_fpower_series_on_ball.tendsto_locally_uniformly_on HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn /-- 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 convert (hf.tendstoUniformlyOn h).comp fun y => y - x using 1 Β· simp [(Β· ∘ Β·)] Β· ext z simp [dist_eq_norm] #align has_fpower_series_on_ball.tendsto_uniformly_on' HasFPowerSeriesOnBall.tendstoUniformlyOn' /-- 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 have A : ContinuousOn (fun y : E => y - x) (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_eq_coe_nnnorm, edist_eq_coe_nnnorm_sub] #align has_fpower_series_on_ball.tendsto_locally_uniformly_on' HasFPowerSeriesOnBall.tendstoLocallyUniformlyOn' /-- If a function admits a power series expansion on a disk, then it is continuous there. -/ protected theorem HasFPowerSeriesOnBall.continuousOn (hf : HasFPowerSeriesOnBall f p x r) : ContinuousOn f (EMetric.ball x r) := hf.tendstoLocallyUniformlyOn'.continuousOn <| eventually_of_forall fun n => ((p.partialSum_continuous n).comp (continuous_id.sub continuous_const)).continuousOn #align has_fpower_series_on_ball.continuous_on HasFPowerSeriesOnBall.continuousOn 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) #align has_fpower_series_at.continuous_at HasFPowerSeriesAt.continuousAt protected theorem AnalyticAt.continuousAt (hf : AnalyticAt π•œ f x) : ContinuousAt f x := let ⟨_, hp⟩ := hf hp.continuousAt #align analytic_at.continuous_at AnalyticAt.continuousAt protected theorem AnalyticOn.continuousOn {s : Set E} (hf : AnalyticOn π•œ f s) : ContinuousOn f s := fun x hx => (hf x hx).continuousAt.continuousWithinAt #align analytic_on.continuous_on AnalyticOn.continuousOn /-- Analytic everywhere implies continuous -/ theorem AnalyticOn.continuous {f : E β†’ F} (fa : AnalyticOn π•œ f univ) : Continuous f := by rw [continuous_iff_continuousOn_univ]; exact fa.continuousOn /-- 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 } #align formal_multilinear_series.has_fpower_series_on_ball FormalMultilinearSeries.hasFPowerSeriesOnBall 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 #align has_fpower_series_on_ball.sum HasFPowerSeriesOnBall.sum /-- 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 #align formal_multilinear_series.continuous_on FormalMultilinearSeries.continuousOn end /-! ### Uniqueness of power series If a function `f : E β†’ F` has two representations as power series at a point `x : E`, corresponding to formal multilinear series `p₁` and `pβ‚‚`, then these representations agree term-by-term. That is, for any `n : β„•` and `y : E`, `p₁ n (fun i ↦ y) = pβ‚‚ n (fun i ↦ y)`. In the one-dimensional case, when `f : π•œ β†’ E`, the continuous multilinear maps `p₁ n` and `pβ‚‚ n` are given by `ContinuousMultilinearMap.mkPiField`, and hence are determined completely by the value of `p₁ n (fun i ↦ 1)`, so `p₁ = pβ‚‚`. Consequently, the radius of convergence for one series can be transferred to the other. -/ section Uniqueness open ContinuousMultilinearMap theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : β„•} {p : E[Γ—n]β†’L[π•œ] F} (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => β€–yβ€– ^ (n + 1)) (y : E) : (p fun _ => y) = 0 := by obtain ⟨c, c_pos, hc⟩ := h.exists_pos obtain ⟨t, ht, t_open, z_mem⟩ := eventually_nhds_iff.mp (isBigOWith_iff.mp hc) obtain ⟨δ, Ξ΄_pos, δΡ⟩ := (Metric.isOpen_iff.mp t_open) 0 z_mem clear h hc z_mem cases' n with n Β· exact norm_eq_zero.mp (by -- porting note: the symmetric difference of the `simpa only` sets: -- added `Nat.zero_eq, zero_add, pow_one` -- removed `zero_pow', Ne.def, Nat.one_ne_zero, not_false_iff` simpa only [Nat.zero_eq, fin0_apply_norm, norm_eq_zero, norm_zero, zero_add, pow_one, mul_zero, norm_le_zero_iff] using ht 0 (δΡ (Metric.mem_ball_self Ξ΄_pos))) Β· refine' Or.elim (Classical.em (y = 0)) (fun hy => by simpa only [hy] using p.map_zero) fun hy => _ replace hy := norm_pos_iff.mpr hy refine' norm_eq_zero.mp (le_antisymm (le_of_forall_pos_le_add fun Ξ΅ Ξ΅_pos => _) (norm_nonneg _)) have hβ‚€ := _root_.mul_pos c_pos (pow_pos hy (n.succ + 1)) obtain ⟨k, k_pos, k_norm⟩ := NormedField.exists_norm_lt π•œ (lt_min (mul_pos Ξ΄_pos (inv_pos.mpr hy)) (mul_pos Ξ΅_pos (inv_pos.mpr hβ‚€))) have h₁ : β€–k β€’ yβ€– < Ξ΄ := by rw [norm_smul] exact inv_mul_cancel_rightβ‚€ hy.ne.symm Ξ΄ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_left _ _)) hy have hβ‚‚ := calc β€–p fun _ => k β€’ yβ€– ≀ c * β€–k β€’ yβ€– ^ (n.succ + 1) := by -- porting note: now Lean wants `_root_.` simpa only [norm_pow, _root_.norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) --simpa only [norm_pow, norm_norm] using ht (k β€’ y) (δΡ (mem_ball_zero_iff.mpr h₁)) _ = β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by -- porting note: added `Nat.succ_eq_add_one` since otherwise `ring` does not conclude. simp only [norm_smul, mul_pow, Nat.succ_eq_add_one] -- porting note: removed `rw [pow_succ]`, since it now becomes superfluous. ring have h₃ : β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)) < Ξ΅ := inv_mul_cancel_rightβ‚€ hβ‚€.ne.symm Ξ΅ β–Έ mul_lt_mul_of_pos_right (lt_of_lt_of_le k_norm (min_le_right _ _)) hβ‚€ calc β€–p fun _ => yβ€– = β€–k⁻¹ ^ n.succβ€– * β€–p fun _ => k β€’ yβ€– := by simpa only [inv_smul_smulβ‚€ (norm_pos_iff.mp k_pos), norm_smul, Finset.prod_const, Finset.card_fin] using congr_arg norm (p.map_smul_univ (fun _ : Fin n.succ => k⁻¹) fun _ : Fin n.succ => k β€’ y) _ ≀ β€–k⁻¹ ^ n.succβ€– * (β€–kβ€– ^ n.succ * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1)))) := by gcongr _ = β€–(k⁻¹ * k) ^ n.succβ€– * (β€–kβ€– * (c * β€–yβ€– ^ (n.succ + 1))) := by rw [← mul_assoc] simp [norm_mul, mul_pow] _ ≀ 0 + Ξ΅ := by rw [inv_mul_cancel (norm_pos_iff.mp k_pos)] simpa using h₃.le set_option linter.uppercaseLean3 false in #align asymptotics.is_O.continuous_multilinear_map_apply_eq_zero Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero /-- If a formal multilinear series `p` represents the zero function at `x : E`, then the terms `p n (fun i ↦ y)` appearing in the sum are zero for any `n : β„•`, `y : E`. -/ theorem HasFPowerSeriesAt.apply_eq_zero {p : FormalMultilinearSeries π•œ E F} {x : E} (h : HasFPowerSeriesAt 0 p x) (n : β„•) : βˆ€ y : E, (p n fun _ => y) = 0 := by refine' Nat.strong_induction_on n fun k hk => _ have psum_eq : p.partialSum (k + 1) = fun y => p k fun _ => y := by funext z refine' Finset.sum_eq_single _ (fun b hb hnb => _) fun hn => _ Β· have := Finset.mem_range_succ_iff.mp hb simp only [hk b (this.lt_of_ne hnb), Pi.zero_apply] Β· exact False.elim (hn (Finset.mem_range.mpr (lt_add_one k))) replace h := h.isBigO_sub_partialSum_pow k.succ simp only [psum_eq, zero_sub, Pi.zero_apply, Asymptotics.isBigO_neg_left] at h exact h.continuousMultilinearMap_apply_eq_zero #align has_fpower_series_at.apply_eq_zero HasFPowerSeriesAt.apply_eq_zero /-- A one-dimensional formal multilinear series representing the zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries π•œ π•œ E} {x : π•œ} (h : HasFPowerSeriesAt 0 p x) : p = 0 := by -- porting note: `funext; ext` was `ext (n x)` funext n ext x rw [← mkPiField_apply_one_eq_self (p n)] -- porting note: nasty hack, was `simp [h.apply_eq_zero n 1]` have := Or.intro_right ?_ (h.apply_eq_zero n 1) simpa using this #align has_fpower_series_at.eq_zero HasFPowerSeriesAt.eq_zero /-- One-dimensional formal multilinear series representing the same function are equal. -/ theorem HasFPowerSeriesAt.eq_formalMultilinearSeries {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (h₁ : HasFPowerSeriesAt f p₁ x) (hβ‚‚ : HasFPowerSeriesAt f pβ‚‚ x) : p₁ = pβ‚‚ := sub_eq_zero.mp (HasFPowerSeriesAt.eq_zero (by simpa only [sub_self] using h₁.sub hβ‚‚)) #align has_fpower_series_at.eq_formal_multilinear_series HasFPowerSeriesAt.eq_formalMultilinearSeries theorem HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually {p q : FormalMultilinearSeries π•œ π•œ E} {f g : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hq : HasFPowerSeriesAt g q x) (heq : βˆ€αΆ  z in 𝓝 x, f z = g z) : p = q := (hp.congr heq).eq_formalMultilinearSeries hq #align has_fpower_series_at.eq_formal_multilinear_series_of_eventually HasFPowerSeriesAt.eq_formalMultilinearSeries_of_eventually /-- A one-dimensional formal multilinear series representing a locally zero function is zero. -/ theorem HasFPowerSeriesAt.eq_zero_of_eventually {p : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {x : π•œ} (hp : HasFPowerSeriesAt f p x) (hf : f =αΆ [𝓝 x] 0) : p = 0 := (hp.congr hf).eq_zero #align has_fpower_series_at.eq_zero_of_eventually HasFPowerSeriesAt.eq_zero_of_eventually /-- If a function `f : π•œ β†’ E` has two power series representations at `x`, then the given radii in which convergence is guaranteed may be interchanged. This can be useful when the formal multilinear series in one representation has a particularly nice form, but the other has a larger radius. -/ theorem HasFPowerSeriesOnBall.exchange_radius {p₁ pβ‚‚ : FormalMultilinearSeries π•œ π•œ E} {f : π•œ β†’ E} {r₁ rβ‚‚ : ℝβ‰₯0∞} {x : π•œ} (h₁ : HasFPowerSeriesOnBall f p₁ x r₁) (hβ‚‚ : HasFPowerSeriesOnBall f pβ‚‚ x rβ‚‚) : HasFPowerSeriesOnBall f p₁ x rβ‚‚ := hβ‚‚.hasFPowerSeriesAt.eq_formalMultilinearSeries h₁.hasFPowerSeriesAt β–Έ hβ‚‚ #align has_fpower_series_on_ball.exchange_radius HasFPowerSeriesOnBall.exchange_radius /-- If a function `f : π•œ β†’ E` has power series representation `p` on a ball of some radius and for each positive radius it has some power series representation, then `p` converges to `f` on the whole `π•œ`. -/ theorem HasFPowerSeriesOnBall.r_eq_top_of_exists {f : π•œ β†’ E} {r : ℝβ‰₯0∞} {x : π•œ} {p : FormalMultilinearSeries π•œ π•œ E} (h : HasFPowerSeriesOnBall f p x r) (h' : βˆ€ (r' : ℝβ‰₯0) (_ : 0 < r'), βˆƒ p' : FormalMultilinearSeries π•œ π•œ E, HasFPowerSeriesOnBall f p' x r') : HasFPowerSeriesOnBall f p x ∞ := { r_le := ENNReal.le_of_forall_pos_nnreal_lt fun r hr _ => let ⟨_, hp'⟩ := h' r hr (h.exchange_radius hp').r_le r_pos := ENNReal.coe_lt_top hasSum := fun {y} _ => let ⟨r', hr'⟩ := exists_gt β€–yβ€–β‚Š let ⟨_, hp'⟩ := h' r' hr'.ne_bot.bot_lt (h.exchange_radius hp').hasSum <| mem_emetric_ball_zero_iff.mpr (ENNReal.coe_lt_coe.2 hr') } #align has_fpower_series_on_ball.r_eq_top_of_exists HasFPowerSeriesOnBall.r_eq_top_of_exists end Uniqueness /-! ### Changing origin in a power series If a function is analytic in a disk `D(x, R)`, then it is analytic in any disk contained in that one. Indeed, one can write $$ f (x + y + z) = \sum_{n} p_n (y + z)^n = \sum_{n, k} \binom{n}{k} p_n y^{n-k} z^k = \sum_{k} \Bigl(\sum_{n} \binom{n}{k} p_n y^{n-k}\Bigr) z^k. $$ The corresponding power series has thus a `k`-th coefficient equal to $\sum_{n} \binom{n}{k} p_n y^{n-k}$. In the general case where `pβ‚™` is a multilinear map, this has to be interpreted suitably: instead of having a binomial coefficient, one should sum over all possible subsets `s` of `Fin n` of cardinal `k`, and attribute `z` to the indices in `s` and `y` to the indices outside of `s`. In this paragraph, we implement this. The new power series is called `p.changeOrigin y`. Then, we check its convergence and the fact that its sum coincides with the original sum. The outcome of this discussion is that the set of points where a function is analytic is open. -/ namespace FormalMultilinearSeries section variable (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} /-- A term of `FormalMultilinearSeries.changeOriginSeries`. Given a formal multilinear series `p` and a point `x` in its ball of convergence, `p.changeOrigin x` is a formal multilinear series such that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. Each term of `p.changeOrigin x` is itself an analytic function of `x` given by the series `p.changeOriginSeries`. Each term in `changeOriginSeries` is the sum of `changeOriginSeriesTerm`'s over all `s` of cardinality `l`. The definition is such that `p.changeOriginSeriesTerm k l s hs (fun _ ↦ x) (fun _ ↦ y) = p (k + l) (s.piecewise (fun _ ↦ x) (fun _ ↦ y))` -/ def changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : E[Γ—l]β†’L[π•œ] E[Γ—k]β†’L[π•œ] F := by let a := ContinuousMultilinearMap.curryFinFinset π•œ E F hs (by erw [Finset.card_compl, Fintype.card_fin, hs, add_tsub_cancel_right]) exact a (p (k + l)) #align formal_multilinear_series.change_origin_series_term FormalMultilinearSeries.changeOriginSeriesTerm theorem changeOriginSeriesTerm_apply (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) (x y : E) : (p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => y) = p (k + l) (s.piecewise (fun _ => x) fun _ => y) := ContinuousMultilinearMap.curryFinFinset_apply_const _ _ _ _ _ #align formal_multilinear_series.change_origin_series_term_apply FormalMultilinearSeries.changeOriginSeriesTerm_apply @[simp] theorem norm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€– = β€–p (k + l)β€– := by simp only [changeOriginSeriesTerm, LinearIsometryEquiv.norm_map] #align formal_multilinear_series.norm_change_origin_series_term FormalMultilinearSeries.norm_changeOriginSeriesTerm @[simp] theorem nnnorm_changeOriginSeriesTerm (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) : β€–p.changeOriginSeriesTerm k l s hsβ€–β‚Š = β€–p (k + l)β€–β‚Š := by simp only [changeOriginSeriesTerm, LinearIsometryEquiv.nnnorm_map] #align formal_multilinear_series.nnnorm_change_origin_series_term FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm theorem nnnorm_changeOriginSeriesTerm_apply_le (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) (x y : E) : β€–p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => yβ€–β‚Š ≀ β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l * β€–yβ€–β‚Š ^ k := by
rw [← p.nnnorm_changeOriginSeriesTerm k l s hs, ← Fin.prod_const, ← Fin.prod_const]
theorem nnnorm_changeOriginSeriesTerm_apply_le (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) (x y : E) : β€–p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => yβ€–β‚Š ≀ β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l * β€–yβ€–β‚Š ^ k := by
Mathlib.Analysis.Analytic.Basic.1145_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOriginSeriesTerm_apply_le (k l : β„•) (s : Finset (Fin (k + l))) (hs : s.card = l) (x y : E) : β€–p.changeOriginSeriesTerm k l s hs (fun _ => x) fun _ => yβ€–β‚Š ≀ β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l * β€–yβ€–β‚Š ^ k
Mathlib_Analysis_Analytic_Basic