Section 21.3 The Prime Number Theorem
It turns out \(Li(x)\) is a pretty good approximation indeed.
Subsection 21.3.1 Stating the theorem
Theorem 21.3.1. Prime Number Theorem.
If \(\pi(x)\) is the number of primes \(p\leq x\text{,}\) then
In fact, the first bound also has this property (see Exercise 21.5.6):
Historical remark 21.3.2. The Prime Number Theorem.
The Prime Number Theorem was conjectured by Bernhard Riemann in his only paper on number theory. It was proved about 100 years after the initial investigations of Gauss by the French and Belgian mathematicians Jacques Hadamard and Charles-Jean de la Vallée-Poussin. They made good use of the analytic methods we are slowly approaching.
Any proof is this is well beyond the bounds of this text. One of several modern versions is in the analytic number theory text [E.4.6] by Apostol; see also [E.2.9]. Additionally, as a series of exercises (!) in that book, one can also explore a proof 6 due to Selberg and Erdős that is “elementary”, in the sense of not using complex-valued integrals. There is a well-known exposition of a very similar proof in [E.2.2], and another in [E.4.4].
Later, we'll see that many better approximations to \(\pi(x)\) exist which come out of this sort of thinking. Notice how the approximations in the next interactive cell take the logarithmic integral and subtract various correction factors in the attempt to get closer.
Subsection 21.3.2 Chebyshev's contributions
Although we cannot explore the theorem itself in depth, we can try to understand some of the intermediate steps. This is a good place to highlight the contributions of the great Russian mathematician Chebyshev.
Historical remark 21.3.3. Pafnuty Chebyshev.
Chebyshev (Чебышёв) was a prominent Russian mathematician of the mid-19th century, but his most important legacy may be bringing the native Russian tradition into international prominence. (Recall that Euler worked in Russia for much of his life, but alongside other Swiss scientists.) In addition to fundamental advances in this type of number theory, he worked on the theory of orthogonal polynomials which is used so much today in applications, and probability theory underlying modern statistics.
He was the first person to prove a conjecture known (even today!) as Bertrand's Postulate, after the French mathematician who first proposed it.
Theorem 21.3.4. Bertrand's Postulate.
For any integer \(n\geq 2\text{,}\) there is a prime between \(n\) and \(2n\text{.}\)
Proof.
It is actually quite possible to prove this at the level we have reached, but any proof is long enough to take us a little far afield.
Try testing it yourself below!
On a related note, although this proves you can't have too long of stretches without prime numbers, you can certainly have arbitrary stretches of composite numbers. See Exercise 21.5.7 for an easy example. Paul Nahin, in [E.7.13], describes the following more clever example, a cute result of Louis A. Graham.
Fact 21.3.5.
Multiply all the primes \(p\) from \(2\) to \(n+1\) to get \(N=\prod_{2\leq p \leq n+1}p\text{.}\) Then we have \(n\) consecutive composite integers from \(N-(n+1)\) to \(N-2\text{.}\)
Proof.
We know that \(N\) is a multiple of a prime factor 7 of each number \(x\) from \(2\) to \(n+1\text{.}\) For each such \(x\) and prime factor \(p_x\text{,}\) Proposition 1.2.8 guarantees that \(N-x\) is also a multiple of \(p_x\text{.}\)
Try testing it yourself below!
More immediately germane to our task of looking at \(\pi(x)\) and its value, Chebyshev proved the first substantial result on the way to the Prime Number Theorem, validating Legendre's intuition.
Theorem 21.3.6. Big Oh of Prime Pi.
It is true both that:
\(\pi(x)\) is \(O\left(\frac{x}{\log(x)}\right)\) and
\(\frac{x}{\log(x)}\) is \(O(\pi(x))\text{.}\)
Interestingly, this is not the same as the Prime Number Theorem; see Exercise 21.5.8.
What we will show here is the gist of a smaller piece of this theorem.
Proposition 21.3.7.
For all positive \(x\text{,}\) \(\pi(x)<2\frac{x}{\log(x)}\text{.}\)
Proof.
We follow Stopple's presentation in Section 5.2 of [E.4.5] closely in sketching out most of a proof of this below; see also [E.2.11] for a very similar proof. It is a little longer than some of our other proofs. It uses some very basic combinatorial ideas and calculus facts, however, so it is a great example of several parts of mathematics coming together.
First, it's not hard to verify this for \(x<1000\text{,}\) as the following figure demonstrates.
Now we'll proceed by induction, in an unusual way. We'll assume it is true for \(n\text{,}\) and prove it is true for \(2n\text{.}\) This needs a little massaging for odd numbers, but is a legitimate induction method.
With this in mind, we first assume that \(\pi(n)<2\frac{n}{\log(n)}\text{.}\) Now what?
Below, in Lemma 21.3.9 we look at the product of all the primes (if any) between \(n\) and \(2n\text{,}\) which we write as
In that result some combinatorial thinking leads to the following estimate:
These bounds show that \(P\) is between a certain power of \(n\) and a certain power of \(2\text{.}\)
Now we will manipulate this to get the final result. Begin by taking \(\log\) of both ends to get
Now divide out and isolate to get
In Exercise 21.5.10 you will show that, as long as \(n> 1000\text{,}\) we have the inequality
Now we can put it all together to see that
which is exactly what the proposition would predict.
To rescue this for \(2n+1\text{,}\) we need another calculus comparison. First, from above we have
Since \(2\frac{2n+1}{\log(2n+1)}>\frac{4n}{\log(2n+1)}\text{,}\) it will suffice then to show
Since \(n>1000\) and \(\frac{n}{\log(n)}\) is increasing, \(\frac{1}{n/\log(n)}\lt 0.007\text{,}\) so
To finish it suffices to show that in this range
Showing the last (purely calculus) steps is Exercise 21.5.11.
Lemma 21.3.9.
Let the product of all the primes between \(n\) and \(2n\) be written
Then we can bound it as
Proof.
Think of all the primes in question. On the one hand, each of these primes \(p\) is greater than \(n\text{,}\) and there are \(\pi(2n)-\pi(n)\) of them. So
On the other hand, each of these primes is greater than \(n\) but they are all in the list of numbers from \(n\) to \(2n\text{,}\) so their product divides
That is to say \(P\) is a factor of a binomial coefficient
and in particular,
We are now ready for the conceptual key of the proof, which uses the combinatorial leitmotif of counting things in two different way. Namely, we reinterpret this factorial fraction as the number of ways to choose \(n\) things from a collection of \(2n\) things! And the number of ways to choose \(n\) things is certainly less than the number of ways to pick any old collection out of \(2n\) things, which is \(2^{2n}\) (because you either pick it or you don't).
Since we showed both bounds, this concludes the proof.