Variable T : Type.

(* Specifications: *)
Lemma has_nthP (a : pred T) s x0 :
reflect (exists2 i, i < size s & a (nth x0 s i)) (has a s).
Lemma all_nthP (a : pred T) s x0 :
reflect (forall i, i < size s -> a (nth x0 s i)) (all a s).
Lemma homo_ltn_in (D : pred nat) (f : nat -> T) (r : T -> T -> Prop) :
(forall y x z, r x y -> r y z -> r x z) ->
{in D &, forall i j k, i < k < j -> k \in D} ->
{in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} ->
{in D &, {homo f : i j / i < j >-> r i j}}.
Lemma homo_ltn (f : nat -> T) (r : T -> T -> Prop) :
(forall y x z, r x y -> r y z -> r x z) ->
(forall i, r (f i) (f i.+1)) -> {homo f : i j / i < j >-> r i j}.
Lemma homo_leq (f : nat -> T) (r : T -> T -> Prop) :
(forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) ->
(forall i, r (f i) (f i.+1)) -> {homo f : i j / i <= j >-> r i j}.
Lemma expE : exp =2 expn.
Definition trecE := (addE, (doubleE, oddE), (mulE, add_mulE, (expE, mul_expE))).