About the formalization of some results by Chebyshev in

Introduction
The
factorization of
n!
Upper and lower
bounds for B
About the formalization of some results by
Chebyshev in number theory
via the Matita ITP
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Dipartimento di Scienze dell’Informazione
Mura Anteo Zamboni 7, Bologna
[email protected]
January 19, 2009
Outline
Introduction
1
Introduction
2
The factorization of n!
Upper and lower bounds for B
3
Chebishev’s Ψ function
4
Bertrand’s postulate
Erdös approach (1932)
Automatic check
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Matita in a nutshell
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Matita in a nutshell
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
A light version of Coq.
Matita in a nutshell
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
A light version of Coq.
Some distinctive features:
a primitive notion of metavariable
a sophisticated disambiguation mechanism
a powerful coercion system
tynicals
a mathml compliant goal window
semantic selection, cut & paste
Style of the talk
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Style of the talk
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
I will describe the subject in a way suited to formalization
but not the formal details.
Style of the talk
Introduction
The
factorization of
n!
Upper and lower
bounds for B
I will describe the subject in a way suited to formalization
but not the formal details.
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
At a few points I will point out some tricky aspects of the
formal encoding.
The Prime Number Theorem
Introduction
The
factorization of
n!
Let π(n) denote the number of primes not exceeding n.
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Theorem (Hadamard and La Vallé Poussin, 1896)
π(n) ∼ n/log(n)
The Prime Number Theorem
Introduction
The
factorization of
n!
Let π(n) denote the number of primes not exceeding n.
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Theorem (Hadamard and La Vallé Poussin, 1896)
π(n) ∼ n/log(n)
Formalized by Avigad et al. in Isabelle (ACM-TOCL 9(1),
2007), following Selberg’s “elementary” proof (1949).
Chebyshev’s Theorem
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Theorem (Chebyshev, 1850)
There are two constants c1 and c2 such that, for any n
c1
n
n
≤ π(n) ≤ c2
log(n)
log(n)
Chebyshev’s Theorem
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Theorem (Chebyshev, 1850)
There are two constants c1 and c2 such that, for any n
c1
n
n
≤ π(n) ≤ c2
log(n)
log(n)
Motivations for the formalization:
Chebyshev’s Theorem
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Theorem (Chebyshev, 1850)
There are two constants c1 and c2 such that, for any n
c1
n
n
≤ π(n) ≤ c2
log(n)
log(n)
Motivations for the formalization:
important machinery for number theory: ψ, θ, . . .
Chebyshev’s Theorem
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Theorem (Chebyshev, 1850)
There are two constants c1 and c2 such that, for any n
c1
n
n
≤ π(n) ≤ c2
log(n)
log(n)
Motivations for the formalization:
important machinery for number theory: ψ, θ, . . .
methodology: provide a purely arithmetical (and
constructive) formalization
Chebyshev’s Theorem
Introduction
Theorem (Chebyshev, 1850)
There are two constants c1 and c2 such that, for any n
The
factorization of
n!
c1
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
n
n
≤ π(n) ≤ c2
log(n)
log(n)
Motivations for the formalization:
important machinery for number theory: ψ, θ, . . .
methodology: provide a purely arithmetical (and
constructive) formalization
To spare logs:
2c1 n ≤ nπ(n) ≤ 2c2 n
Outline
Introduction
1
Introduction
2
The factorization of n!
Upper and lower bounds for B
3
Chebishev’s Ψ function
4
Bertrand’s postulate
Erdös approach (1932)
Automatic check
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
The factorization of n!
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Chebyshev’s approach: exploit the decomposition of the
number n! as a product of prime numbers.
The factorization of n!
Introduction
The
factorization of
n!
Chebyshev’s approach: exploit the decomposition of the
number n! as a product of prime numbers.
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
For any prime p, the numbers 1, 2, . . . , n include just
multiples of p, pn2 multiples of p2 , an so on. Hence
n! =
Y
Y
pn/p
p≤n i<logp (n)
(see e.g. Hardy & Wright’s, pag. 342).
i+1
n
p
(1)
A formal proof:(1) the factorization of n
Introduction
The
factorization of
n!
Every integer n may be uniquely decomposed as the
product of all its prime factors.
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Le us write ordp (n) for the multiplicity of p in n; then
Y
Y
Y
n=
pordp (n) =
p
Erdös approach
(1932)
p≤n
Automatic check
for p prime.
p≤n i < logp (n)
pi+1 |n
(2)
A formal proof:(2) the factorization of n
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
A direct proof by induction on the upper bound of the
product.
A formal proof:(2) the factorization of n
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
A direct proof by induction on the upper bound of the
product. We have to rephrase the statement in the form
Y
∀m > c(n), n =
pordp (n)
p≤m
A formal proof:(2) the factorization of n
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
A direct proof by induction on the upper bound of the
product. We have to rephrase the statement in the form
Y
∀m > c(n), n =
pordp (n)
p≤m
To make induction work c(n) must be miminal: in this case,
the largest prime factor of n (mpf (n))
Y
∀m > mpf (n), n =
pordp (n)
p≤m
A formal proof:(3) the factorization of n in matita
Introduction
The
factorization of
n!
definition mpf n := max n (λ i .primeb i ∧ i | n).
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
theorem lt max to pi p primeb:
∀ m,n.
O<n→
mpf n < m →
n = pi p m (λ i .primeb i ∧ i | n) (λ p.pˆ(ord n p )).
A formal proof:(4) the factorization of n!
Introduction
The
factorization of
n!
n!
=
m
1≤m≤n
=
Upper and lower
bounds for B
Y Y
1≤m≤n p≤m
Chebishev’s Ψ
function
Bertrand’s
postulate
Y
=
Y
i < logp (m)
pi+1 |m
Y Y
p≤n p≤m≤n
Erdös approach
(1932)
p
Y
p
i < logp (m)
pi+1 |m
Automatic check
=
Y
Y
p≤n i<logp (n)
=
Y
Y
p≤n i<logp (n)
Y
m≤n
pi+1 |m
pn/p
i+1
p
The binomial coefficient B(2n) = (
For 2n we have:
2n! =
Introduction
The
factorization of
n!
But
Automatic check
p2n/p
i+1
(3)
n
2n
2n
= 2 i+1 + ( i+1 mod 2)
pi+1
p
p
Moreover, if n ≤ p or logp (n) ≤ i we have
n
=O
pi+1
Bertrand’s
postulate
Erdös approach
(1932)
Y
p≤2n i<logp (2n)
Upper and lower
bounds for B
Chebishev’s Ψ
function
Y
2n
)
n
Hence, if we define
B(n) =
Y
Y
p(n/p
i+1
mod 2)
p≤n i<logp (n)
equation (3) becomes
2n! = n!2 B(2n)
(4)
Upper and lower bounds for B
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
By induction on n we easily prove:
2n!
22n
≤ B(2n) = 2 ≤ 22n−1
2n
n!
Upper and lower bounds for B
Introduction
The
factorization of
n!
Upper and lower
bounds for B
By induction on n we easily prove:
2n!
22n
≤ B(2n) = 2 ≤ 22n−1
2n
n!
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
For technical reasons, we need a slightly stronger results, namely,
Automatic check
B(2n) =
that holds for any n larger than 4.
2n!
≤ 22n−2
n!2
Outline
Introduction
1
Introduction
2
The factorization of n!
Upper and lower bounds for B
3
Chebishev’s Ψ function
4
Bertrand’s postulate
Erdös approach (1932)
Automatic check
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Chebishev’s Ψ function
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Ψ(n) =
Y
p≤n
plogp (n)
Chebishev’s Ψ function
Introduction
The
factorization of
n!
Ψ(n) =
Y
plogp (n)
p≤n
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Chebyshev’s ψ is the naperian logarithm of Ψ:
Erdös approach
(1932)
Automatic check
ψ=
X log n
p≤n
log p
log p
Relation between Ψ and π
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Ψ(n) =
Y
plogp (n) ≤
p≤n
nπ(n) ≤
Y
p≤n
plogp (n)+1 ≤
Y
n = nπ(n)
(5)
p≤n
Y
p≤n
p2logp (n) = Ψ(n)2
(6)
Relation between Ψ and π
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Ψ(n) =
Y
plogp (n) ≤
p≤n
nπ(n) ≤
Y
p≤n
plogp (n)+1 ≤
Y
n = nπ(n)
(5)
p≤n
Y
p2logp (n) = Ψ(n)2
p≤n
Erdös approach
(1932)
Automatic check
Next: provide lower and upper bounds for Ψ.
(6)
Ψ lower bound
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
We have:
Ψ(n) =
Y
p≤n
plogp (n) =
Y
Y
p≤n i<logp (n)
p ≥ B(n)
Ψ lower bound
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
We have:
Ψ(n) =
Y
p≤n
plogp (n) =
Y
Y
p ≥ B(n)
p≤n i<logp (n)
Hence, the lower bound for B gives a lower bound for Ψ:
22n /2n ≤ B(2n) ≤ Ψ(2n)
(7)
Ψ lower bound
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
We have:
Ψ(n) =
Y
p≤n
plogp (n) =
Y
Y
p ≥ B(n)
p≤n i<logp (n)
Hence, the lower bound for B gives a lower bound for Ψ:
22n /2n ≤ B(2n) ≤ Ψ(2n)
(7)
Automatic check
In particular, since Ψ is monotonic
2n/2 ≤ Ψ(n)
(8)
Ψ upper bound (1)
Introduction
The
factorization of
n!
For the upper bound, let us first observe that
Y
Y
Ψ(2n) = (
pj(n,p,i) )Ψ(n)
p≤2n i<logp (2n)
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
where j(n, p, i) is 1 if n < pi+1 and 0 otherwise.
(9)
Ψ upper bound (1)
Introduction
The
factorization of
n!
For the upper bound, let us first observe that
Y
Y
Ψ(2n) = (
pj(n,p,i) )Ψ(n)
p≤2n i<logp (2n)
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
where j(n, p, i) is 1 if n < pi+1 and 0 otherwise.
Indeed
Ψ(2n)
=
Automatic check
Y
Y
p
p≤2n i<logp (2n)
=
(
Y
Y
pj(n,p,i) )(
p≤2n i<logp (2n)
=
(
Y
Y
p≤2n i<logp (2n)
Y
Y
p≤2n i<logp (2n)
p
j(n,p,i)
)Ψ(n)
p1−j(n,p,i) )
(9)
Ψ upper bound (2)
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Then observe that
Y
Y
Y
pj(n,p,i) ≤ B(2n) =
p≤2n i<logp (2n)
Y
p≤2n i<logp (2n)
since if n < pi+1 then 2n/pi+1 mod 2 = 1.
p(2n/p
i+1
mod 2)
Ψ upper bound (2)
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Then observe that
Y
Y
Y
pj(n,p,i) ≤ B(2n) =
p≤2n i<logp (2n)
Y
p(2n/p
i+1
mod 2)
p≤2n i<logp (2n)
since if n < pi+1 then 2n/pi+1 mod 2 = 1.
Hence:
Ψ(2n) ≤ B(2n)Ψ(n)
(10)
Ψ upper bound (2)
Introduction
Using B upper estimates, we have, for any n
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Ψ(2n) ≤ 22n−1 Ψ(n)
(11)
Ψ(2n) ≤ 22n−2 Ψ(n)
(12)
and for 4 < n
Ψ upper bound (2)
Introduction
Using B upper estimates, we have, for any n
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Ψ(2n) ≤ 22n−1 Ψ(n)
(11)
Ψ(2n) ≤ 22n−2 Ψ(n)
(12)
and for 4 < n
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
We may now use inductively these extimates to prove
Ψ(n) ≤ 22n−3
(13)
Summary
Introduction
In conclusion,
The
factorization of
n!
22n
≤ B(2n) ≤ 22n−1
2n
Upper and lower
bounds for B
Chebishev’s Ψ
function
2n
≤ Ψ(n) ≤ 22n−3
n
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
2n/2 ≤
2n
≤ Ψ(n) ≤ nπ(n) ≤ Ψ(n)2 ≤ 24n−6 ≤ 24n
n
(14)
Outline
Introduction
1
Introduction
2
The factorization of n!
Upper and lower bounds for B
3
Chebishev’s Ψ function
4
Bertrand’s postulate
Erdös approach (1932)
Automatic check
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Bertrand’s postulate
Chebyshev’s approach was similar but more precise:
Introduction
The
factorization of
n!
(c1 +o(1))
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
n
n
≤ π(n) ≤ (c2 +o(1))
logn
logn
(n → ∞)
with
c1 = log(21/2 31/3 51/5 30−1/30 ) ≈ 0.92129
c2 = 6/5c1 ≈ 1.10555
Bertrand’s postulate
Chebyshev’s approach was similar but more precise:
Introduction
The
factorization of
n!
(c1 +o(1))
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
n
n
≤ π(n) ≤ (c2 +o(1))
logn
logn
(n → ∞)
with
c1 = log(21/2 31/3 51/5 30−1/30 ) ≈ 0.92129
c2 = 6/5c1 ≈ 1.10555
In particular, since c2 < 2c1
π(2n) > π(n)
for all large n (Bertrand’s postulate).
Erdös approach (1932)
Introduction
The
factorization of
n!
Let
k(n, p) =
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
X
(n/pi+1 mod 2)
i<logp n
Then,
B(n) =
Y
pk(n,p)
p≤n
Automatic check
We now split this product in two parts B1 and B2 , according
to k(n, p) = 1 or k (n, p) > 1.
case k (n, p) = 1
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Suppose that Bertrand postulate is false: there is no prime
between n and 2n.
Morevoer, if 2n
3 < p ≤ n, then
k(2n, p) =
X
i<logp n
(n/pi+1 mod 2) = 0
case k (n, p) = 1
Introduction
The
factorization of
n!
Suppose that Bertrand postulate is false: there is no prime
between n and 2n.
Morevoer, if 2n
3 < p ≤ n, then
Upper and lower
bounds for B
k(2n, p) =
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
X
(n/pi+1 mod 2) = 0
i<logp n
Indeed
2n/p = 2
for i > 1, and n ≥ 6, 2n/pi = 0, since
2n ≤ (
2n 2
) ≤ pi
3
case k (n, p) = 1
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Summing up, assuming Bertrand’s postulate is false,
Y
B1 (2n) =
p
p ≤ 2n
k(2n, p) = 1
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
=
Y
p
p≤2n/3
Automatic check
≤ Ψ(2n/3)
≤ 22∗(2n/3)
case k (n, p) > 1
k(n, p) =
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
X
i<logp n
(n/pi+1 mod 2) ≤ logp n
case k (n, p) > 1
k(n, p) =
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
X
(n/pi+1 mod 2) ≤ logp n
i<logp n
k (2n, p) ≥ 2 ⇒ logp 2n ≥ 2 ⇒ p ≤
√
2n
case k (n, p) > 1
k(n, p) =
Introduction
The
factorization of
n!
X
(n/pi+1 mod 2) ≤ logp n
i<logp n
k (2n, p) ≥ 2 ⇒ logp 2n ≥ 2 ⇒ p ≤
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
B2 (2n) =
Y
pk(2n,p)
p ≤ 2n
2 ≤ k(2n, p)
Erdös approach
(1932)
Automatic check
≤
Y
2n
√
p≤ 2n
√
= (2n)π(
√
≤ (2n)
2n)
2n/2−1
√
2n
A contradictory upper bound
Introduction
The
factorization of
n!
Putting everything together, assuming Bertrand’s postulate
is false, we would have, for any n ≥ 27
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
22n ≤ 2nB(2n) = 2nB1 (2n)B2 (2n) ≤ 22(2n/3) (2n)
√
2n/2
that, by algebraic manipulations and taking logarithms, gives
√
2n
2n
≤
(log2n + 1)
3
2
Make the contradiction explicit
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Make the contradiction explicit
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
find an integer m such that for all values larger than m
the equation
√
2n
2n
≤
(log2n + 1)
3
2
is false
Make the contradiction explicit
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
find an integer m such that for all values larger than m
the equation
√
2n
2n
≤
(log2n + 1)
3
2
is false
only use arithmetical means
Make the contradiction explicit
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
find an integer m such that for all values larger than m
the equation
√
2n
2n
≤
(log2n + 1)
3
2
is false
only use arithmetical means
m must be sufficiently small to allow to check the
remaining cases automatically in a feasible time.
Reduce
√
2n
2n
(log2n + 1) <
2
3
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
to
√
(∗)
using the fact that
2n
2n
(log2n + 1) ≤
2
4
n
n
<
m+1
m
for any n ≥ m2 (in our case, n ≥ 8).
Then transform (∗) to
2(log n + 2)2 ≤ n
Introduction
Use the fact that for any a > 0 and any n ≥ 4a
The
factorization of
n!
2a n2 ≤ 2n
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
to get, for any n ≥ 28
2(log n + 2)2 ≤ 4(log n)2
= 22 (log n)2
≤ 2log n
n
Automatic check
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
To complete the proof, we have to check that Bertrand’s
postulate is true for all integers less then 28 . To this aim, we
Automatic check
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
To complete the proof, we have to check that Bertrand’s
postulate is true for all integers less then 28 . To this aim, we
1
generate the list of all primes up to the first prime larger
than 28 (in reverse order)
Automatic check
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
To complete the proof, we have to check that Bertrand’s
postulate is true for all integers less then 28 . To this aim, we
1
generate the list of all primes up to the first prime larger
than 28 (in reverse order)
2
check that for any pair pi , pi+1 of consecutive primes in
such list, pi < 2pi+1
Automatic check
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
To complete the proof, we have to check that Bertrand’s
postulate is true for all integers less then 28 . To this aim, we
1
generate the list of all primes up to the first prime larger
than 28 (in reverse order)
2
check that for any pair pi , pi+1 of consecutive primes in
such list, pi < 2pi+1
Both the generation of the list and its check are performed
automatically (takes few seconds).
Using reflection, prove that our algorithm for generating
primes is correct and complete, and that the previous check
is equivalent to Bertrand’s postulate, on the given interval.
Eratosthene’s sieve
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
To generate primes we use the following sieve of
Eratosthene
let rec sieve aux l1 l2 t on t :=
match t with
[ O ⇒ l1 (∗ this case is vacuous ∗)
| S t1 ⇒ match l2 with
[ nil ⇒ l1
| cons n tl ⇒
sieve aux (n :: l1 )
( filter nat tl
(λ x.notb (x | n ))) t1 ]].
definition sieve m := sieve aux [] ( list n m) m.
Checking Bertrand’s condition
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
To check that each element of the list is less than twice its
successor:
let rec check list l \def
match l with
[ nil ⇒ true
| cons hd tl ⇒
match tl with
[ nil ⇒ hd = 2
| cons hd1 tl1 ⇒ hd1 < hd ∧ hd ≤2∗hd1 ∧ check list tl
]
]
.
Resources - library integrations
Prerequisites and integrations to the library
Introduction
logarithms, square root (632 lines)
The
factorization of
n!
inequalities involving integer division (339 lines)
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
magnitude of functions (255 lines)
decomposition of a number n as a product of its primes
(250 lines)
binomial coefficients (260 lines)
properties of the factorial function, lower and upper
2n
bounds of the binomial coefficient (
) (303 lines)
n
P
Q
integrations to the library for
and
(148 lines)
operations over lists (224 lines)
Resources - other
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
Selection from the garbage collector
Chebyshev’s Θ function (500 lines)
Abel summation (209 lines)
Upper and lower bounds for Euler’s e constant (1154
lines)
Resources - other
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
Automatic check
ln.
h.
prereq.
2411
54
chebys.
2073
51
bertrand
743
21
check
526
16
other
1863
48
total
7616
190
1.5 min per script line
in Hardy’s book [6], the proof of Bertrand’s postulate
takes 42 lines, while Chebyshev’s theorem takes
precisely three pages (90 lines):
De Brujin factor ≈ 20-25
1.5 hours/source mathematical line.
Bibliography
T.M.Apostol. Introduction to Analytic Number Theory. Springer Verlag, 1976.
Introduction
The
factorization of
n!
Upper and lower
bounds for B
Chebishev’s Ψ
function
Bertrand’s
postulate
Erdös approach
(1932)
A.Asperti, C.Armentano. A Page In Number Theory. Journal of Formalized
Reasoning. Vol.1, 2008.
J.Avigad, K.Donnelly, D.Gray, P.Raff. A formally verified proof of the prime
number theorem. ACM Transactions on Computational Logic, 9(1), 2007. To
appear in the ACM Transactions on Computational Logic.
P.Erdös. Beweis eines Satzes von Tschebyschef. In Acta Scientifica
Mathematica, volume 5, pages 194-198, 1932.
G.J.O.Jameson. The Prime Number Theorem. London Mathematical Society
Student Texts 53, Cambridge University Press, 2003.
Automatic check
G.H.Hardy, E.M.Wright. An introduction to the theory of numbers, Oxford
University Press, 1938. Fourth edition 1975.
G.Tenenbaum, M.Mendes France. The Prime Numbers and Their
Distribution. Student Mathematical Library, American Mathematical
Society,2000.
L.Théry. Proving Pearl: Knuth’s Algorithm for Prime Numbers. Proceeedings
of TPHOLs’03, LNCS 2758, pp.304-318, 2003.