Fixpoint app A n: Vector.t A n -> forall m, Vector.t A m -> Vector.t A (n + m) :=
  match n return Vector.t A n -> forall m, Vector.t A m -> Vector.t A (n + m) with
  | 0 => fun _ _ w => w
  | S n' => fun v _ w => Vector.cons (head v) (app (tail v) w)
  end.(* vmap *)

Fixpoint map X Y (f: X -> Y) (n: nat) (v: Vector.t X n): Vector.t Y n :=
  match v with
  | Vector.nil => @Vector.nil Y
  | Vector.cons h _ t => Vector.cons (f h) (map f t)
  end.

Lemma map_ext X Y (f g: X -> Y) (e: ext_eq f g) (n: nat) (v: Vector.t X n): map f v = map g v.