diff options
author | Samuel Mimram <smimram@debian.org> | 2008-07-25 15:12:53 +0200 |
---|---|---|
committer | Samuel Mimram <smimram@debian.org> | 2008-07-25 15:12:53 +0200 |
commit | a0cfa4f118023d35b767a999d5a2ac4b082857b4 (patch) | |
tree | dabcac548e299fee1da464c93b3dba98484f45b1 /theories/Arith/Plus.v | |
parent | 2281410e38ef99d025ea77194585a9bc019fdaa9 (diff) |
Imported Upstream version 8.2~beta3+dfsgupstream/8.2.beta3+dfsg
Diffstat (limited to 'theories/Arith/Plus.v')
-rw-r--r-- | theories/Arith/Plus.v | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/theories/Arith/Plus.v b/theories/Arith/Plus.v index 74d0dc93..6d510447 100644 --- a/theories/Arith/Plus.v +++ b/theories/Arith/Plus.v @@ -6,7 +6,7 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -(*i $Id: Plus.v 9245 2006-10-17 12:53:34Z notin $ i*) +(*i $Id: Plus.v 9750 2007-04-06 00:58:14Z letouzey $ i*) (** Properties of addition. [add] is defined in [Init/Peano.v] as: << @@ -198,16 +198,14 @@ Qed. tail-recursive, whereas [plus] is not. This can be useful when extracting programs. *) -Fixpoint plus_acc q n {struct n} : nat := +Fixpoint tail_plus n m {struct n} : nat := match n with - | O => q - | S p => plus_acc (S q) p + | O => m + | S n => tail_plus n (S m) end. -Definition tail_plus n m := plus_acc m n. - Lemma plus_tail_plus : forall n m, n + m = tail_plus n m. -unfold tail_plus in |- *; induction n as [| n IHn]; simpl in |- *; auto. +induction n as [| n IHn]; simpl in |- *; auto. intro m; rewrite <- IHn; simpl in |- *; auto. Qed. |