Library Coquelicot.PSeries

This file is part of the Coquelicot formalization of real analysis in Coq: http://coquelicot.saclay.inria.fr/
Copyright (C) 2011-2015 Sylvie Boldo
Copyright (C) 2011-2015 Catherine Lelay
Copyright (C) 2011-2015 Guillaume Melquiond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYING file for more details.
This file describes power series: Σ ak xk. It contains definition, equivalence with the standard library, differentiability, integrability, and many results about the convergence circle.

Section Definitions.

Definition


Context {K : AbsRing} {V : NormedModule K}.

Definition is_pseries (a : natV) (x:K) (l : V) :=
  is_series (fun kscal (pow_n x k) (a k)) l.

Definition ex_pseries (a : natV) (x : K) :=
  ex_series (fun kscal (pow_n x k) (a k)).

End Definitions.

Definition PSeries (a : natR) (x : R) : R :=
  Series (fun ka k × x ^ k).

Lemma ex_pseries_dec {V : NormedModule R_AbsRing} (a : natR) (x : R) :
  {ex_pseries a x} + {¬ ex_pseries a x}.

Lemma is_pseries_R (a : natR) (x l : R) :
  is_pseries a x l is_series (fun n : nata n × x ^ n) l.

Lemma ex_pseries_R (a : natR) (x : R) :
  ex_pseries a x ex_series (fun n : nata n × x ^ n).

Lemma PSeries_eq (a : natR) (x : R) :
  PSeries a x = Series (fun kscal (pow_n x k) (a k)).

Lemma PSeries_1 (a : natR) :
  PSeries a 1 = Series a.
Lemma ex_pseries_1 (a : natR) :
  ex_pseries a 1 ex_series a.

Lemma is_pseries_unique (a : natR) (x l : R) :
  is_pseries a x lPSeries a x = l.
Lemma PSeries_correct (a : natR) (x : R) :
  ex_pseries a xis_pseries a x (PSeries a x).

Equivalence with standard library Reals

Lemma is_pseries_Reals (a : natR) (x l : R) :
  is_pseries a x l Pser a x l.

Extensionality

Section Extensionality.

Context {K : AbsRing} {V : NormedModule K}.

Lemma is_pseries_ext (a b : natV) (x : K) (l:V) :
  ( n, a n = b n) → (is_pseries a x l)
    → is_pseries b x l.

Lemma ex_pseries_ext (a b : natV) (x : K) :
  ( n, a n = b n) → ex_pseries a x
    → ex_pseries b x.

End Extensionality.

Lemma PSeries_ext (a b : natR) (x : R) :
  ( n, a n = b n) → PSeries a x = PSeries b x.

Convergence circle

A power series is always defined at 0

Section ConvergenceCircle.

Context {K : AbsRing} {V : NormedModule K}.

Lemma is_pseries_0 (a : natV) :
  is_pseries a zero (a O).

Lemma ex_pseries_0 (a : natV) :
  ex_pseries a zero.

End ConvergenceCircle.

Lemma PSeries_0 (a : natR) :
  PSeries a 0 = a O.

Convergence disk
Definition CV_disk (a : natR) (r : R) :=
  ex_series (fun nRabs (a n × r^n)).

Lemma CV_disk_le (a : natR) (r1 r2 : R) :
  Rabs r1 Rabs r2CV_disk a r2CV_disk a r1.
Lemma CV_disk_correct (a : natR) (x : R) :
  CV_disk a xex_pseries a x.

Lemma CV_disk_0 (a : natR) :
  CV_disk a 0.

Definition CV_radius (a : natR) : Rbar :=
  Lub_Rbar (CV_disk a).

Lemma CV_radius_ge_0 (a : natR) :
  Rbar_le (Finite 0) (CV_radius a).

Lemma CV_radius_bounded (a : natR) :
  is_lub_Rbar (fun r M, n, Rabs (a n × r ^ n) M) (CV_radius a).

Convergence theorems

