Guide
Special functions
Gamma and zeta values, Bernoulli numbers, the error function, Bessel functions and the classical orthogonal polynomials, each with its theorem.
With special functions the conventions matter as much as the values. Mathlib’s bernoulli has , and there are two families of Hermite polynomials, the physicists’ and the probabilists’. So I want every value to say which function it is about, and here it does. A special function is a call inside #cas, as in #cas (gamma (5/2)) or #cas (ChebyshevT 5 x). The exact values come with a theorem about Mathlib’s own function, such as Real.Gamma or riemannZeta. Two of the functions, erf and BesselJ, give digits only: you request them with [N d], and the theorem is an enclosure of width at most .
Exact values
gammaThe exact value of the Gamma function at an integer or a half-integer, with a theorem about Mathlib’sReal.Gamma.zetaExact values of the Riemann zeta function at even positive and nonpositive integers, with a theorem about Mathlib’sriemannZeta.BernoulliBBernoulli numbers and Bernoulli polynomials for , with theorems about Mathlib’sbernoulliandPolynomial.bernoulli.
Digits
Orthogonal polynomials
LegendrePThe Legendre polynomial in monomials, proved at every real , and its exact values at rational points.ChebyshevTThe Chebyshev polynomial in monomials, proved in every commutative ring, and its exact values at rational points.ChebyshevUThe Chebyshev polynomial in monomials, proved in every commutative ring, and its exact values at rational points.HermiteHThe physicists’ Hermite polynomial in monomials, proved at every real , and its exact values at rational points.HermiteHeThe probabilists’ Hermite polynomial , Mathlib’sPolynomial.hermite n, in monomials, with its exact values at rational points.
The Gamma function at a half-integer is a rational multiple of , and the theorem is about Mathlib’s Real.Gamma, so a proof can use it as it is:
#cas (gamma (5/2))
exact value of Γ
3√π/4- Input (rational number)
5/2
Checked by Lean’s kernel: Gamma by a closed formula
Real.Gamma (5 / 2) = 3 * √Real.pi / 4
The certificate: 1 checked step
Gamma by a closed formula
Real.Gamma (5 / 2) = 3 * √Real.pi / 4
A Chebyshev polynomial comes in monomials, and the theorem holds in every commutative ring at once, so a proof can specialize it to the ring it works in:
#cas (ChebyshevT 5 x)
polynomial with integer coefficients
16*x^5 - 20*x^3 + 5*x- Domain
Polynomial.Chebyshev.T R 5, every commutative ring R : Type- Input (polynomial in x)
ChebyshevT 5 x
Checked by Lean’s kernel: Monomial expansion of ChebyshevT 5
∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.T R 5 = 16 * Polynomial.X ^ 5 - 20 * Polynomial.X ^ 3 + 5 * Polynomial.X
The certificate: 1 checked step
Monomial expansion of ChebyshevT 5
∀ (R : Type) [inst : CommRing R], Polynomial.Chebyshev.T R 5 = 16 * Polynomial.X ^ 5 - 20 * Polynomial.X ^ 3 + 5 * Polynomial.X
Here are thirty proved digits of . The Mathlib that SymLean builds on has no error function, so erf is SymLean’s own CAS.erf, defined by the Gaussian integral . When it appears in a statement of yours, that definition is part of what a reader has to check:
#cas [N 30] (erf 1)
decimal enclosure of width at most 10^-30, with 30 terms of the series
[0.8427007929497148693412206350826, 0.8427007929497148693412206350827]- Domain
error function erf x = 2/√π ∫₀ˣ e^(-t²) dt at a rational point
Checked by Lean’s kernel: Enclosure of erf 1
0.8427007929497148693412206350826 ≤ CAS.erf 1 ∧ CAS.erf 1 ≤ 0.8427007929497148693412206350827 ∧ 0.8427007929497148693412206350827 - 0.8427007929497148693412206350826 ≤ 1 / 10 ^ 30
from CAS.erfCheck_sound
The certificate: 1 checked step
Enclosure of erf 1
0.8427007929497148693412206350826 ≤ CAS.erf 1 ∧ CAS.erf 1 ≤ 0.8427007929497148693412206350827 ∧ 0.8427007929497148693412206350827 - 0.8427007929497148693412206350826 ≤ 1 / 10 ^ 30
The exact values cover a fixed set of points. gamma takes integers and half-integers with , and zeta takes even positive integers and nonpositive integers with . At the odd integers there is no formula, and zeta refuses. At a pole of the theorem is Mathlib’s value there, Real.Gamma q = 0, and the report says so. erf and BesselJ stop at 30 digits. The orthogonal polynomials have caps on the degree, from 30 for LegendreP to 80 for the Chebyshev polynomials and HermiteHe, and BernoulliB stops at . gamma and zeta are evaluated only when the call is the whole input of #cas, not inside a larger expression.
