induction n; intuition; simpl in *.
rewrite (vector_0 v1).
rewrite (vector_0 v2).
trivial.
destruct (vector_S v1).
destruct (vector_S v2).
destruct H0.
destruct H1.
subst.
unfold eqb_vector in H.
simpl in *.
case_eq (eqb x x0); intuition.
rewrite eqb_leibniz in H0.
subst.
f_equal.
rewrite eqb_refl in H.
eapply IHn.
eapply H.
rewrite H0 in H.
rewrite vector_fold_false in H.
discriminate.
Qed.
Section Vector_EqDec.
Variable A : Set.
Context `{eqd_A : EqDec A}.
Instance Vector_EqDec :
forall (n : nat),
EqDec (Vector.t A n).
intuition.
eapply (Build_EqDec (@eqb_vector A eqd_A n)).
intuition.
eapply eqb_vector_leibniz.
trivial.
subst.
apply eqb_vector_refl.
Qed.
End Vector_EqDec.
(* Fixpoint BvIsZero n (v : Bvector n) : bool  := match v with | Vector.nil => true | Vector.cons b _ v' => (andb (if (bool_dec b false) then true else false) (BvIsZero v')) end. *)
Instance unit_EqDec : EqDec unit.
refine {| eqb := (fun x y => true) |}.
intuition.
destruct x.
destruct y.
trivial.
Qed.
Instance bool_EqDec : EqDec bool.
refine {| eqb := Bool.eqb |}.
eapply eqb_true_iff.
Qed.
(* Bvector decidable equality was added before Vector.t decidable equality.  Definitions remain for compatibility. *)
Definition eqbBvector n (v1 v2 : Bvector n) : bool :=
(eqb_vector _ v1 v2).

Theorem eqbBvector_sound : forall n (v1 v2 : Bvector n),
eqbBvector v1 v2 = true -> v1 = v2.