Documentation

Std.Data.BitVec.Lemmas

Prove equality of bitvectors in terms of nat operations.

@[simp]
theorem Std.BitVec.getLsb_ge {w : Nat} (x : Std.BitVec w) (i : Nat) (ge : i w) :
theorem Std.BitVec.eq_of_getLsb_eq {w : Nat} {x : Std.BitVec w} {y : Std.BitVec w} (pred : ∀ (i : Fin w), Std.BitVec.getLsb x i.val = Std.BitVec.getLsb y i.val) :
x = y
theorem Std.BitVec.eq_of_getMsb_eq {w : Nat} {x : Std.BitVec w} {y : Std.BitVec w} (pred : ∀ (i : Fin w), Std.BitVec.getMsb x i.val = Std.BitVec.getMsb y i.val) :
x = y
@[simp]
theorem Std.BitVec.toNat_ofFin {n : Nat} (x : Fin (2 ^ n)) :
Std.BitVec.toNat { toFin := x } = x.val
theorem Std.BitVec.toNat_ofNat (x : Nat) (w : Nat) :
Std.BitVec.toNat x#w = x % 2 ^ w
@[simp]
@[simp]

cons #

theorem Std.BitVec.getLsb_cons (b : Bool) {n : Nat} (x : Std.BitVec n) (i : Nat) :
Std.BitVec.getLsb (Std.BitVec.cons b x) i = if i = n then b else Std.BitVec.getLsb x i

zeroExtend and truncate #

@[simp]
@[simp]

add #

Definition of bitvector addition as a nat.

@[simp]
theorem Std.BitVec.add_zero {n : Nat} (x : Std.BitVec n) :
x + 0#n = x