law word_sub_exact_sym
import bend-mathlib@0.8.1.0/u32.bend as U32import Base
import bend-mathlib@0.8.1.0/nat.bend as MNat
1079# Word subtraction is exact without underflow: b <= a implies to_nat (sub a b) = a - b, reversed to rewrite toward the simple side.
1080law word_sub_exact_sym:
1081 for n: Nat
1082 for a: Word(n)
1083 for b: Word(n)
1084 for h: MNat.le(Word.to_nat(n, b), Word.to_nat(n, a))
1085 {Nat.sub(Word.to_nat(n, a), Word.to_nat(n, b)) == Word.to_nat(n, Word.sub(n, a, b)) : Nat}
Uses (8)
Used by (0)
No other definition uses this definition.