induction n; destruct ls; intuition; simpl in *; try discriminate.
apply le_n_S.
case_eq (shiftOut ls n); intuition.
destruct p.
eauto.
rewrite H0 in H.
discriminate.
Qed.

(* Specifications: *)
Theorem shiftOut_correct_inv : forall n ls ls' v,
shiftOut ls n = Some (v, ls') ->
ls = (Vector.to_list v) ++ ls'.