mathlib documentation

number_theory.arithmetic_function

Arithmetic Functions and Dirichlet Convolution #

This file defines arithmetic functions, which are functions from to a specified type that map 0 to 0. In the literature, they are often instead defined as functions from ℕ+. These arithmetic functions are endowed with a multiplication, given by Dirichlet convolution, and pointwise addition, to form the Dirichlet ring.

Main Definitions #

Main Results #

Notation #

The arithmetic functions ζ and σ have Greek letter names, which are localized notation in the namespace arithmetic_function.

Tags #

arithmetic functions, dirichlet convolution, divisors

def nat.arithmetic_function (R : Type u_1) [has_zero R] :
Type u_1

An arithmetic function is a function from that maps 0 to 0. In the literature, they are often instead defined as functions from ℕ+. Multiplication on arithmetic_functions is by Dirichlet convolution.

Equations
@[simp]
@[simp]
theorem nat.arithmetic_function.map_zero {R : Type u_1} [has_zero R] {f : nat.arithmetic_function R} :
f 0 = 0
theorem nat.arithmetic_function.coe_inj {R : Type u_1} [has_zero R] {f g : nat.arithmetic_function R} :
f = g f = g
@[simp]
theorem nat.arithmetic_function.zero_apply {R : Type u_1} [has_zero R] {x : } :
0 x = 0
@[ext]
theorem nat.arithmetic_function.ext {R : Type u_1} [has_zero R] ⦃f g : nat.arithmetic_function R⦄ (h : ∀ (x : ), f x = g x) :
f = g
theorem nat.arithmetic_function.ext_iff {R : Type u_1} [has_zero R] {f g : nat.arithmetic_function R} :
f = g ∀ (x : ), f x = g x
@[instance]
Equations
@[simp]
theorem nat.arithmetic_function.one_one {R : Type u_1} [has_zero R] [has_one R] :
1 1 = 1
@[simp]
theorem nat.arithmetic_function.one_apply_ne {R : Type u_1} [has_zero R] [has_one R] {x : } (h : x 1) :
1 x = 0
@[simp]
theorem nat.arithmetic_function.nat_coe_apply {R : Type u_1} [has_zero R] [has_one R] [has_add R] {f : nat.arithmetic_function } {x : } :
f x = (f x)
@[simp]
theorem nat.arithmetic_function.int_coe_apply {R : Type u_1} [has_zero R] [has_one R] [has_add R] [has_neg R] {f : nat.arithmetic_function } {x : } :
f x = (f x)
@[simp]
@[instance]
Equations
@[simp]
theorem nat.arithmetic_function.add_apply {R : Type u_1} [add_monoid R] {f g : nat.arithmetic_function R} {n : } :
(f + g) n = f n + g n
@[instance]
Equations
@[instance]

The Dirichlet convolution of two arithmetic functions f and g is another arithmetic function such that (f * g) n is the sum of f x * g y over all (x,y) such that x * y = n.

Equations
@[simp]
theorem nat.arithmetic_function.smul_apply {R : Type u_1} {M : Type u_2} [has_zero R] [add_comm_monoid M] [has_scalar R M] {f : nat.arithmetic_function R} {g : nat.arithmetic_function M} {n : } :
(f g) n = ∑ (x : × ) in n.divisors_antidiagonal, f x.fst g x.snd
@[instance]

The Dirichlet convolution of two arithmetic functions f and g is another arithmetic function such that (f * g) n is the sum of f x * g y over all (x,y) such that x * y = n.

Equations
@[simp]
theorem nat.arithmetic_function.mul_apply {R : Type u_1} [semiring R] {f g : nat.arithmetic_function R} {n : } :
(f * g) n = ∑ (x : × ) in n.divisors_antidiagonal, (f x.fst) * g x.snd
theorem nat.arithmetic_function.mul_smul' {R : Type u_1} {M : Type u_2} [semiring R] [add_comm_monoid M] [module R M] (f g : nat.arithmetic_function R) (h : nat.arithmetic_function M) :
(f * g) h = f g h
theorem nat.arithmetic_function.one_smul' {R : Type u_1} {M : Type u_2} [semiring R] [add_comm_monoid M] [module R M] (b : nat.arithmetic_function M) :
1 b = b

ζ 0 = 0, otherwise ζ x = 1. The Dirichlet Series is the Riemann ζ.

