Skip to content

Commit a2eb0a4

Browse files
luisacicolinibollu
andauthored
chore: docstring
Co-authored-by: Siddharth <[email protected]>
1 parent 3b1c8f4 commit a2eb0a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Init/Data/BitVec/Lemmas.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3866,6 +3866,10 @@ theorem toInt_mul_of_not_smulOverflow {x y : BitVec w} (h : ¬ smulOverflow x y)
38663866
_root_.not_or, Int.not_le, Int.not_lt] at h
38673867
rw [toInt_mul, Int.bmod_eq_of_le (by push_cast; omega) (by push_cast; omega)]
38683868

3869+
/--
3870+
Signed multiplication overflow reassociation.
3871+
If `(x * y)` and `(y * z)` do not overflow, then `(x * y) * z` overflows iff `x * (y * z)` overflows.
3872+
-/
38693873
theorem smulOverflow_assoc {x y z : BitVec w} (h : ¬ x.smulOverflow y) (h' : ¬ y.smulOverflow z) :
38703874
(x * y).smulOverflow z = x.smulOverflow (y * z) := by
38713875
rcases w with _|w

0 commit comments

Comments
 (0)