Library Coq.Arith.EqNat
Equality on natural numbers
Local Open Scope nat_scope.
Implicit Types m n x y :
nat.
eq restricted to nat and eq_nat are equivalent
Fixpoint beq_nat n m :
bool :=
match n,
m with
|
O,
O =>
true
|
O,
S _ =>
false
|
S _,
O =>
false
|
S n1,
S m1 =>
beq_nat n1 m1
end.
Lemma beq_nat_refl :
forall n,
true = beq_nat n n.
Definition beq_nat_eq :
forall x y,
true = beq_nat x y ->
x = y.
Lemma beq_nat_true :
forall x y,
beq_nat x y = true ->
x=y.
Lemma beq_nat_false :
forall x y,
beq_nat x y = false ->
x<>y.
Lemma beq_nat_true_iff :
forall x y,
beq_nat x y = true <-> x=y.
Lemma beq_nat_false_iff :
forall x y,
beq_nat x y = false <-> x<>y.