Properties of Nat.gcd, Nat.lcm, and Nat.Coprime #
Definitions are provided in batteries.
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.
Most of this file could be moved to batteries as well.
gcd #
theorem
Nat.gcd_greatest
{a b d : ℕ}
(hda : d ∣ a)
(hdb : d ∣ b)
(hd : ∀ (e : ℕ), e ∣ a → e ∣ b → e ∣ d)
:
d = a.gcd b
Lemmas where one argument consists of addition of a multiple of the other
@[simp, irreducible]
@[simp, irreducible]
lcm and divisibility #
Alias of Nat.dvd_lcm_of_dvd_left.
Alias of Nat.dvd_lcm_of_dvd_right.
Coprime #
See also Nat.coprime_of_dvd and Nat.coprime_of_dvd' to prove Nat.Coprime m n.
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Nat.Coprime.of_dvd
{a₁ a₂ b₁ b₂ : ℕ}
(ha : a₁ ∣ a₂)
(hb : b₁ ∣ b₂)
(h : a₂.Coprime b₂)
:
a₁.Coprime b₁
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Nat.gcd_mul_of_coprime_of_dvd
{a b c : ℕ}
(hac : a.Coprime c)
(b_dvd_c : b ∣ c)
:
(a * b).gcd c = b
theorem
Nat.Coprime.eq_of_mul_eq_zero
{m n : ℕ}
(h : m.Coprime n)
(hmn : m * n = 0)
:
m = 0 ∧ n = 1 ∨ m = 1 ∧ n = 0
theorem
Nat.eq_one_of_dvd_coprimes
{a b k : ℕ}
(h_ab_coprime : a.Coprime b)
(hka : k ∣ a)
(hkb : k ∣ b)
:
k = 1
If k:ℕ divides coprime a and b then k = 1
theorem
Nat.Coprime.mul_add_mul_ne_mul
{m n a b : ℕ}
(cop : m.Coprime n)
(ha : a ≠ 0)
(hb : b ≠ 0)
:
a * m + b * n ≠ m * n
theorem
Nat.gcd_mul_gcd_eq_iff_dvd_mul_of_coprime
{x n m : ℕ}
(hcop : n.Coprime m)
:
x.gcd n * x.gcd m = x ↔ x ∣ n * m
theorem
Nat.div_lcm_eq_div_gcd
{n m k : ℕ}
(hkm : m ∣ k)
(hkn : n ∣ k)
:
(k / m).lcm (k / n) = k / m.gcd n