(* 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_list A (l: List.list A) (v: Vector.t A (List.length l)): from_list l = v -> l = to_list v.