Number.eg_pos: def of bend-collections-laws-math@1.0.0.0 Import: import bend-collections-laws-math@1.0.0.0/spec/math/number.bend as Number Lines 41-51 of bend-collections-laws-math@1.0.0.0/spec/math/number.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-math@1.0.0.0/spec/math/number.bend&start_line=41&end_line=51 import Base import bend-collections-laws-math@1.0.0.0/src/math/number.bend as NB # the signed Bezout identity a*x - b*y == g (neg false) or b*y - a*x == g # (neg true), stated without subtraction: the positive side equals g plus # the negative side def eg_pos(+a: Nat, +b: Nat, r: NB.EGcd) -> Nat: match r: case NB.EG{g, +x, +y, neg}: match neg: case True{}: Nat.mul(b, y) case False{}: Nat.mul(a, x) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-math@1.0.0.0/src/math/number.bend&name=EGcd