Function of #cas

zeta

Exact values of the Riemann zeta function at even positive and nonpositive integers, with a theorem about Mathlib’s riemannZeta.

#cas (zeta s)
gives the exact value of ζ(s) at an even positive or a nonpositive integer s and proves it as an equation about riemannZeta s in ℂ.

zeta gives exact values of the Riemann zeta function at the even positive integers and at the nonpositive integers. At an even positive integer the value is a rational multiple of πs, as in Euler’s ζ(2)=π2/6, and at a nonpositive integer it is rational. Both come from Bernoulli numbers that the kernel evaluates. The call has no formula for the odd integers from 3 on, and refuses them.

Details and Options

  • s is a closed rational expression whose value is an integer, such as 2 or (-1), with −59≤s≤60.
  • At an even s=2k>0 the theorem is riemannZeta s = a * (Real.pi : ℂ) ^ s / b with a/b in lowest terms, and without a * when a=1, by Mathlib’s riemannZeta_two_mul_nat, such as riemannZeta 2 = (Real.pi : ℂ) ^ 2 / 6.
  • At an integer s≤0 the theorem is riemannZeta s = q with a rational q, by riemannZeta_neg_nat_eq_bernoulli.
  • The equations hold in ℂ, for Mathlib’s riemannZeta, and their rational number comes from a Bernoulli number that the kernel evaluates.
  • The odd integers s≥3 and the pole s=1 are refused, and so are rationals that are not integers.
  • The call is evaluated when it is the whole input of #cas.
  • There are no options.

Examples (11)#

Basic Examples (2)

Euler’s value of ζ(2), the sum of the reciprocal squares:

In[1]:=
#cas (zeta 2)
Out[1]=

exact value of ζ

