playground/coq/unfinished/eqdec.v

25 lines
410 B
Coq

Print Eq.
Class Eq (A:Type) := {
eqb: A -> A -> bool;
}.
Instance eqBool : Eq bool := {
eqb :=
fun (a b:bool) =>
match a,b with
| true, true => true
| false, false => true
| _, _ => false
end
}.
Class EqDec (A:Type) {H:Eq A} := {
eqb_eq: forall x y:A,
(eqb x y) = true <-> x = y
}.
Require Import Nat.
Instance eqdecNat : EqDec nat := {
eqb_eq := Nat.eqb_eq
}.