Skip to content

Commit 3440ca7

Browse files
Merge pull request #202 from Shark-with-Blue-Shoes/mod_false_spec
Added new lemma: mod_false_spec
2 parents 240d19c + 51bf443 commit 3440ca7

File tree

1 file changed

+7
-0
lines changed
  • theories/Numbers/Natural/Abstract

1 file changed

+7
-0
lines changed

theories/Numbers/Natural/Abstract/NBits.v

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,13 @@ Proof.
13121312
- now rewrite ones_spec_low, mod_pow2_bits_low, andb_true_r.
13131313
Qed.
13141314

1315+
Lemma testbit_false_mod_pow2 :
1316+
forall a n j, testbit a n = false -> testbit (a mod 2 ^ j) n = false.
1317+
Proof.
1318+
intros a n j H. rewrite <- land_ones. rewrite land_spec.
1319+
rewrite H. rewrite Bool.andb_false_l. reflexivity.
1320+
Qed.
1321+
13151322
Lemma land_ones_low : forall a n, log2 a < n ->
13161323
land a (ones n) == a.
13171324
Proof.

0 commit comments

Comments
 (0)