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.