Prime numbers #
This file deals with the factors of natural numbers.
Important declarations #
Nat.factors n
: the prime factorization ofn
Nat.factors_unique
: uniqueness of the prime factorisation
@[irreducible]
primeFactorsList n
is the prime factorization of n
, listed in increasing order.
Equations
- Nat.primeFactorsList 0 = []
- Nat.primeFactorsList 1 = []
- k.succ.succ.primeFactorsList = (k + 2).minFac :: ((k + 2) / (k + 2).minFac).primeFactorsList
Instances For
@[deprecated Nat.primeFactorsList]
Alias of Nat.primeFactorsList
.
primeFactorsList n
is the prime factorization of n
, listed in increasing order.
Equations
Instances For
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
theorem
Nat.Prime.primeFactorsList_pow
{p : ℕ}
(hp : Nat.Prime p)
(n : ℕ)
:
(p ^ n).primeFactorsList = List.replicate n p
theorem
Nat.coprime_primeFactorsList_disjoint
{a : ℕ}
{b : ℕ}
(hab : a.Coprime b)
:
a.primeFactorsList.Disjoint b.primeFactorsList
The sets of factors of coprime a
and b
are disjoint