Equations
@[simp]
theorem nat.arithmetic_function.coe_zeta_smul_apply {R : Type u_1} {M : Type u_2} [comm_ring R] [add_comm_group M] [module R M] {f : nat.arithmetic_function M} {x : } :
@[simp]

This is the pointwise product of arithmetic_functions.

Equations
@[simp]
theorem nat.arithmetic_function.pmul_apply {R : Type u_1} [mul_zero_class R] {f g : nat.arithmetic_function R} {x : } :
(f.pmul g) x = (f x) * g x

This is the pointwise power of arithmetic_functions.

Equations
@[simp]
theorem nat.arithmetic_function.ppow_apply {R : Type u_1} [semiring R] {f : nat.arithmetic_function R} {k x : } (kpos : 0 < k) :
(f.ppow k) x = f x ^ k
theorem nat.arithmetic_function.ppow_succ {R : Type u_1} [semiring R] {f : nat.arithmetic_function R} {k : } :
f.ppow (k + 1) = f.pmul (f.ppow k)
theorem nat.arithmetic_function.ppow_succ' {R : Type u_1} [semiring R] {f : nat.arithmetic_function R} {k : } {kpos : 0 < k} :
f.ppow (k + 1) = (f.ppow k).pmul f

Multiplicative functions

Equations
@[simp]
theorem nat.arithmetic_function.is_multiplicative.map_mul_of_coprime {R : Type u_1} [monoid_with_zero R] {f : nat.arithmetic_function R} (hf : f.is_multiplicative) {m n : } (h : m.coprime n) :
f (m * n) = (f m) * f n

The identity on as an arithmetic_function.

Equations
@[simp]
theorem nat.arithmetic_function.pow_apply {k n : } :
(nat.arithmetic_function.pow k) n = ite (k = 0 n = 0) 0 (n ^ k)

σ k n is the sum of the kth powers of the divisors of n

Equations
@[simp]

Ω n is the number of prime factors of n.

Equations

ω n is the number of distinct prime factors of n.

Equations

μ is the Möbius function. If n is squarefree with an even number of distinct prime factors, μ n = 1. If n is squarefree with an odd number of distinct prime factors, μ n = -1. If n is not squarefree, μ n = 0.

Equations

A unit in arithmetic_function R that evaluates to ζ, with inverse μ.

Equations
theorem nat.arithmetic_function.sum_eq_iff_sum_smul_moebius_eq {R : Type u_1} [add_comm_group R] {f g : → R} :
(∀ (n : ), 0 < n∑ (i : ) in n.divisors, f i = g n) ∀ (n : ), 0 < n∑ (x : × ) in n.divisors_antidiagonal, nat.arithmetic_function.moebius x.fst g x.snd = f n

Möbius inversion for functions to an add_comm_group.

theorem nat.arithmetic_function.sum_eq_iff_sum_mul_moebius_eq {R : Type u_1} [comm_ring R] {f g : → R} :
(∀ (n : ), 0 < n∑ (i : ) in n.divisors, f i = g n) ∀ (n : ), 0 < n∑ (x : × ) in n.divisors_antidiagonal, ((nat.arithmetic_function.moebius x.fst)) * g x.snd = f n

Möbius inversion for functions to a comm_ring.

theorem nat.arithmetic_function.prod_eq_iff_prod_pow_moebius_eq {R : Type u_1} [comm_group R] {f g : → R} :
(∀ (n : ), 0 < n∏ (i : ) in n.divisors, f i = g n) ∀ (n : ), 0 < n∏ (x : × ) in n.divisors_antidiagonal, g x.snd ^ nat.arithmetic_function.moebius x.fst = f n

Möbius inversion for functions to a comm_group.

theorem nat.arithmetic_function.prod_eq_iff_prod_pow_moebius_eq_of_nonzero {R : Type u_1} [comm_group_with_zero R] {f g : → R} (hf : ∀ (n : ), 0 < nf n 0) (hg : ∀ (n : ), 0 < ng n 0) :
(∀ (n : ), 0 < n∏ (i : ) in n.divisors, f i = g n) ∀ (n : ), 0 < n∏ (x : × ) in n.divisors_antidiagonal, g x.snd ^ nat.arithmetic_function.moebius x.fst = f n

Möbius inversion for functions to a comm_group_with_zero.