Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] An interated composition puzzle

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] An interated composition puzzle


Chronological Thread 
  • From: Laurent Théry <Laurent.Thery AT inria.fr>
  • To: Kevin Sullivan <sullivan.kevinj AT gmail.com>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] An interated composition puzzle
  • Date: Sat, 10 Nov 2012 16:37:44 +0100

On 11/10/2012 02:54 PM, Kevin Sullivan wrote:
Fixpoint ant {X: Type} (f: X->X) (x: X) (n: nat) : X :=
match n with
| O => x
| S n' => f (ant f x n')
end.

Fixpoint ant' {X: Type} (f: X->X) (x: X) (n: nat) : X :=
match n with
| O => x
| S n' => ant' f (f x) n'
end.

Theorem equiv: forall (X: Type) (f: X->X) (x: X) (n: nat),
(ant f x n) = (ant' f x n).
Proof. admit.
You can prove it directly with two inductions, or only one induction using an intermediate lemme
f (ant' f x n) = ant' f (f x) n (that is proved by induction)

Hint: don' t forget to generalize your goal before doing the induction!

--
Laurent





Archive powered by MHonArc 2.6.18.

Top of Page