Divisor Finsets #
This file defines sets of divisors of a natural number. This is particularly useful as background for defining Dirichlet convolution.
Main Definitions #
Let n : ℕ. All of the following definitions are in the Nat namespace:
divisors nis theFinsetof natural numbers that dividen.properDivisors nis theFinsetof natural numbers that dividen, other thann.divisorsAntidiagonal nis theFinsetof pairs(x,y)such thatx * y = n.Perfect nis true whennis positive and the sum ofproperDivisors nisn.
Implementation details #
divisors 0,properDivisors 0, anddivisorsAntidiagonal 0are defined to be∅.
Tags #
divisors, perfect numbers
divisors n is the Finset of divisors of n. As a special case, divisors 0 = ∅.
Equations
- n.divisors = Finset.filter (fun (d : ℕ) => d ∣ n) (Finset.Ico 1 (n + 1))
Instances For
properDivisors n is the Finset of divisors of n, other than n.
As a special case, properDivisors 0 = ∅.
Equations
- n.properDivisors = Finset.filter (fun (d : ℕ) => d ∣ n) (Finset.Ico 1 n)
Instances For
divisorsAntidiagonal n is the Finset of pairs (x,y) such that x * y = n.
As a special case, divisorsAntidiagonal 0 = ∅.
Equations
- n.divisorsAntidiagonal = Finset.filter (fun (x : ℕ × ℕ) => x.1 * x.2 = n) (Finset.Ico 1 (n + 1) ×ˢ Finset.Ico 1 (n + 1))
Instances For
@[simp]
@[simp]
theorem
Nat.left_ne_zero_of_mem_divisorsAntidiagonal
{n : ℕ}
{p : ℕ × ℕ}
(hp : p ∈ n.divisorsAntidiagonal)
:
theorem
Nat.right_ne_zero_of_mem_divisorsAntidiagonal
{n : ℕ}
{p : ℕ × ℕ}
(hp : p ∈ n.divisorsAntidiagonal)
:
See also Nat.mem_properDivisors.
theorem
Nat.fst_mem_divisors_of_mem_antidiagonal
{n : ℕ}
{x : ℕ × ℕ}
(h : x ∈ n.divisorsAntidiagonal)
:
theorem
Nat.snd_mem_divisors_of_mem_antidiagonal
{n : ℕ}
{x : ℕ × ℕ}
(h : x ∈ n.divisorsAntidiagonal)
:
@[simp]
@[simp]
@[simp]
n : ℕ is perfect if and only the sum of the proper divisors of n is n and n
is positive.
Instances For
theorem
Nat.eq_properDivisors_of_subset_of_sum_eq_sum
{n : ℕ}
{s : Finset ℕ}
(hsub : s ⊆ n.properDivisors)
:
∑ x ∈ s, x = ∑ x ∈ n.properDivisors, x → s = n.properDivisors
@[simp]
theorem
Nat.Prime.prod_properDivisors
{α : Type u_1}
[CommMonoid α]
{p : ℕ}
{f : ℕ → α}
(h : Prime p)
:
@[simp]
theorem
Nat.Prime.sum_properDivisors
{α : Type u_1}
[AddCommMonoid α]
{p : ℕ}
{f : ℕ → α}
(h : Prime p)
:
@[simp]
@[simp]
@[simp]
theorem
Nat.prod_properDivisors_prime_pow
{α : Type u_1}
[CommMonoid α]
{k p : ℕ}
{f : ℕ → α}
(h : Prime p)
:
@[simp]
theorem
Nat.sum_properDivisors_prime_nsmul
{α : Type u_1}
[AddCommMonoid α]
{k p : ℕ}
{f : ℕ → α}
(h : Prime p)
:
@[simp]
theorem
Nat.prod_divisors_prime_pow
{α : Type u_1}
[CommMonoid α]
{k p : ℕ}
{f : ℕ → α}
(h : Prime p)
:
@[simp]
theorem
Nat.sum_divisors_prime_pow
{α : Type u_1}
[AddCommMonoid α]
{k p : ℕ}
{f : ℕ → α}
(h : Prime p)
:
The factors of n are the prime divisors
@[simp]