(* end hide *)

(* Specifications: *)
Lemma leftinv_is_rightinv_interv : forall (f g:R->R) (lb ub:R),
(forall x y, lb <= x -> x < y -> y <= ub -> f x < f y) ->
(forall y, f lb <= y -> y <= f ub -> (comp f g) y = id y) ->
(forall x, f lb <= x -> x <= f ub -> lb <= g x <= ub) ->
forall x,
lb <= x <= ub ->
(comp g f) x = id x.