def fv_mul

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

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/spec/lib/common.bend as C
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

962def fv_mul(+a: U32, +x: U32, +n: Nat, +hn: {Nat.mul(v(a), v(x)) == n : Nat}, +c: Bool, +hc: {C.fits(32n, n) == c : Bool}) -> {fv(Bool.not(I.u32_is(NM.MulOver{a, x})), v(I.u32_op(NM.Mul{a, x})), n) == n : Nat}:
963  match c:
964    case True{}:
965      +hmo = mo_of(a, x, n, hn, True{}, hc)
966      %Equal.sym(Bool, I.u32_is(NM.MulOver{a, x}), False{}, hmo) : {fv(Bool.not(_), v(I.u32_op(NM.Mul{a, x})), n) == n : Nat}
967      Equal.trans(Nat, v(I.u32_op(NM.Mul{a, x})), Nat.mul(v(a), v(x)), n, LW.ops_mul(a, x, hmo), hn)
968    case False{}:
969      %Equal.sym(Bool, I.u32_is(NM.MulOver{a, x}), True{}, mo_of(a, x, n, hn, False{}, hc)) : {fv(Bool.not(_), v(I.u32_op(NM.Mul{a, x})), n) == n : Nat}
970      {==}

Uses (16)

Used by (3)