mathlib3 documentation

ring_theory.int.basic

Divisibility over ℕ and ℤ #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This file collects results for the integers and natural numbers that use abstract algebra in their proofs or cases of ℕ and ℤ being examples of structures in abstract algebra.

Main statements #

Tags #

prime, irreducible, natural numbers, integers, normalization monoid, gcd monoid, greatest common divisor, prime factorization, prime factors, unique factorization, unique factors

@[protected, instance]
@[protected, instance]

ℕ is a gcd_monoid.

Equations
@[protected, instance]
Equations
theorem gcd_eq_nat_gcd (m n : ℕ) :
theorem lcm_eq_nat_lcm (m n : ℕ) :
@[protected, instance]
Equations
theorem int.normalize_of_nonneg {z : ℤ} (h : 0 ≤ z) :
theorem int.normalize_of_nonpos {z : ℤ} (h : z ≤ 0) :
theorem int.nonneg_of_normalize_eq_self {z : ℤ} (hz : ⇑normalize z = z) :
0 ≤ z
theorem int.eq_of_associated_of_nonneg {a b : ℤ} (h : associated a b) (ha : 0 ≤ a) (hb : 0 ≤ b) :
a = b
@[protected, instance]
Equations
@[protected, instance]
Equations
theorem int.coe_gcd (i j : ℤ) :
theorem int.coe_lcm (i j : ℤ) :
theorem int.nat_abs_gcd (i j : ℤ) :
theorem int.nat_abs_lcm (i j : ℤ) :
theorem int.exists_unit_of_abs (a : ℤ) :
∃ (u : ℤ) (h : is_unit u), ↑(a.nat_abs) = u * a
theorem int.gcd_eq_nat_abs {a b : ℤ} :
theorem int.gcd_eq_one_iff_coprime {a b : ℤ} :
a.gcd b = 1 ↔ is_coprime a b
theorem int.gcd_ne_one_iff_gcd_mul_right_ne_one {a : ℤ} {m n : ℕ} :
a.gcd (↑m * ↑n) ≠ 1 ↔ a.gcd ↑m ≠ 1 ∨ a.gcd ↑n ≠ 1

If gcd a (m * n) ≠ 1, then gcd a m ≠ 1 or gcd a n ≠ 1.

theorem int.gcd_eq_one_of_gcd_mul_right_eq_one_left {a : ℤ} {m n : ℕ} (h : a.gcd (↑m * ↑n) = 1) :
a.gcd ↑m = 1

If gcd a (m * n) = 1, then gcd a m = 1.

theorem int.gcd_eq_one_of_gcd_mul_right_eq_one_right {a : ℤ} {m n : ℕ} (h : a.gcd (↑m * ↑n) = 1) :
a.gcd ↑n = 1

If gcd a (m * n) = 1, then gcd a n = 1.

theorem int.sq_of_gcd_eq_one {a b c : ℤ} (h : a.gcd b = 1) (heq : a * b = c ^ 2) :
∃ (a0 : ℤ), a = a0 ^ 2 ∨ a = -a0 ^ 2
theorem int.sq_of_coprime {a b c : ℤ} (h : is_coprime a b) (heq : a * b = c ^ 2) :
∃ (a0 : ℤ), a = a0 ^ 2 ∨ a = -a0 ^ 2

Maps an associate class of integers consisting of -n, n to n : ℕ

Equations
theorem int.prime.dvd_mul {m n : ℤ} {p : ℕ} (hp : nat.prime p) (h : ↑p ∣ m * n) :
theorem int.prime.dvd_mul' {m n : ℤ} {p : ℕ} (hp : nat.prime p) (h : ↑p ∣ m * n) :
↑p ∣ m ∨ ↑p ∣ n
theorem int.prime.dvd_pow {n : ℤ} {k p : ℕ} (hp : nat.prime p) (h : ↑p ∣ n ^ k) :
theorem int.prime.dvd_pow' {n : ℤ} {k p : ℕ} (hp : nat.prime p) (h : ↑p ∣ n ^ k) :
↑p ∣ n
theorem prime_two_or_dvd_of_dvd_two_mul_pow_self_two {m : ℤ} {p : ℕ} (hp : nat.prime p) (h : ↑p ∣ 2 * m ^ 2) :
p = 2 ∨ p ∣ m.nat_abs
theorem int.exists_prime_and_dvd {n : ℤ} (hn : n.nat_abs ≠ 1) :
∃ (p : ℤ), prime p ∧ p ∣ n
@[protected, instance]
Equations
@[protected, instance]
Equations
theorem induction_on_primes {P : ℕ → Prop} (h₀ : P 0) (h₁ : P 1) (h : ∀ (p a : ℕ), nat.prime p → P a → P (p * a)) (n : ℕ) :
P n
theorem int.associated_iff {a b : ℤ} :
associated a b ↔ a = b ∨ a = -b
theorem int.eq_pow_of_mul_eq_pow_bit1_left {a b c : ℤ} (hab : is_coprime a b) {k : ℕ} (h : a * b = c ^ bit1 k) :
∃ (d : ℤ), a = d ^ bit1 k
theorem int.eq_pow_of_mul_eq_pow_bit1_right {a b c : ℤ} (hab : is_coprime a b) {k : ℕ} (h : a * b = c ^ bit1 k) :
∃ (d : ℤ), b = d ^ bit1 k
theorem int.eq_pow_of_mul_eq_pow_bit1 {a b c : ℤ} (hab : is_coprime a b) {k : ℕ} (h : a * b = c ^ bit1 k) :
(∃ (d : ℤ), a = d ^ bit1 k) ∧ ∃ (e : ℤ), b = e ^ bit1 k