From b9cbf680f13927340720d1d0f4938dcc6cd65d1f Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Mon, 8 Sep 2014 17:35:50 +0200 Subject: eta contractions --- theories/PArith/BinPosDef.v | 4 ++-- theories/PArith/Pnat.v | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'theories/PArith') 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. -- cgit v1.2.3