π26
pi^2/6
Domain
ℂ (Mathlib's riemannZeta)
Input (even positive integer)
s = 2

Checked by Lean’s kernel: ζ(2k) by Bernoulli numbers (riemannZeta_two_mul_nat)

riemannZeta 2 = ↑Real.pi ^ 2 / 6
The certificate: 1 checked step
  1. ζ(2k) by Bernoulli numbers (riemannZeta_two_mul_nat)

    riemannZeta 2 = ↑Real.pi ^ 2 / 6

    Checked by Lean’s kernel


At a negative integer the value is rational:

In[2]:=
#cas (zeta (-1))
Out[2]=

exact value of ζ

−112
-1/12
Domain
ℂ (Mathlib's riemannZeta)
Input (nonpositive integer)
s = -1

Checked by Lean’s kernel: ζ(-k) by Bernoulli numbers (riemannZeta_neg_nat_eq_bernoulli)

riemannZeta (-1) = -(1 / 12)
The certificate: 1 checked step
  1. ζ(-k) by Bernoulli numbers (riemannZeta_neg_nat_eq_bernoulli)

    riemannZeta (-1) = -(1 / 12)

    Checked by Lean’s kernel

Scope (3)

Larger even values bring in Bernoulli numbers of higher index. The 691 in ζ(12) is the numerator of B12=−6912730:

In[3]:=
#cas (zeta 12)
Out[3]=

exact value of ζ

691π12638512875
691*pi^12/638512875
Domain
ℂ (Mathlib's riemannZeta)
Input (even positive integer)
s = 12

Checked by Lean’s kernel: ζ(2k) by Bernoulli numbers (riemannZeta_two_mul_nat)

riemannZeta 12 = 691 * ↑Real.pi ^ 12 / 638512875
The certificate: 1 checked step
  1. ζ(2k) by Bernoulli numbers (riemannZeta_two_mul_nat)

    riemannZeta 12 = 691 * ↑Real.pi ^ 12 / 638512875

    Checked by Lean’s kernel


The value at 0:

In[4]:=
#cas (zeta 0)
Out[4]=

exact value of ζ

−12
-1/2
Domain
ℂ (Mathlib's riemannZeta)
Input (nonpositive integer)
s = 0

Checked by Lean’s kernel: ζ(-k) by Bernoulli numbers (riemannZeta_neg_nat_eq_bernoulli)

riemannZeta 0 = -(1 / 2)
The certificate: 1 checked step
  1. ζ(-k) by Bernoulli numbers (riemannZeta_neg_nat_eq_bernoulli)

    riemannZeta 0 = -(1 / 2)

    Checked by Lean’s kernel


The negative even integers are the trivial zeros of ζ:

In[5]:=
#cas (zeta (-2))
Out[5]=

exact value of ζ

0
Domain
ℂ (Mathlib's riemannZeta)
Input (nonpositive integer)
s = -2

Checked by Lean’s kernel: ζ(-k) by Bernoulli numbers (riemannZeta_neg_nat_eq_bernoulli)

riemannZeta (-2) = 0
The certificate: 1 checked step
  1. ζ(-k) by Bernoulli numbers (riemannZeta_neg_nat_eq_bernoulli)

    riemannZeta (-2) = 0

    Checked by Lean’s kernel

Applications (1)

A proof can take the printed theorem as a hypothesis and use it. Only the three standard axioms are used:

In[6]:=
theorem six_mul_zeta_two (h : riemannZeta 2 = (Real.pi : ℂ) ^ 2 / 6) :
    6 * riemannZeta 2 = (Real.pi : ℂ) ^ 2 := by
  rw [h]
  ring

#print axioms six_mul_zeta_two
Out[6]=

six_mul_zeta_two depends on the axioms propext, Classical.choice, Quot.sound.

Properties and Relations (2)

ζ(2) is the sum of the series ∑k≥11/k2, and sum proves the sum as a HasSum:

In[7]:=
#cas [sum k 1 ∞] (1/k^2)
Out[7]=

sum of the series (ζ value)

π26
pi^2/6
Domain
k ∈ ℕ, k ≥ 1
Input (summand)
1/k^2

Checked by Lean’s kernel: Sum of the series by hasSum_zeta_nat

HasSum (fun k ↦ 1 / ↑(k + 1) ^ 2) (Real.pi ^ 2 / 6)
The certificate: 1 checked step
  1. Sum of the series by hasSum_zeta_nat

    HasSum (fun k ↦ 1 / ↑(k + 1) ^ 2) (Real.pi ^ 2 / 6)

    Checked by Lean’s kernel


Euler’s formula ζ(2k)=(−1)k+1B2k(2π)2k/(2(2k)!) ties the even values to the Bernoulli numbers. With B4=−130 it gives ζ(4)=130·16π448=π490:

In[8]:=
#cas (zeta 4)
Out[8]=

exact value of ζ

π490
pi^4/90
Domain
ℂ (Mathlib's riemannZeta)
Input (even positive integer)
s = 4

Checked by Lean’s kernel: ζ(2k) by Bernoulli numbers (riemannZeta_two_mul_nat)

riemannZeta 4 = ↑Real.pi ^ 4 / 90
The certificate: 1 checked step
  1. ζ(2k) by Bernoulli numbers (riemannZeta_two_mul_nat)

    riemannZeta 4 = ↑Real.pi ^ 4 / 90

    Checked by Lean’s kernel

In[9]:=
#cas (BernoulliB 4)
Out[9]=

Bernoulli number

−130
-1/30
Domain
ℚ (Mathlib's bernoulli, B₁ = -1/2)
Input (natural number)
4

Checked by Lean’s kernel: Bernoulli number from the kernel-evaluated numerators

bernoulli 4 = -(1 / 30)
The certificate: 1 checked step
  1. Bernoulli number from the kernel-evaluated numerators

    bernoulli 4 = -(1 / 30)

    Checked by Lean’s kernel

Possible Issues (3)

At the odd integers s≥3 the call has no formula and refuses:

In[10]:=
#cas (zeta 3)
Out[10]=

Error

zeta: unsupported formula at the odd integer `3`; exact values are computed at even positive and at nonpositive integers

s=1 is the pole. Mathlib’s riemannZeta 1 is a convention, not a value of the series, and the call does not report it:

In[11]:=
#cas (zeta 1)
Out[11]=

Error

zeta: s = 1 is the pole of ζ; Mathlib's riemannZeta 1 is a convention, not a value of the series, and is not reported

The argument is an integer:

In[12]:=
#cas (zeta (1/2))
Out[12]=

Error

zeta: exact values are computed at integers

See Also

BernoulliB · sum · gamma