(*****************************************************)
(** * Derivative's definition using Landau's kernel  *)
(*****************************************************)
Definition derivable_pt_lim f (x l:R) : Prop :=
forall eps:R,
0 < eps ->
exists delta : posreal,
(forall h:R,
h <> 0 -> Rabs h < delta -> Rabs ((f (x + h) - f x) / h - l) < eps).
Definition derivable_pt_abs f (x l:R) : Prop := derivable_pt_lim f x l.
Definition derivable_pt f (x:R) := { l:R | derivable_pt_abs f x l }.
Definition derivable f := forall x:R, derivable_pt f x.
Definition derive_pt f (x:R) (pr:derivable_pt f x) := proj1_sig pr.
Definition derive f (pr:derivable f) (x:R) := derive_pt f x (pr x).
Arguments derivable_pt_lim f%_F x%_R l.
Arguments derivable_pt_abs f%_F (x l)%_R.
Arguments derivable_pt f%_F x%_R.
Arguments derivable f%_F.
Arguments derive_pt f%_F x%_R pr.
Arguments derive f%_F pr x.
Definition antiderivative f (g:R -> R) (a b:R) : Prop :=
(forall x:R,
a <= x <= b ->  exists pr : derivable_pt g x, f x = derive_pt g x pr) /\
a <= b.
(**************************************)
(** * Class of differential functions *)
(**************************************)
Record Differential : Type := mkDifferential
{d1 :> R -> R; cond_diff : derivable d1}.
Record Differential_D2 : Type := mkDifferential_D2
{d2 :> R -> R;
cond_D1 : derivable d2;
cond_D2 : derivable (derive d2 cond_D1)}.

(* Specifications: *)
(**********)
Lemma uniqueness_step1 :
forall f (x l1 l2:R),
limit1_in (fun h:R => (f (x + h) - f x) / h) (fun h:R => h <> 0) l1 0 ->
limit1_in (fun h:R => (f (x + h) - f x) / h) (fun h:R => h <> 0) l2 0 ->
l1 = l2.
Lemma uniqueness_step2 :
forall f (x l:R),
derivable_pt_lim f x l ->
limit1_in (fun h:R => (f (x + h) - f x) / h) (fun h:R => h <> 0) l 0.
Lemma uniqueness_step3 :
forall f (x l:R),
limit1_in (fun h:R => (f (x + h) - f x) / h) (fun h:R => h <> 0) l 0 ->
derivable_pt_lim f x l.
Lemma uniqueness_limite :
forall f (x l1 l2:R),
derivable_pt_lim f x l1 -> derivable_pt_lim f x l2 -> l1 = l2.
Lemma derive_pt_eq :
forall f (x l:R) (pr:derivable_pt f x),
derive_pt f x pr = l <-> derivable_pt_lim f x l.
(**********)
Lemma derive_pt_eq_0 :
forall f (x l:R) (pr:derivable_pt f x),
derivable_pt_lim f x l -> derive_pt f x pr = l.
(**********)
Lemma derive_pt_eq_1 :
forall f (x l:R) (pr:derivable_pt f x),
derive_pt f x pr = l -> derivable_pt_lim f x l.
(**********************************************************************)
(** * Equivalence of this definition with the one using limit concept *)
(**********************************************************************)
Lemma derive_pt_D_in :
forall f (df:R -> R) (x:R) (pr:derivable_pt f x),
D_in f df no_cond x <-> derive_pt f x pr = df x.
Lemma derivable_pt_lim_D_in :
forall f (df:R -> R) (x:R),
D_in f df no_cond x <-> derivable_pt_lim f x (df x).