Documentation

Ratpoints.Mathlib.Data.Nat.Factors

The part of a number with its prime factors in a set #

Candidates for Mathlib.Data.Nat.Factors: the product of the prime factors of n that pass a test p, (n.primeFactorsList.filter p).prod, the part of n with its prime factors in a set (as Nat.prod_mem_factoredNumbers of Mathlib.NumberTheory.SmoothNumbers has it), is multiplicative, a divisor of n, 1 when no prime factor passes and n when all do; for the test (·.Coprime m) it is Nat.coprimePart n m, the largest divisor of n ≠ 0 prime to m.

Main definitions #

Main statements #

Implementation notes #

Nat.coprime_coprimePart and Nat.dvd_coprimePart_of_dvd use Nat.coprime_list_prod_left_iff and Nat.coprime_list_prod_right_iff of Mathlib.Data.Nat.GCD.BigOperators, which Mathlib.Data.Nat.Factors does not import.

theorem Nat.prod_filter_primeFactorsList_eq_self {p : ℕ → Bool} {n : ℕ} (hn : n ≠ 0) (h : ∀ q ∈ n.primeFactorsList, p q = true) :

Multiplying by a number without a prime factor that passes the test keeps the part of a number with its prime factors passing it.

def Nat.coprimePart (n m : ℕ) :

The product of the prime factors of n, with multiplicity, that are prime to m: for n ≠ 0 the largest divisor of n prime to m (Nat.dvd_coprimePart_of_dvd).

Equations
Instances For
    theorem Nat.dvd_coprimePart_of_dvd {n m d : ℕ} (hn : n ≠ 0) (hd : d ∣ n) (hdm : d.Coprime m) :

    The largest divisor prime to m. Every divisor of n ≠ 0 prime to m divides Nat.coprimePart n m, since it is prime to the other prime factors of n, which divide m.