I am passing through coq course "Logical Foundations". Solving problem:
Having less or equal function:
Fixpoint leb (n m : nat) : bool :=
match n with
| O => true
| S n' =>
match m with
| O => false
| S m' => leb n' m'
end
end.
create "less then" function:
Definition blt_nat (n m : nat) : bool
(* REPLACE THIS LINE WITH ":= _your_definition_ ." *). Admitted.
As far as I understand it should work like this:
if (n == m)
return false
else
return (leb n m)
I created this:
Definition blt_nat (n m : nat) : bool
match n with
| m => false
| _ => leb n m
end.
But it doesn't work - outputs: "Error: This clause is redundant." for the line:
| _ => leb n m
Please, help.