aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/Arith
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2007-04-06 00:58:14 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2007-04-06 00:58:14 +0000
commitb7e4dbd4ff8ff12dc061ffb4664670b11831fd81 (patch)
tree1fe64e3de5e197f4d28753f71261b56b62e9c1aa /theories/Arith
parent548fd57a9910a1622348c4a6f6f44f8d8a262bb1 (diff)
simplier version of tail_plus
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9750 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Arith')
-rw-r--r--theories/Arith/Plus.v10
1 files changed, 4 insertions, 6 deletions
diff --git a/theories/Arith/Plus.v b/theories/Arith/Plus.v
index 98961fce8..5f7517c75 100644
--- a/theories/Arith/Plus.v
+++ b/theories/Arith/Plus.v
@@ -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.