def le_one

bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/poly1305/arith.bend:110

import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/poly1305/arith.bend as Arith
import Base
import bend-collections-laws-crypto@1.0.0.0/spec/lib/common.bend as C
import bend-collections-laws-crypto@1.0.0.0/proofs/lib/nat.bend as N
import bend-collections-laws-crypto@1.0.0.0/proofs/math/typed/width.bend as WW

110# x fits k bits: x <= 2^k (with 2^k written C.shift(k, one), one = 1)
111def le_one(+k: Nat, +one: Nat, +h1: {one == 1n : Nat}, +x: Nat, +h: {C.fits(k, x) == True{} : Bool}) -> {Nat.is_le(x, C.shift(k, one)) == True{} : Bool}:
112  N.lt_le(x, C.shift(k, one), WW.lt_one(k, one, h1, x, h))

Uses (7)

Used by (1)