feat: add BitVec.intMax_add_one
This commit is contained in:
parent
30fa18816c
commit
9ef996259b
1 changed files with 6 additions and 0 deletions
|
|
@ -1836,4 +1836,10 @@ theorem getLsb_intMax (w : Nat) : (intMax w).getLsb i = decide (i + 1 < w) := by
|
|||
rw [← testBit_toNat, toNat_intMax, Nat.testBit_two_pow_sub_one, decide_eq_decide]
|
||||
omega
|
||||
|
||||
@[simp] theorem intMax_add_one {w : Nat} : intMax w + 1#w = intMin w := by
|
||||
simp only [toNat_eq, toNat_intMax, toNat_add, toNat_intMin, toNat_ofNat, Nat.add_mod_mod]
|
||||
by_cases h : w = 0
|
||||
· simp [h]
|
||||
· rw [Nat.sub_add_cancel (Nat.two_pow_pos (w - 1)), Nat.two_pow_pred_mod_two_pow (by omega)]
|
||||
|
||||
end BitVec
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue