Definition Forall_tl (A : Type) (P : A -> Prop) (a : A) (l : list A)
           (H : Forall P (a :: l)): Forall P l.

(* Specifications: *)
Lemma firstn_exact : forall {A : Type} (l1 l2 : list A) (n : nat), (length l1 = n)%nat -> firstn n (l1 ++ l2) = l1.
Lemma skipn_exact : forall {A : Type} (l1 l2 : list A) (n : nat), (length l1 = n)%nat -> skipn n (l1 ++ l2) = l2.
Lemma length_not_emp : forall {A B : Type} (l : list A) (z y : B), (Datatypes.length l > 0)%nat -> match l with [] => z | _ => y end = y.
Lemma list_splitLength {A}: forall n (l:list A) m, length l = (n + m)%nat -> exists l1 l2, l = l1 ++ l2 /\ length l1 = n /\ length l2 = m.
Lemma skipn_short {A}: forall n (l:list A), (length l <= n)%nat -> skipn n l = nil.
Lemma skipn_app2: forall A n (al bl: list A), (n >= length al)%nat -> skipn n (al++bl) = skipn (n-length al) bl.
Lemma firstn_map {A B} (f:A -> B): forall n l, firstn n (map f l) = map f (firstn n l).
Lemma firstn_combine {A}: forall n (l k: list A), firstn n (combine l k) = combine (firstn n l) (firstn n k).
Lemma firstn_precise {A}: forall n (l:list A), length l = n -> firstn n l = l.
Lemma mapnth': forall {A B : Type} (f : A -> B) (l : list A) (d : A) (n : nat) fd, fd = f d -> nth n (map f l) fd = f (nth n l d).
Lemma Ztest_Bytetest: forall a, Z.testbit (Byte.unsigned a) = Byte.testbit a.
Lemma nthD_1 {A B}: forall (f: A ->B) n l d fx dd, (n < length l)%nat -> nth n (map f l) d = fx -> exists x, In x l /\ nth n l dd = x /\ f x = fx.
Lemma nth_list_repeat' {A}: forall (a d:A) k i (Hik: (i <k)%nat), nth i (list_repeat k a) d = a.
Lemma minus_lt_compat_r: forall n m p : nat, (n < m)%nat -> (p <= n)%nat -> (n - p < m - p)%nat.
Lemma map_nth_error_inv {A B}: forall n (l:list A) (f: A -> B) fd, nth_error (map f l) n = Some fd -> exists d, nth_error l n = Some d /\ fd = f d.
Lemma nth_error_app {A}: forall n (l:list A) d, nth_error l n = Some d -> forall ll, nth_error (l ++ ll) n = Some d.
Lemma Forall_app {A} p (l1 l2: list A): Forall p (l1 ++ l2) <-> (Forall p l1 /\ Forall p l2).
Lemma Zlength_nonneg {A}: forall (l:list A), 0 <= Zlength l.
Lemma Zlength_max_zero {A} (l:list A): Z.max 0 (Zlength l) = Zlength l.
Theorem xor_inrange : forall (x y : Z), x = x mod Byte.modulus -> y = y mod Byte.modulus -> Z.lxor x y = (Z.lxor x y) mod Byte.modulus.
Lemma length_mul_split A k (K:(0<k)%nat) n (N:(0<n)%nat): forall (l:list A), length l = (k * n)%nat -> exists l1, exists l2, l=l1++l2 /\ length l1=n /\ length l2 = ((k-1) * n)%nat.