law pack_byte

lawful-words@0.1.0.0 · proof_bytes.bend:1170

import lawful-words@0.1.0.0/proof_bytes.bend as ProofBytes
import Base
import lawful-words@0.1.0.0/defs.bend as D

1170# Bit k (k < 8) of byte j (j < 4) of a packed word is bit k of the j-th value.
1171law pack_byte:
1172  for +b0: U32
1173  for +b1: U32
1174  for +b2: U32
1175  for +b3: U32
1176  for +j: Nat
1177  for +k: Nat
1178  for +h0: {Nat.is_lt(U32.to_nat(b0), Nat.pow(2n, 8n)) == True{} : Bool}
1179  for +h1: {Nat.is_lt(U32.to_nat(b1), Nat.pow(2n, 8n)) == True{} : Bool}
1180  for +h2: {Nat.is_lt(U32.to_nat(b2), Nat.pow(2n, 8n)) == True{} : Bool}
1181  for +h3: {Nat.is_lt(U32.to_nat(b3), Nat.pow(2n, 8n)) == True{} : Bool}
1182  for +hj: {Nat.is_lt(j, 4n) == True{} : Bool}
1183  for +hk: {Nat.is_lt(k, 8n) == True{} : Bool}
1184  {D.bit(D.pack4(b0, b1, b2, b3), Nat.add(Nat.mul(8n, j), k)) == D.bit(D.nth4(j, b0, b1, b2, b3), k) : Bool}

Uses (22)

Used by (2)