\subsection{Proof of \texorpdfstring{\cref{thm:actual}}{the theorem on the actual primes}} \label{sec:proof-actual} \ThmActual* \paragraph{External results.} \begin{itemize} \item[(E1)] Truncated explicit formula \citep[Theorem~12.5]{MontgomeryVaughan2007}: for $c>1$, $x\ge c$, and $T\ge2$, with $\langle x\rangle$ the distance from $x$ to the nearest prime power other than $x$, \begin{gather*} \psi_0(x)=x-\sum_{\abs\gamma\le T}\frac{x^\rho}\rho-\log2\pi-\tfrac12\log(1-x^{-2})+R(x,T),\\ R(x,T)\ll(\log x)\min\Bigl(1,\frac x{T\langle x\rangle}\Bigr)+\frac xT(\log xT)^2, \end{gather*} the sum over zeros counted with multiplicity. Taking $c=2$ and bounding $\min(1,\cdot)\le1$, $\abs{\psi(x)-\psi_0(x)}\le\frac12\log x$, and $\abs{\log 2\pi+\frac12\log(1-x^{-2})}\le 3\log x$ for $x\ge2$ yields an absolute constant $C_D>0$ such that for all real $x\ge2$ and $T\ge2$, \begin{equation}\label{eq:explicit} \Bigl|\psi(x)-x+\sum_{\abs\gamma\le T}\frac{x^\rho}\rho\Bigr|\le C_D\Bigl(\frac xT\log^2(xT)+\log x\Bigr). \end{equation} \item[(E2)] The zero count \eqref{eq:zerocount}. \item[(E4)] \citet[Proposition~6.1, eq.~(6.2)]{MatsumotoSuzuki2024Mscrew}: for $X>1$, \begin{multline*} \sum_\rho\frac{X^\rho}{\rho(1-\rho)}=\sum_{n\le X}\Lambda(n)\Bigl(\frac Xn-1\Bigr)+(1+\gamma_E)X-X\log X\\ +1-\log2\pi-\tfrac12\log(1-X^{-2})-\tfrac X2\log\frac{X+1}{X-1}. \end{multline*} Since $\re\rho=\frac12$, the zero sum converges uniformly on bounded $X$-intervals; letting $X\to1^+$ gives $\sum_\rho 1/(\rho(1-\rho))=2+\gamma_E-\log(4\pi)=0.0461914\ldots$ \item[(F)] Fej\'er kernel transform: $\int_\R\bigl(\frac{\sin(t/2)}{t/2}\bigr)^2e^{-i\xi t}\rd t=2\pi(1-\abs\xi)_+$. \end{itemize} We also use \cref{prop:meansq,prop:meansqmult}. Our proof is self-contained (requiring no Besicovitch almost-periodicity theory): we prove a general mean-value lemma (Steps~2--7) for an arbitrary finite Dirichlet polynomial and specialise it to $\AN$, $\ANsharp$, and $1$ in Steps~8--9. \begin{proof} Every nontrivial zero is $\rho=\frac12+i\gamma$ with $\gamma\in\R$, $\abs\rho^2=\frac14+\gamma^2$, and $m_\gamma\defeq m_\rho$. Sums over $\rho$ count zeros with multiplicity. \textbf{Step 0 (general setting).} Let $M\ge1$ be an integer and $q=(q_1,\dots,q_M)\in\C^M$. Put $\norm q_1\defeq\sum_{n=1}^M\abs{q_n}$ and $D_q(s)\defeq\sum_{n=1}^M q_n n^{-s}$. For real $v$ put \[ E(v)\defeq e^{-v/2}\bigl(\psi(e^v)-e^v\bigr) \qquad(\text{so }E(v)=-e^{v/2}\text{ for }v<\log 2), \] and for $u\ge0$ set $f_q(u)\defeq\sum_{n=1}^M q_n n^{-1/2}E(u-\log n)$. Then $f_q$ is bounded and piecewise continuous on every bounded interval, and $\abs{D_q(\rho)}\le\norm q_1$. \emph{General lemma (proved in Steps~2--7).} The limit $\lim_{U\to\infty}\frac1U\int_0^U\abs{f_q(u)}^2\rd u$ exists and equals \[ \mc M_q\defeq\sum_{\gamma\ \mathrm{distinct}}\frac{m_\gamma^2\abs{D_q(\frac12+i\gamma)}^2}{\frac14+\gamma^2} =\sum_\rho m_\rho\frac{\abs{D_q(\rho)}^2}{\abs\rho^2}<\infty. \] \textbf{Step 1 (change of variables and specialisation).} Fix real $N\ge1$. For the smooth predictor, take $M\defeq\ceil{2N}-1\ge1$ and $q_n\defeq\varepsilon(n)w(n/N)$, so $D_q=\AN$ and $\norm q_1<2N$; for the sharp predictor, take $M\defeq\floor{N}\ge1$ and $q_n\defeq\varepsilon(n)$, so $D_q=\ANsharp$ and $\norm q_1\le N$. Since $e^{-u/2}\bigl(\psi(e^u/n)-e^u/n\bigr)=n^{-1/2}E(u-\log n)$ for all $u\ge0$ and $1\le n\le M$ (including $e^u/n<2$), we have $e^{-u/2}\DeltaN(e^u)=f_q(u)$ in the smooth case and $e^{-u/2}\DeltaNsharp(e^u)=f_q(u)$ in the sharp case. Substituting $x=e^u$ ($\rd x/x^2=e^{-u}\rd u$, $U\defeq\log X$) yields \[ \frac1{\log X}\int_1^X\abs{\DeltaN(x)}^2\,\frac{\rd x}{x^2} =\frac1U\int_0^U\abs{f_q(u)}^2\rd u, \] and identically for $\DeltaNsharp$. \textbf{Step 2 (convergence of the zero sums).} Grouping zeros by $k\defeq\floor{\abs\gamma}$ and applying \eqref{eq:zerocount} gives at most $2C_Z\log(3+k)$ zeros in each group, each with $\abs\rho^2\ge\frac14+k^2$ and $\log(3+\abs\gamma)\le\log(4+k)$. Hence \[ \Sigma_0\defeq\sum_\rho\frac{\log(3+\abs\gamma)}{\abs\rho^2} \le \sum_{k\ge0}\frac{2C_Z\log(3+k)\log(4+k)}{\frac14+k^2}<\infty, \] so the tails $\Sigma(T_0)\defeq\sum_{\abs\gamma\ge T_0}\log(3+\abs\gamma)/\abs\rho^2$ tend to $0$ as $T_0\to\infty$. Since $m_\rho\le C_Z\log(2+\abs\gamma)$ by \eqref{eq:zerocount} at $T=\gamma$ and $\abs{D_q(\rho)}\le\norm q_1$, we have $\mc M_q\le C_Z\norm q_1^2\Sigma_0<\infty$. Grouping the $m_\rho$ copies of each distinct zero gives the identity between the two expressions for $\mc M_q$. \textbf{Step 3 (local mean value inequality over zeros).} We claim that for any finite sub-list $\mc F$ of the zeros (with multiplicity), any complex $a_\rho$ ($\rho\in\mc F$), and any $V\in\R$, \[ \int_V^{V+1}\Bigl|\sum_{\rho\in\mc F}a_\rho e^{i\gamma v}\Bigr|^2\rd v \le c_*\sum_{\rho\in\mc F}\abs{a_\rho}^2\log(3+\abs\gamma), \qquad c_*\defeq\frac{4\pi C_Z}{0.979}. \] Indeed, let $\mc K(t)\defeq\bigl(\sin(t/2)/(t/2)\bigr)^2$ ($\mc K(0)=1$). Then $\mc K\ge0$, $\hat{\mc K}(\xi)=2\pi(1-\abs\xi)_+$ by (F), and for $\abs t\le\frac12$, $\mc K(t)\ge\mc K(\frac12)=(4\sin\frac14)^2=0.9793\ldots>0.979$. With $v_0\defeq V+\frac12$ and $S(v)\defeq\sum_{\rho\in\mc F}a_\rho e^{i\gamma v}$, \[ 0.979\int_V^{V+1}\abs S^2\le\int_\R\mc K(v-v_0)\abs{S(v)}^2\rd v =\sum_{\rho,\rho'\in\mc F}a_\rho\overline{a_{\rho'}}\,e^{i(\gamma-\gamma')v_0}\,\hat{\mc K}(\gamma'-\gamma). \] Using $\abs{\hat{\mc K}(\gamma'-\gamma)}\le 2\pi\,\mathbf 1_{\abs{\gamma-\gamma'}<1}$ and $\abs{a_\rho}\abs{a_{\rho'}}\le\frac12(\abs{a_\rho}^2+\abs{a_{\rho'}}^2)$, the right-hand side is at most $2\pi\sum_{\rho\in\mc F}\abs{a_\rho}^2\,\#\set{\rho'\in\mc F:\abs{\gamma'-\gamma}<1}$. Covering $(\gamma-1,\gamma+1)$ by $[\gamma-1,\gamma]\cup[\gamma,\gamma+1]$ and applying \eqref{eq:zerocount} bounds the inner count by $2C_Z\log(3+\abs\gamma)$, proving the claim. \textbf{Step 4 (explicit formula on unit windows).} Let $K_0\defeq\ceil{\log(2M)}\ge1$. Fix an integer $k\ge K_0$, put $T_k\defeq e^{k+1}>2$, and let $u\in[k,k+1]$. For every $1\le n\le M$, $x\defeq e^u/n$ satisfies $2\le e^k/M\le x\le e^{k+1}=T_k$. Applying \eqref{eq:explicit} at $T=T_k$, multiplying by $e^{-(u-\log n)/2}=n^{1/2}e^{-u/2}\le n^{1/2}e^{-k/2}$, and summing against $q_n n^{-1/2}$ yields \[ f_q(u)=-\sum_{\abs\gamma\le T_k}\frac{D_q(\rho)e^{i\gamma u}}\rho+r_k(u), \qquad \abs{r_k(u)}\le B_k\defeq 5C_D\norm q_1(k+1)^2 e^{-k/2}, \] with $\sum_{k\ge K_0}B_k^2<\infty$. \textbf{Step 5 (tail bound uniform in $k$).} Fix $T_0\ge1$ and set $P_{T_0}(u)\defeq-\sum_{\abs\gammaT_0$, and on $[k,k+1]$ Step~4 gives $f_q-P_{T_0}=Q_k+r_k$ with $Q_k(u)\defeq-\sum_{T_0\le\abs\gamma\le T_k}D_q(\rho)e^{i\gamma u}/\rho$. By Step~3 with $\abs{a_\rho}^2=\abs{D_q(\rho)}^2/\abs\rho^2\le\norm q_1^2/\abs\rho^2$, \[ \int_k^{k+1}\abs{Q_k}^2\le c_*\norm q_1^2\,\Sigma(T_0), \] uniformly in $k$, whence $\int_k^{k+1}\abs{f_q-P_{T_0}}^2\le 2c_*\norm q_1^2\Sigma(T_0)+2B_k^2$. \textbf{Step 6 (mean value of $P_{T_0}$).} Grouping equal ordinates gives $P_{T_0}(u)=\sum_{\gamma\in\mc O}c_\gamma e^{i\gamma u}$, where $\mc O$ is the finite set of distinct ordinates with $\abs\gamma