-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Nat.shiftRight_bitwise_distrib
#6334
feat: Nat.shiftRight_bitwise_distrib
#6334
Conversation
Mathlib CI status (docs):
|
Can you expand on this? This PR adds: theorem shiftRight_and_distrib {a b : Nat} : (a &&& b) >>> i = a >>> i &&& b >>> i :=
shiftRight_bitwise_distrib while the BitVev library has theorem ushiftRight_and_distrib (x y : BitVec w) (n : Nat) :
(x &&& y) >>> n = (x >>> n) &&& (y >>> n) := by
ext
simp This seem to be consistent among data types. What would be needed to make these |
My thesis is that distributing example (n : Nat) : (n <<< 2 ||| 3) >>> 2 = n := by simp Nonetheless, there are cases were distributing example (n : Nat) : (1 &&& 3) >>> n = 1 >>> n := by simp Distributing first here would create the term Weighing thees pros and cons lead me to believe the making the |
Otherwise, LGTM. |
3e14908
to
a0af185
Compare
This PR adds
Nat
theorems for distributing>>>
over bitwise operations, paralleling those ofBitVec
.This enables closing goals like the following using
simp
:It might be nice for these theorems to be
simp
lemmas, but they are not currently in order to be consistent with the existingBitVec
anddiv_two
theorems.