Bezout's Identity
Statement
For any integers and , there exist integers and such that:
These are called Bezout coefficients. The gcd is the smallest positive integer expressible as such a combination, and every integer linear combination of and is a multiple of .
In particular, and are coprime (i.e. ) if and only if there exist integers with .
Visualization
Extended Euclidean algorithm for :
| Step | Equation | ||
|---|---|---|---|
| 1 | |||
| 2 | |||
| Back-sub: |
Check: . ✓
Lattice of multiples for :
Multiples of 6: ..., -12, -6, 0, 6, 12, 18, 24, 30, ...
Multiples of 9: ..., -18, -9, 0, 9, 18, 27, 36, ...
Combinations: ..., -3, 0, 3, 6, 9, 12, 15, ...
↑ smallest positive = gcd(6,9) = 3
Coefficients: (and also , etc.)
Proof Sketch
-
Existence via the algorithm. The Euclidean AlgorithmEuclidean AlgorithmThe oldest surviving algorithm, computing the greatest common divisor via iterated remaindersRead more → maintains coefficients such that the current remainder equals . Initialising with for and for , each step updates by integer row operations. The final nonzero remainder is .
-
Minimality. Let be the smallest positive integer linear combination of and . Then and (divide with remainder and use minimality), so . But is a linear combination, so . Thus .
-
All combinations are multiples. If then and implies .
Connections
Bezout's Identity gives the bridge from the Euclidean AlgorithmEuclidean AlgorithmThe oldest surviving algorithm, computing the greatest common divisor via iterated remaindersRead more → to modular arithmetic. It directly implies that in every nonzero element has a multiplicative inverse (feeding into Fermat's Little TheoremFermat's Little TheoremFor prime p, a^p is congruent to a mod pRead more →). It is also the key lemma in proving the Chinese Remainder TheoremChinese Remainder TheoremSimultaneous congruences with coprime moduli have a unique solution mod their productRead more → (constructing the simultaneous solution) and Euler's Totient FunctionEuler's Totient Functionφ(n) counts integers up to n coprime to n, and governs modular exponentiationRead more → (characterising units).
Lean4 Proof
/-- **Bezout's identity**: the gcd is an integer linear combination of the two inputs.
Mathlib provides the Bezout coefficients `Int.gcdA` and `Int.gcdB` and
proves the identity as `Int.gcd_eq_gcd_ab`. -/
theorem bezout (a b : ℕ) :
∃ x y : ℤ, (Nat.gcd a b : ℤ) = a * x + b * y :=
⟨Int.gcdA a b, Int.gcdB a b, (Int.gcd_eq_gcd_ab a b).symm⟩Referenced by
- RSA CorrectnessCryptography
- Digital Signature (Schnorr)Cryptography
- Chinese Remainder TheoremNumber Theory
- Chinese Remainder TheoremNumber Theory
- Euclidean AlgorithmNumber Theory
- Euler's Totient FunctionNumber Theory
- Euler's Totient FunctionNumber Theory