[proofplan]
The Prime Number Theorem is equivalent to the asymptotic $\psi(X) \sim X$ for the second Chebyshev function, where $\psi(X) = \sum_{n \leq X} \Lambda(n)$ and $\Lambda$ is the von Mangoldt function. The proof proceeds in three stages. First, we translate the counting problem into analytic information about the Riemann zeta function via the identity $-\zeta'(s)/\zeta(s) = \sum_{n \geq 1} \Lambda(n) n^{-s}$ on $\{\operatorname{Re}(s) > 1\}$. Second, we extend $\zeta$ meromorphically to a neighbourhood of the closed half-plane $\{\operatorname{Re}(s) \geq 1\}$ and establish the non-vanishing $\zeta(1 + it) \neq 0$ for $t \in \mathbb{R}$, which is the deep analytic content. Third, we feed this information into the Wiener–Ikehara Tauberian theorem to conclude $\psi(X) \sim X$, and finally translate back to $\pi(X) \sim X/\log X$ by partial summation.
[/proofplan]
[step:Reduce the counting statement to $\psi(X) \sim X$ via Chebyshev functions]
Define the first and second Chebyshev functions as
\begin{align*}
\vartheta: [1, \infty) &\to \mathbb{R}, & \vartheta(X) &:= \sum_{p \leq X} \log p, \\
\psi: [1, \infty) &\to \mathbb{R}, & \psi(X) &:= \sum_{n \leq X} \Lambda(n) = \sum_{p^k \leq X} \log p,
\end{align*}
where the sum in $\vartheta$ runs over primes and the sum in $\psi$ runs over prime powers $p^k$ with $k \geq 1$. Here $\Lambda: \mathbb{N} \to \mathbb{R}$ is the [von Mangoldt function](/pages/???), $\Lambda(n) = \log p$ if $n = p^k$ and $0$ otherwise.
We first bound the difference $\psi(X) - \vartheta(X)$. Separating the $k = 1$ term,
\begin{align*}
\psi(X) - \vartheta(X) = \sum_{\substack{p^k \leq X \\ k \geq 2}} \log p \leq \sum_{p \leq \sqrt{X}} \log p \cdot \lfloor \log_p X \rfloor \leq \sqrt{X} \log X,
\end{align*}
where we used that for each prime $p \leq \sqrt{X}$ there are at most $\log X / \log p$ values of $k \geq 2$ with $p^k \leq X$, and there are at most $\sqrt{X}$ such primes; the bound $\sqrt{X} \log X$ is then immediate from $\log p \cdot \log X / \log p = \log X$. Hence $\psi(X) - \vartheta(X) = O(\sqrt{X} \log X) = o(X)$, so $\psi(X) \sim X$ if and only if $\vartheta(X) \sim X$.
Next we connect $\vartheta$ to $\pi$ by Abel summation applied to the step function $\pi(t)$ with weights $\log$. Since $\vartheta(X) = \sum_{p \leq X} \log p = \int_{2^-}^X \log t \, d\pi(t)$, integration by parts gives
\begin{align*}
\vartheta(X) = \pi(X) \log X - \int_2^X \frac{\pi(t)}{t} \, d\mathcal{L}^1(t).
\end{align*}
Assuming $\vartheta(X) \sim X$ (to be established), the elementary bound $\pi(t) \leq t$ shows $\int_2^X \pi(t) t^{-1} \, d\mathcal{L}^1(t) = O(X)$, and with more care (using $\vartheta(X) \sim X$ together with the inverse summation $\pi(X) = \vartheta(X)/\log X + \int_2^X \vartheta(t)/(t \log^2 t) \, d\mathcal{L}^1(t)$) one obtains
\begin{align*}
\pi(X) = \frac{X}{\log X} + O\!\left(\frac{X}{\log^2 X}\right) \sim \frac{X}{\log X}.
\end{align*}
The second asymptotic $\pi(X) \sim \operatorname{Li}(X)$ follows because $\operatorname{Li}(X) = \int_2^X d\mathcal{L}^1(t)/\log t \sim X/\log X$ by L'Hôpital applied to the ratio. It therefore suffices to prove $\psi(X) \sim X$.
[/step]
[step:Express $\psi$ analytically via the logarithmic derivative of $\zeta$]
For $\operatorname{Re}(s) > 1$, the [Euler product](/theorems/1747) gives $\zeta(s) = \prod_p (1 - p^{-s})^{-1}$. Taking the logarithmic derivative — justified because the product converges absolutely and uniformly on compact subsets of $\{\operatorname{Re}(s) > 1\}$, so term-by-term differentiation of $\log \zeta(s) = -\sum_p \log(1 - p^{-s})$ is permitted — we obtain
\begin{align*}
-\frac{\zeta'(s)}{\zeta(s)} = \sum_p \frac{p^{-s} \log p}{1 - p^{-s}} = \sum_p \sum_{k \geq 1} \frac{\log p}{p^{ks}} = \sum_{n \geq 1} \frac{\Lambda(n)}{n^s}, \qquad \operatorname{Re}(s) > 1.
\end{align*}
The rearrangement of the double sum is absolute because $\sum_p \sum_k |\log p| \, p^{-k \sigma} \leq \sum_n \Lambda(n) n^{-\sigma} \leq \sum_n (\log n) n^{-\sigma} < \infty$ for $\sigma > 1$.
The Dirichlet series $F(s) := \sum_{n \geq 1} \Lambda(n) n^{-s}$ is the [Mellin–Dirichlet transform](/pages/???) of $\psi$: a summation-by-parts identity gives
\begin{align*}
F(s) = s \int_1^{\infty} \frac{\psi(X)}{X^{s+1}} \, d\mathcal{L}^1(X), \qquad \operatorname{Re}(s) > 1.
\end{align*}
Thus the asymptotic behaviour of $\psi$ is encoded in the analytic behaviour of $-\zeta'/\zeta$ near the line $\operatorname{Re}(s) = 1$.
[/step]
[step:Extend $\zeta$ meromorphically past $\operatorname{Re}(s) = 1$ and locate the pole]
By [Analytic Continuation to $\operatorname{Re}(s) > 0$](/theorems/1748), the function $\zeta$ extends meromorphically to $\{\operatorname{Re}(s) > 0\}$ with a single simple pole at $s = 1$ of residue $1$; that is, $\zeta(s) - 1/(s-1)$ is holomorphic there. Consequently $\zeta'/\zeta$ extends meromorphically to $\{\operatorname{Re}(s) > 0\}$, with a pole at $s = 1$ of residue $-1$ (coming from the simple pole of $\zeta$) and additional poles at each zero of $\zeta$ in the strip $\{0 < \operatorname{Re}(s) \leq 1\}$.
It follows that
\begin{align*}
G: \{\operatorname{Re}(s) > 0\} \setminus \{1, \text{zeros of } \zeta\} &\to \mathbb{C} \\
s &\mapsto -\frac{\zeta'(s)}{\zeta(s)} - \frac{1}{s - 1}
\end{align*}
is the correction obtained by subtracting off the pole at $s = 1$. Thus $G$ is holomorphic at $s = 1$, and its extension to a neighbourhood of the closed half-plane $\{\operatorname{Re}(s) \geq 1\}$ is controlled entirely by the zeros of $\zeta$ on the critical line $\operatorname{Re}(s) = 1$.
[/step]
[step:Establish the non-vanishing of $\zeta$ on the line $\operatorname{Re}(s) = 1$]
This is the analytic heart of the proof. We claim $\zeta(1 + it) \neq 0$ for all $t \in \mathbb{R}$.
The case $t = 0$ is immediate since $\zeta$ has a pole there. Fix $t \neq 0$. The argument rests on the non-negative trigonometric identity
\begin{align*}
3 + 4 \cos \theta + \cos 2\theta = 2(1 + \cos \theta)^2 \geq 0, \qquad \theta \in \mathbb{R}.
\end{align*}
For $\sigma > 1$ we have $\log \zeta(\sigma + it) = \sum_p \sum_{k \geq 1} \frac{1}{k} p^{-k\sigma} e^{-ikt \log p}$, so
\begin{align*}
\operatorname{Re} \log \zeta(\sigma + it) = \sum_p \sum_{k \geq 1} \frac{1}{k} p^{-k\sigma} \cos(kt \log p).
\end{align*}
Setting $\theta = kt \log p$ in the non-negative identity above and summing (all terms non-negative after multiplication by $k^{-1} p^{-k\sigma}$), we obtain
\begin{align*}
3 \log|\zeta(\sigma)| + 4 \log|\zeta(\sigma + it)| + \log|\zeta(\sigma + 2it)| \geq 0,
\end{align*}
equivalently
\begin{align*}
|\zeta(\sigma)|^3 \, |\zeta(\sigma + it)|^4 \, |\zeta(\sigma + 2it)| \geq 1. \qquad (*)
\end{align*}
Suppose for contradiction $\zeta(1 + it) = 0$. Then $\zeta(\sigma + it)$ has a zero of some order $m \geq 1$ at $\sigma = 1$, so $|\zeta(\sigma + it)| = O((\sigma - 1)^m)$ as $\sigma \downarrow 1$. Since $\zeta$ has a simple pole at $s = 1$, $|\zeta(\sigma)| \sim 1/(\sigma - 1)$. Since $\zeta(\sigma + 2it)$ is analytic at $\sigma = 1$ (the potential zero of $\zeta$ at $1 + 2it$ still gives $|\zeta(\sigma + 2it)| = O(1)$ from above), the left side of $(*)$ is
\begin{align*}
O\!\left( (\sigma - 1)^{-3} \cdot (\sigma - 1)^{4m} \cdot 1 \right) = O((\sigma - 1)^{4m - 3}) \to 0
\end{align*}
as $\sigma \downarrow 1$, since $4m - 3 \geq 1 > 0$ for $m \geq 1$. This contradicts $(*)$. Hence $\zeta(1 + it) \neq 0$.
Consequently $-\zeta'/\zeta$ extends to a meromorphic function on a neighbourhood of $\{\operatorname{Re}(s) \geq 1\}$ whose only singularity on the closed half-plane is the simple pole at $s = 1$ with residue $1$.
[/step]
[step:Apply the Wiener–Ikehara Tauberian theorem to extract $\psi(X) \sim X$]
We invoke the [Wiener–Ikehara Tauberian Theorem](/theorems/???): if $A: [1, \infty) \to [0, \infty)$ is non-decreasing and the integral
\begin{align*}
F(s) = s \int_1^{\infty} \frac{A(X)}{X^{s+1}} \, d\mathcal{L}^1(X)
\end{align*}
converges for $\operatorname{Re}(s) > 1$, and if $F(s) - c/(s - 1)$ extends continuously to the closed half-plane $\{\operatorname{Re}(s) \geq 1\}$ for some constant $c \geq 0$, then $A(X)/X \to c$ as $X \to \infty$.
We verify the hypotheses with $A = \psi$ and $c = 1$.
(a) Non-decreasing: $\psi$ is non-decreasing since $\Lambda \geq 0$. Non-negative: $\psi(X) \geq 0$.
(b) Mellin representation: shown in Step 2 — $F(s) = -\zeta'(s)/\zeta(s)$ for $\operatorname{Re}(s) > 1$.
(c) Continuous extension: by Step 4, $F(s) - 1/(s - 1)$ is holomorphic on a neighbourhood of $\{\operatorname{Re}(s) \geq 1\}$, since the only pole of $F$ on that half-plane is the simple pole at $s = 1$ of residue $1$. In particular it extends continuously to the boundary line $\operatorname{Re}(s) = 1$.
All hypotheses are met, so Wiener–Ikehara gives $\psi(X)/X \to 1$, i.e., $\psi(X) \sim X$.
[/step]
[step:Conclude $\pi(X) \sim X/\log X \sim \operatorname{Li}(X)$]
By Step 1, $\psi(X) \sim X$ implies $\vartheta(X) \sim X$, and the partial summation identity
\begin{align*}
\pi(X) = \frac{\vartheta(X)}{\log X} + \int_2^X \frac{\vartheta(t)}{t \log^2 t} \, d\mathcal{L}^1(t)
\end{align*}
(obtained by integration by parts from $\pi(X) = \int_{2^-}^X (\log t)^{-1} \, d\vartheta(t)$) gives $\pi(X) \sim X/\log X$, since the dominant term is $\vartheta(X)/\log X \sim X/\log X$ and the integral contributes a lower-order term $O(X/\log^2 X)$ because $\vartheta(t) = O(t)$.
Finally, $\operatorname{Li}(X) = \int_2^X d\mathcal{L}^1(t)/\log t \sim X/\log X$ by L'Hôpital's rule applied to the ratio $\operatorname{Li}(X) \cdot \log X / X$, whose derivative ratio tends to $1$. Hence $\pi(X) \sim X/\log X \sim \operatorname{Li}(X)$, completing the proof.
[/step]