Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Induction principle for folding over lists

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Induction principle for folding over lists


chronological Thread 
  • From: Nicolas Marti <nicolas AT yl.is.s.u-tokyo.ac.jp>
  • To: mikeday AT yeslogic.com
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club] Induction principle for folding over lists
  • Date: Fri, 28 Dec 2007 21:52:06 +0900 (JST)
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Try it that way:

Theorem fold_folded : forall (A:Set) (xs:list A) (f:A -> A -> A) (a:A),
    folded A f a xs (fold A f a xs).
Proof.
  induction xs; simpl; intro.
  constructor.
  constructor.
  intuition.
Qed.

When you make an induction over a variable, assure to put it leftmost
in the lemma definition/type. To understand why, just look at 

Check list_rect.

which is (nearby) the induction principle you invoke.


      Nicolas





Archive powered by MhonArc 2.6.16.

Top of Page