File: .lake/packages/lean4/src/lean/Init/Data/BitVec/Basic.lean

full_name: BitVec
code: /--
A bitvector of the specified width.

This is represented as the underlying `Nat` number in both the runtime
and the kernel, inheriting all the special support for `Nat`.
-/
structure BitVec (w : Nat) where
  /-- Construct a `BitVec w` from a number less than `2^w`.
  O(1), because we use `Fin` as the internal representation of a bitvector. -/
  ofFin ::
  /-- Interpret a bitvector as a number less than `2^w`.
  O(1), because we use `Fin` as the internal representation of a bitvector. -/
  toFin : Fin (2^w)
goal: Type

full_name: BitVec.toFin
code: /--
A bitvector of the specified width.

This is represented as the underlying `Nat` number in both the runtime
and the kernel, inheriting all the special support for `Nat`.
-/
structure BitVec (w : Nat) where
  /-- Construct a `BitVec w` from a number less than `2^w`.
  O(1), because we use `Fin` as the internal representation of a bitvector. -/
  ofFin ::
  /-- Interpret a bitvector as a number less than `2^w`.
  O(1), because we use `Fin` as the internal representation of a bitvector. -/
  toFin : Fin (2^w)
goal: Fin (2 ^ w)

full_name: BitVec.ofFin
code: /--
A bitvector of the specified width.

This is represented as the underlying `Nat` number in both the runtime
and the kernel, inheriting all the special support for `Nat`.
-/
structure BitVec (w : Nat) where
  /-- Construct a `BitVec w` from a number less than `2^w`.
  O(1), because we use `Fin` as the internal representation of a bitvector. -/
  ofFin ::
  /-- Interpret a bitvector as a number less than `2^w`.
  O(1), because we use `Fin` as the internal representation of a bitvector. -/
  toFin : Fin (2^w)
goal: BitVec w

full_name: Std.BitVec
code: @[deprecated (since := "2024-04-12")]
protected abbrev Std.BitVec 
goal: Type

full_name: BitVec.decEq
code: def BitVec.decEq (a b : BitVec n) : Decidable (a = b) 
goal: Decidable (a = b)

full_name: instDecidableEqBitVec
code: instance : DecidableEq (BitVec n) 
goal: DecidableEq (BitVec n)

full_name: BitVec.ofNatLt
code: /-- The `BitVec` with value `i`, given a proof that `i < 2^n`. -/
@[match_pattern]
protected def ofNatLt {n : Nat} (i : Nat) (p : i < 2^n) : BitVec n 
goal: BitVec n

full_name: BitVec.ofNat
code: /-- The `BitVec` with value `i mod 2^n`. -/
@[match_pattern]
protected def ofNat (n : Nat) (i : Nat) : BitVec n 
goal: BitVec n

full_name: BitVec.instOfNat
code: instance instOfNat : OfNat (BitVec n) i 
goal: OfNat (BitVec n) i

full_name: BitVec.natCastInst
code: instance natCastInst : NatCast (BitVec w) 
goal: NatCast (BitVec w)

full_name: BitVec.toNat
code: /-- Given a bitvector `a`, return the underlying `Nat`. This is O(1) because `BitVec` is a
(zero-cost) wrapper around a `Nat`. -/
protected def toNat (a : BitVec n) : Nat 
goal: Nat

full_name: BitVec.isLt
code: /-- Return the bound in terms of toNat. -/
theorem isLt (x : BitVec w) : x.toNat < 2^w 
goal: x.toNat < 2 ^ w

full_name: BitVec.toNat_lt
code: @[deprecated isLt (since := "2024-03-12")]
theorem toNat_lt (x : BitVec n) : x.toNat < 2^n 
goal: x.toNat < 2 ^ n

