Definition sig_forall_dec_T : Type
  := forall (P : nat -> Prop), (forall n, {P n} + {~P n})
                   -> {n | ~P n} + {forall n, P n}.Definition sig_not_dec_T : Type := forall P : Prop, { ~~P } + { ~P }.Definition is_upper_bound {R : ConstructiveReals}
           (E:CRcarrier R -> Prop) (m:CRcarrier R)
  := forall x:CRcarrier R, E x -> x <= m.Definition is_lub {R : ConstructiveReals}
           (E:CRcarrier R -> Prop) (m:CRcarrier R) :=
  is_upper_bound E m /\ (forall b:CRcarrier R, is_upper_bound E b -> m <= b).

(* Specifications: *)
Lemma CRlt_lpo_dec : forall {R : ConstructiveReals} (x y : CRcarrier R), (forall (P : nat -> Prop), (forall n, {P n} + {~P n}) -> {n | ~P n} + {forall n, P n}) -> sum (x < y) (y <= x).
Lemma is_upper_bound_dec : forall {R : ConstructiveReals} (E:CRcarrier R -> Prop) (x:CRcarrier R), sig_forall_dec_T -> sig_not_dec_T -> { is_upper_bound E x } + { ~is_upper_bound E x }.
Lemma is_upper_bound_epsilon : forall {R : ConstructiveReals} (E:CRcarrier R -> Prop), sig_forall_dec_T -> sig_not_dec_T -> (exists x:CRcarrier R, is_upper_bound E x) -> { n:nat | is_upper_bound E (CR_of_Q R (Z.of_nat n # 1)) }.
Lemma is_upper_bound_not_epsilon : forall {R : ConstructiveReals} (E:CRcarrier R -> Prop), sig_forall_dec_T -> sig_not_dec_T -> (exists x : CRcarrier R, E x) -> { m:nat | ~is_upper_bound E (-CR_of_Q R (Z.of_nat m # 1)) }.