aboutsummaryrefslogtreecommitdiffhomepage
path: root/theories/ZArith
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-01-04 18:48:06 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-01-04 18:48:06 +0000
commit12c796fe185876021e2dfc7753b8f90ba9de31e0 (patch)
tree38eea7388cb9295f2169ad34eb1682578017aaee /theories/ZArith
parentfdda04b92b7347f252d41aa76693ec221a07fe47 (diff)
Ndigits: a Pshiftl_nat used in BigN (was double_digits there)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13764 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/ZArith')
-rw-r--r--theories/ZArith/Zdigits_def.v16
1 files changed, 16 insertions, 0 deletions
diff --git a/theories/ZArith/Zdigits_def.v b/theories/ZArith/Zdigits_def.v
index 028149eb8..618214357 100644
--- a/theories/ZArith/Zdigits_def.v
+++ b/theories/ZArith/Zdigits_def.v
@@ -418,3 +418,19 @@ Proof.
now rewrite Nxor_spec, negb_xorb_l.
now rewrite Nxor_spec, xorb_negb_negb.
Qed.
+
+(** An additionnal proof concerning [Pshiftl_nat], used in BigN *)
+
+Lemma Pshiftl_nat_Zpower : forall n p,
+ Zpos (Pshiftl_nat p n) = Zpos p * 2 ^ Z_of_nat n.
+Proof.
+ intros.
+ rewrite Zmult_comm.
+ induction n. simpl; auto.
+ transitivity (2 * (2 ^ Z_of_nat n * Zpos p)).
+ rewrite <- IHn. auto.
+ rewrite Zmult_assoc.
+ rewrite inj_S.
+ rewrite <- Zpower_succ_r; auto with zarith.
+ apply Zle_0_nat.
+Qed.