Skip to content

Commit 01a2342

Browse files
committed
chore: shorten proof further
1 parent 92271ae commit 01a2342

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Init/Data/BitVec/Lemmas.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,7 @@ theorem sshiftRight_eq' (x : BitVec w) : x.sshiftRight' y = x.sshiftRight y.toNa
860860
/-! ### udiv -/
861861

862862
theorem udiv_eq {x y : BitVec n} : x.udiv y = BitVec.ofNat n (x.toNat / y.toNat) := by
863-
have h : x.toNat / y.toNat < 2 ^ n := by
864-
exact Nat.lt_of_le_of_lt (Nat.div_le_self ..) (by omega)
863+
have h : x.toNat / y.toNat < 2 ^ n := Nat.lt_of_le_of_lt (Nat.div_le_self ..) (by omega)
865864
simp [udiv, bv_toNat, h, Nat.mod_eq_of_lt]
866865

867866
@[simp, bv_toNat]
@@ -876,8 +875,7 @@ theorem toNat_udiv {x y : BitVec n} : (x.udiv y).toNat = x.toNat / y.toNat := by
876875

877876
theorem umod_eq {x y : BitVec n} :
878877
x.umod y = BitVec.ofNat n (x.toNat % y.toNat) := by
879-
have h : x.toNat % y.toNat < 2 ^ n := by
880-
apply Nat.lt_of_le_of_lt (Nat.mod_le _ _) x.isLt
878+
have h : x.toNat % y.toNat < 2 ^ n := Nat.lt_of_le_of_lt (Nat.mod_le _ _) x.isLt
881879
simp [umod, bv_toNat, Nat.mod_eq_of_lt h]
882880

883881
@[simp, bv_toNat]

0 commit comments

Comments
 (0)