Skip to content

Commit

Permalink
chore: golf proof
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias Grosser <[email protected]>
  • Loading branch information
luisacicolini and tobiasgrosser authored Jan 28, 2025
1 parent 4537011 commit e1fbe8b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Init/Data/BitVec/Bitblast.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1233,11 +1233,9 @@ theorem shiftRight_eq_ushiftRightRec (x : BitVec w₁) (y : BitVec w₂) :
/-! ### Overflow definitions -/


@[simp] theorem toNat_mod_lt_eq {x : BitVec n} (h : n < m): x.toNat % (2 ^ m) = x.toNat :=
Nat.mod_eq_of_lt (by
have := (@Nat.pow_lt_pow_iff_right 2 n m (by omega)).mpr (by omega)
omega
)
@[simp] theorem toNat_mod_lt_eq {x : BitVec n} (h : n < m) : x.toNat % (2 ^ m) = x.toNat := by
have : 2 ^ n < 2 ^ m := Nat.pow_lt_pow_of_lt (by omega) h
exact Nat.mod_eq_of_lt (by omega)

theorem uaddOverflow_eq {w : Nat} (x y : BitVec w) :
uaddOverflow x y = (x.setWidth (w + 1) + y.setWidth (w + 1)).msb := by
Expand Down

0 comments on commit e1fbe8b

Please sign in to comment.