(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)
Local Open Scope R_scope.
(** * Preliminaries lemmas *)
(* end hide *)
(** Intermediate Value Theorem on an Interval (Proof mainly taken from Reals.Rsqrt_def) and its corollary *)
(* begin hide *)
Ltac case_le H :=
let t := type of H in
let h' := fresh in
match t with ?x <= ?y => case (total_order_T x y);
[intros h'; case h'; clear h' |
intros h'; clear -H h'; elimtype False; lra ] end.
(* end hide *)
(** ** The derivative of a reciprocal function       *)
(** * Continuity of the reciprocal function *)
(** *   Derivability of the reciprocal function        *)
(****************************************************)
(** *   Value of the derivative of the reciprocal function        *)
(****************************************************)
(****************************************************)
(** * Existence of the derivative of a function which is the limit of a sequence of functions *)
(****************************************************)
Definition mkposreal_lb_ub (x lb ub:R) (lb_lt_x:lb<x) (x_lt_ub:x<ub) : posreal.
apply (mkposreal ((ub-lb)/2) (ub_lt_2_pos x ub lb lb_lt_x x_lt_ub)).
Defined.
(* end hide *)

Lemma derivable_pt_lim_CVU : forall (fn fn':nat -> R -> R) (f g:R->R)
(x:R) c r, Boule c r x ->
(forall y n, Boule c r y -> derivable_pt_lim (fn n) y (fn' n y)) ->
(forall y, Boule c r y -> Un_cv (fun n => fn n y) (f y)) ->
(CVU fn' g c r) ->
(forall y, Boule c r y -> continuity_pt g y) ->
derivable_pt_lim f x (g x).