Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Redundant clause

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Redundant clause


chronological Thread 
  • From: "Yevgeniy Makarov" <emakarov AT gmail.com>
  • Cc: "Marko Malikovi�" <marko AT ffri.hr>, coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] Redundant clause
  • Date: Sat, 20 Oct 2007 23:59:15 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=d/hFsrqfQ4XC6gqP8yvVe3YpRKf9S9PK1/p2vtL78moocVdEn8y0jp8d0hgFJ7xtMyf50+vILwsRkEY0FtXaE6K4lS/ENOfzrJ7o33jr0EkItfUs08/JUKcJ1+zYUMf4QSWjqdUQi7Ks7Xa1Of1G+xoYsAmzlSa+DVpP++foHy4=
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

This is correct. You cannot match on (x < y). You may write

match (nat_compare x y) with
| Lt => ...
| Gt => ...
| Eq => ...
end.

There is also a boolean analog of <=:  leb : nat -> nat -> bool (these
functions are in Coq.Arith.Compare_dec).

You can also match on the /proofs/ of x < y. For example, you may prove

Lemma lt_sum : forall x y : nat, x < y -> exists z, x + z = y.
Proof.
intros x y H; induction H. ...

and then if you say

compute delta [lt_sum le_ind] in x.

then you'll see a match on an object of type x < y. However, in
applying match to proofs one may return only other proofs. For
example, you cannot return a number 1 if x < y has been proved using
the constructor le_n and 2 if it has been proved using le_S.

Evgeny





Archive powered by MhonArc 2.6.16.

Top of Page