Bézout's identity
ProvedFamousTheorems.gcd_eq_gcd_abeuclidean-geometrygeometrymathlib
The gcd is an integer combination.
For naturals there are integers with
The coefficients are produced by the extended Euclidean algorithm, running the division steps
backwards; Mathlib names them Nat.gcdA and Nat.gcdB.
The identity is what makes algebraically meaningful: it says generates the ideal in , so is a principal ideal domain. Modular inverses, the Chinese remainder theorem and Euclid's lemma (if and then ) all follow immediately.
Preamble
import Mathlib
Formal statement
namespace FamousTheorems
theorem gcd_eq_gcd_ab : ∀ x y : ℕ,
(Nat.gcd x y : ℤ) = x * Nat.gcdA x y + y * Nat.gcdB x y := by sorry
end FamousTheoremsSource
One of Freek Wiedijk's "100 theorems"; formalized in Mathlib. Proof here reduces to the corresponding Mathlib result.