summaryrefslogtreecommitdiff
path: root/theories/Arith/Plus.v
diff options
context:
space:
mode:
Diffstat (limited to 'theories/Arith/Plus.v')
-rw-r--r--theories/Arith/Plus.v12
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.