law word_sub_wrap_sym
import bend-mathlib@0.8.1.0/u32.bend as U32import Base
1090# Word subtraction wraps modulo 2^n: to_nat (sub a b) = (a + (2^n - b)) % 2^n, reversed to rewrite toward the simple side.
1091law word_sub_wrap_sym:
1092 for n: Nat
1093 for a: Word(n)
1094 for b: Word(n)
1095 {Nat.mod(Nat.add(Word.to_nat(n, a), Nat.sub(Nat.pow(2n, n), Word.to_nat(n, b))), Nat.pow(2n, n)) == Word.to_nat(n, Word.sub(n, a, b)) : Nat}
Uses (10)
Used by (0)
No other definition uses this definition.