(** This file is part of the Coquelicot formalization of real analysis in Coq: http://coquelicot.saclay.inria.fr/  Copyright (C) 2011-2015 Sylvie Boldo #<br /># Copyright (C) 2011-2015 Catherine Lelay #<br /># 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: #&Sigma; a<sub>k</sub> x<sup>k</sup>#. 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 : nat -> V) (x:K) (l : V) :=
is_series (fun k => scal (pow_n x k) (a k)) l.
Definition ex_pseries (a : nat -> V) (x : K) :=
ex_series (fun k => scal (pow_n x k) (a k)).
End Definitions.
Definition PSeries (a : nat -> R) (x : R) : R :=
Series (fun k => a k * x ^ k).

(* Specifications: *)
Lemma ex_pseries_dec {V : NormedModule R_AbsRing} (a : nat -> R) (x : R) :
{ex_pseries a x} + {~ ex_pseries a x}.
Lemma is_pseries_R (a : nat -> R) (x l : R) :
is_pseries a x l <-> is_series (fun n : nat => a n * x ^ n) l.
Lemma ex_pseries_R (a : nat -> R) (x : R) :
ex_pseries a x <-> ex_series (fun n : nat => a n * x ^ n).
Lemma PSeries_eq (a : nat -> R) (x : R) :
PSeries a x = Series (fun k => scal (pow_n x k) (a k)).
Lemma PSeries_1 (a : nat -> R) :
PSeries a 1 = Series a.
Lemma ex_pseries_1 (a : nat -> R) :
ex_pseries a 1 <-> ex_series a.
Lemma is_pseries_unique (a : nat -> R) (x l : R) :
is_pseries a x l -> PSeries a x = l.
Lemma PSeries_correct (a : nat -> R) (x : R) :
ex_pseries a x -> is_pseries a x (PSeries a x).