English
There exist integers a and b such that gcd x y = x·a + y·b (the extended gcd).
Русский
Существуют целые a и b такие, что gcd(x,y) = x·a + y·b (расширенный НОД).
LaTeX
$$$$\\gcd(x,y) = x \\cdot \\gcdA(x,y) + y \\cdot \\gcdB(x,y).$$$$
Lean4
/-- The extended GCD `a` value in the equation `gcd x y = x * a + y * b`. -/
def gcdA : ℤ → ℤ → ℤ
| ofNat m, n => m.gcdA n.natAbs
| -[m+1], n => -m.succ.gcdA n.natAbs