Documentation
Init
.
Data
.
Int
.
Bitwise
.
Lemmas
Search
return to top
source
Imports
Init.ByCases
Init.Omega
Init.RCases
Init.WFTactics
Init.Data.Int.Pow
Init.Data.Nat.Lemmas
Init.Data.Int.Bitwise.Basic
Init.Data.Int.DivMod.Basic
Init.Data.Int.DivMod.Lemmas
Init.Data.Nat.Bitwise.Lemmas
Imported by
Int
.
shiftRight_eq
Int
.
natCast_shiftRight
Int
.
negSucc_shiftRight
Int
.
shiftRight_add
Int
.
shiftRight_eq_div_pow
Int
.
zero_shiftRight
Int
.
shiftRight_zero
Int
.
le_shiftRight_of_nonpos
Int
.
shiftRight_le_of_nonneg
Int
.
le_shiftRight_of_nonneg
Int
.
shiftRight_le_of_nonpos
Int
.
natCast_shiftLeft
Int
.
zero_shiftLeft
Int
.
shiftLeft_zero
Int
.
shiftLeft_succ
Int
.
shiftLeft_succ'
Int
.
shiftLeft_eq
Int
.
shiftLeft_eq'
Int
.
not_eq_neg_sub_one
Int
.
shiftLeft_add
Int
.
shiftLeft_shiftRight_cancel
Int
.
shiftLeft_shiftRight_eq_shiftLeft_of_le
Int
.
shiftLeft_shiftRight_eq_shiftRight_of_le
Int
.
shiftLeft_shiftRight_eq
Int
.
shiftRight_shiftLeft_cancel
Int
.
add_shiftLeft
Int
.
neg_shiftLeft
Int
.
shiftLeft_mul
Int
.
mul_shiftLeft
Int
.
shiftLeft_mul_shiftLeft
Int
.
shiftLeft_eq_zero_iff
Int
.
instNeZeroHShiftLeftNat
Int
.
trailingZeros_eq_natAbs
Int
.
trailingZeros_zero
Int
.
trailingZeros_eq_zero_of_mod_eq
Int
.
trailingZeros_two_mul_add_one
Int
.
trailingZeros_two_mul
Int
.
trailingZeros_def
Int
.
shiftRight_trailingZeros_mod_two
Int
.
two_pow_trailingZeros_dvd
Int
.
two_pow_trailingZeros_add_one_not_dvd
Int
.
trailingZeros_shiftLeft
Int
.
trailingZeros_neg
source
theorem
Int
.
shiftRight_eq
(
n
:
Int
)
(
s
:
Nat
)
:
n
>>>
s
=
n
.
shiftRight
s
source
@[simp]
theorem
Int
.
natCast_shiftRight
(
n
s
:
Nat
)
:
↑(
n
>>>
s
)
=
↑
n
>>>
s
source
@[simp]
theorem
Int
.
negSucc_shiftRight
(
m
n
:
Nat
)
:
negSucc
m
>>>
n
=
negSucc
(
m
>>>
n
)
source
theorem
Int
.
shiftRight_add
(
i
:
Int
)
(
m
n
:
Nat
)
:
i
>>>
(
m
+
n
)
=
i
>>>
m
>>>
n
source
theorem
Int
.
shiftRight_eq_div_pow
(
m
:
Int
)
(
n
:
Nat
)
:
m
>>>
n
=
m
/
↑(
2
^
n
)
source
@[simp]
theorem
Int
.
zero_shiftRight
(
n
:
Nat
)
:
0
>>>
n
=
0
source
@[simp]
theorem
Int
.
shiftRight_zero
(
n
:
Int
)
:
n
>>>
0
=
n
source
theorem
Int
.
le_shiftRight_of_nonpos
{
n
:
Int
}
{
s
:
Nat
}
(
h
:
n
≤
0
)
:
n
≤
n
>>>
s
source
theorem
Int
.
shiftRight_le_of_nonneg
{
n
:
Int
}
{
s
:
Nat
}
(
h
:
0
≤
n
)
:
n
>>>
s
≤
n
source
theorem
Int
.
le_shiftRight_of_nonneg
{
n
:
Int
}
{
s
:
Nat
}
(
h
:
0
≤
n
)
:
0
≤
n
>>>
s
source
theorem
Int
.
shiftRight_le_of_nonpos
{
n
:
Int
}
{
s
:
Nat
}
(
h
:
n
≤
0
)
:
n
>>>
s
≤
0
source
@[simp]
theorem
Int
.
natCast_shiftLeft
(
n
s
:
Nat
)
:
↑(
n
<<<
s
)
=
↑
n
<<<
s
source
@[simp]
theorem
Int
.
zero_shiftLeft
(
n
:
Nat
)
:
0
<<<
n
=
0
source
@[simp]
theorem
Int
.
shiftLeft_zero
(
n
:
Int
)
:
n
<<<
0
=
n
source
theorem
Int
.
shiftLeft_succ
(
m
:
Int
)
(
n
:
Nat
)
:
m
<<<
(
n
+
1
)
=
m
<<<
n
*
2
source
theorem
Int
.
shiftLeft_succ'
(
m
:
Int
)
(
n
:
Nat
)
:
m
<<<
(
n
+
1
)
=
2
*
m
<<<
n
source
theorem
Int
.
shiftLeft_eq
(
a
:
Int
)
(
b
:
Nat
)
:
a
<<<
b
=
a
*
2
^
b
source
theorem
Int
.
shiftLeft_eq'
(
a
:
Int
)
(
b
:
Nat
)
:
a
<<<
b
=
a
*
↑(
2
^
b
)
source
theorem
Int
.
not_eq_neg_sub_one
(
a
:
Int
)
:
~~~
a
=
-
a
-
1
source
theorem
Int
.
shiftLeft_add
(
a
:
Int
)
(
b
c
:
Nat
)
:
a
<<<
(
b
+
c
)
=
a
<<<
b
<<<
c
source
@[simp]
theorem
Int
.
shiftLeft_shiftRight_cancel
(
a
:
Int
)
(
b
:
Nat
)
:
a
<<<
b
>>>
b
=
a
source
theorem
Int
.
shiftLeft_shiftRight_eq_shiftLeft_of_le
{
b
c
:
Nat
}
(
h
:
c
≤
b
)
(
a
:
Int
)
:
a
<<<
b
>>>
c
=
a
<<<
(
b
-
c
)
source
theorem
Int
.
shiftLeft_shiftRight_eq_shiftRight_of_le
{
b
c
:
Nat
}
(
h
:
b
≤
c
)
(
a
:
Int
)
:
a
<<<
b
>>>
c
=
a
>>>
(
c
-
b
)
source
theorem
Int
.
shiftLeft_shiftRight_eq
(
a
:
Int
)
(
b
c
:
Nat
)
:
a
<<<
b
>>>
c
=
a
<<<
(
b
-
c
)
>>>
(
c
-
b
)
source
@[simp]
theorem
Int
.
shiftRight_shiftLeft_cancel
{
a
:
Int
}
{
b
:
Nat
}
(
h
:
2
^
b
∣
a
)
:
a
>>>
b
<<<
b
=
a
source
theorem
Int
.
add_shiftLeft
(
a
b
:
Int
)
(
n
:
Nat
)
:
(
a
+
b
)
<<<
n
=
a
<<<
n
+
b
<<<
n
source
theorem
Int
.
neg_shiftLeft
(
a
:
Int
)
(
n
:
Nat
)
:
(
-
a
)
<<<
n
=
-
a
<<<
n
source
theorem
Int
.
shiftLeft_mul
(
a
b
:
Int
)
(
n
:
Nat
)
:
a
<<<
n
*
b
=
(
a
*
b
)
<<<
n
source
theorem
Int
.
mul_shiftLeft
(
a
b
:
Int
)
(
n
:
Nat
)
:
a
*
b
<<<
n
=
(
a
*
b
)
<<<
n
source
theorem
Int
.
shiftLeft_mul_shiftLeft
(
a
b
:
Int
)
(
m
n
:
Nat
)
:
a
<<<
m
*
b
<<<
n
=
(
a
*
b
)
<<<
(
m
+
n
)
source
@[simp]
theorem
Int
.
shiftLeft_eq_zero_iff
{
a
:
Int
}
{
n
:
Nat
}
:
a
<<<
n
=
0
↔
a
=
0
source
instance
Int
.
instNeZeroHShiftLeftNat
{
a
:
Int
}
{
n
:
Nat
}
[
NeZero
a
]
:
NeZero
(
a
<<<
n
)
source
theorem
Int
.
trailingZeros_eq_natAbs
(
i
:
Int
)
:
i
.
trailingZeros
=
i
.
natAbs
.
trailingZeros
source
theorem
Int
.
trailingZeros_zero
:
trailingZeros
0
=
0
source
theorem
Int
.
trailingZeros_eq_zero_of_mod_eq
{
i
:
Int
}
(
h
:
i
%
2
=
1
)
:
i
.
trailingZeros
=
0
source
theorem
Int
.
trailingZeros_two_mul_add_one
(
i
:
Int
)
:
(
2
*
i
+
1
).
trailingZeros
=
0
source
theorem
Int
.
trailingZeros_two_mul
{
i
:
Int
}
(
h
:
i
≠
0
)
:
(
2
*
i
).
trailingZeros
=
i
.
trailingZeros
+
1
source
theorem
Int
.
trailingZeros_def
(
i
:
Int
)
:
i
.
trailingZeros
=
if
i
=
0
then
0
else
if
i
%
2
=
0
then
(
i
/
2
).
trailingZeros
+
1
else
0
source
theorem
Int
.
shiftRight_trailingZeros_mod_two
{
i
:
Int
}
(
h
:
i
≠
0
)
:
i
>>>
i
.
trailingZeros
%
2
=
1
source
theorem
Int
.
two_pow_trailingZeros_dvd
{
i
:
Int
}
(
h
:
i
≠
0
)
:
2
^
i
.
trailingZeros
∣
i
source
theorem
Int
.
two_pow_trailingZeros_add_one_not_dvd
{
i
:
Int
}
(
h
:
i
≠
0
)
:
¬
2
^
(
i
.
trailingZeros
+
1
)
∣
i
source
theorem
Int
.
trailingZeros_shiftLeft
{
x
:
Int
}
(
hx
:
x
≠
0
)
(
n
:
Nat
)
:
(
x
<<<
n
).
trailingZeros
=
x
.
trailingZeros
+
n
source
@[simp]
theorem
Int
.
trailingZeros_neg
(
x
:
Int
)
:
(
-
x
).
trailingZeros
=
x
.
trailingZeros