mathlib documentation

ring_theory.int.basic

Divisibility over ℕ and ℤ #

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 : ) :
gcd m n = m.gcd n
theorem lcm_eq_nat_lcm (m n : ) :
lcm m n = m.lcm n
@[protected, instance]
Equations
theorem int.normalize_of_nonneg {z : } (h : 0 z) :
theorem int.normalize_of_neg {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 : ) :
(i.gcd j) = gcd i j
theorem int.coe_lcm (i j : ) :
(i.lcm j) = lcm i j
theorem int.nat_abs_gcd (i j : ) :
(gcd i j).nat_abs = i.gcd j
theorem int.nat_abs_lcm (i j : ) :
(lcm i j).nat_abs = i.lcm 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.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 : } (n2 : 2 n.nat_abs) :
∃ (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 pP aP (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