(*For compability:  A more cbn-friendly version of Vector.to_list *)
(* TODO: rework such that every lemma is in terms of Vector.to_list and we can use vector_to_list_correct to transfer? *)
Fixpoint vector_to_list (X : Type) (n : nat) (v : Vector.t X n) : list X :=
match v with
| Vector.nil _ => List.nil
| Vector.cons _ x n v' => x :: vector_to_list v'
end.
induction v.
- cbn. auto.
- cbn. f_equal. auto.
Qed.

Lemma vector_nth_error_nat X n' i (xs : Vector.t X n') :
nth_error (Vector.to_list xs) i = match lt_dec i n' with
Specif.left H => Some (Vector.nth xs (Fin.of_nat_lt H))
| _ => None
end.