full_name: BitVec.ofNat_eq_ofNat
code: /-- Theorem for normalizing the bit vector literal representation. -/
-- TODO: This needs more usage data to assess which direction the simp should go.
@[simp, bv_toNat] theorem ofNat_eq_ofNat : @OfNat.ofNat (BitVec n) i _ = .ofNat n i 
goal: OfNat.ofNat i = BitVec.ofNat n i

full_name: BitVec.natCast_eq_ofNat
code: @[simp] theorem natCast_eq_ofNat (w x : Nat) : @Nat.cast (BitVec w) _ x = .ofNat w x 
goal: ↑x = BitVec.ofNat w x

full_name: BitVec.instSubsingletonOfNatNat
code: /-- All empty bitvectors are equal -/
instance : Subsingleton (BitVec 0) 
goal: Subsingleton (BitVec 0)

full_name: BitVec.nil
code: /-- The empty bitvector -/
abbrev nil : BitVec 0 
goal: BitVec 0

full_name: BitVec.eq_nil
code: /-- Every bitvector of length 0 is equal to `nil`, i.e., there is only one empty bitvector -/
theorem eq_nil (x : BitVec 0) : x = nil 
goal: x = BitVec.nil

full_name: BitVec.zero
code: /-- Return a bitvector `0` of size `n`. This is the bitvector with all zero bits. -/
protected def zero (n : Nat) : BitVec n 
goal: BitVec n

full_name: BitVec.instInhabited
code: instance : Inhabited (BitVec n) 
goal: Inhabited (BitVec n)

full_name: BitVec.allOnes
code: /-- Bit vector of size `n` where all bits are `1`s -/
def allOnes (n : Nat) : BitVec n 
goal: BitVec n

full_name: BitVec.getLsb
code: /-- Return the `i`-th least significant bit or `false` if `i ≥ w`. -/
@[inline] def getLsb (x : BitVec w) (i : Nat) : Bool 
goal: Bool

full_name: BitVec.getMsb
code: /-- Return the `i`-th most significant bit or `false` if `i ≥ w`. -/
@[inline] def getMsb (x : BitVec w) (i : Nat) : Bool 
goal: Bool

full_name: BitVec.msb
code: /-- Return most-significant bit in bitvector. -/
@[inline] protected def msb (a : BitVec n) : Bool 
goal: Bool

full_name: BitVec.toInt
code: /-- Interpret the bitvector as an integer stored in two's complement form. -/
protected def toInt (a : BitVec n) : Int 
goal: Int

full_name: BitVec.ofInt
code: /-- The `BitVec` with value `(2^n + (i mod 2^n)) mod 2^n`.  -/
protected def ofInt (n : Nat) (i : Int) : BitVec n 
goal: BitVec n

full_name: BitVec.instIntCast
code: instance : IntCast (BitVec w) 
goal: IntCast (BitVec w)

full_name: BitVec.«term__#__»
code: /-- Notation for bit vector literals. `i#n` is a shorthand for `BitVec.ofNat n i`. -/
syntax:max num noWs "#" noWs term:max : term
goal: Lean.ParserDescr

full_name: BitVec.«_aux_.lake_packages_lean4_src_lean_Init_Data_BitVec_Basic___macroRules_BitVec_term__#___1»
code: macro_rules | `($i:num#$n) => `(BitVec.ofNat $n $i)
goal: Lean.Macro

full_name: BitVec.unexpandBitVecOfNat
code: /-- Unexpander for bit vector literals. -/
@[app_unexpander BitVec.ofNat] def unexpandBitVecOfNat : Lean.PrettyPrinter.Unexpander
  
goal: Lean.PrettyPrinter.Unexpander

full_name: BitVec.«term__#'__»
code: /-- Notation for bit vector literals without truncation. `i#'lt` is a shorthand for `BitVec.ofNatLt i lt`. -/
scoped syntax:max term:max noWs "#'" noWs term:max : term
goal: Lean.TrailingParserDescr

