aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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.