intros f g x a b l axb fg df e ep.
destruct (df e ep) as [d pd].
assert (d'h : 0 < Rmin d (Rmin (b - x) (x - a))).
- apply Rmin_pos;[apply cond_pos | apply Rmin_pos; apply Rlt_0_minus; tauto].
- exists (mkposreal _ d'h); simpl; intros h hn0 cmp.
rewrite <- !fg;[ |assumption | ].
+ apply pd;[assumption |].
apply Rlt_le_trans with (1 := cmp), Rmin_l.
+ assert (-h < x - a).
* apply Rle_lt_trans with (1 := Rle_abs _).
rewrite Rabs_Ropp; apply Rlt_le_trans with (1 := cmp).
rewrite Rmin_assoc; apply Rmin_r.
* assert (h < b - x).
-- apply Rle_lt_trans with (1 := Rle_abs _).
apply Rlt_le_trans with (1 := cmp).
rewrite Rmin_comm, <- Rmin_assoc; apply Rmin_l.
-- split.
++ apply (Rplus_lt_reg_l (- h)).
replace ((-h) + (x + h)) with x by ring.
apply (Rplus_lt_reg_r (- a)).
replace (((-h) + a) + - a) with (-h) by ring.
assumption.
++ apply (Rplus_lt_reg_r (- x)).
replace (x + h + - x) with h by ring.
assumption.
Qed.

(* Specifications: *)
(***********************************)
(** * derivability -> continuity   *)
(***********************************)
(**********)
Lemma derivable_derive :
forall f (x:R) (pr:derivable_pt f x),  exists l : R, derive_pt f x pr = l.
Theorem derivable_continuous_pt :
forall f (x:R), derivable_pt f x -> continuity_pt f x.
Theorem derivable_continuous : forall f, derivable f -> continuity f.
(****************************************************************)
(** *                    Main rules                             *)
(****************************************************************)
(** ** Rules for derivable_pt_lim (value of the derivative at a point) *)
Lemma derivable_pt_lim_id : forall x:R, derivable_pt_lim id x 1.
Lemma derivable_pt_lim_comp :
forall f1 f2 (x l1 l2:R),
derivable_pt_lim f1 x l1 ->
derivable_pt_lim f2 (f1 x) l2 -> derivable_pt_lim (f2 o f1) x (l2 * l1).
Lemma derivable_pt_lim_opp :
forall f (x l:R), derivable_pt_lim f x l -> derivable_pt_lim (- f) x (- l).
Lemma derivable_pt_lim_opp_fwd :
forall f (x l:R), derivable_pt_lim f x (- l) -> derivable_pt_lim (- f) x l.
Lemma derivable_pt_lim_opp_rev :
forall f (x l:R), derivable_pt_lim (- f) x (- l) -> derivable_pt_lim f x l.
Lemma derivable_pt_lim_mirr_fwd :
forall f (x l:R), derivable_pt_lim f (- x) (- l) -> derivable_pt_lim (mirr_fct f) x l.
Lemma derivable_pt_lim_mirr_rev :
forall f (x l:R), derivable_pt_lim (mirr_fct f) (- x) (- l) -> derivable_pt_lim f x l.
Lemma derivable_pt_lim_plus :
forall f1 f2 (x l1 l2:R),
derivable_pt_lim f1 x l1 ->
derivable_pt_lim f2 x l2 -> derivable_pt_lim (f1 + f2) x (l1 + l2).