Definitions and properties of Nat.gcd
, Nat.lcm
, and Nat.coprime
#
Generalizations of these are provided in a later file as GCDMonoid.gcd
and
GCDMonoid.lcm
.
Note that the global IsCoprime
is not a straightforward generalization of Nat.coprime
, see
Nat.isCoprime_iff_coprime
for the connection between the two.
gcd
#
lcm
#
Coprime
#
See also Nat.coprime_of_dvd
and Nat.coprime_of_dvd'
to prove Nat.Coprime m n
.
Equations
- Nat.instDecidableCoprime_1 m n = inferInstanceAs (Decidable (Nat.gcd m n = 1))
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Nat.coprime_add_mul_right_right
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime m (n + k * m) ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_add_mul_left_right
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime m (n + m * k) ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_mul_right_add_right
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime m (k * m + n) ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_mul_left_add_right
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime m (m * k + n) ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_add_mul_right_left
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime (m + k * n) n ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_add_mul_left_left
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime (m + n * k) n ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_mul_right_add_left
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime (k * n + m) n ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_mul_left_add_left
(m : ℕ)
(n : ℕ)
(k : ℕ)
:
Nat.Coprime (n * k + m) n ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_sub_self_left
{m : ℕ}
{n : ℕ}
(h : m ≤ n)
:
Nat.Coprime (n - m) m ↔ Nat.Coprime n m
@[simp]
theorem
Nat.coprime_sub_self_right
{m : ℕ}
{n : ℕ}
(h : m ≤ n)
:
Nat.Coprime m (n - m) ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_self_sub_left
{m : ℕ}
{n : ℕ}
(h : m ≤ n)
:
Nat.Coprime (n - m) n ↔ Nat.Coprime m n
@[simp]
theorem
Nat.coprime_self_sub_right
{m : ℕ}
{n : ℕ}
(h : m ≤ n)
:
Nat.Coprime n (n - m) ↔ Nat.Coprime n m
@[simp]
theorem
Nat.coprime_pow_left_iff
{n : ℕ}
(hn : 0 < n)
(a : ℕ)
(b : ℕ)
:
Nat.Coprime (a ^ n) b ↔ Nat.Coprime a b
@[simp]
theorem
Nat.coprime_pow_right_iff
{n : ℕ}
(hn : 0 < n)
(a : ℕ)
(b : ℕ)
:
Nat.Coprime a (b ^ n) ↔ Nat.Coprime a b
theorem
Nat.gcd_mul_of_coprime_of_dvd
{a : ℕ}
{b : ℕ}
{c : ℕ}
(hac : Nat.Coprime a c)
(b_dvd_c : b ∣ c)
:
Represent a divisor of m * n
as a product of a divisor of m
and a divisor of n
.
See exists_dvd_and_dvd_of_dvd_mul
for the more general but less constructive version for other
GCDMonoid
s.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
Nat.eq_one_of_dvd_coprimes
{a : ℕ}
{b : ℕ}
{k : ℕ}
(h_ab_coprime : Nat.Coprime a b)
(hka : k ∣ a)
(hkb : k ∣ b)
:
k = 1
If k:ℕ
divides coprime a
and b
then k = 1