Skip to content

Commit

Permalink
chore: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasgrosser committed Aug 10, 2024
1 parent c75da23 commit 2d46ca2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Init/Data/BitVec/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ theorem truncate_eq_zeroExtend {v : Nat} {x : BitVec w} :

@[simp, bv_toNat] theorem toNat_zeroExtend' {m n : Nat} (p : m ≤ n) (x : BitVec m) :
(zeroExtend' p x).toNat = x.toNat := by
unfold zeroExtend'
simp [p, x.isLt, Nat.mod_eq_of_lt]
simp [zeroExtend']

@[bv_toNat] theorem toNat_zeroExtend (i : Nat) (x : BitVec n) :
BitVec.toNat (zeroExtend i x) = x.toNat % 2^i := by
Expand Down

0 comments on commit 2d46ca2

Please sign in to comment.