Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] applying a function definition

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] applying a function definition


chronological Thread 
  • From: Paul Tarau <paul.tarau AT gmail.com>
  • To: Guillaume Brunerie <guillaume.brunerie AT gmail.com>
  • Cc: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] applying a function definition
  • Date: Sat, 28 May 2011 14:01:26 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=NQRnjkT4FmCeJTZVhFwD1XkNyvxnanIbdZwWDAQlHZpi6Qt0zpGCFvFknl405T+/Ff giVPlGbpRI/l5Iq41xh7q8s+3ThHA/5+daOT9SuDAkMLb2Z0LGZgC0DvAFNmgN4DIkLA JuZWJ9RTJ2jiU4ekecc9dBvny4Ezr06Jzgf8Q=

Thanks for you help - the following did it:

Lemma sp_inv : forall n:B, p (s n) = n.
Proof.
induction n.
intros;firstorder.
trivial.
rewrite psi_os.
rewrite pos_ips.
f_equal. trivial.
Qed.

Paul

On May 28, 2011, at 1:14 PM, Guillaume Brunerie wrote:



2011/5/28 Paul Tarau <paul.tarau AT gmail.com>
I would like Coq to reason along the following equations:

    p (s (i b)) = p (o (s b)) = i (p (s b)) = i b

where I want to use, as an inductive hypothesis, that p (s b) = b holds.
I tried "apply psi_os" (that I just proved) but it seems to want both sides
of an equation - is there any way to make it just rewrite p (s (i b)) as
p (o (s b)) according to Lemma psi_os?

The answer is in the question :-)
The tactic you want is called 'rewrite', if you use 'rewrite psi_os' instead of 'apply psi_os', this will work (the tactic 'apply' try to match the current goal with the conclusion, here this is not what you want).
In order to do an induction, you will first need to use 'induction n' at the beginning of the proof, and prove the two other (easy) cases of the induction.

Guillaume




Archive powered by MhonArc 2.6.16.

Top of Page