-
Notifications
You must be signed in to change notification settings - Fork 439
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: add BitVec.getElem_truncate
#5278
Conversation
@semorrison, we modelled this PR after #5247, but I am a bit confused that we would not have getElem on the RHS of these identities. Could you briefly explain why the RHS has getLsbD? |
Mathlib CI status (docs):
|
I chatted with @alexkeizer, and his suggestion was to add: theorem getLsbD_eq_getElem {x : BitVec w} {i : Nat} (h : i < w) :
x.getLsbD i = x[i] := by
simp [getLsbD, getElem_eq_testBit_toNat] to get back to getElem after these rewrites to getLsbD, if the relevant hypothesis is flying around. Does this make sense from your perspective? |
Mathlib CI status (docs):
|
Yes, this looks good. I think it can even be a |
Apologies for the delay reviewing here. |
Co-authored-by: Kim Morrison <scott@tqft.net>
@semorrison, I applied your suggestions. However, I am not use we want to implement them without adding a new hypothesis
|
awaiting-review |
I moved this back to |
Mathlib CI status (docs):
|
This reverts commit 567f4fe.
Mathlib CI status (docs):
|
Mathlib CI status (docs):
|
Mathlib CI status (docs):
|
No description provided.