Documentation
Init
.
Data
.
Nat
.
Power2
.
Lemmas
Search
return to top
source
Imports
Init.Data.Nat.Bitwise.Lemmas
Init.Data.Nat.Power2.Basic
Imported by
Nat
.
not_isPowerOfTwo_zero
Nat
.
and_sub_one_testBit_log2
Nat
.
and_sub_one_eq_zero_iff_isPowerOfTwo
Nat
.
ne_zero_and_sub_one_eq_zero_iff_isPowerOfTwo
Nat
.
instDecidableIsPowerOfTwo
Further lemmas about
Nat.isPowerOfTwo
, with the convenience of having bitwise lemmas available.
#
source
theorem
Nat
.
not_isPowerOfTwo_zero
:
¬
isPowerOfTwo
0
source
theorem
Nat
.
and_sub_one_testBit_log2
{
n
:
Nat
}
(
h
:
n
≠
0
)
(
hpow2
:
¬
n
.
isPowerOfTwo
)
:
(
n
&&&
n
-
1
).
testBit
n
.
log2
=
true
source
theorem
Nat
.
and_sub_one_eq_zero_iff_isPowerOfTwo
{
n
:
Nat
}
(
h
:
n
≠
0
)
:
n
&&&
n
-
1
=
0
↔
n
.
isPowerOfTwo
source
theorem
Nat
.
ne_zero_and_sub_one_eq_zero_iff_isPowerOfTwo
{
n
:
Nat
}
:
n
≠
0
∧
n
&&&
n
-
1
=
0
↔
n
.
isPowerOfTwo
source
@[inline]
instance
Nat
.
instDecidableIsPowerOfTwo
{
n
:
Nat
}
:
Decidable
n
.
isPowerOfTwo
Equations