law u32_inc_exact

bend-mathlib@0.8.1.0 · u32.bend:668

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

668# U32 increment is exact without overflow: 1 + a < 2^32 implies to_nat (inc a) = 1 + a.
669law u32_inc_exact:
670  for a: U32
671  for h: MNat.lt(1n+U32.to_nat(a), Nat.pow(2n, 32n))
672  {U32.to_nat(U32.inc(a)) == 1n+U32.to_nat(a) : Nat}

Uses (7)

Used by (1)