(* maybe it would be nicer to have this one as the primitive, and natBelow_S_inv above as the derived one *)

Fixpoint nth X (n: nat) (v: Vector.t X n): natBelow n -> X :=
  match v with
  | Vector.nil => fun nb => natBelow0_rect nb _
  | Vector.cons h k t => fun nb => natBelow_S_bla nb h (nth t)
  end.

(* Specifications: *)
Lemma nth_0 A n (v: Vector.t A (S n)): nth v (nb0 n) = head v.
Lemma nth_S A p (v: Vector.t A (S p)) (n: natBelow p): nth v (Snb n) = nth (tail v) n.
Lemma nth_map A B (f: A -> B) n i (v: Vector.t A n): nth (map f v) i = f (nth v i).
Lemma nb1 (n: natBelow 1): n = mkNatBelow 0 0.
Lemma ext_nth A n (x y: Vector.t A n): ext_eq (nth x) (nth y) -> x = y.
Lemma In_nth A n i (v: Vector.t A n): List.In (nth v i) v.
Lemma to_list_app A n (v: Vector.t A n) m (w: Vector.t A m): to_list (app v w) = List.app (to_list v) (to_list w).
Lemma In_vec_inv A a n (v: Vector.t A n): List.In a v -> exists i, a = nth v i.
Lemma nb_val_eq_rec_r (k u: nat) (n: natBelow u) (h: k = u): nb_val (eq_rec_r natBelow n h) = nb_val n.