Skip to content

Commit

Permalink
chore: use have, rw
Browse files Browse the repository at this point in the history
  • Loading branch information
bollu committed Sep 12, 2024
1 parent 7f4fad2 commit 3d79832
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 @@ -2022,7 +2022,7 @@ theorem toNat_sub_of_le {x y : BitVec n} (h : y ≤ x) :
rw [BitVec.le_def] at h
by_cases h' : x.toNat = y.toNat
· rw [h', Nat.sub_self, Nat.sub_add_cancel (by omega), Nat.mod_self]
· rw [show 2 ^ n - y.toNat + x.toNat = 2 ^ n + (x.toNat - y.toNat) by omega,
Nat.add_mod_left, Nat.mod_eq_of_lt (by omega)]
· have : 2 ^ n - y.toNat + x.toNat = 2 ^ n + (x.toNat - y.toNat) := by omega
rw [this, Nat.add_mod_left, Nat.mod_eq_of_lt (by omega)]

end BitVec

0 comments on commit 3d79832

Please sign in to comment.