(* 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 eq_as_lists X n (x y: Vector.t X n): to_list x = to_list y -> x = y.