(* conversion to/from list *)

Fixpoint to_list X (n: nat) (v: Vector.t X n) {struct v}: List.list X :=
  match v with
  | Vector.nil => List.nil | Vector.cons x _ v' => List.cons x (to_list v')
  end.Fixpoint from_list A (l: List.list A): Vector.t A (List.length l) :=
  match l return Vector.t A (List.length l) with
  | List.nil => Vector.nil | List.cons h t => Vector.cons h (from_list t)
  end.

Lemma list_round_trip A (l: List.list A): to_list (from_list l) = l.