End Last.

(* Specifications: *)
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}.
Section Firstn_skipn.
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_firstn {A:Type} n (l:list A):
skipn n (firstn n l) = [].
Lemma skipn_app2 {A : Type} (l l' : list A) n:
length l = n → skipn n (l ++ l') = l'.
Lemma firstn_app2 : forall (A : Type) (l l' : list A) n,
length l = n -> firstn n (l ++ l') = l .
Lemma ints_length : ∀ n m,
n ≤ m → length (ints n m) = m-n.
Lemma Forall_app_iff {A:Type} (P:A→Prop) l1 l2:
Forall P (l1++l2) ↔ Forall P l1 ∧ Forall P l2.
Lemma Forall_unary {A:Type} (P:A→Prop) a:
Forall P [a] ↔ P a.