def lcm_dw

bend-collections-laws-crypto@1.0.0.0 · proofs/math/natural/lcm.bend:191

import bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/lcm.bend as Lcm
import Base
import bend-collections-laws-crypto@1.0.0.0/proofs/math/natural/gcd.bend as G

191# the quotient m / lcm(a, b) for a common multiple m == x a == y b
192def lcm_dw(+a: Nat, +b: Nat, +m: Nat, +x: Nat, +y: Nat) -> Nat:
193  match a b:
194    case 0n _:
195      0n
196    case 1n+ap 0n:
197      0n
198    case 1n+ +ap 1n+ +bp:
199      G.dw(Nat.mul(m, 1n+bp), Nat.mul(m, 1n+ap), Nat.mul(m, 1n+bp), y, x)

Uses (3)

Used by (5)