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 the- Finsetof natural numbers that divide- n.
- properDivisors nis the- Finsetof natural numbers that divide- n, other than- n.
- divisorsAntidiagonal nis the- Finsetof pairs- (x,y)such that- x * y = n.
- Perfect nis true when- nis positive and the sum of- properDivisors nis- n.
Conventions #
Since 0 has infinitely many divisors, none of the definitions in this file make sense for it.
Therefore we adopt the convention that Nat.divisors 0, Nat.properDivisors 0,
Nat.divisorsAntidiagonal 0 and Int.divisorsAntidiag 0 are all ∅.
Tags #
divisors, perfect numbers
divisors n is the Finset of divisors of n. By convention, we set 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.
By convention, we set properDivisors 0 = ∅.
Equations
- n.properDivisors = Finset.filter (fun (d : ℕ) => d ∣ n) (Finset.Ico 1 n)
Instances For
Pairs of divisors of a natural number as a finset.
n.divisorsAntidiagonal is the finset of pairs (a, b) : ℕ × ℕ such that a * b = n.
By convention, we set Nat.divisorsAntidiagonal 0 = ∅.
O(n).
Equations
Instances For
See also Nat.mem_properDivisors.
Nat.swap_mem_divisorsAntidiagonal with the LHS in simp normal form.
n : ℕ is perfect if and only the sum of the proper divisors of n is n and n
is positive.
Instances For
The factors of n are the prime divisors
Pairs of divisors of an integer as a finset.
z.divisorsAntidiag is the finset of pairs (a, b) : ℤ × ℤ such that a * b = z.
By convention, we set Int.divisorsAntidiag 0 = ∅.
O(|z|). Computed from Nat.divisorsAntidiagonal.
Equations
- One or more equations did not get rendered due to their size.