Definition lex_prod_dec: 
  (forall a1 a2 : A, {a1 = a2} + {a1 <> a2}) ->
  (forall a1 a2, {ltA a1 a2} + {~ltA a1 a2}) ->
  (forall b1 b2, {ltB b1 b2} + {~ltB b1 b2}) ->
  (forall x y, {lexprod x y} + {~ lexprod x y}).

(* Specifications: *)
Lemma cons_cons_last (A:Type) (a b:A) l x: last (a::b::l) x = last (b::l) x.
Lemma cons_last (A:Type) (a:A) l x: last (a::l) x = last l a.
Lemma last_in (A:Type) (l:list A) x: (last l x = x) \/ (In (last l x) l).
Lemma beq_eq_dec {A : Type} {beq : A -> A -> bool} (Hbeq : forall x y, beq x y = true <-> x = y) : forall (x y : A), {x = y} + {~ x = y}.
Lemma firstn_map {A B : Type} (f : A -> B) l n : firstn n (map f l) = map f (firstn n l).
Lemma skipn_map {A B : Type} (f : A -> B) l n : skipn n (map f l) = map f (skipn n l).
Lemma skipn_app_length {A : Type} (l1 l2 : list A) : skipn (length l1) (l1 ++ l2) = l2.
Lemma firstn_app_length {A : Type} (l1 l2 : list A) : firstn (length l1) (l1 ++ l2) = l1.
Lemma skipn_nil : forall {A} n (x : list A), length x <= n -> skipn n x = nil.
Lemma firstn_seq n start len : firstn n (seq start len) = seq start (min n len).
Lemma skipn_seq n start len : skipn n (seq start len) = seq (start+n) (len-n).
Lemma skipn_incl {A:Type} (l:list A) n: incl (skipn n l) l.
Lemma skipn_app2 {A : Type} (l l' : list A) n: length l = n → skipn n (l ++ l') = l'.
Lemma firstn_app {A} (l l' : list A) : firstn (length l) (l ++ l') = l.
Lemma firstn_app2 : forall (A : Type) (l l' : list A) n, length l = n -> firstn n (l ++ l') = l .