def pm_rem

bend-collections-laws-math@1.0.0.0 · proofs/math/typed/u32int.bend:457

import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32int.bend as U32int
import Base
import bend-collections-laws-math@1.0.0.0/src/math/num.bend as NM
import bend-collections-laws-math@1.0.0.0/src/math/instances.bend as I
import bend-collections-laws-math@1.0.0.0/proofs/math/typed/u32laws.bend as LW

457def pm_rem(+x: U32, +m: U32, +mp: Nat, +hm: {v(m) == 1n+mp : Nat}) -> {v(I.u32_op(NM.Rem{x, m})) == Nat.mod(v(x), 1n+mp) : Nat}:
458  +hq = Equal.trans(Bool, Nat.is_eq(v(m), 0n), Nat.is_eq(1n+mp, 0n), False{}, Equal.cong(Nat, Bool, t => Nat.is_eq(t, 0n), v(m), 1n+mp, hm), {==})
459  Equal.trans(Nat, v(I.u32_op(NM.Rem{x, m})), Nat.mod(v(x), v(m)), Nat.mod(v(x), 1n+mp), LW.ops_rem(x, m, hq), Equal.cong(Nat, Nat, t => Nat.mod(v(x), t), v(m), 1n+mp, hm))

Uses (11)

Used by (4)