Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Proving same goal with another definitions

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Proving same goal with another definitions


chronological Thread 
  • From: "Yevgeniy Makarov" <emakarov AT gmail.com>
  • To: "Marko Malikovi�" <marko AT ffri.hr>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] Proving same goal with another definitions
  • Date: Tue, 2 Oct 2007 22:56:26 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FvO9v1c78FlOKNlB0jAGTUOaYvRSRTKqeZaG7Qna3Y8/mCBI90TICAP4kDsEEID1vhXVv4tv1C/AEWgMOozaw1l2q7aWfTjjkgw1p4RysoGkBC72m1/n+OGUAAHiS86OyAa5x50s3q/g7ovjjBWSLeIlGAVtQduIYV/uhhvaaMU=
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hello,

You can do recursive proof construction using the tactic language
Ltac. It would be more natural not to use variables x and y in the
context. The reason is that Coq is a functional language, and the
values of variables cannot be changed once it is set. (A variable can
be cleared and introduced again, but only if the it is not used in any
object that continues to exists.) So instead I suggest using x and y
as arguments to a recursive tactic.

Consider the following example:

Definition f (x : nat) := x + 1.

Definition test (y : nat) := y = 5.

Ltac search x := try (exists x; compute; reflexivity); search (f x).

Goal exists y, test y.
search 0.

If "reflexivity" does not work for the current x, then the tactic
calls itself with the new value for x. Note that "compute" above is
optional since "reflexivity" normalizes both side of the equation.

Hope this helps.

Evgeny





Archive powered by MhonArc 2.6.16.

Top of Page