(** * Limit of sequences *)

(** ** Definition *)

Definition is_lim_seq (u : nat -> R) (l : Rbar) :=
  filterlim u eventually (Rbar_locally l).Definition is_lim_seq' (u : nat -> R) (l : Rbar) :=
  match l with
    | Finite l => forall eps : posreal, eventually (fun n => Rabs (u n - l) < eps)
    | p_infty => forall M : R, eventually (fun n => M < u n)
    | m_infty => forall M : R, eventually (fun n => u n < M)
  end.Definition ex_lim_seq (u : nat -> R) :=
  exists l, is_lim_seq u l.Definition ex_finite_lim_seq (u : nat -> R) :=
  exists l : R, is_lim_seq u l.Definition Lim_seq (u : nat -> R) : Rbar :=
  Rbar_div_pos (Rbar_plus (LimSup_seq u) (LimInf_seq u))
    {| pos := 2; cond_pos := Rlt_R0_R2 |}.

Lemma is_LimSup_LimInf_lim_seq (u : nat -> R) (l : Rbar) : is_LimSup_seq u l -> is_LimInf_seq u l -> is_lim_seq u l.