Documentation

Mathlib.Data.Nat.Factors

Prime numbers #

This file deals with the factors of natural numbers.

Important declarations #

@[irreducible]

primeFactorsList n is the prime factorization of n, listed in increasing order.

Equations
Instances For
    @[irreducible]
    @[irreducible]
    @[irreducible]
    theorem Nat.primeFactorsList_chain {n a : } :
    (∀ (p : ), Prime pp na p)List.Chain (fun (x1 x2 : ) => x1 x2) a n.primeFactorsList
    theorem Nat.primeFactorsList_chain_2 (n : ) :
    List.Chain (fun (x1 x2 : ) => x1 x2) 2 n.primeFactorsList
    theorem Nat.primeFactorsList_chain' (n : ) :
    List.Chain' (fun (x1 x2 : ) => x1 x2) n.primeFactorsList
    theorem Nat.primeFactorsList_sorted (n : ) :
    List.Sorted (fun (x1 x2 : ) => x1 x2) n.primeFactorsList

    primeFactorsList can be constructed inductively by extracting minFac, for sufficiently large n.

    theorem Nat.eq_of_perm_primeFactorsList {a b : } (ha : a 0) (hb : b 0) (h : a.primeFactorsList.Perm b.primeFactorsList) :
    a = b
    theorem Nat.mem_primeFactorsList_iff_dvd {n p : } (hn : n 0) (hp : Prime p) :
    theorem Nat.mem_primeFactorsList {n p : } (hn : n 0) :
    theorem Nat.primeFactorsList_unique {n : } {l : List } (h₁ : l.prod = n) (h₂ : pl, Prime p) :

    Fundamental theorem of arithmetic

    theorem Nat.eq_prime_pow_of_unique_prime_dvd {n p : } (hpos : n 0) (h : ∀ {d : }, Prime dd nd = p) :

    For positive a and b, the prime factors of a * b are the union of those of a and b

    For coprime a and b, the prime factors of a * b are the union of those of a and b

    theorem Nat.mem_primeFactorsList_mul {a b : } (ha : a 0) (hb : b 0) {p : } :

    The sets of factors of coprime a and b are disjoint

    theorem Nat.mem_primeFactorsList_mul_left {p a b : } (hpa : p a.primeFactorsList) (hb : b 0) :

    If p is a prime factor of a then p is also a prime factor of a * b for any b > 0

    theorem Nat.mem_primeFactorsList_mul_right {p a b : } (hpb : p b.primeFactorsList) (ha : a 0) :

    If p is a prime factor of b then p is also a prime factor of a * b for any a > 0

    theorem Nat.eq_two_pow_or_exists_odd_prime_and_dvd (n : ) :
    (∃ (k : ), n = 2 ^ k) ∃ (p : ), Prime p p n Odd p
    theorem Nat.four_dvd_or_exists_odd_prime_and_dvd_of_two_lt {n : } (n2 : 2 < n) :
    4 n ∃ (p : ), Prime p p n Odd p