chore: undo small change (#6917)
In #6818, I removed this small section of reductions from BitVec to Nat since it seemed unnecessary. Since then, I saw that there are equivalent sections for shiftLeft/sshiftRight that are more substantial and that I should have not made this change.
This commit is contained in:
parent
6e7b76c097
commit
bc54db2af1
1 changed files with 8 additions and 5 deletions
|
|
@ -1473,11 +1473,6 @@ theorem shiftLeft_ofNat_eq {x : BitVec w} {k : Nat} : x <<< (BitVec.ofNat w k) =
|
|||
|
||||
/-! ### ushiftRight -/
|
||||
|
||||
@[simp] theorem ushiftRight_eq' (x : BitVec w₁) (y : BitVec w₂) :
|
||||
x >>> y = x >>> y.toNat := by rfl
|
||||
|
||||
theorem ushiftRight_ofNat_eq {x : BitVec w} {k : Nat} : x >>> (BitVec.ofNat w k) = x >>> (k % 2^w) := rfl
|
||||
|
||||
@[simp, bv_toNat] theorem toNat_ushiftRight (x : BitVec n) (i : Nat) :
|
||||
(x >>> i).toNat = x.toNat >>> i := rfl
|
||||
|
||||
|
|
@ -1601,6 +1596,14 @@ theorem msb_ushiftRight {x : BitVec w} {n : Nat} :
|
|||
case succ nn ih =>
|
||||
simp [BitVec.ushiftRight_eq, getMsbD_ushiftRight, BitVec.msb, ih, show nn + 1 > 0 by omega]
|
||||
|
||||
/-! ### ushiftRight reductions from BitVec to Nat -/
|
||||
|
||||
@[simp]
|
||||
theorem ushiftRight_eq' (x : BitVec w₁) (y : BitVec w₂) :
|
||||
x >>> y = x >>> y.toNat := by rfl
|
||||
|
||||
theorem ushiftRight_ofNat_eq {x : BitVec w} {k : Nat} : x >>> (BitVec.ofNat w k) = x >>> (k % 2^w) := rfl
|
||||
|
||||
@[simp]
|
||||
theorem ushiftRight_self (n : BitVec w) : n >>> n.toNat = 0#w := by
|
||||
simp [BitVec.toNat_eq, Nat.shiftRight_eq_div_pow, Nat.lt_two_pow_self, Nat.div_eq_of_lt]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue