-
Notifications
You must be signed in to change notification settings - Fork 459
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.[(getMsbD, msb)_extractLsb', (getLsbD, getMsbD, msb)_extractLsb]
#6792
base: master
Are you sure you want to change the base?
Conversation
Mathlib CI status (docs):
|
changelog-library |
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.
Thanks for the API :) I request a couple of minor syntactic changes, and one simplification of a theorem statement.
Co-authored-by: Siddharth <[email protected]>
Co-authored-by: Siddharth <[email protected]>
git push
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.
Some style comments
Co-authored-by: Alex Keizer <[email protected]>
awaiting-review |
awaiting-review |
src/Init/Data/BitVec/Lemmas.lean
Outdated
@@ -789,6 +815,32 @@ protected theorem extractLsb_ofNat (x n : Nat) (hi lo : Nat) : | |||
getLsbD (extractLsb hi lo x) i = (i ≤ (hi-lo) && getLsbD x (lo+i)) := by | |||
simp [getLsbD, Nat.lt_succ] | |||
|
|||
@[boolToPropSimps] theorem and_eq_decide (a b : Bool) : (a && b) = decide (a = true ∧ b = true) := by simp [Bool.decide_and] |
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.
Does this belong in this file?
BitVec.(getMsbD, msb)_(extractLsb', extractLsb), getMsbD_extractLsb'_eq_getLsbD
BitVec.[(getMsbD, msb)_extractLsb', (getLsbD, getMsbD, msb)_extractLsb]
After reasoning about it, the solution I am adopting to balance the organization of theorems in the appropriate locations without breaking consists of:
This should ensure that we don't break existing theorems, while still maintaining a relatively nice proof for |
This PR adds theorems
BitVec.(getMsbD, msb)_(extractLsb', extractLsb), getMsbD_extractLsb'_eq_getLsbD
.