-
Notifications
You must be signed in to change notification settings - Fork 462
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.neg_neg #4977
feat: add BitVec.neg_neg #4977
Conversation
Draft PR to indicate that @bollu or @alexkeizer should maybe double-check my style choices before Kim does his review. |
.. as well as neg_neq_iff_neq_neg.
a37c16d
to
3d98bfc
Compare
I am currently still unhappy with the BitVec.neg_neg proof, as the explicit use of theorem neg_neg {x : BitVec w} : - - x = x := by
by_cases h : x = 0
· simp [h]
· simp only [toNat_eq, ofNat_eq_ofNat, toNat_ofNat, Nat.zero_mod] at h
simp only [toNat_eq, toNat_neg]
rw [Nat.mod_eq_of_lt (a := 2 ^ w - x.toNat) (by omega)]
rw [Nat.mod_eq_of_lt (by omega)]
omega |
3b8cdcf
to
ca08674
Compare
ca08674
to
c75da23
Compare
I found a neat way to clean this up with two helper theorems |
Mathlib CI status (docs):
|
This is now clean from my perspective and ready to review. |
Co-authored-by: Henrik Böving <[email protected]>
.. as well as neg_neq_iff_neq_neg. --------- Co-authored-by: Henrik Böving <[email protected]>
.. as well as neg_neq_iff_neq_neg.