(** ** Properties of [rev] *)

(* Specifications: *)
Lemma rev_nil A: rev (nil A) = [].
Lemma rev_cons A: forall a n (v : t A n), rev (a :: v) = shiftin a (rev v).
Lemma rev_shiftin A: forall a n (v : t A n),
rev (shiftin a v) = a :: rev v.
Lemma rev_rev A: forall n (v : t A n), rev (rev v) = v.
Lemma map_rev A B: forall (f : A -> B) n (v : t A n),
map f (rev v) = rev (map f v).
Lemma fold_left_rev_right A B: forall (f:A->B->B) n (v : t A n) a,
fold_right f (rev v) a = fold_left (fun x y => f y x) a v.
Lemma In_rev A: forall a n (v : t A n),
In a (rev v) <-> In a v.
Lemma Forall_rev A: forall (P : A -> Prop) n (v : t A n),
Forall P (rev v) <-> Forall P v.