Skip to content

Commit bc54db2

Browse files
authored
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.
1 parent 6e7b76c commit bc54db2

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Init/Data/BitVec/Lemmas.lean

+8-5
Original file line numberDiff line numberDiff line change
@@ -1473,11 +1473,6 @@ theorem shiftLeft_ofNat_eq {x : BitVec w} {k : Nat} : x <<< (BitVec.ofNat w k) =
14731473

14741474
/-! ### ushiftRight -/
14751475

1476-
@[simp] theorem ushiftRight_eq' (x : BitVec w₁) (y : BitVec w₂) :
1477-
x >>> y = x >>> y.toNat := by rfl
1478-
1479-
theorem ushiftRight_ofNat_eq {x : BitVec w} {k : Nat} : x >>> (BitVec.ofNat w k) = x >>> (k % 2^w) := rfl
1480-
14811476
@[simp, bv_toNat] theorem toNat_ushiftRight (x : BitVec n) (i : Nat) :
14821477
(x >>> i).toNat = x.toNat >>> i := rfl
14831478

@@ -1601,6 +1596,14 @@ theorem msb_ushiftRight {x : BitVec w} {n : Nat} :
16011596
case succ nn ih =>
16021597
simp [BitVec.ushiftRight_eq, getMsbD_ushiftRight, BitVec.msb, ih, show nn + 1 > 0 by omega]
16031598

1599+
/-! ### ushiftRight reductions from BitVec to Nat -/
1600+
1601+
@[simp]
1602+
theorem ushiftRight_eq' (x : BitVec w₁) (y : BitVec w₂) :
1603+
x >>> y = x >>> y.toNat := by rfl
1604+
1605+
theorem ushiftRight_ofNat_eq {x : BitVec w} {k : Nat} : x >>> (BitVec.ofNat w k) = x >>> (k % 2^w) := rfl
1606+
16041607
@[simp]
16051608
theorem ushiftRight_self (n : BitVec w) : n >>> n.toNat = 0#w := by
16061609
simp [BitVec.toNat_eq, Nat.shiftRight_eq_div_pow, Nat.lt_two_pow_self, Nat.div_eq_of_lt]

0 commit comments

Comments
 (0)