Primary and prime-to-n component of a natural number (TODO: should go mathlib ???) #
The m-primary component for a non-zero natural number n is the largest divisor of n
whose prime factors divide m. This number has explicit expression gcd(n, m ^ n).
Equations
- n.primaryComponent m = n.gcd (m ^ n)
Instances For
The prime-to-m component for a non-zero natural number n is the largest divisor of n
which is coprime to m.
Equations
- n.primeToComponent m = n / n.primaryComponent m
Instances For
@[simp]
theorem
Nat.primeFactors_primaryComponent_subset
{n m : ℕ}
(hn : n ≠ 0)
(hm : m ≠ 0)
:
(n.primaryComponent m).primeFactors ⊆ m.primeFactors
theorem
Nat.coprime_primeToComponent_right
{n : ℕ}
(m : ℕ)
(hn : n ≠ 0)
:
(n.primeToComponent m).Coprime m
theorem
Nat.coprime_primeToComponent_primaryComponent
(n m : ℕ)
:
(n.primeToComponent m).Coprime (n.primaryComponent m)