law u32_sub_wrap_sym

bend-mathlib@0.8.1.0 · u32.bend:1192

import bend-mathlib@0.8.1.0/u32.bend as U32
import Base

1192# U32 subtraction wraps modulo 2^32: to_nat (a - b) = (a + (2^32 - b)) % 2^32, reversed to rewrite toward the simple side.
1193law u32_sub_wrap_sym:
1194  for a: U32
1195  for b: U32
1196  {Nat.mod(Nat.add(U32.to_nat(a), Nat.sub(Nat.pow(2n, 32n), U32.to_nat(b))), Nat.pow(2n, 32n)) == U32.to_nat(U32.sub(a, b)) : Nat}

Uses (10)

Used by (0)

No other definition uses this definition.