(** Uniform convergence *)
(** Normal convergence *)
Definition CVN_r (fn:nat -> R -> R) (r:posreal) : Type :=
{ An:nat -> R &
{ l:R |
Un_cv (fun n:nat => sum_f_R0 (fun k:nat => Rabs (An k)) n) l /\
(forall (n:nat) (y:R), Boule 0 r y -> Rabs (fn n y) <= An n) } }.
Definition CVN_R (fn:nat -> R -> R) : Type := forall r:posreal, CVN_r fn r.
Definition SFL (fn:nat -> R -> R)
(cv:forall x:R, { l:R | Un_cv (fun N:nat => SP fn N x) l })
(y:R) : R := let (a,_) := cv y in a.

(* Specifications: *)
(** In a complete space, normal convergence implies uniform convergence *)
Lemma CVN_CVU :
forall (fn:nat -> R -> R)
(cv:forall x:R, {l:R | Un_cv (fun N:nat => SP fn N x) l })
(r:posreal), CVN_r fn r -> CVU (fun n:nat => SP fn n) (SFL fn cv) 0 r.
(** Each limit of a sequence of functions which converges uniformly is continue *)
Lemma CVU_continuity :
forall (fn:nat -> R -> R) (f:R -> R) (x:R) (r:posreal),
CVU fn f x r ->
(forall (n:nat) (y:R), Boule x r y -> continuity_pt (fn n) y) ->
forall y:R, Boule x r y -> continuity_pt f y.
(**********)
Lemma continuity_pt_finite_SF :
forall (fn:nat -> R -> R) (N:nat) (x:R),
(forall n:nat, (n <= N)%nat -> continuity_pt (fn n) x) ->
continuity_pt (fun y:R => sum_f_R0 (fun k:nat => fn k y) N) x.
(** Continuity and normal convergence *)
Lemma SFL_continuity_pt :
forall (fn:nat -> R -> R)
(cv:forall x:R, { l:R | Un_cv (fun N:nat => SP fn N x) l })
(r:posreal),
CVN_r fn r ->
(forall (n:nat) (y:R), Boule 0 r y -> continuity_pt (fn n) y) ->
forall y:R, Boule 0 r y -> continuity_pt (SFL fn cv) y.
Lemma SFL_continuity :
forall (fn:nat -> R -> R)
(cv:forall x:R, { l:R | Un_cv (fun N:nat => SP fn N x) l }),
CVN_R fn -> (forall n:nat, continuity (fn n)) -> continuity (SFL fn cv).
(** As R is complete, normal convergence implies that (fn) is simply-uniformly convergent *)
Lemma CVN_R_CVS :
forall fn:nat -> R -> R,
CVN_R fn -> forall x:R, { l:R | Un_cv (fun N:nat => SP fn N x) l }.
(* Uniform convergence implies pointwise simple convergence *)
Lemma CVU_cv : forall f g c d, CVU f g c d ->
forall x, Boule c d x -> Un_cv (fun n => f n x) (g x).
(* convergence is preserved through extensional equality *)
Lemma CVU_ext_lim :
forall f g1 g2 c d, CVU f g1 c d -> (forall x, Boule c d x -> g1 x = g2 x) ->
CVU f g2 c d.