Lemma CV_disk_inside (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → ex_series (fun nRabs (a n × x ^ n)).
Lemma CV_radius_inside (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → ex_pseries a x.

Lemma CV_disk_outside (a : natR) (x : R) :
  Rbar_lt (CV_radius a) (Finite (Rabs x))
    → ¬ is_lim_seq (fun na n × x ^ n) 0.

Lemma CV_radius_ext (a b : natR) :
  ( n, a n = b n) → CV_radius a = CV_radius b.

Convergence criteria

D'Alembert criterion for power series

Lemma CV_disk_DAlembert_aux (a : natR) (x k : R) :
  x 0 → ( n, a n 0) →
  (is_lim_seq (fun nRabs (a (S n) / a n)) k
     is_lim_seq (fun nRabs ((a (S n) × x^(S n)) / (a n × x ^ n))) (Rabs x × k)).

Lemma CV_disk_DAlembert (a : natR) (x:R) l :
  ( n:nat, a n 0) →
  is_lim_seq (fun n:natRabs (a (S n) / a n)) (Finite l) →
  (l = 0 (l 0 Rabs x < / l))
    → CV_disk a x.

Lemma CV_radius_finite_DAlembert (a : natR) (l : R) :
  ( n:nat, a n 0) → 0 < l
  is_lim_seq (fun n:natRabs (a (S n) / a n)) l
  CV_radius a = Finite (/l).

Lemma CV_radius_infinite_DAlembert (a : natR) :
  ( n:nat, a n 0) →
  is_lim_seq (fun n:natRabs (a (S n) / a n)) 0 →
  CV_radius a = p_infty.

Equivalence with standard library Reals

Lemma CV_radius_Reals_0 (a : natR) (r : posreal) :
  Rbar_lt (Finite r) (CV_radius a) → CVN_r (fun n xa n × x ^ n) r.

Lemma CV_radius_Reals_1 (a : natR) (r : posreal) :
  CVN_r (fun n xa n × x ^ n) rRbar_le (Finite r) (CV_radius a).

Lemma CV_radius_Reals_2 (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
  → r : posreal, CVU (fun n xsum_f_R0 (fun ka k × x ^ k) n) (PSeries a) x r.

Operations

Addition of two power series

Section PS_plus.

Context {K : AbsRing} {V : NormedModule K}.

Definition PS_plus (a b : natV) (n : nat) : V := plus (a n) (b n).

Lemma is_pseries_plus (a b : natV) (x :K) (la lb : V) :
  is_pseries a x lais_pseries b x lb
    → is_pseries (PS_plus a b) x (plus la lb).

Lemma ex_pseries_plus (a b : natV) (x : K) :
  ex_pseries a xex_pseries b x
    → ex_pseries (PS_plus a b) x.

End PS_plus.

Lemma PSeries_plus (a b : natR) (x : R) :
  ex_pseries a xex_pseries b x
    → PSeries (PS_plus a b) x = PSeries a x + PSeries b x.

Lemma CV_disk_plus (a b : natR) (x : R) :
  (CV_disk a x) → (CV_disk b x)
  → (CV_disk (PS_plus a b) x).
Lemma CV_radius_plus (a b : natR) :
  Rbar_le (Rbar_min (CV_radius a) (CV_radius b)) (CV_radius (PS_plus a b)).

Scalar multiplication

Section PS_scal.

Context {K : AbsRing} {V : NormedModule K}.

Definition PS_scal (c : K) (a : natV) (n : nat) : V := scal c (a n).

Lemma is_pseries_scal (c : K) (a : natV) (x : K) (l : V) :
  mult x c = mult c xis_pseries a x lis_pseries (PS_scal c a) x (scal c l).

Lemma ex_pseries_scal (c : K) (a : natV) (x : K) :
  mult x c = mult c xex_pseries a xex_pseries (PS_scal c a) x.

End PS_scal.

Lemma PSeries_scal (c : R) (a : natR) (x : R) :
  PSeries (PS_scal c a) x = c × PSeries a x.

Lemma CV_disk_scal (c : R) (a : natR) (x : R) :
  (CV_disk a x)
  → (CV_disk (PS_scal c a) x).

Lemma CV_radius_scal (c : R) (a : natR) : c 0 →
  (CV_radius (PS_scal c a)) = (CV_radius a).

Definition PS_scal_r (c : R) (a : natR) (n : nat) : R :=
  a n × c.
Lemma PSeries_scal_r (c : R) (a : natR) (x : R) :
  PSeries (PS_scal_r c a) x = PSeries a x × c.

Lemma CV_disk_scal_r (c : R) (a : natR) (x : R) :
  (CV_disk a x)
  → (CV_disk (PS_scal_r c a) x).
Lemma CV_radius_scal_r (c : R) (a : natR) : c 0 →
  (CV_radius (PS_scal_r c a)) = (CV_radius a).

Multiplication and division by a variable

Section PS_incr.

Context {K : AbsRing} {V : NormedModule K}.

Definition PS_incr_1 (a : natV) (n : nat) : V :=
  match n with
    | 0 ⇒ zero
    | S na n
  end.

Lemma is_pseries_incr_1 (a : natV) (x:K) (l : V) :
  is_pseries a x lis_pseries (PS_incr_1 a) x (scal x l).

Lemma ex_pseries_incr_1 (a : natV) (x : K) :
  ex_pseries a xex_pseries (PS_incr_1 a) x.

Fixpoint PS_incr_n (a : natV) (n k : nat) : V :=
  match n with
    | Oa k
    | S nPS_incr_1 (PS_incr_n a n) k
  end.

Lemma PS_incr_n_simplify (a : natV) (n k : nat) :
  PS_incr_n a n k =
  match (le_lt_dec n k) with
    | left _a (k-n)%nat
    | right _zero
  end.

Lemma is_pseries_incr_n (a : natV) (n : nat) (x : K) (l : V) :
  is_pseries a x lis_pseries (PS_incr_n a n) x (scal (pow_n x n) l).

Lemma ex_pseries_incr_n (a : natV) (n : nat) (x : K) :
  ex_pseries a xex_pseries (PS_incr_n a n) x.

Definition PS_decr_1 (a : natV) (n : nat) : V := a (S n).

Lemma is_pseries_decr_1 (a : natV) (x y : K) (l : V) :
  mult y x = oneis_pseries a x l
    → is_pseries (PS_decr_1 a) x (scal y (plus l (opp (a O)))).

Lemma ex_pseries_decr_1 (a : natV) (x : K) :
 (x = zero y, mult y x = one) →
 ex_pseries a xex_pseries (PS_decr_1 a) x.

Definition PS_decr_n (a : natV) (n k : nat) : V := a (n + k)%nat.

Lemma is_pseries_decr_n (a : natV) (n : nat) (x y:K) (l : V) :
  mult y x = one → (0 < n)%natis_pseries a x l
    → is_pseries (PS_decr_n a n) x (scal (pow_n y n) (plus l (opp (sum_n (fun kscal (pow_n x k) (a k)) (n-1)%nat)))).

Lemma ex_pseries_decr_n (a : natV) (n : nat) (x : K) :
  (x = zero y, mult y x = one) → ex_pseries a xex_pseries (PS_decr_n a n) x.

End PS_incr.

Lemma PSeries_incr_1 a x :
  PSeries (PS_incr_1 a) x = x × PSeries a x.

Lemma PSeries_incr_n (a : natR) (n : nat) (x : R) :
  PSeries (PS_incr_n a n) x = x^n × PSeries a x.

Lemma PSeries_decr_1 (a : natR) (x : R) :
  ex_pseries a xPSeries a x = a O + x × PSeries (PS_decr_1 a) x.

Lemma PSeries_decr_1_aux (a : natR) (x : R) :
  a O = 0 → (PSeries a x) = x × PSeries (PS_decr_1 a) x.

Lemma PSeries_decr_n (a : natR) (n : nat) (x : R) :
  ex_pseries a x
    → PSeries a x = sum_f_R0 (fun ka k × x^k) n + x^(S n) × PSeries (PS_decr_n a (S n)) x.

Lemma PSeries_decr_n_aux (a : natR) (n : nat) (x : R) :
  ( k : nat, (k < n)%nata k = 0)
    → PSeries a x = x^n × PSeries (PS_decr_n a n) x.

Lemma CV_radius_incr_1 (a : natR) :
  CV_radius (PS_incr_1 a) = CV_radius a.
Lemma CV_radius_decr_1 (a : natR) :
  CV_radius (PS_decr_1 a) = CV_radius a.

Definition PS_mult (a b : natR) n :=
  sum_f_R0 (fun ka k × b (n - k)%nat) n.

Lemma is_pseries_mult (a b : natR) (x la lb : R) :
  is_pseries a x lais_pseries b x lb
  → Rbar_lt (Rabs x) (CV_radius a) → Rbar_lt (Rabs x) (CV_radius b)
  → is_pseries (PS_mult a b) x (la × lb).
Lemma ex_pseries_mult (a b : natR) (x : R) :
  Rbar_lt (Rabs x) (CV_radius a) → Rbar_lt (Rabs x) (CV_radius b)
  → ex_pseries (PS_mult a b) x.
Lemma PSeries_mult (a b : natR) (x : R) :
  Rbar_lt (Rabs x) (CV_radius a) → Rbar_lt (Rabs x) (CV_radius b)
  → PSeries (PS_mult a b) x = PSeries a x × PSeries b x.

Sums on even and odd

Lemma is_pseries_odd_even (a : natR) (x l1 l2 : R) :
  is_pseries (fun na (2×n)%nat) (x^2) l1is_pseries (fun na (2×n+1)%nat) (x^2) l2
    → is_pseries a x (l1 + x × l2).
Lemma ex_pseries_odd_even (a : natR) (x : R) :
  ex_pseries (fun na (2×n)%nat) (x^2) → ex_pseries (fun na (2×n+1)%nat) (x^2)
    → ex_pseries a x.
Lemma PSeries_odd_even (a : natR) (x : R) :
  ex_pseries (fun na (2×n)%nat) (x^2) → ex_pseries (fun na (2×n+1)%nat) (x^2)
    → PSeries a x = PSeries (fun na (2×n)%nat) (x^2) + x × PSeries (fun na (2×n+1)%nat) (x^2).

Lemma PSeries_const_0 : x, PSeries (fun _ ⇒ 0) x = 0.

Lemma CV_radius_const_0 : CV_radius (fun _ ⇒ 0) = p_infty.

Section PS_opp.

Context {K : AbsRing} {V : NormedModule K}.

Definition PS_opp (a : natV) (n : nat) : V := opp (a n).

Lemma is_pseries_opp (a : natV) (x :K) (l : V) :
  is_pseries a x lis_pseries (PS_opp a) x (opp l).

Lemma ex_pseries_opp (a : natV) (x : K) :
  ex_pseries a xex_pseries (PS_opp a) x.

End PS_opp.

Lemma PSeries_opp (a : natR) (x : R) :
  PSeries (PS_opp a) x = - PSeries a x.

Lemma CV_radius_opp (a : natR) :
  (CV_radius (PS_opp a)) = (CV_radius a).

Section PS_minus.

Context {K : AbsRing} {V : NormedModule K}.

Definition PS_minus (a b : natV) (n : nat) : V := plus (a n) (opp (b n)).

Lemma is_pseries_minus (a b : natV) (x:K) (la lb : V) :
  is_pseries a x lais_pseries b x lb
  → is_pseries (PS_minus a b) x (plus la (opp lb)).

Lemma ex_pseries_minus (a b : natV) (x : K) :
  ex_pseries a xex_pseries b x
  → ex_pseries (PS_minus a b) x.

End PS_minus.

Lemma PSeries_minus (a b : natR) (x : R) :
  ex_pseries a xex_pseries b x
  → PSeries (PS_minus a b) x = PSeries a x - PSeries b x.

Abel's theorem for power series


Lemma Abel (a : natR) :
  Rbar_lt 0 (CV_radius a) → Rbar_lt (CV_radius a) p_infty
  → ex_pseries a (CV_radius a)
  → filterlim (PSeries a) (at_left (CV_radius a)) (locally (PSeries a (CV_radius a))).

Analysis

Continuity


Lemma PSeries_continuity (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → continuity_pt (PSeries a) x.

Differentiability


Definition PS_derive (a : natR) (n : nat) :=
  INR (S n) × a (S n).
Lemma CV_radius_derive (a : natR) :
  CV_radius (PS_derive a) = CV_radius a.

Lemma is_derive_PSeries (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → is_derive (PSeries a) x (PSeries (PS_derive a) x).
Lemma ex_derive_PSeries (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → ex_derive (PSeries a) x.
Lemma Derive_PSeries (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → Derive (PSeries a) x = PSeries (PS_derive a) x.

Lemma is_pseries_derive (a : natR) x :
  Rbar_lt (Rabs x) (CV_radius a)
    → is_pseries (PS_derive a) x (Derive (PSeries a) x).
Lemma ex_pseries_derive (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → ex_pseries (PS_derive a) x.

Definition PS_derive_n (n : nat) (a : natR) :=
  (fun k(INR (fact (k + n)%nat) / INR (fact k)) × a (k + n)%nat).

Lemma is_derive_n_PSeries (n : nat) (a : natR) :
   x, Rbar_lt (Rabs x) (CV_radius a)
    → is_derive_n (PSeries a) n x (PSeries (PS_derive_n n a) x).
Lemma ex_derive_n_PSeries (n : nat) (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → ex_derive_n (PSeries a) n x.

Lemma Derive_n_PSeries (n : nat) (a : natR) (x : R) :
  Rbar_lt (Finite (Rabs x)) (CV_radius a)
    → Derive_n (PSeries a) n x = PSeries (PS_derive_n n a) x.

Lemma CV_radius_derive_n (n : nat) (a : natR) :
  CV_radius (PS_derive_n n a) = CV_radius a.

Coefficients

Lemma Derive_n_coef (a : natR) (n : nat) :
  Rbar_lt (Finite 0) (CV_radius a)
    → Derive_n (PSeries a) n 0 = a n × (INR (fact n)).

Lemma PSeries_ext_recip (a b : natR) (n : nat) :
  Rbar_lt (Finite 0) (CV_radius a) → Rbar_lt (Finite 0) (CV_radius b)
  → locally 0 (fun xPSeries a x = PSeries b x)
    → a n = b n.

Lemma mk_pseries (f : RR) (M : R) (r : Rbar) :
  ( n x, Rbar_lt (Finite (Rabs x)) r
    → (ex_derive_n f n x) Rabs (Derive_n f n x) M)
  → x, Rbar_lt (Finite (Rabs x)) r
    → is_pseries (fun nDerive_n f n 0 / INR (fact n)) x (f x).