full_name: BitVec.«_aux_.lake_packages_lean4_src_lean_Init_Data_BitVec_Basic___macroRules_BitVec_term__#'___1»
code: macro_rules | `($i#'$p) => `(BitVec.ofNatLt $i $p)
goal: Lean.Macro

full_name: BitVec.unexpandBitVecOfNatLt
code: /-- Unexpander for bit vector literals without truncation. -/
@[app_unexpander BitVec.ofNatLt] def unexpandBitVecOfNatLt : Lean.PrettyPrinter.Unexpander
  
goal: Lean.PrettyPrinter.Unexpander

full_name: BitVec.toHex
code: /-- Convert bitvector into a fixed-width hex number. -/
protected def toHex {n : Nat} (x : BitVec n) : String 
goal: String

full_name: BitVec.instRepr
code: instance : Repr (BitVec n) 
goal: Repr (BitVec n)

full_name: BitVec.instToString
code: instance : ToString (BitVec n) 
goal: ToString (BitVec n)

full_name: BitVec.add
code: /--
Addition for bit vectors. This can be interpreted as either signed or unsigned addition
modulo `2^n`.

SMT-Lib name: `bvadd`.
-/
protected def add (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instAdd
code: instance : Add (BitVec n) 
goal: Add (BitVec n)

full_name: BitVec.sub
code: /--
Subtraction for bit vectors. This can be interpreted as either signed or unsigned subtraction
modulo `2^n`.
-/
protected def sub (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instSub
code: instance : Sub (BitVec n) 
goal: Sub (BitVec n)

full_name: BitVec.neg
code: /--
Negation for bit vectors. This can be interpreted as either signed or unsigned negation
modulo `2^n`.

SMT-Lib name: `bvneg`.
-/
protected def neg (x : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instNeg
code: instance : Neg (BitVec n) 
goal: Neg (BitVec n)

full_name: BitVec.abs
code: /--
Return the absolute value of a signed bitvector.
-/
protected def abs (s : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.mul
code: /--
Multiplication for bit vectors. This can be interpreted as either signed or unsigned negation
modulo `2^n`.

SMT-Lib name: `bvmul`.
-/
protected def mul (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instMul
code: instance : Mul (BitVec n) 
goal: Mul (BitVec n)

full_name: BitVec.udiv
code: /--
Unsigned division for bit vectors using the Lean convention where division by zero returns zero.
-/
def udiv (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instDiv
code: instance : Div (BitVec n) 
goal: Div (BitVec n)

full_name: BitVec.umod
code: /--
Unsigned modulo for bit vectors.

SMT-Lib name: `bvurem`.
-/
def umod (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instMod
code: instance : Mod (BitVec n) 
goal: Mod (BitVec n)

full_name: BitVec.smtUDiv
code: /--
Unsigned division for bit vectors using the
[SMT-Lib convention](http://smtlib.cs.uiowa.edu/theories-FixedSizeBitVectors.shtml)
where division by zero returns the `allOnes` bitvector.

SMT-Lib name: `bvudiv`.
-/
def smtUDiv (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.sdiv
code: /--
Signed t-division for bit vectors using the Lean convention where division
by zero returns zero.

```lean
sdiv 7#4 2 = 3#4
sdiv (-9#4) 2 = -4#4
sdiv 5#4 -2 = -2#4
sdiv (-7#4) (-2) = 3#4
```
-/
def sdiv (s t : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.smtSDiv
code: /--
Signed division for bit vectors using SMTLIB rules for division by zero.

Specifically, `smtSDiv x 0 = if x >= 0 then -1 else 1`

SMT-Lib name: `bvsdiv`.
-/
def smtSDiv (s t : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.srem
code: /--
Remainder for signed division rounding to zero.

SMT_Lib name: `bvsrem`.
-/
def srem (s t : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.smod
code: /--
Remainder for signed division rounded to negative infinity.

SMT_Lib name: `bvsmod`.
-/
def smod (s t : BitVec m) : BitVec m 
goal: BitVec m

full_name: BitVec.ofBool
code: /-- Turn a `Bool` into a bitvector of length `1` -/
def ofBool (b : Bool) : BitVec 1 
goal: BitVec 1

full_name: BitVec.ofBool_false
code: @[simp] theorem ofBool_false : ofBool false = 0 
goal: BitVec.ofBool false = 0

full_name: BitVec.ofBool_true
code: @[simp] theorem ofBool_true  : ofBool true  = 1 
goal: BitVec.ofBool true = 1

full_name: BitVec.fill
code: /-- Fills a bitvector with `w` copies of the bit `b`. -/
def fill (w : Nat) (b : Bool) : BitVec w 
goal: BitVec w

full_name: BitVec.ult
code: /--
Unsigned less-than for bit vectors.

SMT-Lib name: `bvult`.
-/
protected def ult (x y : BitVec n) : Bool 
goal: Bool

full_name: BitVec.instLT
code: instance : LT (BitVec n) 
goal: LT (BitVec n)

full_name: BitVec.instDecidableLt
code: instance (x y : BitVec n) : Decidable (x < y) 
goal: Decidable (x < y)

full_name: BitVec.ule
code: /--
Unsigned less-than-or-equal-to for bit vectors.

SMT-Lib name: `bvule`.
-/
protected def ule (x y : BitVec n) : Bool 
goal: Bool

full_name: BitVec.instLE
code: instance : LE (BitVec n) 
goal: LE (BitVec n)

full_name: BitVec.instDecidableLe
code: instance (x y : BitVec n) : Decidable (x ≤ y) 
goal: Decidable (x ≤ y)

full_name: BitVec.slt
code: /--
Signed less-than for bit vectors.

```lean
BitVec.slt 6#4 7 = true
BitVec.slt 7#4 8 = false
```
SMT-Lib name: `bvslt`.
-/
protected def slt (x y : BitVec n) : Bool 
goal: Bool

full_name: BitVec.sle
code: /--
Signed less-than-or-equal-to for bit vectors.

SMT-Lib name: `bvsle`.
-/
protected def sle (x y : BitVec n) : Bool 
goal: Bool

full_name: BitVec.cast
code: /-- `cast eq i` embeds `i` into an equal `BitVec` type. -/
@[inline] def cast (eq : n = m) (i : BitVec n) : BitVec m 
goal: BitVec m

full_name: BitVec.cast_ofNat
code: @[simp] theorem cast_ofNat {n m : Nat} (h : n = m) (x : Nat) :
    cast h (BitVec.ofNat n x) = BitVec.ofNat m x 
goal: BitVec.cast h (BitVec.ofNat n x) = BitVec.ofNat m x

full_name: BitVec.cast_cast
code: @[simp] theorem cast_cast {n m k : Nat} (h₁ : n = m) (h₂ : m = k) (x : BitVec n) :
    cast h₂ (cast h₁ x) = cast (h₁ ▸ h₂) x 
goal: BitVec.cast h₂ (BitVec.cast h₁ x) = BitVec.cast ⋯ x

full_name: BitVec.cast_eq
code: @[simp] theorem cast_eq {n : Nat} (h : n = n) (x : BitVec n) : cast h x = x 
goal: BitVec.cast h x = x

full_name: BitVec.extractLsb'
code: /--
Extraction of bits `start` to `start + len - 1` from a bit vector of size `n` to yield a
new bitvector of size `len`. If `start + len > n`, then the vector will be zero-padded in the
high bits.
-/
def extractLsb' (start len : Nat) (a : BitVec n) : BitVec len 
goal: BitVec len

full_name: BitVec.extractLsb
code: /--
Extraction of bits `hi` (inclusive) down to `lo` (inclusive) from a bit vector of size `n` to
yield a new bitvector of size `hi - lo + 1`.

SMT-Lib name: `extract`.
-/
def extractLsb (hi lo : Nat) (a : BitVec n) : BitVec (hi - lo + 1) 
goal: BitVec (hi - lo + 1)

full_name: BitVec.zeroExtend'
code: /--
A version of `zeroExtend` that requires a proof, but is a noop.
-/
def zeroExtend' {n w : Nat} (le : n ≤ w) (x : BitVec n)  : BitVec w 
goal: BitVec w

full_name: BitVec.shiftLeftZeroExtend
code: /--
`shiftLeftZeroExtend x n` returns `zeroExtend (w+n) x <<< n` without
needing to compute `x % 2^(2+n)`.
-/
def shiftLeftZeroExtend (msbs : BitVec w) (m : Nat) : BitVec (w+m) 
goal: BitVec (w + m)

full_name: BitVec.zeroExtend
code: /--
Zero extend vector `x` of length `w` by adding zeros in the high bits until it has length `v`.
If `v < w` then it truncates the high bits instead.

SMT-Lib name: `zero_extend`.
-/
def zeroExtend (v : Nat) (x : BitVec w) : BitVec v 
goal: BitVec v

full_name: BitVec.truncate
code: /--
Truncate the high bits of bitvector `x` of length `w`, resulting in a vector of length `v`.
If `v > w` then it zero-extends the vector instead.
-/
abbrev truncate 
goal: BitVec v

full_name: BitVec.signExtend
code: /--
Sign extend a vector of length `w`, extending with `i` additional copies of the most significant
bit in `x`. If `x` is an empty vector, then the sign is treated as zero.

SMT-Lib name: `sign_extend`.
-/
def signExtend (v : Nat) (x : BitVec w) : BitVec v 
goal: BitVec v

full_name: BitVec.and
code: /--
Bitwise AND for bit vectors.

```lean
0b1010#4 &&& 0b0110#4 = 0b0010#4
```

SMT-Lib name: `bvand`.
-/
protected def and (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instAndOp
code: instance : AndOp (BitVec w) 
goal: AndOp (BitVec w)

full_name: BitVec.or
code: /--
Bitwise OR for bit vectors.

```lean
0b1010#4 ||| 0b0110#4 = 0b1110#4
```

SMT-Lib name: `bvor`.
-/
protected def or (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instOrOp
code: instance : OrOp (BitVec w) 
goal: OrOp (BitVec w)

full_name: BitVec.xor
code: /--
 Bitwise XOR for bit vectors.

```lean
0b1010#4 ^^^ 0b0110#4 = 0b1100#4
```

SMT-Lib name: `bvxor`.
-/
protected def xor (x y : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instXor
code: instance : Xor (BitVec w) 
goal: Xor (BitVec w)

full_name: BitVec.not
code: /--
Bitwise NOT for bit vectors.

```lean
~~~(0b0101#4) == 0b1010
```
SMT-Lib name: `bvnot`.
-/
protected def not (x : BitVec n) : BitVec n 
goal: BitVec n

full_name: BitVec.instComplement
code: instance : Complement (BitVec w) 
goal: Complement (BitVec w)

full_name: BitVec.shiftLeft
code: /--
Left shift for bit vectors. The low bits are filled with zeros. As a numeric operation, this is
equivalent to `a * 2^s`, modulo `2^n`.

SMT-Lib name: `bvshl` except this operator uses a `Nat` shift value.
-/
protected def shiftLeft (a : BitVec n) (s : Nat) : BitVec n 
goal: BitVec n

full_name: BitVec.instHShiftLeftNat
code: instance : HShiftLeft (BitVec w) Nat (BitVec w) 
goal: HShiftLeft (BitVec w) Nat (BitVec w)

full_name: BitVec.ushiftRight
code: /--
(Logical) right shift for bit vectors. The high bits are filled with zeros.
As a numeric operation, this is equivalent to `a / 2^s`, rounding down.

SMT-Lib name: `bvlshr` except this operator uses a `Nat` shift value.
-/
def ushiftRight (a : BitVec n) (s : Nat) : BitVec n 
goal: BitVec n

full_name: BitVec.instHShiftRightNat
code: instance : HShiftRight (BitVec w) Nat (BitVec w) 
goal: HShiftRight (BitVec w) Nat (BitVec w)

full_name: BitVec.sshiftRight
code: /--
Arithmetic right shift for bit vectors. The high bits are filled with the
most-significant bit.
As a numeric operation, this is equivalent to `a.toInt >>> s`.

SMT-Lib name: `bvashr` except this operator uses a `Nat` shift value.
-/
def sshiftRight (a : BitVec n) (s : Nat) : BitVec n 
goal: BitVec n

full_name: BitVec.instHShiftLeft
code: instance {n} : HShiftLeft  (BitVec m) (BitVec n) (BitVec m) 
goal: HShiftLeft (BitVec m) (BitVec n) (BitVec m)

full_name: BitVec.instHShiftRight
code: instance {n} : HShiftRight (BitVec m) (BitVec n) (BitVec m) 
goal: HShiftRight (BitVec m) (BitVec n) (BitVec m)

full_name: BitVec.rotateLeftAux
code: /-- Auxiliary function for `rotateLeft`, which does not take into account the case where
the rotation amount is greater than the bitvector width. -/
def rotateLeftAux (x : BitVec w) (n : Nat) : BitVec w 
goal: BitVec w

full_name: BitVec.rotateLeft
code: /--
Rotate left for bit vectors. All the bits of `x` are shifted to higher positions, with the top `n`
bits wrapping around to fill the low bits.

```lean
rotateLeft  0b0011#4 3 = 0b1001
```
SMT-Lib name: `rotate_left` except this operator uses a `Nat` shift amount.
-/
def rotateLeft (x : BitVec w) (n : Nat) : BitVec w 
goal: BitVec w

full_name: BitVec.rotateRightAux
code: /--
Auxiliary function for `rotateRight`, which does not take into account the case where
the rotation amount is greater than the bitvector width.
-/
def rotateRightAux (x : BitVec w) (n : Nat) : BitVec w 
goal: BitVec w

full_name: BitVec.rotateRight
code: /--
Rotate right for bit vectors. All the bits of `x` are shifted to lower positions, with the
bottom `n` bits wrapping around to fill the high bits.

```lean
rotateRight 0b01001#5 1 = 0b10100
```
SMT-Lib name: `rotate_right` except this operator uses a `Nat` shift amount.
-/
def rotateRight (x : BitVec w) (n : Nat) : BitVec w 
goal: BitVec w

full_name: BitVec.append
code: /--
Concatenation of bitvectors. This uses the "big endian" convention that the more significant
input is on the left, so `0xAB#8 ++ 0xCD#8 = 0xABCD#16`.

SMT-Lib name: `concat`.
-/
def append (msbs : BitVec n) (lsbs : BitVec m) : BitVec (n+m) 
goal: BitVec (n + m)

full_name: BitVec.instHAppendHAddNat
code: instance : HAppend (BitVec w) (BitVec v) (BitVec (w + v)) 
goal: HAppend (BitVec w) (BitVec v) (BitVec (w + v))

full_name: BitVec.replicate
code: /-- `replicate i x` concatenates `i` copies of `x` into a new vector of length `w*i`. -/
def replicate : (i : Nat) → BitVec w → BitVec (w*i)
  
goal: BitVec w → BitVec (w * i)

full_name: BitVec.concat
code: /-- Append a single bit to the end of a bitvector, using big endian order (see `append`).
    That is, the new bit is the least significant bit. -/
def concat {n} (msbs : BitVec n) (lsb : Bool) : BitVec (n+1) 
goal: BitVec (n + 1)

full_name: BitVec.cons
code: /-- Prepend a single bit to the front of a bitvector, using big endian order (see `append`).
    That is, the new bit is the most significant bit. -/
def cons {n} (msb : Bool) (lsbs : BitVec n) : BitVec (n+1) 
goal: BitVec (n + 1)

full_name: BitVec.append_ofBool
code: theorem append_ofBool (msbs : BitVec w) (lsb : Bool) :
    msbs ++ ofBool lsb = concat msbs lsb 
goal: msbs ++ BitVec.ofBool lsb = msbs.concat lsb

full_name: BitVec.ofBool_append
code: theorem ofBool_append (msb : Bool) (lsbs : BitVec w) :
    ofBool msb ++ lsbs = (cons msb lsbs).cast (Nat.add_comm ..) 
goal: BitVec.ofBool msb ++ lsbs = BitVec.cast ⋯ (BitVec.cons msb lsbs)

full_name: BitVec.twoPow
code: /--
`twoPow w i` is the bitvector `2^i` if `i < w`, and `0` otherwise.
That is, 2 to the power `i`.
For the bitwise point of view, it has the `i`th bit as `1` and all other bits as `0`.
-/
def twoPow (w : Nat) (i : Nat) : BitVec w 
goal: BitVec w

full_name: BitVec.append_eq
code: @[simp] theorem append_eq (x : BitVec w) (y : BitVec v)   : BitVec.append x y = x ++ y        
goal: x.append y = x ++ y

full_name: BitVec.shiftLeft_eq
code: @[simp] theorem shiftLeft_eq (x : BitVec w) (n : Nat)     : BitVec.shiftLeft x n = x <<< n    
goal: x.shiftLeft n = x <<< n

full_name: BitVec.ushiftRight_eq
code: @[simp] theorem ushiftRight_eq (x : BitVec w) (n : Nat)   : BitVec.ushiftRight x n = x >>> n  
goal: x.ushiftRight n = x >>> n

full_name: BitVec.not_eq
code: @[simp] theorem not_eq (x : BitVec w)                     : BitVec.not x = ~~~x               
goal: x.not = ~~~x

full_name: BitVec.and_eq
code: @[simp] theorem and_eq (x y : BitVec w)                   : BitVec.and x y = x &&& y          
goal: x.and y = x &&& y

full_name: BitVec.or_eq
code: @[simp] theorem or_eq (x y : BitVec w)                    : BitVec.or x y = x ||| y           
goal: x.or y = x ||| y

full_name: BitVec.xor_eq
code: @[simp] theorem xor_eq (x y : BitVec w)                   : BitVec.xor x y = x ^^^ y          
goal: x.xor y = x ^^^ y

full_name: BitVec.neg_eq
code: @[simp] theorem neg_eq (x : BitVec w)                     : BitVec.neg x = -x                 
goal: x.neg = -x

full_name: BitVec.add_eq
code: @[simp] theorem add_eq (x y : BitVec w)                   : BitVec.add x y = x + y            
goal: x.add y = x + y

full_name: BitVec.sub_eq
code: @[simp] theorem sub_eq (x y : BitVec w)                   : BitVec.sub x y = x - y            
goal: x.sub y = x - y

full_name: BitVec.mul_eq
code: @[simp] theorem mul_eq (x y : BitVec w)                   : BitVec.mul x y = x * y            
goal: x.mul y = x * y

full_name: BitVec.zero_eq
code: @[simp] theorem zero_eq                                   : BitVec.zero n = 0#n               
goal: BitVec.zero n = 0#n

full_name: BitVec.ofBoolListBE
code: /-- Converts a list of `Bool`s to a big-endian `BitVec`. -/
def ofBoolListBE : (bs : List Bool) → BitVec bs.length

goal: BitVec bs.length

full_name: BitVec.ofBoolListLE
code: /-- Converts a list of `Bool`s to a little-endian `BitVec`. -/
def ofBoolListLE : (bs : List Bool) → BitVec bs.length

goal: BitVec bs.length