\subsection{Proof of \texorpdfstring{\cref{lem:mellin}}{the lemma on smoothed partial sums}} \label{sec:proof-mellin} \LemMellin* \paragraph{External results.} \begin{itemize} \item[(E1a)] Functional equation: $\zeta(s)=2^s\pi^{s-1}\sin(\pi s/2)\Gamma(1-s)\zeta(1-s)$ as meromorphic functions, for $s\ne0,1$ \citep[Theorem~2.1, eq.~(2.1.1)]{Titchmarsh1986}. \item[(E1b)] For $\sigma>0$, $s\ne1$: $\zeta(s)=\frac{s}{s-1}-s\int_1^\infty\{x\}x^{-s-1}\rd x$, equivalent to \citet[eq.~(2.1.4)]{Titchmarsh1986}. \item[(E1c)] Standard properties of $\Gamma$: $\Gamma(z+1)=z\Gamma(z)$, $\Gamma(z)\Gamma(1-z)=\pi/\sin(\pi z)$ (hence $\abs{\Gamma(\frac12+iy)}^2=\pi/\cosh(\pi y)$), $\Gamma(\bar z)=\overline{\Gamma(z)}$, and $\Gamma(z)=\int_0^\infty t^{z-1}e^{-t}\rd t$ for $\re z>0$; together with Fourier inversion for Schwartz functions. \end{itemize} \begin{proof} Let $s=\frac12+it$ and fix an integer $k\ge1$. \textbf{Step 1 ($\eta$ on $\re s>1$).} For $\re s>1$, $\sum_{n\ge1}\varepsilon(n)n^{-s}=\sum n^{-s}-2\sum(2n)^{-s}=(1-2^{1-s})\zeta(s)=\eta(s)$ converges absolutely. The function $\eta$ is entire because $1-2^{1-s}$ cancels the simple pole of $\zeta$ at $s=1$. \textbf{Step 2 (vanishing derivatives of $w$).} Since $w\in C^\infty([0,\infty))$ is constant on $[0,1]$ and on $[2,\infty)$, we have $w^{(j)}(1)=w^{(j)}(2)=0$ and $\supp w^{(j)}\subseteq[1,2]$ for all $j\ge1$. \textbf{Step 3 (Mellin transform).} Define $\tilde w(z)\defeq\int_0^\infty w(y)y^{z-1}\rd y$ for $\re z>0$. Integrating by parts (boundary terms vanish at $0$ since $\re z>0$ and at $2$ since $w(2)=0$) gives $\tilde w(z)=F(z)/z$, where $F(z)\defeq-\int_1^2 w'(y)y^z\rd y$ is entire. Thus $\tilde w$ extends meromorphically to $\C$ with a single simple pole at $z=0$ of residue $F(0)=-(w(2)-w(1))=1$. Integrating by parts $j$ times (using Step~2) yields \[ (z+1)\cdots(z+j)F(z)=(-1)^{j+1}\int_1^2 w^{(j+1)}(y)y^{z+j}\rd y \] for all $z\in\C$ by analytic continuation. On $\re z=x$, the right-hand side is at most $\norm{w^{(j+1)}}_\infty 2^{\abs x+j}$, while $\abs{(z+1)\cdots(z+j)}\ge\abs{\im z}^j$. Hence for every $j\ge0$ and compact $[a,b]$ there is $B=B(j,a,b,w)$ such that $\abs{F(x+iv)}\le B(1+\abs v)^{-j}$ for all $x\in[a,b]$ and $v\in\R$. In particular, $\tilde w$ decays faster than any power on vertical lines, uniformly in vertical strips away from $z=0$. \textbf{Step 4 (Mellin inversion).} Fix $c>0$ and put $g(u)\defeq w(e^u)e^{cu}$. Then $g(u)=e^{cu}$ on $u\le0$ and $g(u)=0$ on $u\ge\log 2$, so $g$ is a Schwartz function with Fourier transform $\int_\R g(u)e^{ivu}\rd u=\tilde w(c+iv)$. Fourier inversion rewritten with $y=e^u$ gives \[ w(y)=\frac1{2\pi i}\int_{(c)}\tilde w(z)y^{-z}\rd z\qquad(y>0), \] converging absolutely by Step~3. \textbf{Step 5 (integral representation of $\AN$).} Take $c=1$ and $\re s=\frac12$. By Step~4, for every $n\ge1$, \[ \varepsilon(n)n^{-s}w(n/N)=\frac1{2\pi i}\int_{(1)}\varepsilon(n)n^{-s-z}N^z\tilde w(z)\rd z. \] Since $\sum_{n\ge1}\int_{(1)}\abs{n^{-s-z}N^z\tilde w(z)}\abs{\rd z}=N\zeta(3/2)\int_\R\abs{\tilde w(1+iv)}\rd v<\infty$, Tonelli's theorem permits summing over $n$ inside the integral. By Step~1 (as $\re(s+z)=3/2$), \[ \AN(s)=\frac1{2\pi i}\int_{(1)}\eta(s+z)N^z\tilde w(z)\rd z. \] \textbf{Step 6 (polynomial growth in the strip).} We check that $\abs{\eta(\sigma+iu)}\le C(1+\abs u)^A$ for $\frac12-k\le\sigma\le\frac32$ and $\abs u\ge1$, with $C,A$ depending only on $k$. The factor $1-2^{1-s}$ satisfies $\abs{1-2^{1-s}}\le 1+2^{1/2+k}$. For $\sigma\ge\frac12$ and $\abs u\ge1$, (E1b) gives $\abs{\zeta(\sigma+iu)}\le 3\abs{\sigma+iu}$. For $\frac12-k\le\sigma<\frac12$, (E1a) gives $\zeta(s)=\chi(s)\zeta(1-s)$ with $\re(1-s)\in(\frac12,k+\frac12]$, so $\abs{\zeta(1-s)}\le 3(k+1)(1+\abs u)$ and $\abs{\chi(s)}\le 2^\sigma\pi^{\sigma-1}e^{\pi\abs u/2}\abs{\Gamma(1-s)}$. To bound $\Gamma(x+iu)$ for $x>0$ and $u\in\R$, rotate the contour in $\Gamma(z)=\int_0^\infty t^{z-1}e^{-t}\rd t$ to the ray $\arg t=\phi\defeq\sign(u)(\pi/2-\delta)$ with $\delta\defeq 1/(1+\abs u)$: the circular arcs at $\abs t=R\to\infty$ and $\abs t=r\to0$ vanish, and on the ray we obtain \[ \abs{\Gamma(x+iu)}\le e^{-\abs u(\pi/2-\delta)}\Gamma(x)(\sin\delta)^{-x} \le e\,\Gamma(x)\bigl(\tfrac\pi2(1+\abs u)\bigr)^x e^{-\pi\abs u/2}, \] using $\sin\delta\ge 2\delta/\pi$ and $e^{\delta\abs u}\le e$. Thus the bound holds with $A=k+\frac32$. \textbf{Step 7 (contour shift).} The integrand $H(z)\defeq\eta(s+z)N^z\tilde w(z)$ is meromorphic with a single simple pole at $z=0$ of residue $\eta(s)$. Apply the residue theorem on the rectangle with corners $1\pm iY$, $-k\pm iY$. For $Y>\abs t+1$, Step~6 and Step~3 (with $j=k+4\ge A+2$) show that the horizontal sides are $O_{s,N}(Y^{-2})\to0$ as $Y\to\infty$. Since the vertical integral on $\re z=-k$ converges absolutely (Step~8), \[ \AN(s)-\eta(s)=\frac1{2\pi i}\int_{(-k)}\eta(s+z)N^z\tilde w(z)\rd z. \] \textbf{Step 8 (exact bound on $\re s=\frac12-k$).} Let $u_0=\frac12-k+iy$ ($y\in\R$). By (E1a), $\zeta(u_0)=2^{u_0}\pi^{u_0-1}\sin(\pi u_0/2)\Gamma(1-u_0)\zeta(1-u_0)$. We have $\abs{\zeta(1-u_0)}\le\zeta(k+\frac12)$ and $\abs{\sin(\pi u_0/2)}\le\cosh(\pi y/2)$. By (E1c), $\Gamma(\frac12+k-iy)=\Gamma(\frac12-iy)\prod_{j=0}^{k-1}(\frac12+j-iy)$, with $\abs{\Gamma(\frac12-iy)}=\sqrt{\pi/\cosh(\pi y)}\le\sqrt{2\pi}\,e^{-\pi\abs y/2}$ and $\prod_{j=0}^{k-1}\abs{\frac12+j-iy}\le (k+\abs y)^k\le k^k(1+\abs y)^k$. Using $\cosh(\pi y/2)e^{-\pi\abs y/2}\le1$ gives \[ \abs{\zeta(\tfrac12-k+iy)}\le 2\zeta(k+\tfrac12)\Bigl(\frac{k}{2\pi}\Bigr)^k(1+\abs y)^k, \] and hence $\abs{\eta(\frac12-k+iy)}\le E_k(1+\abs y)^k$ for all $y\in\R$, with $E_k\defeq 2(1+2^{1/2+k})\zeta(k+\frac12)(k/2\pi)^k$. \textbf{Step 9 (conclusion).} On $z=-k+iv$ we have $\abs{N^z}=N^{-k}$ and $1+\abs{t+v}\le(1+\abs t)(1+\abs v)$. By Steps~7 and~8, \[ \abs{\AN(\tfrac12+it)-\eta(\tfrac12+it)} \le \frac{E_k}{2\pi}\Bigl(\frac{1+\abs t}{N}\Bigr)^k\int_\R(1+\abs v)^k\abs{\tilde w(-k+iv)}\rd v. \] The integral is finite by Step~3 (with $j=k+2$), yielding the first claim with $C_k\defeq(2\pi)^{-1}E_k\int_\R(1+\abs v)^k\abs{\tilde w(-k+iv)}\rd v$. Setting $t=\gamma$ at a critical-line zero $\rho=\frac12+i\gamma$, where $\eta(\rho)=0$, gives the second claim. \end{proof} \subsection{Proof of \texorpdfstring{\cref{lem:sharp}}{the lemma on sharp partial sums}} \label{sec:proof-sharp} \LemSharp* \paragraph{External result.} \begin{itemize} \item[(E1d)] Hardy--Littlewood approximation to $\zeta(s)$ \citep[Theorem~4.11]{Titchmarsh1986}: for fixed $\sigma_0>0$ and $C>1$, uniformly for $\sigma\ge\sigma_0$, $x\ge1$, and $\abs t\le 2\pi x/C$, \[ \zeta(\sigma+it)=\sum_{1\le n\le x}n^{-\sigma-it}-\frac{x^{1-\sigma-it}}{1-\sigma-it}+O_{\sigma_0,C}(x^{-\sigma}). \] We apply this with $\sigma_0=\frac12$ and $C=2$, so the valid range is $\abs t\le\pi x$. \end{itemize} \begin{proof} Write $s=\frac12+it$ with $\abs t\le N$. \textbf{Case $1\le N<2$.} Here $\ANsharp(s)=1$ and $\abs t<2$. Since $\eta$ is entire, $M_0\defeq\max_{\abs t\le2}\abs{1-\eta(\frac12+it)}<\infty$. As $N^{-1/2}>2^{-1/2}$, we have $\abs{\ANsharp(s)-\eta(s)}\le \sqrt2\,M_0 N^{-1/2}$. \textbf{Case $N\ge2$.} Splitting $\ANsharp(s)$ into odd and even indices gives the identity \[ \ANsharp(s)=\sum_{1\le n\le N}n^{-s}-2^{1-s}\sum_{1\le m\le N/2}m^{-s}. \] Both $x=N$ and $x=N/2$ satisfy $x\ge1$ and $\abs t\le N<\frac\pi2 N=\pi(N/2)<\pi N$, so (E1d) applies at both $x=N$ and $x=N/2$ with an absolute implied constant $B_0$: \begin{align*} \sum_{1\le n\le N}n^{-s} &= \zeta(s)+\frac{N^{1-s}}{1-s}+O(N^{-1/2}),\\ \sum_{1\le m\le N/2}m^{-s} &= \zeta(s)+\frac{(N/2)^{1-s}}{1-s}+O\bigl((N/2)^{-1/2}\bigr). \end{align*} Multiplying the second relation by $2^{1-s}$ (which has modulus $\abs{2^{1-s}}=2^{1/2}$ on $\re s=\frac12$) and subtracting from the first, the pole terms cancel identically: \[ \frac{N^{1-s}}{1-s}-2^{1-s}\frac{(N/2)^{1-s}}{1-s}=\frac{N^{1-s}-N^{1-s}}{1-s}=0. \] Hence \[ \ANsharp(s)=(1-2^{1-s})\zeta(s)+O(N^{-1/2})=\eta(s)+O(N^{-1/2}) \] uniformly for $N\ge2$ and $\abs t\le N$. Taking $C_0\defeq\max(\sqrt2\,M_0, 3B_0)$ covers all $N\ge1$, and setting $t=\gamma$ at a critical-line zero $\rho=\frac12+i\gamma$ with $\abs\gamma\le N$ (where $\eta(\rho)=0$) yields $\abs{\ANsharp(\rho)}\le C_0 N^{-1/2}$. \end{proof}