(** ** Properties of [to_list] *)

(* Specifications: *)
Lemma to_list_of_list_opp {A} (l: list A): to_list (of_list l) = l.
Lemma length_to_list A n (v : t A n): length (to_list v) = n.
Lemma to_list_nil A : to_list (nil A) = List.nil.
Lemma to_list_inj A n (v w : t A n):
to_list v = to_list w -> v = w.
Lemma to_list_hd A n (v : t A (S n)) d:
hd v = List.hd d (to_list v).
Lemma to_list_const A (a : A) n:
to_list (const a n) = List.repeat a n.
Lemma to_list_nth_order A n (v : t A n) p (H : p < n) d:
nth_order v H = List.nth p (to_list v) d.
Lemma to_list_tl A n (v : t A (S n)):
to_list (tl v) = List.tl (to_list v).
Lemma to_list_rev_append_tail A n m (v1 : t A n) (v2 : t A m):
to_list (rev_append_tail v1 v2) = List.rev_append (to_list v1) (to_list v2).
Lemma to_list_map A B (f : A -> B) n (v : t A n) :
to_list (map f v) = List.map f (to_list v).
Lemma to_list_fold_left A B f (b : B) n (v : t A n):
fold_left f b v = List.fold_left f (to_list v) b.
Lemma to_list_Exists A P n (v : t A n):
Exists P v <-> List.Exists P (to_list v).
Lemma to_list_In A a n (v : t A n):
In a v <-> List.In a (to_list v).
Lemma to_list_Forall2 A B P n (v1 : t A n) (v2 : t B n) :
Forall2 P v1 v2 <-> List.Forall2 P (to_list v1) (to_list v2).