aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories
diff options
context:
space:
mode:
authorGravatar Pierre Boutillier <pierre.boutillier@pps.univ-paris-diderot.fr>2014-09-08 17:35:50 +0200
committerGravatar Pierre Boutillier <pierre.boutillier@ens-lyon.org>2014-10-01 23:24:36 +0200
commitb9cbf680f13927340720d1d0f4938dcc6cd65d1f (patch)
tree7cc258ea9458122d4e333f6cfa7af8a792242824 /theories
parentf640bcbe834cef3559118a093f1a905cacdccc2f (diff)
eta contractions
Diffstat (limited to 'theories')
-rw-r--r--theories/Init/Nat.v4
-rw-r--r--theories/NArith/BinNatDef.v4
-rw-r--r--theories/PArith/BinPosDef.v4
-rw-r--r--theories/PArith/Pnat.v2
-rw-r--r--theories/ZArith/Zpower.v4
5 files changed, 9 insertions, 9 deletions
diff --git a/theories/Init/Nat.v b/theories/Init/Nat.v
index 5764b349b..dddc0fc33 100644
--- a/theories/Init/Nat.v
+++ b/theories/Init/Nat.v
@@ -280,8 +280,8 @@ Fixpoint testbit a n : bool :=
| S n => testbit (div2 a) n
end.
-Definition shiftl a n := iter n double a.
-Definition shiftr a n := iter n div2 a.
+Definition shiftl a := nat_rect _ a (fun _ => double).
+Definition shiftr a := nat_rect _ a (fun _ => div2).
Fixpoint bitwise (op:bool->bool->bool) n a b :=
match n with
diff --git a/theories/NArith/BinNatDef.v b/theories/NArith/BinNatDef.v
index befcf7929..6aeeccaf5 100644
--- a/theories/NArith/BinNatDef.v
+++ b/theories/NArith/BinNatDef.v
@@ -325,8 +325,8 @@ Definition lxor n m :=
(** Shifts *)
-Definition shiftl_nat (a:N)(n:nat) := Nat.iter n double a.
-Definition shiftr_nat (a:N)(n:nat) := Nat.iter n div2 a.
+Definition shiftl_nat (a:N) := nat_rect _ a (fun _ => double).
+Definition shiftr_nat (a:N) := nat_rect _ a (fun _ => div2).
Definition shiftl a n :=
match a with
diff --git a/theories/PArith/BinPosDef.v b/theories/PArith/BinPosDef.v
index 44b9e7d03..c10f323ff 100644
--- a/theories/PArith/BinPosDef.v
+++ b/theories/PArith/BinPosDef.v
@@ -482,8 +482,8 @@ Fixpoint lxor (p q:positive) : N :=
(** Shifts. NB: right shift of 1 stays at 1. *)
-Definition shiftl_nat (p:positive)(n:nat) := Nat.iter n xO p.
-Definition shiftr_nat (p:positive)(n:nat) := Nat.iter n div2 p.
+Definition shiftl_nat (p:positive) := nat_rect _ p (fun _ => xO).
+Definition shiftr_nat (p:positive) := nat_rect _ p (fun _ => div2).
Definition shiftl (p:positive)(n:N) :=
match n with
diff --git a/theories/PArith/Pnat.v b/theories/PArith/Pnat.v
index 0f2ecf55a..4658f46b8 100644
--- a/theories/PArith/Pnat.v
+++ b/theories/PArith/Pnat.v
@@ -192,7 +192,7 @@ Qed.
Theorem inj_iter :
forall p {A} (f:A->A) (x:A),
- Pos.iter f x p = Nat.iter (to_nat p) f x.
+ Pos.iter f x p = nat_rect _ x (fun _ => f) (to_nat p).
Proof.
induction p using peano_ind.
- trivial.
diff --git a/theories/ZArith/Zpower.v b/theories/ZArith/Zpower.v
index 485935502..2d0b9926a 100644
--- a/theories/ZArith/Zpower.v
+++ b/theories/ZArith/Zpower.v
@@ -25,7 +25,7 @@ Local Open Scope Z_scope.
(** [Zpower_nat z n] is the n-th power of [z] when [n] is an unary
integer (type [nat]) and [z] a signed integer (type [Z]) *)
-Definition Zpower_nat (z:Z)(n:nat) := Nat.iter n (Z.mul z) 1.
+Definition Zpower_nat (z:Z) := nat_rect _ 1 (fun _ => Z.mul z).
Lemma Zpower_nat_0_r z : Zpower_nat z 0 = 1.
Proof. reflexivity. Qed.
@@ -255,7 +255,7 @@ Section power_div_with_rest.
Proof.
rewrite Pos2Nat.inj_iter, two_power_pos_nat.
induction (Pos.to_nat p); simpl; trivial.
- destruct (Nat.iter _ _ _) as ((q,r),d).
+ destruct (nat_rect _ _ _ _) as ((q,r),d).
unfold Zdiv_rest_aux. rewrite two_power_nat_S; now f_equal.
Qed.