(************************************************************************)
(*         *   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        *)
(****************************************************)

Lemma derive_pt_recip_interv : forall (f g:R->R) (lb ub x:R)
(lb_lt_ub:lb < ub) (x_encad:f lb < x < f ub)
(f_incr:forall x y : R, lb <= x -> x < y -> y <= ub -> f x < f y)
(g_wf:forall x : R, f lb <= x -> x <= f ub -> lb <= g x <= ub)
(Prf:forall a : R, lb <= a <= ub -> derivable_pt f a)
(f_eq_g:forall x, f lb <= x -> x <= f ub -> (comp f g) x = id x)
(Df_neq:derive_pt f (g x) (derivable_pt_recip_interv_prelim1 f g lb ub x
lb_lt_ub x_encad f_eq_g g_wf f_incr Prf) <> 0),
derive_pt g x (derivable_pt_recip_interv f g lb ub x lb_lt_ub x_encad f_eq_g
g_wf f_incr Prf Df_neq)
=
1 / (derive_pt f (g x) (Prf (g x) (derive_pt_recip_interv_prelim1_1 f g lb ub x
lb_lt_ub x_encad f_incr g_wf f_eq_g))).