Definitions and properties of gcd
, lcm
, and coprime
#
gcd
#
lcm
#
coprime
#
See also nat.coprime_of_dvd
and nat.coprime_of_dvd'
to prove nat.coprime m n
.
@[protected, instance]
Equations
- nat.coprime.decidable m n = _.mpr (nat.decidable_eq (m.gcd n) 1)
See is_coprime.prod_left
for the corresponding lemma about is_coprime
See is_coprime.prod_right
for the corresponding lemma about is_coprime
Represent a divisor of m * n
as a product of a divisor of m
and a divisor of n
.
Equations
- nat.prod_dvd_and_dvd_of_dvd_prod H = (λ (_x : ℕ) (h0 : k.gcd m = _x), _x.cases_on (λ (h0 : k.gcd m = 0), eq.rec (λ (H : 0 ∣ m * n) (h0 : 0.gcd m = 0), eq.rec (λ (H : 0 ∣ 0 * n) (h0 : 0.gcd 0 = 0), ⟨(⟨0, nat.prod_dvd_and_dvd_of_dvd_prod._proof_1⟩, ⟨n, _⟩), _⟩) _ H h0) _ H h0) (λ (n_1 : ℕ) (h0 : k.gcd m = n_1.succ), (λ (h0 : k.gcd m = n_1.succ), ⟨(⟨k.gcd m, _⟩, ⟨k / k.gcd m, _⟩), _⟩) h0) h0) (k.gcd m) nat.prod_dvd_and_dvd_of_dvd_prod._proof_7