-
Notifications
You must be signed in to change notification settings - Fork 447
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.getLsb_concat
#3457
Conversation
Mathlib CI status (docs):
|
6b66a34
to
b35a9b7
Compare
awaiting-review |
src/Init/Data/BitVec/Lemmas.lean
Outdated
(concat x b).getLsb i = match i with | ||
| 0 => b | ||
| i+1 => x.getLsb i := by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm skeptical of this as a simp lemma with the match on the RHS.
The @[simp] lemmas should be for getLsb_concat_zero
and getLsb_concat_succ
.
theorem toNat_le_one (c:Bool) : c.toNat ≤ 1 := by | ||
cases c <;> trivial | ||
|
||
theorem toNat_lt (b : Bool) : b.toNat < 2 := | ||
Nat.lt_succ_of_le (toNat_le_one _) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer consistent names here, but I think toNat_lt
is correct, so will rename the other one.
To merge after #3457. --------- Co-authored-by: Alex Keizer <[email protected]>
First (baby)-step to a
concat
-basedbitblast
: a characterization ofconcat
in terms ofgetLsb
.The proof might benefit slightly from a
toNat_concat
lemma, but I wasn't sure what the normal form there should be, so I avoided it.