Skip to content

Commit

Permalink
chore: Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
joehendrix committed Nov 28, 2023
1 parent 1264243 commit d61e9e7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Std/Data/BitVec/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ private theorem lt_two_pow_of_le {x m n : Nat} (lt : x < 2 ^ m) (le : m ≤ n) :
Nat.lt_of_lt_of_le lt (Nat.pow_le_pow_of_le_right (by trivial : 0 < 2) le)

@[simp] theorem ofNat_toNat (m : Nat) (x : BitVec n) : (BitVec.ofNat m x.toNat) = truncate m x := by
let ⟨x, lt_n⟩ := x
unfold truncate
unfold zeroExtend
if h : n ≤ m then
unfold zeroExtend'
have lt_m : x < 2 ^ m := lt_two_pow_of_le lt_n h
simp [h, lt_m, Nat.mod_eq_of_lt, BitVec.toNat, BitVec.ofNat]
else
simp [h]
let ⟨x, lt_n⟩ := x
unfold truncate
unfold zeroExtend
if h : n ≤ m then
unfold zeroExtend'
have lt_m : x < 2 ^ m := lt_two_pow_of_le lt_n h
simp [h, lt_m, Nat.mod_eq_of_lt, BitVec.toNat, BitVec.ofNat]
else
simp [h]

theorem toNat_append (x : BitVec m) (y : BitVec n) : (x ++ y).toNat = x.toNat <<< n ||| y.toNat :=
rfl
Expand Down

0 comments on commit d61e9e7

Please sign in to comment.