(** ** Composition *)
Section Comp.
Context {V : CompleteNormedModule R_AbsRing}.
(* Notation consistent version of the lemmas used in is_RInt_comp *)

(* Specifications: *)
Lemma IVT_gen_consistent (f : R -> R) (a b y : R) :
(forall x, continuous f x)
-> Rmin (f a) (f b) <= y <= Rmax (f a) (f b)
-> { x : R | Rmin a b <= x <= Rmax a b /\ f x = y }.
Lemma continuous_ab_maj_consistent :
forall (f : R -> R) (a b : R),
a <= b ->
(forall c : R, a <= c <= b -> continuous f c) ->
exists Mx : R, (forall c : R, a <= c <= b -> f c <= f Mx) /\ a <= Mx <= b.
Lemma continuous_ab_min_consistent :
forall (f : R -> R) (a b : R),
a <= b ->
(forall c : R, a <= c <= b -> continuous f c) ->
exists mx : R, (forall c : R, a <= c <= b -> f mx <= f c) /\ a <= mx <= b.
Lemma is_RInt_comp (f : R -> V) (g dg : R -> R) (a b : R) :
(forall x, Rmin a b <= x <= Rmax a b -> continuous f (g x)) ->
(forall x, Rmin a b <= x <= Rmax a b -> is_derive g x (dg x) /\ continuous dg x) ->
is_RInt (fun y => scal (dg y) (f (g y))) a b (RInt f (g a) (g b)).
Lemma RInt_comp (f : R -> V) (g dg : R -> R) (a b : R) :
(forall x, Rmin a b <= x <= Rmax a b -> continuous f (g x)) ->
(forall x, Rmin a b <= x <= Rmax a b -> is_derive g x (dg x) /\ continuous dg x) ->
RInt (fun y => scal (dg y) (f (g y))) a b = RInt f (g a) (g b).