Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] unblocked, thanks!

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] unblocked, thanks!


chronological Thread 
  • From: Jean-Francois Monin <jean-francois.monin AT imag.fr>
  • To: Daniel de Rauglaudre <daniel.de_rauglaudre AT inria.fr>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] unblocked, thanks!
  • Date: Mon, 13 Dec 2010 18:56:14 +0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=HMXn6EOuL3ZgspzClKEKGMdemzAeXE59pghOwUK+ri3yTlZwgjyr/hVt4Ws0fEp4Pc YTMRcOeYl0IzqFAWP391jEVllIufw71SZ0htLfS3IvdUIHbi9dz4zE+tzy+vCzLfuBix HgrQRU4qONMdlm2VvAJdcAcizIDDtC7hX1XD0=

On Mon, Dec 13, 2010 at 10:30:55AM +0100, Daniel de Rauglaudre wrote:
> Hi,
> 
> On Mon, Dec 13, 2010 at 05:26:01AM +0100, Jean-Francois Monin wrote:
> 
> > It is also a good opportunity to interpret this as a concrete
> > application of Curry-Howard.  Making the induction over a quantified
> > formula is more than a trick [...]
> 
> I suppose you say that because I used:
>    intros a b; generalize a; generalize b; clear ?

Yes. A recent and convenient tactic to get the same effect is revert. 
Something like
  intros a b; revert a; induction b etc.

> 
> [...]
> 
> > fix 2 (* better practice: use "refine", but I'm lazy *).
> 
> So, "fix 2" does the same trick?

Forgot to explain fix 2 : it is an undocumented tactic 
for a reason you will better understand by trying it. 
The bottom line is roughly:
  induction H = generalize H + fix 1 + destruct.
The tactic fix n allows you to use the function-theorem you are defining
in the body, provided you call it with a structurally smaller 
nth argument (here = 2). 
You have to know what you are doing, and some tactics like auto
become dangerous. If you forget the guard condition 
(and auto will happily forget it), you will "finish" the proof
and Qed will "surprisingly" refuse your attempt.
A useful command to know is "Guarded", to be used after a suspicious
recursive call for instance.
Refine has not this drawback, but it is heavier.

> I did not know "fix" nor "refine". I am looking at them.
> 
> But is not "refine" difficult to use, since you must give the explicit
> lambda term of the proof.

Only for the first step.

> 
> And why "fix 2" is a so bad practice?

It is a common opinion, see above why.  Matter of taste...
I prefer to be explicit with uses of induction hypotyheses
in my scripts, but when dealing with large inductive types
it can be tedious, here induction + automation is more convenient.

JF



Archive powered by MhonArc 2.6.16.

Top of Page