# Definitions and properties of `coprime` #

### `coprime` #

source
@[reducible]
def Nat.Coprime (m n : Nat) :
Prop

`m` and `n` are coprime, or relatively prime, if their `gcd` is 1.

Equations

- m.Coprime n = (m.gcd n = 1)

Instances For

source
@[inline]
instance Nat.instDecidableCoprime (m n : Nat) :
Decidable (m.Coprime n)
Equations

- m.instDecidableCoprime n = inferInstanceAs (Decidable (m.gcd n = 1))

source
theorem Nat.coprime_iff_gcd_eq_one {m n : Nat} :
m.Coprime n ↔ m.gcd n = 1
source
theorem Nat.Coprime.gcd_eq_one {m n : Nat} :
m.Coprime n → m.gcd n = 1
source
theorem Nat.Coprime.symm {n m : Nat} :
n.Coprime m → m.Coprime n
source
theorem Nat.coprime_comm {n m : Nat} :
n.Coprime m ↔ m.Coprime n
source
theorem Nat.Coprime.dvd_of_dvd_mul_right {k n m : Nat} (H1 : k.Coprime n) (H2 : k ∣ m * n) :
k ∣ m
source
theorem Nat.Coprime.dvd_of_dvd_mul_left {k m n : Nat} (H1 : k.Coprime m) (H2 : k ∣ m * n) :
k ∣ n
source
theorem Nat.Coprime.gcd_mul_left_cancel {k n : Nat} (m : Nat) (H : k.Coprime n) :
(k * m).gcd n = m.gcd n
source
theorem Nat.Coprime.gcd_mul_right_cancel {k n : Nat} (m : Nat) (H : k.Coprime n) :
(m * k).gcd n = m.gcd n
source
theorem Nat.Coprime.gcd_mul_left_cancel_right {k m : Nat} (n : Nat) (H : k.Coprime m) :
m.gcd (k * n) = m.gcd n
source
theorem Nat.Coprime.gcd_mul_right_cancel_right {k m : Nat} (n : Nat) (H : k.Coprime m) :
m.gcd (n * k) = m.gcd n
source
theorem Nat.coprime_div_gcd_div_gcd {m n : Nat} (H : 0 < m.gcd n) :
(m / m.gcd n).Coprime (n / m.gcd n)
source
theorem Nat.not_coprime_of_dvd_of_dvd {d m n : Nat} (dgt1 : 1 < d) (Hm : d ∣ m) (Hn : d ∣ n) :
¬m.Coprime n
source
theorem Nat.exists_coprime (m n : Nat) :
∃ (m' : Nat), ∃ (n' : Nat), m'.Coprime n' ∧ m = m' * m.gcd n ∧ n = n' * m.gcd n
source
theorem Nat.exists_coprime' {m n : Nat} (H : 0 < m.gcd n) :
∃ (g : Nat), ∃ (m' : Nat), ∃ (n' : Nat), 0 < g ∧ m'.Coprime n' ∧ m = m' * g ∧ n = n' * g
source
theorem Nat.Coprime.mul_left {m k n : Nat} (H1 : m.Coprime k) (H2 : n.Coprime k) :
(m * n).Coprime k
source
theorem Nat.Coprime.mul_right {k m n : Nat} (H1 : k.Coprime m) (H2 : k.Coprime n) :
k.Coprime (m * n)
source
theorem Nat.Coprime.coprime_dvd_left {m k n : Nat} (H1 : m ∣ k) (H2 : k.Coprime n) :
m.Coprime n
source
theorem Nat.Coprime.coprime_dvd_right {n m k : Nat} (H1 : n ∣ m) (H2 : k.Coprime m) :
k.Coprime n
source
theorem Nat.Coprime.coprime_mul_left {k m n : Nat} (H : (k * m).Coprime n) :
m.Coprime n
source
theorem Nat.Coprime.coprime_mul_right {m k n : Nat} (H : (m * k).Coprime n) :
m.Coprime n
source
theorem Nat.Coprime.coprime_mul_left_right {m k n : Nat} (H : m.Coprime (k * n)) :
m.Coprime n
source
theorem Nat.Coprime.coprime_mul_right_right {m n k : Nat} (H : m.Coprime (n * k)) :
m.Coprime n
source
theorem Nat.Coprime.coprime_div_left {m n a : Nat} (cmn : m.Coprime n) (dvd : a ∣ m) :
(m / a).Coprime n
source
theorem Nat.Coprime.coprime_div_right {m n a : Nat} (cmn : m.Coprime n) (dvd : a ∣ n) :
m.Coprime (n / a)
source
theorem Nat.coprime_mul_iff_left {m n k : Nat} :
(m * n).Coprime k ↔ m.Coprime k ∧ n.Coprime k
source
theorem Nat.coprime_mul_iff_right {k m n : Nat} :
k.Coprime (m * n) ↔ k.Coprime m ∧ k.Coprime n
source
theorem Nat.Coprime.gcd_left {m n : Nat} (k : Nat) (hmn : m.Coprime n) :
(k.gcd m).Coprime n
source
theorem Nat.Coprime.gcd_right {m n : Nat} (k : Nat) (hmn : m.Coprime n) :
m.Coprime (k.gcd n)
source
theorem Nat.Coprime.gcd_both {m n : Nat} (k l : Nat) (hmn : m.Coprime n) :
(k.gcd m).Coprime (l.gcd n)
source
theorem Nat.Coprime.mul_dvd_of_dvd_of_dvd {m n a : Nat} (hmn : m.Coprime n) (hm : m ∣ a) (hn : n ∣ a) :
m * n ∣ a
source
@[simp]
theorem Nat.coprime_zero_left (n : Nat) :
Coprime 0 n ↔ n = 1
source
@[simp]
theorem Nat.coprime_zero_right (n : Nat) :
n.Coprime 0 ↔ n = 1
source
theorem Nat.coprime_one_left (n : Nat) :
Coprime 1 n
source
theorem Nat.coprime_one_right (n : Nat) :
n.Coprime 1
source
@[simp]
theorem Nat.coprime_one_left_eq_true (n : Nat) :
Coprime 1 n = True
source
@[simp]
theorem Nat.coprime_one_right_eq_true (n : Nat) :
n.Coprime 1 = True
source
@[simp]
theorem Nat.coprime_self (n : Nat) :
n.Coprime n ↔ n = 1
source
theorem Nat.Coprime.pow_left {m k : Nat} (n : Nat) (H1 : m.Coprime k) :
(m ^ n).Coprime k
source
theorem Nat.Coprime.pow_right {k m : Nat} (n : Nat) (H1 : k.Coprime m) :
k.Coprime (m ^ n)
source
theorem Nat.Coprime.pow {k l : Nat} (m n : Nat) (H1 : k.Coprime l) :
(k ^ m).Coprime (l ^ n)
source
theorem Nat.Coprime.eq_one_of_dvd {k m : Nat} (H : k.Coprime m) (d : k ∣ m) :
k = 1
source
theorem Nat.Coprime.gcd_mul {m n : Nat} (k : Nat) (h : m.Coprime n) :
k.gcd (m * n) = k.gcd m * k.gcd n
source
theorem Nat.Coprime.mul_gcd {m n : Nat} (h : m.Coprime n) (k : Nat) :
(m * n).gcd k = m.gcd k * n.gcd k
source
theorem Nat.gcd_mul_gcd_of_coprime_of_mul_eq_mul {c d a b : Nat} (cop : c.Coprime d) (h : a * b = c * d) :
a.gcd c * b.gcd c = c