Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Stuck on a proof of div2 (n + n) = n.

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Stuck on a proof of div2 (n + n) = n.


chronological Thread 
  • From: frank maltman <frank.maltman AT googlemail.com>
  • To: Chris Dams <chris.dams.nl AT gmail.com>
  • Cc: <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Stuck on a proof of div2 (n + n) = n.
  • Date: Sat, 21 May 2011 11:39:08 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=VEuNFjYz8375Jt/NIosJYEMFS3nakRIyTPB6UewlrXrzjUfKG/AidO8/NFzcxOwkkT 9z3tNTicNTBgRz585/bKTT8y2QIgAQ+AHRVxWHahG9NsjqT5EMCIJG+jQwv/szJiPwsv om+JZtr/s/lHE4PTY+pmWlpzlUgkMlNRTq5TU=

On Sat, 21 May 2011 13:22:27 +0200
Chris Dams 
<chris.dams.nl AT gmail.com>
 wrote:

> Dear Frank,
> 
> The idea is to get something of the form div2 (S (S m)) because div2
> has been recursively defined as becomes apparent when you do Print
> div2.

Right.

> I found the following proof that utilizes this. The first S in (S n +
> S n) moves to the front automatically because addition is recursive in
> the first argument. The second one needs to helped a bit by using
> plus_n_Sm.

I see. I don't think I would have spotted that.

I guess the trick in general is to spot familiar patterns.

> Lemma divplus : forall n, div2 (n + n) = n.
> intro n.
> induction n as [|n IH]; [tauto|].
> simpl.
> rewrite <- plus_n_Sm.
> f_equal.
> assumption.
> Qed.

Thanks!



Archive powered by MhonArc 2.6.16.

Top of Page