(** Composition *)

(* Specifications: *)
Lemma is_lim_comp' :
forall {T} {F} {FF : @Filter T F} (f : T -> R) (g : R -> R) (x l : Rbar),
filterlim f F (Rbar_locally x) -> is_lim g x l ->
F (fun y => Finite (f y) <> x) ->
filterlim (fun y => g (f y)) F (Rbar_locally l).
Lemma is_lim_comp_seq (f : R -> R) (u : nat -> R) (x l : Rbar) :
is_lim f x l ->
eventually (fun n => Finite (u n) <> x) ->
is_lim_seq u x -> is_lim_seq (fun n => f (u n)) l.
Lemma is_lim_comp (f g : R -> R) (x k l : Rbar) :
is_lim f l k -> is_lim g x l -> Rbar_locally' x (fun y => Finite (g y) <> l)
-> is_lim (fun x => f (g x)) x k.
Lemma ex_lim_comp (f g : R -> R) (x : Rbar) :
ex_lim f (Lim g x) -> ex_lim g x -> Rbar_locally' x (fun y => Finite (g y) <> Lim g x)
-> ex_lim (fun x => f (g x)) x.
Lemma Lim_comp (f g : R -> R) (x : Rbar) :
ex_lim f (Lim g x) -> ex_lim g x -> Rbar_locally' x (fun y => Finite (g y) <> Lim g x)
-> Lim (fun x => f (g x)) x = Lim f (Lim g x).