(** * Mean value theorem *)

(* Specifications: *)
Lemma MVT_gen (f : R -> R) (a b : R) (df : R -> R) :
let a0 := Rmin a b in
let b0 := Rmax a b in
(forall x, a0 < x < b0 -> is_derive f x (df x))
-> (forall x, a0 <= x <= b0 -> continuity_pt f x)
-> exists c, a0 <= c <= b0 /\ f b - f a = df c * (b - a).
Lemma incr_function (f : R -> R) (a b : Rbar) (df : R -> R) :
(forall (x : R), Rbar_lt a x -> Rbar_lt x b -> is_derive f x (df x))
-> ((forall (x : R), Rbar_lt a x -> Rbar_lt x b -> df x > 0)
-> (forall (x y : R), Rbar_lt a x -> x < y -> Rbar_lt y b -> f x < f y)).
Lemma incr_function_le (f : R -> R) (a b : Rbar) (df : R -> R) :
(forall (x : R), Rbar_le a x -> Rbar_le x b -> is_derive f x (df x))
-> ((forall (x : R), Rbar_le a x -> Rbar_le x b -> df x > 0)
-> (forall (x y : R), Rbar_le a x -> x < y -> Rbar_le y b -> f x < f y)).
Lemma MVT_cor4:
forall (f df : R -> R) a eps,
(forall c, Rabs (c - a) <= eps -> is_derive f c (df c)) ->
forall b, (Rabs (b - a) <= eps) ->
exists c, f b - f a = df c * (b - a) /\ (Rabs (c - a) <= Rabs (b - a)).
Lemma bounded_variation (h dh : R -> R) (D : R) (x y : R) :
(forall t : R, Rabs (t - x) <= Rabs (y - x) -> is_derive h t (dh t) /\ (Rabs (dh t) <= D)) ->
Rabs (h y - h x) <= D * Rabs (y - x).
Lemma norm_le_prod_norm_1 {K : AbsRing} {U V : NormedModule K} (x : U * V) :
norm (fst x) <= norm x.
Lemma norm_le_prod_norm_2 {K : AbsRing} {U V : NormedModule K} (x : U * V) :
norm (snd x) <= norm x.
Lemma is_derive_filterdiff (f : R -> R -> R) (x y : R) (dfx : R -> R -> R) (dfy : R) :
locally (x,y) (fun u : R * R => is_derive (fun z => f z (snd u)) (fst u) (dfx (fst u) (snd u))) ->
is_derive (fun z : R => f x z) y dfy ->
continuous (fun u : R * R => dfx (fst u) (snd u)) (x,y) ->
filterdiff (fun u : R * R => f (fst u) (snd u)) (locally (x,y)) (fun u : R * R => plus (scal (fst u) (dfx x y)) (scal (snd u) dfy)).