Skip to content

Commit

Permalink
chore: fix docstring in Bitvec.toNat_add_of_lt (#6638)
Browse files Browse the repository at this point in the history
This PR correct the docstring of theorem `Bitvec.toNat_add_of_lt`
  • Loading branch information
luisacicolini authored Jan 14, 2025
1 parent 85294b8 commit c12b1d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Init/Data/BitVec/Lemmas.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3539,7 +3539,7 @@ theorem getLsbD_intMax (w : Nat) : (intMax w).getLsbD i = decide (i + 1 < w) :=

/-! ### Non-overflow theorems -/

/-- If `x.toNat * y.toNat < 2^w`, then the multiplication `(x * y)` does not overflow. -/
/-- If `x.toNat + y.toNat < 2^w`, then the addition `(x + y)` does not overflow. -/
theorem toNat_add_of_lt {w} {x y : BitVec w} (h : x.toNat + y.toNat < 2^w) :
(x + y).toNat = x.toNat + y.toNat := by
rw [BitVec.toNat_add, Nat.mod_eq_of_lt h]
Expand Down

0 comments on commit c12b1d0

Please sign in to comment.