Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] How does the simpl. tactics behave?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] How does the simpl. tactics behave?


chronological Thread 
  • From: Z <zell08v AT orange.fr>
  • To: Adam Chlipala <adam AT chlipala.net>
  • Cc: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] How does the simpl. tactics behave?
  • Date: Tue, 7 Sep 2010 18:43:26 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=FBE0dvWqpte8PBwnQwoo81uZjp/sqjQ72obxQV55jUksUbCCx1+MxwN18dky78YLFg 0QD7rAJechZlCdpNhQE4ZtEhRByDxFO7zC3ZnRIGAdH+isVc9r8WAGVICZeW9qRKXFAJ 9qsqQ7ajv7jb2OtzLMohf9mucTCW35vMfMhso=

Great answers! Thanks a lot for that insight!

For your 2nd point
"we don't need unfold explicitely..."
which I take leave to doubt however:

For the following theorem, is there another way to
get around? (without unfold)

*****************
Definition gxx(x: nat) := match x with |_ =>0 end.
Theorem test000bis: gxx 0 = 0.
Proof. unfold gxx. Qed.
*******************


********************
Definition gx(x: nat) := match x with |_ =>0 end.
Eval simpl gx in gx 0.
********************

Here, the issue is that Coq programs that you type are elaborated into a simpler internal language.  For your example, that elaboration includes replacing the [match] with its body, since you have just one pattern that binds no variables.  You can see this by running [Print gx.].


Then, in this case, which tactic to do the unfolding work?

In many contexts, there is no need for unfolding.  For instance:

Goal forall x, gx x = 0.
 reflexivity.
Qed.

This works because at the lowest level of Coq's logic, equality is defined modulo unfolding.  For more complicated cases where you need to massage the form of a goal to get other tactics to apply, you can always run [unfold gx] to unfold [gx] in the conclusion.













Archive powered by MhonArc 2.6.16.

Top of Page