Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club]how to prove basic arithmatic properties?

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club]how to prove basic arithmatic properties?


chronological Thread 
  • From: Jean-Marc Notin <notin AT lix.polytechnique.fr>
  • To: Carter Tazio Schonwald <carter.schonwald AT yale.edu>
  • Cc: coq-club AT pauillac.inria.fr
  • Subject: Re: [Coq-Club]how to prove basic arithmatic properties?
  • Date: Wed, 21 Mar 2007 17:40:25 +0100
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>
  • Organization: CNRS - LIX

And now the proofs of the last two theorems... I tried not to use
automatic tactics, so the proofs may seem more complicated than those
from the standard library.

Theorem comm_mult : forall a b : nat, mult a b = mult b a.
Proof.
  induction a; simpl; intro b.
    rewrite multO; trivial.
    
    replace (S a) with (sum a (S O)).
    rewrite distrib_mult_sum.
    rewrite commute_sum. rewrite IHa. 
    repeat rewrite mult1; trivial.
    
    rewrite commute_sum; trivial.
Qed.

Theorem trans_mult : forall a b c : nat, mult a (mult b c) = mult (mult
a b) c.
Proof.
  induction a; simpl.
    trivial.

    intros b c.
    rewrite IHa.
    replace (sum (mult b c) (mult (mult a b) c)) with (sum (mult c b)
(mult c (mult a b))).
    rewrite <- distrib_mult_sum. apply comm_mult; trivial.
    
    rewrite (comm_mult  (mult a b) c); rewrite (comm_mult c b); trivial.
Qed.

-- 
Jean-Marc Notin
LIX - Ã‰quipe LogiCal

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée




Archive powered by MhonArc 2.6.16.

Top of Page