(************************************************************************)
(*         *   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)         *)
(************************************************************************)
(*********************************************************)
(**     Definition of the derivative,continuity          *)
(*                                                       *)
(*********************************************************)
Local Open Scope R_scope.
(*********)
Definition D_x (D:R -> Prop) (y x:R) : Prop := D x /\ y <> x.
(*********)
Definition continue_in (f:R -> R) (D:R -> Prop) (x0:R) : Prop :=
limit1_in f (D_x D x0) (f x0) x0.
(*********)
Definition D_in (f d:R -> R) (D:R -> Prop) (x0:R) : Prop :=
limit1_in (fun x:R => (f x - f x0) / (x - x0)) (D_x D x0) (d x0) x0.

(*********)
Lemma Dcomp :
forall (Df Dg:R -> Prop) (df dg f g:R -> R) (x0:R),
D_in f df Df x0 ->
D_in g dg Dg (f x0) ->
D_in (fun x:R => g (f x)) (fun x:R => df x * dg (f x)) (Dgf Df Dg f) x0.