Extended GCD and divisibility over ℤ #
Main definitions #
- Given
x y : ℕ,xgcd x ycomputes the pair of integers(a, b)such thatgcd x y = x * a + y * b.gcdA x yandgcdB x yare defined to beaandb, respectively.
Main statements #
gcd_eq_gcd_ab: Bézout's lemma, givenx y : ℕ,gcd x y = x * gcdA x y + y * gcdB x y.
Tags #
Bézout's lemma, Bezout's lemma
Extended Euclidean algorithm #
Helper function for the extended GCD algorithm (Nat.xgcd).
Instances For
Use the extended GCD algorithm to generate the a and b values
satisfying gcd x y = x * a + y * b.
Instances For
The extended GCD a value in the equation gcd x y = x * a + y * b.
Instances For
The extended GCD b value in the equation gcd x y = x * a + y * b.
Instances For
Bézout's lemma: given x y : ℕ, gcd x y = x * a + y * b, where a = gcd_a x y and
b = gcd_b x y are computed by the extended Euclidean algorithm.
Alias of Nat.exists_mul_mod_eq_gcd.
Alias of Nat.exists_mul_mod_eq_one_of_coprime.
Divisibility over ℤ #
The extended GCD a value in the equation gcd x y = x * a + y * b.
Instances For
The extended GCD b value in the equation gcd x y = x * a + y * b.
Instances For
Bézout's lemma
Alias of Int.gcd_ediv.
Alias of Int.gcd_ediv_gcd_ediv_gcd.
If gcd a (m * n) = 1, then gcd a m = 1.
If gcd a (m * n) = 1, then gcd a n = 1.
Euclid's lemma: if a ∣ b * c and gcd a c = 1 then a ∣ b.
Compare with IsCoprime.dvd_of_dvd_mul_left and
UniqueFactorizationMonoid.dvd_of_dvd_mul_left_of_no_prime_factors
Euclid's lemma: if a ∣ b * c and gcd a b = 1 then a ∣ c.
Compare with IsCoprime.dvd_of_dvd_mul_right and
UniqueFactorizationMonoid.dvd_of_dvd_mul_right_of_no_prime_factors
For nonzero integers a and b, gcd a b is the smallest positive natural number that can be
written in the form a * x + b * y for some pair of integers x and y