Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Induction step in Coq

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Induction step in Coq


chronological Thread 
  • From: Ezra Cooper <e.e.k.cooper AT sms.ed.ac.uk>
  • To: "Flavio L. C. de Moura" <flaviomoura AT unb.br>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] Induction step in Coq
  • Date: Fri, 24 Oct 2008 17:30:32 +0100
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Flavio L. C. de Moura wrote:
Hello,

   This is probably a simple question, but I didn't manage to solve it...
I have a binary predicate, say my_pred n t. The first argument is a natural and the second is an term of inductive type. In the induction step I get an expression of the form my_pred (n+1) t' where t' is simpler than t, and hence I can apply the induction hypothesis, but the induction hypothesis refers to the expression my_pred n t'. In a paper and pencil proof this step is trivial, but how can I instruct Coq to apply the induction hypothesis correctly?
Thank you in advance!


Presumably you are doing induction on t, so that the induction hypothesis already refers to a simpler term t'. So the problem is just to *generalize* for the argument n--is that right?

The typical solution to this is to reorder the quantifiers in your goal. If you start with

 Goal
   forall n t, my_pred n t.
 induction t.

then Coq will implicitly introduce all the quantified variables preceding t, in this case just "intro n", and thus the inductive hypotheses are working with some *particular*, unknown n. If you reorder them like so:

 Goal
   forall t n, my_pred n t.
 induction t.

then Coq will not need to introduce n and it will remain quantified (i.e. general) in the inductive hypothesis.

HTH,
Ezra


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.





Archive powered by MhonArc 2.6.16.

Top of Page