Skip to content

Commit

Permalink
make it work
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgrosser committed Feb 16, 2025
1 parent dd214af commit 222bfc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Init/Data/BitVec/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,7 @@ theorem toInt_sshiftRight {x : BitVec w} {n : Nat} :
simp [BitVec.eq_nil x]
· simp only [sshiftRight, toInt_ofInt]
have h1 : -↑((2 ^ w) : Nat) ≤ x.toInt >>> n * 2 := by
rw [← Nat.two_pow_pred_add_two_pow_pred (by omega), ← Nat.mul_two]
rw [←Nat.two_pow_pred_add_two_pow_pred (by omega), ←Nat.mul_two]
push_cast
rw [←Int.neg_mul]
by_cases hh : x.toInt ≤ 0
Expand All @@ -1939,7 +1939,7 @@ theorem toInt_sshiftRight {x : BitVec w} {n : Nat} :
norm_cast
omega
have h2 : x.toInt >>> n * 2 < ↑((2 ^ w) : Nat) := by
rw [← Nat.two_pow_pred_add_two_pow_pred (by omega), ← Nat.mul_two]
rw [←Nat.two_pow_pred_add_two_pow_pred (by omega), ←Nat.mul_two]
push_cast
by_cases hh : x.toInt ≤ 0
· have : x.toInt >>> n ≤ 0 := shiftRight_le_of_nonpos x.toInt n (by omega)
Expand Down

0 comments on commit 222bfc4

Please sign in to comment.