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 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β€–β‚Š ≀ (β€–changeOriginSeriesTerm p k l s hsβ€–β‚Š * ∏ _i : Fin l, β€–xβ€–β‚Š) * ∏ _i : Fin 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) _ ≀ β€–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]
apply ContinuousMultilinearMap.le_of_op_nnnorm_le
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]
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
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✝ 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β€–β‚Š ≀ β€–changeOriginSeriesTerm p k l s hsβ€–β‚Š * ∏ _i : Fin l, β€–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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le
apply ContinuousMultilinearMap.le_op_nnnorm
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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le
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
π•œ : 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 : β„• ⊒ βˆ‘ a : { s // Finset.card s = l }, β€–changeOriginSeriesTerm p k l ↑a (_ : Finset.card ↑a = l)β€–β‚Š = βˆ‘' (x : { s // Finset.card s = l }), β€–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] #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by
simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)]
theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by
Mathlib.Analysis.Analytic.Basic.1164_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–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 : β„• x : E ⊒ β€–(changeOriginSeries p k l) fun x_1 => xβ€–β‚Š ≀ βˆ‘' (x_1 : { s // Finset.card s = l }), β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ 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] #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by
rw [NNReal.tsum_mul_right, ← Fin.prod_const]
theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by
Mathlib.Analysis.Analytic.Basic.1171_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ 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 : β„• x : E ⊒ β€–(changeOriginSeries p k l) fun x_1 => xβ€–β‚Š ≀ (βˆ‘' (x : { s // Finset.card s = l }), β€–p (k + l)β€–β‚Š) * ∏ _i : Fin l, β€–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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const]
exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _)
theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const]
Mathlib.Analysis.Analytic.Basic.1171_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ 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 ⊒ Function.LeftInverse (fun s => { fst := s.fst - Finset.card s.snd, snd := { fst := Finset.card s.snd, snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd, property := (_ : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd) = Finset.card s.snd) } } }) fun s => { fst := s.fst + s.snd.fst, snd := ↑s.snd.snd }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by
rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
Mathlib_Analysis_Analytic_Basic
case mk.mk.mk π•œ : 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 ⊒ (fun s => { fst := s.fst - Finset.card s.snd, snd := { fst := Finset.card s.snd, snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd, property := (_ : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd) = Finset.card s.snd) } } }) ((fun s => { fst := s.fst + s.snd.fst, snd := ↑s.snd.snd }) { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }) = { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩
dsimp only [Subtype.coe_mk]
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
Mathlib_Analysis_Analytic_Basic
case mk.mk.mk π•œ : 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 ⊒ { fst := k + l - Finset.card s, snd := { fst := Finset.card s, snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso (_ : k + l = k + l - Finset.card s + Finset.card s)).toEquiv) s, property := (_ : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : k + l = k + l - Finset.card s + Finset.card s)).toEquiv) s) = Finset.card s) } } } = { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal
suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right]
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
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 this : βˆ€ (k' l' : β„•), k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs' : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s) = l'), { fst := k', snd := { fst := l', snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s, property := hs' } } } = { fst := k, snd := { fst := l, snd := { val := s, property := hs } } } ⊒ { fst := k + l - Finset.card s, snd := { fst := Finset.card s, snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso (_ : k + l = k + l - Finset.card s + Finset.card s)).toEquiv) s, property := (_ : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : k + l = k + l - Finset.card s + Finset.card s)).toEquiv) s) = Finset.card s) } } } = { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by
apply this
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
Mathlib_Analysis_Analytic_Basic
case a π•œ : 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 this : βˆ€ (k' l' : β„•), k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs' : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s) = l'), { fst := k', snd := { fst := l', snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s, property := hs' } } } = { fst := k, snd := { fst := l, snd := { val := s, property := hs } } } ⊒ k + l - Finset.card s = 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;>
simp only [hs, add_tsub_cancel_right]
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;>
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
Mathlib_Analysis_Analytic_Basic
case a π•œ : 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 this : βˆ€ (k' l' : β„•), k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs' : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s) = l'), { fst := k', snd := { fst := l', snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s, property := hs' } } } = { fst := k, snd := { fst := l, snd := { val := s, property := hs } } } ⊒ Finset.card s = 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] #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;>
simp only [hs, add_tsub_cancel_right]
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;>
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
Mathlib_Analysis_Analytic_Basic
case mk.mk.mk π•œ : 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 ⊒ βˆ€ (k' l' : β„•), k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs' : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s) = l'), { fst := k', snd := { fst := l', snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s, property := hs' } } } = { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right]
rintro _ _ rfl rfl hkl hs'
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right]
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
Mathlib_Analysis_Analytic_Basic
case mk.mk.mk π•œ : 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'✝ hkl : k'✝ + l'✝ = k'✝ + l'✝ hs' : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s) = l'✝ ⊒ { fst := k'✝, snd := { fst := l'✝, snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso hkl).toEquiv) s, property := hs' } } } = { fst := k'✝, snd := { fst := l'✝, snd := { val := s, property := hs } } }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs'
simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq]
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs'
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
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 ⊒ Function.RightInverse (fun s => { fst := s.fst - Finset.card s.snd, snd := { fst := Finset.card s.snd, snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd, property := (_ : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd) = Finset.card s.snd) } } }) fun s => { fst := s.fst + s.snd.fst, snd := ↑s.snd.snd }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by
rintro ⟨n, s⟩
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
Mathlib_Analysis_Analytic_Basic
case mk π•œ : 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 n : β„• s : Finset (Fin n) ⊒ (fun s => { fst := s.fst + s.snd.fst, snd := ↑s.snd.snd }) ((fun s => { fst := s.fst - Finset.card s.snd, snd := { fst := Finset.card s.snd, snd := { val := Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd, property := (_ : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : s.fst = s.fst - Finset.card s.snd + Finset.card s.snd)).toEquiv) s.snd) = Finset.card s.snd) } } }) { fst := n, snd := s }) = { fst := n, snd := s }
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩
simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv]
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩
Mathlib.Analysis.Analytic.Basic.1185_0.jQw1fRSE1vGpOll
/-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p ⊒ Summable fun s => β€–p (s.fst + s.snd.fst)β€–β‚Š * r ^ s.snd.fst * r' ^ s.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by
rw [← changeOriginIndexEquiv.symm.summable_iff]
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p ⊒ Summable ((fun s => β€–p (s.fst + s.snd.fst)β€–β‚Š * r ^ s.snd.fst * r' ^ s.fst) ∘ ⇑changeOriginIndexEquiv.symm)
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff]
dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst]
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff]
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p ⊒ Summable fun x => β€–p (x.fst - Finset.card x.snd + Finset.card x.snd)β€–β‚Š * r ^ Finset.card x.snd * r' ^ (x.fst - Finset.card x.snd)
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst]
have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst]
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p ⊒ βˆ€ (n : β„•), HasSum (fun s => β€–p (n - Finset.card s + Finset.card s)β€–β‚Š * r ^ Finset.card s * r' ^ (n - Finset.card s)) (β€–p nβ€–β‚Š * (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] 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by
intro n
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p n : β„• ⊒ HasSum (fun s => β€–p (n - Finset.card s + Finset.card s)β€–β‚Š * r ^ Finset.card s * r' ^ (n - Finset.card s)) (β€–p nβ€–β‚Š * (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] 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails?
convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails?
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
Mathlib_Analysis_Analytic_Basic
case h.e'_5 π•œ : 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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p n : β„• ⊒ (fun s => β€–p (n - Finset.card s + Finset.card s)β€–β‚Š * r ^ Finset.card s * r' ^ (n - Finset.card s)) = fun s => β€–p nβ€–β‚Š * (r ^ Finset.card s * r' ^ (n - Finset.card s))
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β·
ext1 s
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β·
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
Mathlib_Analysis_Analytic_Basic
case h.e'_5.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 y : E r✝ R r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p n : β„• s : Finset (Fin n) ⊒ β€–p (n - Finset.card s + Finset.card s)β€–β‚Š * r ^ Finset.card s * r' ^ (n - Finset.card s) = β€–p nβ€–β‚Š * (r ^ Finset.card s * r' ^ (n - Finset.card s))
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s
rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc]
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
Mathlib_Analysis_Analytic_Basic
case convert_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 y : E r✝ R r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p n : β„• ⊒ HasSum (fun s => β€–p nβ€–β‚Š * (r ^ Finset.card s * r' ^ (n - Finset.card s))) (β€–p nβ€–β‚Š * (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] 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc]
rw [← Fin.sum_pow_mul_eq_add_pow]
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc]
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
Mathlib_Analysis_Analytic_Basic
case convert_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 y : E r✝ R r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p n : β„• ⊒ HasSum (fun s => β€–p nβ€–β‚Š * (r ^ Finset.card s * r' ^ (n - Finset.card s))) (β€–p nβ€–β‚Š * βˆ‘ s : Finset (Fin n), r ^ Finset.card s * r' ^ (n - Finset.card s))
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow]
exact (hasSum_fintype _).mul_left _
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow]
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p this : βˆ€ (n : β„•), HasSum (fun s => β€–p (n - Finset.card s + Finset.card s)β€–β‚Š * r ^ Finset.card s * r' ^ (n - Finset.card s)) (β€–p nβ€–β‚Š * (r + r') ^ n) ⊒ Summable fun x => β€–p (x.fst - Finset.card x.snd + Finset.card x.snd)β€–β‚Š * r ^ Finset.card x.snd * r' ^ (x.fst - Finset.card x.snd)
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _
refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p this : βˆ€ (n : β„•), HasSum (fun s => β€–p (n - Finset.card s + Finset.card s)β€–β‚Š * r ^ Finset.card s * r' ^ (n - Finset.card s)) (β€–p nβ€–β‚Š * (r + r') ^ n) ⊒ Summable fun x => βˆ‘' (y : Finset (Fin x)), β€–p ({ fst := x, snd := y }.fst - Finset.card { fst := x, snd := y }.snd + Finset.card { fst := x, snd := y }.snd)β€–β‚Š * r ^ Finset.card { fst := x, snd := y }.snd * r' ^ ({ fst := x, snd := y }.fst - Finset.card { fst := x, snd := y }.snd)
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩
simp only [(this _).tsum_eq]
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 r r' : ℝβ‰₯0 hr : ↑r + ↑r' < radius p this : βˆ€ (n : β„•), HasSum (fun s => β€–p (n - Finset.card s + Finset.card s)β€–β‚Š * r ^ Finset.card s * r' ^ (n - Finset.card s)) (β€–p nβ€–β‚Š * (r + r') ^ n) ⊒ Summable fun x => β€–p xβ€–β‚Š * (r + r') ^ 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq]
exact p.summable_nnnorm_mul_pow hr
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq]
Mathlib.Analysis.Analytic.Basic.1219_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1
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 hr : ↑r < radius p k : β„• ⊒ Summable fun s => β€–p (k + s.fst)β€–β‚Š * r ^ s.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by
rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩
theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by
Mathlib.Analysis.Analytic.Basic.1240_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1
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 p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 hr : ↑r < radius p k : β„• r' : ℝβ‰₯0 h0 : 0 < r' hr' : ↑r + ↑r' < radius p ⊒ Summable fun s => β€–p (k + s.fst)β€–β‚Š * r ^ s.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩
simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹
theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩
Mathlib.Analysis.Analytic.Basic.1240_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1
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 r : ℝβ‰₯0 hr : ↑r < radius p k : β„• ⊒ Summable fun l => β€–changeOriginSeries p k lβ€–β‚Š * r ^ 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] #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by
refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2
theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by
Mathlib.Analysis.Analytic.Basic.1248_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ 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 r : ℝβ‰₯0 hr : ↑r < radius p k n : β„• ⊒ β€–changeOriginSeries p k nβ€–β‚Š * r ^ n ≀ βˆ‘' (y : { s // Finset.card s = n }), β€–p (k + { fst := n, snd := y }.fst)β€–β‚Š * r ^ { fst := n, snd := y }.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2
simp only [NNReal.tsum_mul_right]
theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2
Mathlib.Analysis.Analytic.Basic.1248_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ 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 r : ℝβ‰₯0 hr : ↑r < radius p k n : β„• ⊒ β€–changeOriginSeries p k nβ€–β‚Š * r ^ n ≀ (βˆ‘' (x : { s // Finset.card s = n }), β€–p (k + n)β€–β‚Š) * 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] 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right]
exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl
theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right]
Mathlib.Analysis.Analytic.Basic.1248_0.jQw1fRSE1vGpOll
theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ 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 : β„• h : ↑‖xβ€–β‚Š < radius p ⊒ β€–changeOrigin p x kβ€–β‚Š ≀ βˆ‘' (s : (l : β„•) Γ— { s // Finset.card s = l }), β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by
refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by
Mathlib.Analysis.Analytic.Basic.1261_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1
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 : β„• h : ↑‖xβ€–β‚Š < radius p ⊒ HasSum (fun l => βˆ‘' (x_1 : { s // Finset.card s = l }), β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l) (βˆ‘' (s : (l : β„•) Γ— { s // Finset.card s = l }), β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst)
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x
have := p.changeOriginSeries_summable_auxβ‚‚ h k
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x
Mathlib.Analysis.Analytic.Basic.1261_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1
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 : β„• h : ↑‖xβ€–β‚Š < radius p this : Summable fun s => β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst ⊒ HasSum (fun l => βˆ‘' (x_1 : { s // Finset.card s = l }), β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l) (βˆ‘' (s : (l : β„•) Γ— { s // Finset.card s = l }), β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst)
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k
refine' HasSum.sigma this.hasSum fun l => _
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k
Mathlib.Analysis.Analytic.Basic.1261_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1
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 : β„• h : ↑‖xβ€–β‚Š < radius p this : Summable fun s => β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst l : β„• ⊒ HasSum (fun c => β€–p (k + { fst := l, snd := c }.fst)β€–β‚Š * β€–xβ€–β‚Š ^ { fst := l, snd := c }.fst) (βˆ‘' (x_1 : { s // Finset.card s = l }), β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ 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] #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _
exact ((NNReal.summable_sigma.1 this).1 l).hasSum
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _
Mathlib.Analysis.Analytic.Basic.1261_0.jQw1fRSE1vGpOll
theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1
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 ⊒ radius p - ↑‖xβ€–β‚Š ≀ radius (changeOrigin p 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by
refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by
Mathlib.Analysis.Analytic.Basic.1270_0.jQw1fRSE1vGpOll
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).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 p : FormalMultilinearSeries π•œ E F x y : E r✝ R r : ℝβ‰₯0 _h0 : 0 < r hr : ↑r < radius p - ↑‖xβ€–β‚Š ⊒ ↑r ≀ radius (changeOrigin p 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _
rw [lt_tsub_iff_right, add_comm] at hr
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _
Mathlib.Analysis.Analytic.Basic.1270_0.jQw1fRSE1vGpOll
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).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 p : FormalMultilinearSeries π•œ E F x y : E r✝ R r : ℝβ‰₯0 _h0 : 0 < r hr : ↑‖xβ€–β‚Š + ↑r < radius p ⊒ ↑r ≀ radius (changeOrigin p 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr
have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr
Mathlib.Analysis.Analytic.Basic.1270_0.jQw1fRSE1vGpOll
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).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 p : FormalMultilinearSeries π•œ E F x y : E r✝ R r : ℝβ‰₯0 _h0 : 0 < r hr : ↑‖xβ€–β‚Š + ↑r < radius p hr' : ↑‖xβ€–β‚Š < radius p ⊒ ↑r ≀ radius (changeOrigin p 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr
apply le_radius_of_summable_nnnorm
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr
Mathlib.Analysis.Analytic.Basic.1270_0.jQw1fRSE1vGpOll
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius
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 y : E r✝ R r : ℝβ‰₯0 _h0 : 0 < r hr : ↑‖xβ€–β‚Š + ↑r < radius p hr' : ↑‖xβ€–β‚Š < radius p ⊒ Summable fun n => β€–changeOrigin p x nβ€–β‚Š * 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] 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm
have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k)
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm
Mathlib.Analysis.Analytic.Basic.1270_0.jQw1fRSE1vGpOll
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius
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 y : E r✝ R r : ℝβ‰₯0 _h0 : 0 < r hr : ↑‖xβ€–β‚Š + ↑r < radius p hr' : ↑‖xβ€–β‚Š < radius p this : βˆ€ (k : β„•), β€–changeOrigin p x kβ€–β‚Š * r ^ k ≀ (βˆ‘' (s : (l : β„•) Γ— { s // Finset.card s = l }), β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst) * r ^ k ⊒ Summable fun n => β€–changeOrigin p x nβ€–β‚Š * 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] 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k)
refine' NNReal.summable_of_le this _
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k)
Mathlib.Analysis.Analytic.Basic.1270_0.jQw1fRSE1vGpOll
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius
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 y : E r✝ R r : ℝβ‰₯0 _h0 : 0 < r hr : ↑‖xβ€–β‚Š + ↑r < radius p hr' : ↑‖xβ€–β‚Š < radius p this : βˆ€ (k : β„•), β€–changeOrigin p x kβ€–β‚Š * r ^ k ≀ (βˆ‘' (s : (l : β„•) Γ— { s // Finset.card s = l }), β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst) * r ^ k ⊒ Summable fun b => (βˆ‘' (s : (l : β„•) Γ— { s // Finset.card s = l }), β€–p (b + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst) * r ^ b
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _
simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _
Mathlib.Analysis.Analytic.Basic.1270_0.jQw1fRSE1vGpOll
/-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by
have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h
have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h)
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h)
have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h)
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) ⊒ y ∈ EMetric.ball 0 (radius (changeOrigin p 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by
refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius)
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) ⊒ ↑‖yβ€–β‚Š < radius p - ↑‖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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius)
rwa [lt_tsub_iff_right, add_comm]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius)
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm]
have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm]
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) ⊒ x + y ∈ 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 #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by
refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h)
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) ⊒ ↑‖x + yβ€–β‚Š ≀ ↑‖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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h)
exact mod_cast nnnorm_add_le x y
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h)
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y
set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y
have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y ⊒ Summable 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)) #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by
refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y ⊒ βˆ€ (i : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l }), β€–f iβ€–β‚Š ≀ β€–p (i.fst + i.snd.fst)β€–β‚Š * β€–xβ€–β‚Š ^ i.snd.fst * β€–yβ€–β‚Š ^ i.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _
rintro ⟨k, l, s, hs⟩
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case mk.mk.mk π•œ : 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l ⊒ β€–f { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }β€–β‚Š ≀ β€–p ({ fst := k, snd := { fst := l, snd := { val := s, property := hs } } }.fst + { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }.snd.fst)β€–β‚Š * β€–xβ€–β‚Š ^ { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }.snd.fst * β€–yβ€–β‚Š ^ { fst := k, snd := { fst := l, snd := { val := s, property := hs } } }.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩
dsimp only [Subtype.coe_mk]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case mk.mk.mk π•œ : 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y k l : β„• s : Finset (Fin (k + l)) hs : Finset.card s = l ⊒ β€–((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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk]
exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk]
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _
have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f ⊒ HasSum f (FormalMultilinearSeries.sum (changeOrigin p 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by
refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• ⊒ HasSum (fun c => f { fst := k, snd := c }) ((changeOrigin p x 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β·
dsimp only
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β·
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• ⊒ HasSum (fun c => ((changeOriginSeriesTerm p k c.fst ↑c.snd (_ : Finset.card ↑c.snd = c.fst)) fun x_1 => x) fun x => y) ((changeOrigin p x 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only
refine' ContinuousMultilinearMap.hasSum_eval _ _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• ⊒ HasSum (fun c => (changeOriginSeriesTerm p k c.fst ↑c.snd (_ : Finset.card ↑c.snd = c.fst)) fun x_1 => x) (changeOrigin p x 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _
have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• this : HasSum (fun n => (changeOriginSeries p k n) fun x_1 => x) (changeOrigin p (0 + x) k) ⊒ HasSum (fun c => (changeOriginSeriesTerm p k c.fst ↑c.snd (_ : Finset.card ↑c.snd = c.fst)) fun x_1 => x) (changeOrigin p x 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball
rw [zero_add] at this
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• this : HasSum (fun n => (changeOriginSeries p k n) fun x_1 => x) (changeOrigin p x k) ⊒ HasSum (fun c => (changeOriginSeriesTerm p k c.fst ↑c.snd (_ : Finset.card ↑c.snd = c.fst)) fun x_1 => x) (changeOrigin p x 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this
refine' HasSum.sigma_of_hasSum this (fun l => _) _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• this : HasSum (fun n => (changeOriginSeries p k n) fun x_1 => x) (changeOrigin p x k) l : β„• ⊒ HasSum (fun c => (changeOriginSeriesTerm p k { fst := l, snd := c }.fst ↑{ fst := l, snd := c }.snd (_ : Finset.card ↑{ fst := l, snd := c }.snd = { fst := l, snd := c }.fst)) fun x_1 => x) ((changeOriginSeries p k l) fun x_1 => 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β·
simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β·
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• this : HasSum (fun n => (changeOriginSeries p k n) fun x_1 => x) (changeOrigin p x k) l : β„• ⊒ HasSum (fun c => (changeOriginSeriesTerm p k { fst := l, snd := c }.fst ↑c (_ : Finset.card ↑{ fst := l, snd := c }.snd = { fst := l, snd := c }.fst)) fun x_1 => x) (βˆ‘ x_1 : { s // Finset.card s = l }, (changeOriginSeriesTerm p k l ↑x_1 (_ : Finset.card ↑x_1 = l)) fun x_2 => 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply]
apply hasSum_fintype
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply]
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• this : HasSum (fun n => (changeOriginSeries p k n) fun x_1 => x) (changeOrigin p x k) ⊒ Summable fun c => (changeOriginSeriesTerm p k c.fst ↑c.snd (_ : Finset.card ↑c.snd = c.fst)) fun x_1 => 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β·
refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β·
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• this : HasSum (fun n => (changeOriginSeries p k n) fun x_1 => x) (changeOrigin p x k) s : (b : β„•) Γ— { s // Finset.card s = b } ⊒ β€–(changeOriginSeriesTerm p k s.fst ↑s.snd (_ : Finset.card ↑s.snd = s.fst)) fun x_1 => xβ€–β‚Š ≀ β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _
refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f k : β„• this : HasSum (fun n => (changeOriginSeries p k n) fun x_1 => x) (changeOrigin p x k) s : (b : β„•) Γ— { s // Finset.card s = b } ⊒ β€–changeOriginSeriesTerm p k s.fst ↑s.snd (_ : Finset.card ↑s.snd = s.fst)β€–β‚Š * ∏ i : Fin s.fst, β€–xβ€–β‚Š = β€–p (k + s.fst)β€–β‚Š * β€–xβ€–β‚Š ^ s.fst
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _
simp
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) ⊒ FormalMultilinearSeries.sum (changeOrigin p x) y = FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp
refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _)
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) ⊒ HasSum (f ∘ ⇑changeOriginIndexEquiv.symm) (FormalMultilinearSeries.sum p (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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _)
refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf)
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _)
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• ⊒ HasSum (fun c => (f ∘ ⇑changeOriginIndexEquiv.symm) { fst := n, snd := c }) ((p n) fun x_1 => 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf)
erw [(p n).map_add_univ (fun _ => x) fun _ => y]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf)
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• ⊒ HasSum (fun c => (f ∘ ⇑changeOriginIndexEquiv.symm) { fst := n, snd := c }) (βˆ‘ s : Finset (Fin n), (p n) (Finset.piecewise s (fun x_1 => x) 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function
convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩))
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case h.e'_6.a π•œ : 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• x✝ : Finset (Fin n) a✝ : x✝ ∈ Finset.univ ⊒ (p n) (Finset.piecewise x✝ (fun x_1 => x) fun x => y) = f (changeOriginIndexEquiv.symm { fst := n, snd := 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩))
rename_i s _
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩))
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case h.e'_6.a π•œ : 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• s : Finset (Fin n) a✝ : s ∈ Finset.univ ⊒ (p n) (Finset.piecewise s (fun x_1 => x) fun x => y) = f (changeOriginIndexEquiv.symm { fst := n, snd := s })
/- 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _
dsimp only [changeOriginSeriesTerm, (· ∘ ·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case h.e'_6.a π•œ : 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• s : Finset (Fin n) a✝ : s ∈ Finset.univ ⊒ (p n) (Finset.piecewise s (fun x_1 => x) fun x => y) = (((ContinuousMultilinearMap.curryFinFinset π•œ E F (_ : Finset.card ↑(changeOriginIndexEquiv.symm { fst := n, snd := s }).snd.snd = Finset.card s) (_ : Finset.card (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : { fst := n, snd := s }.fst = { fst := n, snd := s }.fst - Finset.card { fst := n, snd := s }.snd + Finset.card { fst := n, snd := s }.snd)).toEquiv) s)ᢜ = n - Finset.card s)) (p (n - Finset.card s + Finset.card s))) fun x_1 => x) 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe]
rw [ContinuousMultilinearMap.curryFinFinset_apply_const]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe]
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case h.e'_6.a π•œ : 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• s : Finset (Fin n) a✝ : s ∈ Finset.univ ⊒ (p n) (Finset.piecewise s (fun x_1 => x) fun x => y) = (p (n - Finset.card s + Finset.card s)) (Finset.piecewise (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : { fst := n, snd := s }.fst = { fst := n, snd := s }.fst - Finset.card { fst := n, snd := s }.snd + Finset.card { fst := n, snd := s }.snd)).toEquiv) s) (fun x_1 => x) 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const]
have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const]
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• s : Finset (Fin n) a✝ : s ∈ Finset.univ ⊒ βˆ€ (m : β„•) (hm : n = m), (p n) (Finset.piecewise s (fun x_1 => x) fun x => y) = (p m) (Finset.piecewise (Finset.map (Equiv.toEmbedding (Fin.castIso hm).toEquiv) s) (fun x_1 => x) 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by
rintro m rfl
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• s : Finset (Fin n) a✝ : s ∈ Finset.univ ⊒ (p n) (Finset.piecewise s (fun x_1 => x) fun x => y) = (p n) (Finset.piecewise (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : n = n)).toEquiv) s) (fun x_1 => x) 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl
simp (config := { unfoldPartialApp := true }) [Finset.piecewise]
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
Mathlib_Analysis_Analytic_Basic
case h.e'_6.a π•œ : 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 inst✝ : CompleteSpace F p : FormalMultilinearSeries π•œ E F x y : E r R : ℝβ‰₯0 h : ↑‖xβ€–β‚Š + ↑‖yβ€–β‚Š < radius p radius_pos : 0 < radius p x_mem_ball : x ∈ EMetric.ball 0 (radius p) y_mem_ball : y ∈ EMetric.ball 0 (radius (changeOrigin p x)) x_add_y_mem_ball : x + y ∈ EMetric.ball 0 (radius p) f : (k : β„•) Γ— (l : β„•) Γ— { s // Finset.card s = l } β†’ F := fun s => ((changeOriginSeriesTerm p s.fst s.snd.fst ↑s.snd.snd (_ : Finset.card ↑s.snd.snd = s.snd.fst)) fun x_1 => x) fun x => y hsf : Summable f hf : HasSum f (FormalMultilinearSeries.sum (changeOrigin p x) y) n : β„• s : Finset (Fin n) a✝ : s ∈ Finset.univ this : βˆ€ (m : β„•) (hm : n = m), (p n) (Finset.piecewise s (fun x_1 => x) fun x => y) = (p m) (Finset.piecewise (Finset.map (Equiv.toEmbedding (Fin.castIso hm).toEquiv) s) (fun x_1 => x) fun x => y) ⊒ (p n) (Finset.piecewise s (fun x_1 => x) fun x => y) = (p (n - Finset.card s + Finset.card s)) (Finset.piecewise (Finset.map (Equiv.toEmbedding (Fin.castIso (_ : { fst := n, snd := s }.fst = { fst := n, snd := s }.fst - Finset.card { fst := n, snd := s }.snd + Finset.card { fst := n, snd := s }.snd)).toEquiv) s) (fun x_1 => x) 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise]
apply this
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise]
Mathlib.Analysis.Analytic.Basic.1300_0.jQw1fRSE1vGpOll
/-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r ⊒ r - ↑‖yβ€–β‚Š ≀ FormalMultilinearSeries.radius (FormalMultilinearSeries.changeOrigin 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 } #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by
apply le_trans _ p.changeOrigin_radius
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r ⊒ r - ↑‖yβ€–β‚Š ≀ FormalMultilinearSeries.radius 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 } #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius
exact tsub_le_tsub hf.r_le le_rfl
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r ⊒ 0 < r - ↑‖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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by
simp [h]
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : z ∈ EMetric.ball 0 (r - ↑‖yβ€–β‚Š) ⊒ HasSum (fun n => (FormalMultilinearSeries.changeOrigin p y n) fun x => z) (f (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 #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by
have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : z ∈ EMetric.ball 0 (r - ↑‖yβ€–β‚Š) ⊒ f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p 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 #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by
rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : ↑‖yβ€–β‚Š + ↑‖zβ€–β‚Š < r ⊒ f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p 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 #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz
rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum]
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : ↑‖yβ€–β‚Š + ↑‖zβ€–β‚Š < r ⊒ y + 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] #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum]
refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz)
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum]
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : ↑‖yβ€–β‚Š + ↑‖zβ€–β‚Š < r ⊒ ↑‖y + zβ€–β‚Š ≀ ↑‖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 #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz)
exact mod_cast nnnorm_add_le y z
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz)
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : z ∈ EMetric.ball 0 (r - ↑‖yβ€–β‚Š) this : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z ⊒ HasSum (fun n => (FormalMultilinearSeries.changeOrigin p y n) fun x => z) (f (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 #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z
rw [this]
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : z ∈ EMetric.ball 0 (r - ↑‖yβ€–β‚Š) this : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z ⊒ HasSum (fun n => (FormalMultilinearSeries.changeOrigin p y n) fun x => z) (FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p 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 #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this]
apply (p.changeOrigin y).hasSum
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this]
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : z ∈ EMetric.ball 0 (r - ↑‖yβ€–β‚Š) this : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z ⊒ z ∈ EMetric.ball 0 (FormalMultilinearSeries.radius (FormalMultilinearSeries.changeOrigin 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 } #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum
refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : ↑‖yβ€–β‚Š < r z : E hz : z ∈ EMetric.ball 0 (r - ↑‖yβ€–β‚Š) this : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z ⊒ r - ↑‖yβ€–β‚Š ≀ FormalMultilinearSeries.radius 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 } #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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz
exact tsub_le_tsub hf.r_le le_rfl
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz
Mathlib.Analysis.Analytic.Basic.1360_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š)
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : y ∈ EMetric.ball x r ⊒ AnalyticAt π•œ f 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by
have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by
Mathlib.Analysis.Analytic.Basic.1382_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : y ∈ EMetric.ball x r ⊒ ↑‖y - 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 Β· 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by
simpa [edist_eq_coe_nnnorm_sub] using h
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by
Mathlib.Analysis.Analytic.Basic.1382_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : y ∈ EMetric.ball x r this : ↑‖y - xβ€–β‚Š < r ⊒ AnalyticAt π•œ f 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h
have := hf.changeOrigin this
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h
Mathlib.Analysis.Analytic.Basic.1382_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : y ∈ EMetric.ball x r this✝ : ↑‖y - xβ€–β‚Š < r this : HasFPowerSeriesOnBall f (FormalMultilinearSeries.changeOrigin p (y - x)) (x + (y - x)) (r - ↑‖y - xβ€–β‚Š) ⊒ AnalyticAt π•œ f 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h have := hf.changeOrigin this
rw [add_sub_cancel'_right] at this
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h have := hf.changeOrigin this
Mathlib.Analysis.Analytic.Basic.1382_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ hf : HasFPowerSeriesOnBall f p x r h : y ∈ EMetric.ball x r this✝ : ↑‖y - xβ€–β‚Š < r this : HasFPowerSeriesOnBall f (FormalMultilinearSeries.changeOrigin p (y - x)) y (r - ↑‖y - xβ€–β‚Š) ⊒ AnalyticAt π•œ f 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 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h have := hf.changeOrigin this rw [add_sub_cancel'_right] at this
exact this.analyticAt
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h have := hf.changeOrigin this rw [add_sub_cancel'_right] at this
Mathlib.Analysis.Analytic.Basic.1382_0.jQw1fRSE1vGpOll
/-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ ⊒ IsOpen {x | AnalyticAt π•œ f 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h have := hf.changeOrigin this rw [add_sub_cancel'_right] at this exact this.analyticAt #align has_fpower_series_on_ball.analytic_at_of_mem HasFPowerSeriesOnBall.analyticAt_of_mem theorem HasFPowerSeriesOnBall.analyticOn (hf : HasFPowerSeriesOnBall f p x r) : AnalyticOn π•œ f (EMetric.ball x r) := fun _y hy => hf.analyticAt_of_mem hy #align has_fpower_series_on_ball.analytic_on HasFPowerSeriesOnBall.analyticOn variable (π•œ f) /-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x } := by
rw [isOpen_iff_mem_nhds]
/-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x } := by
Mathlib.Analysis.Analytic.Basic.1399_0.jQw1fRSE1vGpOll
/-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x }
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 inst✝ : CompleteSpace F f : E β†’ F p : FormalMultilinearSeries π•œ E F x y : E r : ℝβ‰₯0∞ ⊒ βˆ€ a ∈ {x | AnalyticAt π•œ f x}, {x | AnalyticAt π•œ f x} ∈ 𝓝 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h have := hf.changeOrigin this rw [add_sub_cancel'_right] at this exact this.analyticAt #align has_fpower_series_on_ball.analytic_at_of_mem HasFPowerSeriesOnBall.analyticAt_of_mem theorem HasFPowerSeriesOnBall.analyticOn (hf : HasFPowerSeriesOnBall f p x r) : AnalyticOn π•œ f (EMetric.ball x r) := fun _y hy => hf.analyticAt_of_mem hy #align has_fpower_series_on_ball.analytic_on HasFPowerSeriesOnBall.analyticOn variable (π•œ f) /-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x } := by rw [isOpen_iff_mem_nhds]
rintro x ⟨p, r, hr⟩
/-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x } := by rw [isOpen_iff_mem_nhds]
Mathlib.Analysis.Analytic.Basic.1399_0.jQw1fRSE1vGpOll
/-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x }
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 inst✝ : CompleteSpace F f : E β†’ F p✝ : FormalMultilinearSeries π•œ E F x✝ y : E r✝ : ℝβ‰₯0∞ x : E p : FormalMultilinearSeries π•œ E F r : ℝβ‰₯0∞ hr : HasFPowerSeriesOnBall f p x r ⊒ {x | AnalyticAt π•œ f x} ∈ 𝓝 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) 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] apply ContinuousMultilinearMap.le_of_op_nnnorm_le apply ContinuousMultilinearMap.le_op_nnnorm #align formal_multilinear_series.nnnorm_change_origin_series_term_apply_le FormalMultilinearSeries.nnnorm_changeOriginSeriesTerm_apply_le /-- The power series for `f.changeOrigin k`. 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. Its `k`-th term is the sum of the series `p.changeOriginSeries k`. -/ def changeOriginSeries (k : β„•) : FormalMultilinearSeries π•œ E (E[Γ—k]β†’L[π•œ] F) := fun l => βˆ‘ s : { s : Finset (Fin (k + l)) // Finset.card s = l }, p.changeOriginSeriesTerm k l s s.2 #align formal_multilinear_series.change_origin_series FormalMultilinearSeries.changeOriginSeries theorem nnnorm_changeOriginSeries_le_tsum (k l : β„•) : β€–p.changeOriginSeries k lβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š := (nnnorm_sum_le _ (fun t => changeOriginSeriesTerm p k l (Subtype.val t) t.prop)).trans_eq <| by simp_rw [tsum_fintype, nnnorm_changeOriginSeriesTerm (p := p) (k := k) (l := l)] #align formal_multilinear_series.nnnorm_change_origin_series_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_le_tsum theorem nnnorm_changeOriginSeries_apply_le_tsum (k l : β„•) (x : E) : β€–p.changeOriginSeries k l fun _ => xβ€–β‚Š ≀ βˆ‘' _ : { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + l)β€–β‚Š * β€–xβ€–β‚Š ^ l := by rw [NNReal.tsum_mul_right, ← Fin.prod_const] exact (p.changeOriginSeries k l).le_of_op_nnnorm_le _ (p.nnnorm_changeOriginSeries_le_tsum _ _) #align formal_multilinear_series.nnnorm_change_origin_series_apply_le_tsum FormalMultilinearSeries.nnnorm_changeOriginSeries_apply_le_tsum /-- Changing the origin of a formal multilinear series `p`, so that `p.sum (x+y) = (p.changeOrigin x).sum y` when this makes sense. -/ def changeOrigin (x : E) : FormalMultilinearSeries π•œ E F := fun k => (p.changeOriginSeries k).sum x #align formal_multilinear_series.change_origin FormalMultilinearSeries.changeOrigin /-- An auxiliary equivalence useful in the proofs about `FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a `Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a `Finset (Fin n)`. The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to `(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems with non-definitional equalities. -/ @[simps] def changeOriginIndexEquiv : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Ξ£n : β„•, Finset (Fin n) where toFun s := ⟨s.1 + s.2.1, s.2.2⟩ invFun s := ⟨s.1 - s.2.card, s.2.card, ⟨s.2.map (Fin.castIso <| (tsub_add_cancel_of_le <| card_finset_fin_le s.2).symm).toEquiv.toEmbedding, Finset.card_map _⟩⟩ left_inv := by rintro ⟨k, l, ⟨s : Finset (Fin <| k + l), hs : s.card = l⟩⟩ dsimp only [Subtype.coe_mk] -- Lean can't automatically generalize `k' = k + l - s.card`, `l' = s.card`, so we explicitly -- formulate the generalized goal suffices βˆ€ k' l', k' = k β†’ l' = l β†’ βˆ€ (hkl : k + l = k' + l') (hs'), (⟨k', l', ⟨Finset.map (Fin.castIso hkl).toEquiv.toEmbedding s, hs'⟩⟩ : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) = ⟨k, l, ⟨s, hs⟩⟩ by apply this <;> simp only [hs, add_tsub_cancel_right] rintro _ _ rfl rfl hkl hs' simp only [Equiv.refl_toEmbedding, Fin.castIso_refl, Finset.map_refl, eq_self_iff_true, OrderIso.refl_toEquiv, and_self_iff, heq_iff_eq] right_inv := by rintro ⟨n, s⟩ simp [tsub_add_cancel_of_le (card_finset_fin_le s), Fin.castIso_to_equiv] #align formal_multilinear_series.change_origin_index_equiv FormalMultilinearSeries.changeOriginIndexEquiv theorem changeOriginSeries_summable_aux₁ {r r' : ℝβ‰₯0} (hr : (r + r' : ℝβ‰₯0∞) < p.radius) : Summable fun s : Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (s.1 + s.2.1)β€–β‚Š * r ^ s.2.1 * r' ^ s.1 := by rw [← changeOriginIndexEquiv.symm.summable_iff] dsimp only [Function.comp_def, changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst] have : βˆ€ n : β„•, HasSum (fun s : Finset (Fin n) => β€–p (n - s.card + s.card)β€–β‚Š * r ^ s.card * r' ^ (n - s.card)) (β€–p nβ€–β‚Š * (r + r') ^ n) := by intro n -- TODO: why `simp only [tsub_add_cancel_of_le (card_finset_fin_le _)]` fails? convert_to HasSum (fun s : Finset (Fin n) => β€–p nβ€–β‚Š * (r ^ s.card * r' ^ (n - s.card))) _ Β· ext1 s rw [tsub_add_cancel_of_le (card_finset_fin_le _), mul_assoc] rw [← Fin.sum_pow_mul_eq_add_pow] exact (hasSum_fintype _).mul_left _ refine' NNReal.summable_sigma.2 ⟨fun n => (this n).summable, _⟩ simp only [(this _).tsum_eq] exact p.summable_nnnorm_mul_pow hr #align formal_multilinear_series.change_origin_series_summable_aux₁ FormalMultilinearSeries.changeOriginSeries_summable_aux₁ theorem changeOriginSeries_summable_auxβ‚‚ (hr : (r : ℝβ‰₯0∞) < p.radius) (k : β„•) : Summable fun s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l } => β€–p (k + s.1)β€–β‚Š * r ^ s.1 := by rcases ENNReal.lt_iff_exists_add_pos_lt.1 hr with ⟨r', h0, hr'⟩ simpa only [mul_inv_cancel_rightβ‚€ (pow_pos h0 _).ne'] using ((NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr')).1 k).mul_right (r' ^ k)⁻¹ #align formal_multilinear_series.change_origin_series_summable_auxβ‚‚ FormalMultilinearSeries.changeOriginSeries_summable_auxβ‚‚ theorem changeOriginSeries_summable_aux₃ {r : ℝβ‰₯0} (hr : ↑r < p.radius) (k : β„•) : Summable fun l : β„• => β€–p.changeOriginSeries k lβ€–β‚Š * r ^ l := by refine' NNReal.summable_of_le (fun n => _) (NNReal.summable_sigma.1 <| p.changeOriginSeries_summable_auxβ‚‚ hr k).2 simp only [NNReal.tsum_mul_right] exact mul_le_mul' (p.nnnorm_changeOriginSeries_le_tsum _ _) le_rfl #align formal_multilinear_series.change_origin_series_summable_aux₃ FormalMultilinearSeries.changeOriginSeries_summable_aux₃ theorem le_changeOriginSeries_radius (k : β„•) : p.radius ≀ (p.changeOriginSeries k).radius := ENNReal.le_of_forall_nnreal_lt fun _r hr => le_radius_of_summable_nnnorm _ (p.changeOriginSeries_summable_aux₃ hr k) #align formal_multilinear_series.le_change_origin_series_radius FormalMultilinearSeries.le_changeOriginSeries_radius theorem nnnorm_changeOrigin_le (k : β„•) (h : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : β€–p.changeOrigin x kβ€–β‚Š ≀ βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1 := by refine' tsum_of_nnnorm_bounded _ fun l => p.nnnorm_changeOriginSeries_apply_le_tsum k l x have := p.changeOriginSeries_summable_auxβ‚‚ h k refine' HasSum.sigma this.hasSum fun l => _ exact ((NNReal.summable_sigma.1 this).1 l).hasSum #align formal_multilinear_series.nnnorm_change_origin_le FormalMultilinearSeries.nnnorm_changeOrigin_le /-- The radius of convergence of `p.changeOrigin x` is at least `p.radius - β€–xβ€–`. In other words, `p.changeOrigin x` is well defined on the largest ball contained in the original ball of convergence. -/ theorem changeOrigin_radius : p.radius - β€–xβ€–β‚Š ≀ (p.changeOrigin x).radius := by refine' ENNReal.le_of_forall_pos_nnreal_lt fun r _h0 hr => _ rw [lt_tsub_iff_right, add_comm] at hr have hr' : (β€–xβ€–β‚Š : ℝβ‰₯0∞) < p.radius := (le_add_right le_rfl).trans_lt hr apply le_radius_of_summable_nnnorm have : βˆ€ k : β„•, β€–p.changeOrigin x kβ€–β‚Š * r ^ k ≀ (βˆ‘' s : Ξ£l : β„•, { s : Finset (Fin (k + l)) // s.card = l }, β€–p (k + s.1)β€–β‚Š * β€–xβ€–β‚Š ^ s.1) * r ^ k := fun k => mul_le_mul_right' (p.nnnorm_changeOrigin_le k hr') (r ^ k) refine' NNReal.summable_of_le this _ simpa only [← NNReal.tsum_mul_right] using (NNReal.summable_sigma.1 (p.changeOriginSeries_summable_aux₁ hr)).2 #align formal_multilinear_series.change_origin_radius FormalMultilinearSeries.changeOrigin_radius end -- From this point on, assume that the space is complete, to make sure that series that converge -- in norm also converge in `F`. variable [CompleteSpace F] (p : FormalMultilinearSeries π•œ E F) {x y : E} {r R : ℝβ‰₯0} theorem hasFPowerSeriesOnBall_changeOrigin (k : β„•) (hr : 0 < p.radius) : HasFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 p.radius := have := p.le_changeOriginSeries_radius k ((p.changeOriginSeries k).hasFPowerSeriesOnBall (hr.trans_le this)).mono hr this #align formal_multilinear_series.has_fpower_series_on_ball_change_origin FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin /-- Summing the series `p.changeOrigin x` at a point `y` gives back `p (x + y)`. -/ theorem changeOrigin_eval (h : (β€–xβ€–β‚Š + β€–yβ€–β‚Š : ℝβ‰₯0∞) < p.radius) : (p.changeOrigin x).sum y = p.sum (x + y) := by have radius_pos : 0 < p.radius := lt_of_le_of_lt (zero_le _) h have x_mem_ball : x ∈ EMetric.ball (0 : E) p.radius := mem_emetric_ball_zero_iff.2 ((le_add_right le_rfl).trans_lt h) have y_mem_ball : y ∈ EMetric.ball (0 : E) (p.changeOrigin x).radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_lt_of_le _ p.changeOrigin_radius) rwa [lt_tsub_iff_right, add_comm] have x_add_y_mem_ball : x + y ∈ EMetric.ball (0 : E) p.radius := by refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ h) exact mod_cast nnnorm_add_le x y set f : (Ξ£k l : β„•, { s : Finset (Fin (k + l)) // s.card = l }) β†’ F := fun s => p.changeOriginSeriesTerm s.1 s.2.1 s.2.2 s.2.2.2 (fun _ => x) fun _ => y have hsf : Summable f := by refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_aux₁ h) _ rintro ⟨k, l, s, hs⟩ dsimp only [Subtype.coe_mk] exact p.nnnorm_changeOriginSeriesTerm_apply_le _ _ _ _ _ _ have hf : HasSum f ((p.changeOrigin x).sum y) := by refine' HasSum.sigma_of_hasSum ((p.changeOrigin x).summable y_mem_ball).hasSum (fun k => _) hsf Β· dsimp only refine' ContinuousMultilinearMap.hasSum_eval _ _ have := (p.hasFPowerSeriesOnBall_changeOrigin k radius_pos).hasSum x_mem_ball rw [zero_add] at this refine' HasSum.sigma_of_hasSum this (fun l => _) _ Β· simp only [changeOriginSeries, ContinuousMultilinearMap.sum_apply] apply hasSum_fintype Β· refine' .of_nnnorm_bounded _ (p.changeOriginSeries_summable_auxβ‚‚ (mem_emetric_ball_zero_iff.1 x_mem_ball) k) fun s => _ refine' (ContinuousMultilinearMap.le_op_nnnorm _ _).trans_eq _ simp refine' hf.unique (changeOriginIndexEquiv.symm.hasSum_iff.1 _) refine' HasSum.sigma_of_hasSum (p.hasSum x_add_y_mem_ball) (fun n => _) (changeOriginIndexEquiv.symm.summable_iff.2 hsf) erw [(p n).map_add_univ (fun _ => x) fun _ => y] -- porting note: added explicit function convert hasSum_fintype (fun c : Finset (Fin n) => f (changeOriginIndexEquiv.symm ⟨n, c⟩)) rename_i s _ dsimp only [changeOriginSeriesTerm, (Β· ∘ Β·), changeOriginIndexEquiv_symm_apply_fst, changeOriginIndexEquiv_symm_apply_snd_fst, changeOriginIndexEquiv_symm_apply_snd_snd_coe] rw [ContinuousMultilinearMap.curryFinFinset_apply_const] have : βˆ€ (m) (hm : n = m), p n (s.piecewise (fun _ => x) fun _ => y) = p m ((s.map (Fin.castIso hm).toEquiv.toEmbedding).piecewise (fun _ => x) fun _ => y) := by rintro m rfl simp (config := { unfoldPartialApp := true }) [Finset.piecewise] apply this #align formal_multilinear_series.change_origin_eval FormalMultilinearSeries.changeOrigin_eval /-- Power series terms are analytic as we vary the origin -/ theorem analyticAt_changeOrigin (p : FormalMultilinearSeries π•œ E F) (rp : p.radius > 0) (n : β„•) : AnalyticAt π•œ (fun x ↦ p.changeOrigin x n) 0 := (FormalMultilinearSeries.hasFPowerSeriesOnBall_changeOrigin p n rp).analyticAt end FormalMultilinearSeries section variable [CompleteSpace F] {f : E β†’ F} {p : FormalMultilinearSeries π•œ E F} {x y : E} {r : ℝβ‰₯0∞} /-- If a function admits a power series expansion `p` on a ball `B (x, r)`, then it also admits a power series on any subball of this ball (even with a different center), given by `p.changeOrigin`. -/ theorem HasFPowerSeriesOnBall.changeOrigin (hf : HasFPowerSeriesOnBall f p x r) (h : (β€–yβ€–β‚Š : ℝβ‰₯0∞) < r) : HasFPowerSeriesOnBall f (p.changeOrigin y) (x + y) (r - β€–yβ€–β‚Š) := { r_le := by apply le_trans _ p.changeOrigin_radius exact tsub_le_tsub hf.r_le le_rfl r_pos := by simp [h] hasSum := fun {z} hz => by have : f (x + y + z) = FormalMultilinearSeries.sum (FormalMultilinearSeries.changeOrigin p y) z := by rw [mem_emetric_ball_zero_iff, lt_tsub_iff_right, add_comm] at hz rw [p.changeOrigin_eval (hz.trans_le hf.r_le), add_assoc, hf.sum] refine' mem_emetric_ball_zero_iff.2 (lt_of_le_of_lt _ hz) exact mod_cast nnnorm_add_le y z rw [this] apply (p.changeOrigin y).hasSum refine' EMetric.ball_subset_ball (le_trans _ p.changeOrigin_radius) hz exact tsub_le_tsub hf.r_le le_rfl } #align has_fpower_series_on_ball.change_origin HasFPowerSeriesOnBall.changeOrigin /-- If a function admits a power series expansion `p` on an open ball `B (x, r)`, then it is analytic at every point of this ball. -/ theorem HasFPowerSeriesOnBall.analyticAt_of_mem (hf : HasFPowerSeriesOnBall f p x r) (h : y ∈ EMetric.ball x r) : AnalyticAt π•œ f y := by have : (β€–y - xβ€–β‚Š : ℝβ‰₯0∞) < r := by simpa [edist_eq_coe_nnnorm_sub] using h have := hf.changeOrigin this rw [add_sub_cancel'_right] at this exact this.analyticAt #align has_fpower_series_on_ball.analytic_at_of_mem HasFPowerSeriesOnBall.analyticAt_of_mem theorem HasFPowerSeriesOnBall.analyticOn (hf : HasFPowerSeriesOnBall f p x r) : AnalyticOn π•œ f (EMetric.ball x r) := fun _y hy => hf.analyticAt_of_mem hy #align has_fpower_series_on_ball.analytic_on HasFPowerSeriesOnBall.analyticOn variable (π•œ f) /-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x } := by rw [isOpen_iff_mem_nhds] rintro x ⟨p, r, hr⟩
exact mem_of_superset (EMetric.ball_mem_nhds _ hr.r_pos) fun y hy => hr.analyticAt_of_mem hy
/-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x } := by rw [isOpen_iff_mem_nhds] rintro x ⟨p, r, hr⟩
Mathlib.Analysis.Analytic.Basic.1399_0.jQw1fRSE1vGpOll
/-- For any function `f` from a normed vector space to a Banach space, the set of points `x` such that `f` is analytic at `x` is open. -/ theorem isOpen_analyticAt : IsOpen { x | AnalyticAt π•œ f x }
Mathlib_Analysis_Analytic_Basic