From b7df34e9bc0959a3c074eeb6f67d932605481441 Mon Sep 17 00:00:00 2001 From: Andres Erbsen Date: Mon, 28 Jan 2019 18:23:51 -0500 Subject: BinInt: 3 lemmas about testbit, mod _ 2^, ones --- theories/ZArith/BinInt.v | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'theories') diff --git a/theories/ZArith/BinInt.v b/theories/ZArith/BinInt.v index 8fc3ab56c9..542d169e66 100644 --- a/theories/ZArith/BinInt.v +++ b/theories/ZArith/BinInt.v @@ -1259,6 +1259,30 @@ Proof. f_equal. now rewrite <- add_assoc, add_opp_diag_r, add_0_r. Qed. +(** * [testbit] in terms of comparision. *) + +Lemma testbit_mod_pow2 a n i (H : 0 <= n) + : testbit (a mod 2 ^ n) i = ((i