law word_sub_exact

bend-mathlib@0.8.1.0 · u32.bend:450

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

450# Word subtraction is exact without underflow: b <= a implies to_nat (sub a b) = a - b.
451law word_sub_exact:
452  for n: Nat
453  for a: Word(n)
454  for b: Word(n)
455  for h: MNat.le(Word.to_nat(n, b), Word.to_nat(n, a))
456  {Word.to_nat(n, Word.sub(n, a, b)) == Nat.sub(Word.to_nat(n, a), Word.to_nat(n, b)) : Nat}

Uses (23)

Used by (2)