%! TEX root = AN.tex
% vim: tw=50
% 10/02/2025 09AM

\begin{proof}
  Recall from previous lecture that
  \begin{align*}
    \sieve(A, \mathcal{P}, z)
    &= \sum_{\substack{d \mid P(z) \\ d \le x}}
    \mu(d) |A_d|
    &&\text{(since $A_d = \emptyset$ for $d > x$)}
    \\
    &= \sum_{\substack{d \mid P(z) \\ d \le x}}
    \mu(d) g(d) |A|
    + O \left( \sum_{\substack{d \le x \\ d \mid
    P(z)}} |R_d| \right)
    &&\text{(sieve hypothesis)} \\
    &= |A| \sum_{d \mid P(z)} \mu(d) g(d)
    + O \left( \sum_{\substack{d \le x \\ d \mid
    P(z)}} |R_d| + |A| \sum_{\substack{d \mid P(z)
    \\ d > x}} g(d) \right) \\
    &= |A| \prod_{\substack{p \le z \\ p \in
    \mathcal{P}}} (1 - g(p))
    + O \left( \sum_{\substack{d \le x \\ d \mid
    P(z)}} |R_d| + |A| \sum_{\substack{d \mid P(z)
    \\ d > x}} g(d) \right)
  \end{align*}
  We estimate the first error term using
  Cauchy-Schwarz:
  \[
    \sum_{\substack{d \le x \\ d \mid P(z)}} |R_d|
    \le \left( \sum_{\substack{d \le x \\ d \mid
    P(z)}} |R_d|^2 \right)^{\half} \left(
    \sum_{\substack{d \le x \\ d \mid P(z)}} 1
    \right)^\half
  .\]
  Note that if $d \mid P(z)$, $d > x^{\half}$,
  then
  \[
    \omega(d) \ge \frac{\log x^{\half}}{\log z}
  ,\]
  ($\omega(d)$ -- number of distinct prime factors
  of $d$), since $z^{\omega(d)} \ge d \ge
  x^{\half}$.

  Hence, $2^{\omega(d)} \ge 2^{\frac{\log x}{2
  \log z}}$, $d \mid P(z)$, $d > x^{\half}$.

  Now we get
  \begin{align*}
    \sum_{\substack{d \le x \\ d \mid P(z)}} 1
    &\le 2^{-\frac{\log x}{2 \log z}}
    \sum_{\substack{d \le x \\ d \mid P(z)}}
    \ub{2^{\omega(d)}}_{= \tauf(d)} \\
    &\le 2^{-\frac{\log x}{2 \log z}} \sum_{d \le
    x} \tauf(d) \\
    &\vll 2^{-\frac{\log x}{2\log z}} x \log x
  \end{align*}
  (the last step is by
  \nameref{dirichlet:d:problem}: $\sum_{d \le x}
  \tauf(d) = (1 + o(1)) \cdot x \log x$).

  Substituting this in, the first error term
  becomes as desired.

  Now we estimate the second error term. We have
  \begin{align*}
    \sum_{\substack{d \mid P(z) \\ d > x}} g(d)
    &\le x^{-\frac{1}{\log z}} \sum_{d \mid P(z)}
    g(d) d^{\frac{1}{\log z}}
    &&\text{(since $d > x$ in the sum: Rankin's
    trick)} \\
    &= x^{-\frac{1}{\log z}} \prod_{\substack{p
    \le z \\ p \in \mathcal{P}}} (1 +
    g(p)\ub{p^{\frac{1}{\log z}}}_{\le
    z^{\frac{1}{\log z}} = e}) \\
    &\le x^{-\frac{1}{\log z}} \prod_{\substack{p
    \le z \\ p \in \mathcal{P}}} (1 + eg(p)) \\
    &\le \ub{x^{-\frac{1}{\log z}}}_{=
    e^{-\frac{\log x}{\log z}}} \prod_{\substack{p
    \le z \\ p \in \mathcal{P}}} (1 + g(p))^e
    &&\text{($1 + ey \le (1 + y)^e$)}
  \end{align*}
  Combining the error terms, the claim follows.
\end{proof}

\begin{example*}
  Take $A = [1, x] \cap \Zbb$, $\mathcal{P} =
  \Pbb$. Then $g(d) = \frac{1}{d}$, $R_d = O(1)$,
  so the sieve gives us
  \begin{align*}
    \sieve(A, P, z)
    &= \pi(x, z) \\
    &= (x + O(1)) \prod_{p \le z} \left( 1 -
    \frac{1}{p} \right) \\
    &\phantom{=}+ O \left( x^{\half} (\log x)^{\half}
    2^{-\frac{\log x}{4\log z}} x^{\half} + (x +
    O(1)) e^{-\frac{\log x}{\log z}} \prod_{p \le z}
   \left( 1 + \frac{1}{p} \right)^e \right)
  \end{align*}
  By \nameref{thm:merten},
  \begin{align*}
    \prod_{p \le z} \left( 1 - \frac{1}{p} \right)
    &= \frac{C + o(1)}{\log z} \\
    \prod_{p \le z} \left( 1 + \frac{1}{p} \right)
    &\le \prod_{p \le z} \left( 1 - \frac{1}{p}
    \right)^{-1} \\
    &= \left( \frac{1}{C} + o(1) \right) \log z
  \end{align*}
  Hence,
  \[
    \pi(x, z)
    = \frac{c + o(1)}{\log z}
    + O \left( x(\log x)^{\half} 2^{-\frac{\log
    x}{4 \log z}} + x e^{-\frac{\log x}{\log z}}
    (\log z)^e \right)
  .\]
  Hence, for $2 \le z \le \exp \left( \frac{\log
  x}{10 \log \log x} \right)$,
  \[
    \pi(x, z) = \frac{c + o(1)}{\log z} x
  .\]
  This asymptotic in fact holds for $z \le
  x^{o(1)}$.

  In particular, the Erastothenes-Legendre sieve
  gives
  \[
    \pi(x) \le \pi(x, z) + z \vll \frac{x}{\log x}
    \log \log x
  \]
  for $z = \exp \left( \frac{\log x}{10 \log \log
  x} \right)$. Not quite the Chebyshev bound
  $\pi(x) \vll \frac{x}{\log x}$.
\end{example*}
