Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] trouble with proving min

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] trouble with proving min


chronological Thread 
  • From: "Wan Hai" <wan.whyhigh AT gmail.com>
  • To: "Thomas Nelson" <thomasharrisonnelson AT gmail.com>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] trouble with proving min
  • Date: Wed, 24 Sep 2008 09:59:36 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=tdgdpzrSGEwAWjQ7T7VgLUIbW+VK9dx2vZ3HGEV7riPPDDTkKR18uXUjfdMGWasf3Y KXgGqOfs6d11GF4qz+LuDJEDb8xgvmKcoIwuhniKGeLJ8b4xAFTBHu6y2WzT9xVt9Ier 6LsgsHUoxXMlYPA4V+gxjI1+vNlKYJhpQ/oGU=
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Here is the proof script for your second theorem:

intros.
unfold min in |- *.
unfold Rle in |- *.
case (Rlt_dec x y).
 auto.
intro H.
  elim (Rle_or_lt y x); intros.
 auto.
apply False_ind.
  auto.

Hope this will helpful.

On Tue, Sep 23, 2008 at 9:56 PM, Thomas Nelson <thomasharrisonnelson AT gmail.com> wrote:
Ok, the comments I recieved helped, but I've become stuck again.  I
was working through some simple proofs about the min function on
integers:

Coq < Require Import ZArith.

Coq < Definition min (x y : Z) := if Z_lt_dec x y then x else y.

Theorem min1 : forall x y, Zle (min x y) x.

This solves the proof easily for me:
unfold min in |- *.
intros.
case (Z_lt_dec x y).
 auto with *.
auto with *.

However, if I try the same thing with real numbers, the second auto
with * fails.

Definition min (x y : R) := if Rlt_dec x y then x else y.
Theorem min1 : forall x y, Rle (min x y) x.
unfold min in |- *.
intros.
case (Rlt_dec x y).
 auto with *.
auto with *.

This brings me to here:
1 subgoal

 x : R
 y : R
 ============================
  not (Rlt x y) -> Rle y x

using "apply or_to_imply" I can get to:

  or (not (not (Rlt x y))) (Rle y x)

Which is very close to

Rle_or_lt: forall r1 r2 : R, or (Rle r1 r2) (Rlt r2 r1)

but I cant get rid of the not not, since
P -> ~~P isn't an equality in the standard library, and I can't figure
out how to prove it so I can use rewrite.

I hope this makes sense, If anyone could point out where I'm going
wrong that would be great.

--------------------------------------------------------
Bug reports: http://logical.futurs.inria.fr/coq-bugs
Archives: http://pauillac.inria.fr/pipermail/coq-club
         http://pauillac.inria.fr/bin/wilma/coq-club
Info: http://pauillac.inria.fr/mailman/listinfo/coq-club



--
Best regards,
Hai Wan



Archive powered by MhonArc 2.6.16.

Top of Page