\section{Rough numbers with many prime factors}\label{sec:rough} \begin{lemma}[The Mertens measure]\label{lem:Fp} Let $z \ge 2$, $\ell = \log z$, $S(z) := \sup_{x \ge z} \max\bigl(0,\ \sum_{p \le x} 1/p - \log\log x - B\bigr)$ and $\eps \ge S(z) + D(\ell) + 1/z$; for $z \ge 10372$, (I3) gives $S(z) \le D(\ell)$, and we take $\eps = 2D(\ell) + 1/z$. Let $\nu$ be the measure $\eps\,\delta_1 + \mathbf 1_{[1,\infty)}(u)\,du/u$ on $[1, \infty)$, where $\delta_1$ is the unit mass at $1$. For integers $j \ge 1$ and real $v$ let \[ F_j(v) := \sum_{\substack{p_1, \dots, p_j \ge z\\ p_1 \cdots p_j \le z^v}} \frac{1}{p_1 \cdots p_j} \quad (\text{ordered tuples of primes}), \qquad J_m(w) := \int_{\substack{u_1, \dots, u_m \ge 1\\ u_1 + \dots + u_m \le w}} \frac{du_1 \cdots du_m}{u_1 \cdots u_m}, \] with $J_0(w) = 1$ for $w \ge 0$, $J_0(w) = 0$ for $w < 0$, and $J_m(w) = 0$ for $w < m$. Then \[ F_j(v) \le N_j(v) := \nu^{\otimes j}\bigl\{ u \in [1, \infty)^j : u_1 + \dots + u_j \le v \bigr\} = \sum_{i=0}^{j} \binom{j}{i} \eps^i J_{j-i}(v - i). \] \end{lemma} \begin{proof} Let $\phi(u) := \sum_{z \le p \le z^u} 1/p$ for $u \ge 1$. By the definition of $S(z)$ at $z^u$, the lower bound of (I3) at $z$, and the possible term $p = z$, $\phi(u) \le \log u + S(z) + D(\ell) + 1/z \le \log u + \eps = \nu([1, u])$. For $j = 1$, $F_1(v) = \phi(v) \le N_1(v)$. For $j \ge 2$, with $u_p := \log p/\ell$, \[ F_j(v) = \sum_{p \ge z} \frac{1}{p} F_{j-1}(v - u_p) \le \int_{[1,\infty)} g\, d\phi, \qquad g(u) := N_{j-1}(v - u), \] by induction, where $d\phi$ is the measure with mass $1/p$ at each $u_p$. The function $g$ is nonnegative and nonincreasing, and it vanishes for $u > v - j + 1$. By the layer-cake formula, $\int g\, d\phi = \int_0^\infty \phi(\{g > t\})\, dt$, and each set $\{g > t\}$ is an initial segment $[1, u_t)$ or $[1, u_t]$ of $[1, \infty)$. The $d\phi$-measure of an initial segment is at most its $\nu$-measure: for closed segments this is the bound on $\phi$, and for half-open ones it follows by a limit, since $\nu$ has no atom beyond $1$. Hence $\int g\, d\phi \le \int g\, d\nu = N_j(v)$. The closed form follows by choosing which $i$ coordinates lie on the atom at $1$. \end{proof} \begin{lemma}[A Chebyshev-weighted count of rough integers]\label{lem:R3} Let $M \ge 2$ be an integer, $N = z^M$ with $z \ge 2$, $\eps$ as in Lemma~\ref{lem:Fp}, $0 < \delta < 1$ and $1 \le k \le M - 1$. Put $A_a(z) := \sum_{p \ge z} a \log p/p^a$ for $a \ge 2$, $\mu_0 := 1$, $\mu_1 := N_1(M - 1)$, and for $j \ge 2$ \[ \mu_j := \frac{N_j(M - 1)}{j!} + \frac{\mu_{j-2}}{z - 1} \qquad \text{or, if } \frac{1}{z - 1} \le \eps, \qquad \mu_j := \frac{N_j(M - 1)}{j!} + \frac{(M - 1) e^{2\eps}}{z - 1} . \] Then \[ \#\bigl\{ n \in (N^{1-\delta}, N) : P^-(n) \ge z,\ \Omega(n) = k \bigr\} \le \frac{N}{(1 - \delta)\log N} \Bigl[ c_\theta \mu_{k-1} + \sum_{a=2}^{k} A_a(z)\, \mu_{k-a} \Bigr]. \] \end{lemma} \begin{proof} Each counted $n$ has $\log n > (1 - \delta)\log N$, so the count is at most $\sum_n \log n/((1 - \delta)\log N)$, and by Chebyshev's identity $\sum_n \log n = \sum_n \sum_{p^a \parallel n} a \log p$. For $a = 1$ write $n = p n'$ with $p \nmid n'$; then $n'$ is $z$-rough with $\Omega(n') = k - 1$ and $n' \le N/z = z^{M-1}$, and $p \le N/n'$, so these terms contribute at most $\sum_{n'} \theta(N/n') \le c_\theta N \sum_{n'} 1/n'$ by (I3). The terms with $a \ge 2$ contribute at most $N \sum_{p \ge z} a \log p\, p^{-a} \sum_{n''} 1/n''$ over $z$-rough $n'' \le z^{M-1}$ with $\Omega(n'') = k - a$. It remains to show that $\sum 1/m$ over $z$-rough $m \le z^{M-1}$ with $\Omega(m) = j$ is at most $\mu_j$. The squarefree $m$ contribute at most $F_j(M - 1)/j! \le N_j(M - 1)/j!$ by Lemma~\ref{lem:Fp}. A non-squarefree $m$ is $q^2 m''$ for some prime $q \ge z$ and some $z$-rough $m'' \le z^{M-1}$ with $\Omega(m'') = j - 2$; so these $m$ contribute at most $\sum_{q \ge z} q^{-2}\, \mu_{j-2} \le \mu_{j-2}/(z-1)$, by induction on $j$. Alternatively, their contribution is at most $\sum_{q \ge z} q^{-2}$ times $\prod_{z \le p \le z^{M-1}} (1 - 1/p)^{-1} \le \exp(\log(M-1) + \eps + 1/(z - 1))$, by (I3) as in Lemma~\ref{lem:Fp}, and this is at most $(M - 1)e^{2\eps}$ when $1/(z-1) \le \eps$. \end{proof} The tails satisfy $A_a(z) \le a\bigl[ \log z/z^a + \log z/((a-1)z^{a-1}) + 1/((a-1)^2 z^{a-1}) \bigr]$, by comparison with the integral over all integers $n \ge z$. \begin{lemma}[Pre-sieving modulo $1155$]\label{lem:P} In the setting of Lemma~\ref{lem:R3}, let $N$ be even and $z \ge 8 \cdot 10^9$, and let $\mathcal B_k$ be the set of the counted $n$ for which $N - n$ is a prime other than $3$, $5$, $7$ and $11$. Then \[ \#\mathcal B_k \le \frac{N}{(1 - \delta)\log N} \Bigl[ \Pi(N)\, G_P \Bigl(1 + \frac{480}{840 \log z}\Bigr) \mu_{k-1} + \sum_{a=2}^{k} A_a(z)\, \mu_{k-a} \Bigr], \] where $G_P := 9/32$ and $\Pi(N) := \prod_{q \mid (N, 1155)} (q - 1)/(q - 2)$. \end{lemma} \begin{proof} Let $n \in \mathcal B_k$ and let $q \in \{3, 5, 7, 11\}$. Then $q \nmid n$, since $n$ is $z$-rough, and $q \nmid N - n$, since $N - n$ is a prime other than $q$. So $n$ avoids the class $0$ and the class of $N$ modulo $q$: two classes if $q \nmid N$, one if $q \mid N$. In the terms $a = 1$ of the proof of Lemma~\ref{lem:R3}, $n = p n'$ with $n'$ coprime to $1155$, so $p$ lies in one of $A(N) := \prod_{q \nmid N} (q - 2) \prod_{q \mid N} (q - 1)$ reduced classes modulo $1155$. By (I2) with $q = 1155$ and $x = N/n' \ge z \ge 8 \cdot 10^9$, the sum of $\theta(x; 1155, b)$ over these classes $b$ is at most $(A(N)/480)\, x\, (1 + 480/(840 \log z))$, and $A(N)/480 = G_P\,\Pi(N)$. The terms $a \ge 2$ are bounded as before. \end{proof} \begin{remark}\label{rem:P} Lemma~\ref{lem:P} is used inside a comparison between a good count and a bad count. Every good count below has the form $\ge U_N N m - N r$ with $m > 0$ and $r \ge 0$ ($r = 0$ in Lemma~\ref{lem:S4}; $m = \mathrm{main}/U_{\rm low}$ and $r = \mathrm{rem}$ in Lemma~\ref{lem:T}), and $U_N \ge U_{\rm low}\, \Pi(N)$. Since $\Pi(N) \ge 1$, every term of the bad count without the factor $\Pi(N)$, and $N r$, may be multiplied by it; so if the bad count is at most $\Pi(N) N (\Sigma_1 + \Sigma_2)$, where $\Sigma_1$ is the presieved $a = 1$ expression and $\Sigma_2$ collects the other terms, including the at most four excluded $n = N - q$ with $q \in \{3, 5, 7, 11\}$ and the possible element $1$, then $U_{\rm low} m - r - \Sigma_1 - \Sigma_2 > 0$ implies that the good count exceeds the bad count, whatever $\Pi(N)$ is. This is a statement about the combined comparison, not a bound for all rough integers. \end{remark}