\section{A giant prime factor in a fixed progression} \label{sec:progressions} The distribution of a large prime factor of $p-1$ will be needed with $p$ restricted to a fixed residue class. We prove this extension here. The modulus remains fixed throughout the argument. \begin{proposition}\label{prop:progressions} Let $M\geq1$, let $U\subset(\Z/M\Z)^\times$, and put \[ B_U(n)=\mathbf1_{n\bmod M\in U},\qquad d_U=\frac{|U|}{\varphi(M)}. \] For the giant-factor statistic $f_x$ and reciprocal sum $C_x$ defined above, and any fixed smooth function $\Phi$ of compact support in $(0,\infty)$, one has \begin{equation}\label{eq:ap-centered} \sum_{p\ {\rm prime}}\Phi\left(\frac{p-1}{x}\right)B_U(p) \bigl(f_x(p-1)-C_x\bigr)=o\left(\frac{x}{\log x}\right). \end{equation} Consequently, \begin{equation}\label{eq:ap-giant} \sum_{p\ {\rm prime}}\Phi\left(\frac{p-1}{x}\right)B_U(p)f_x(p-1) =\left(d_Uc_\eps\int_0^\infty\Phi(t)\,dt+o(1)\right) \frac{x}{\log x}. \end{equation} All constants may depend on $M,U,\eps$, and $\Phi$. \end{proposition} The proof extends the prime extraction in \cite[Section~7]{PD}. There are three points to check: the one-sided replacement of a prime factor, the two-sided correlation after the small prime factors have been removed, and the positive sieve used to remove the auxiliary weights. We give these checks explicitly. \subsection{Character twists in the replacement estimates} Retain the roughness threshold $w_x$ and the sieve product $V$ from Section~\ref{sec:preliminaries}. For a fixed Dirichlet character $\chi$ modulo $M$, the replacement coefficient is \begin{equation}\label{eq:ap-replacement-coefficient} \alpha_\chi(m)=\chi(m)m^{iv} \left(\mathbf1_{m\ {\rm prime}}- \frac{\mathbf1_{P^-(m)>w_x}}{V(w_x)\log m}\right), \end{equation} restricted to the interval occurring in the replacement. Dirichlet characters are extended by zero on nonunits. The marked coefficient estimate \cite[Lemma~10.2]{AR} applies to \eqref{eq:ap-replacement-coefficient}. Indeed, testing this coefficient against a character $\theta$ of modulus at most $L^A$ gives the original prime-minus-rough coefficient tested against $\chi\theta$. The latter has a modulus at most $M L^A$, and hence at most $L^{A+1}$ for sufficiently large $x$. The long-coefficient estimate \cite[Lemma~5.2]{PD}, with this larger fixed exponent, supplies every required logarithmic saving, uniformly in the interval and the prescribed frequency range. This also applies to the conjugate coefficient. Rough support and size bounds are unchanged. In particular, the second coefficient may be multiplied by $\chi(n)$ as well. The number of marking bands can be chosen independently of their particular admissible exponents. The corresponding two-sided assertion requires a separate argument: a character of an integer need not be unchanged when an active prime factor is removed. We recall the notation needed for that argument. Let $\mathcal P_g$ be the disjoint active prime groups in \cite[Section~6]{PD}, let \[ V_g=\sum_{q\in\mathcal P_g}\frac1q, \qquad \omega_g(n)=\sum_{q\in\mathcal P_g}\mathbf1_{q\mid n}, \qquad \omega_{\mathcal P}(n)=\sum_g\omega_g(n), \] and let $n_*$ be obtained from $n$ by removing all powers of primes in $\mathcal P=\bigcup_g\mathcal P_g$. There are $O(\log L)$ groups, each with reciprocal mass bounded above and below by fixed positive constants; the small groups lie between $\exp(L^{0.27})$ and $\exp(L^{0.36})$, and the large groups between $\exp(L^{0.39})$ and $\exp(L^{0.46})$. For their fixed damping parameter $00$, \begin{equation}\label{eq:ap-two-sided} \sum_{w\geq1}\frac{\Psi(w/x)}w F_x(w)\chi(w+1)G(w+1) A_1(w)A_1(w+1)\ll L^{-A}. \end{equation} \end{lemma} \begin{proof} We modify the graph proof of \cite[Theorem~6.1]{PD}. In its physical coordinates an edge joins $n$ to $n'=n+D$, where $D=D_RD_C$ is the product of its prime labels. The factor $D_R$ consists of labels shared by the two endpoints; $D_C$ consists of the remaining labels. For large $x$, every label is prime to $M$. Use $\chi(n')G(n')$ at the second endpoint and multiply the edge by $\overline{\chi(D)}$. This modification is allowed by the graph transference estimate \cite[Proposition~6.2]{PD}. To see this, write $e(t)=\exp(2\pi it)$ and expand \[ \overline{\chi(D)}=\sum_{r\bmod M}c_r e(rD/M),\qquad c_r=\frac1M\sum_{a\bmod M}\overline{\chi(a)}e(-ra/M). \] Parseval and Cauchy's inequality give $\sum_r|c_r|\leq\sqrt M$. Since \[ e(rD/M)=e(rn'/M)e(-rn/M), \] each summand is the original graph pairing with both endpoint vectors multiplied by $e(rn/M)$, using conjugation at the first endpoint in the inner product. These phases preserve all norms, supports, and independence from the sampled prime labels. The factor $\chi(n')$ can only decrease absolute values. Thus the same transference bound and the same finite family of comparison patterns \cite[Proposition~6.3]{PD} apply. Separating the smooth factor by Mellin inversion commutes with this finite Fourier expansion. Recombine the Fourier sum before removing the shared labels. On writing $n=D_Rw$ and $n'=D_R(w+D_C)$, the character factors become \begin{equation}\label{eq:ap-shared-labels} \overline{\chi(D_RD_C)}\chi(D_R(w+D_C)) =\overline{\chi(D_C)}\chi(w+D_C). \end{equation} This identity includes nonunits $w+D_C$, when both sides vanish. The invariant cores can now be stripped exactly as in the original proof. Their reciprocal prime factors and damping weights are unchanged; all collision errors have the original positive bounds. The pattern with $D_C=1$ is precisely \eqref{eq:ap-two-sided}. For a comparison pattern, $D_C=D_AD_B$, with the two free prime products sampled independently. Its separated expression has the form \[ \mathbb E\, b_1(D_A)b_2(D_B) \sum_w\mathcal U(w)\mathcal V(w+D_AD_B), \qquad |b_1|,|b_2|\leq1. \] Here $\mathcal U$ and $\mathcal V$ are the first and second endpoint sequences, including their smooth cutoffs and marked weights; the expectation uses the reciprocal-prime measures of the two free lists. Equation \eqref{eq:ap-shared-labels} replaces these three factors by \[ b_1(D_A)\overline{\chi(D_A)},\qquad b_2(D_B)\overline{\chi(D_B)},\qquad \chi(y)\mathcal V(y), \] respectively, and leaves $\mathcal U$ unchanged. The comparison estimates in \cite[Section~6]{PD} allow arbitrary bounded free-list tests. They use the second endpoint only through its global square norm and coefficient mean-square bounds, which are preserved here. Their local Fourier-energy and divisor-model cancellation estimates act on the unchanged first endpoint. Hence each comparison retains its arbitrary logarithmic saving. Subtracting the comparison terms from the graph estimate proves the lemma. \end{proof} \subsection{The positive sieve in residue classes} We may assume $\Phi\geq0$, by decomposing a general smooth function into finitely many such functions with scalar coefficients. Let $H$ be a fixed marking-array weight, a product of two such weights, or a fixed linear combination of these, and write $\mathbb E_x(H)$ for its independent-divisor-model mean. Choose $01$, no term is possible. If $(r,M)=1$, the congruences for a given $a\in U$ are \[ \ell y\equiv-1\pmod r,\qquad \ell y\equiv a-1\pmod M,\qquad d'\mid y. \] When $(d',r)=1$, smooth counting in the resulting progression gives \[ \frac{x}{Mr\ell d'}\int_0^\infty\Phi(t)\,dt+O_\Phi(1); \] otherwise there is no solution. There is no need for $a-1$ to be a unit modulo $M$. The total rounding error is $x^{1-\eps/2+c_0+o(1)}$, and the positive remainder and the exclusion of marking primes dividing $r$ have the bounds of \cite[Lemma~7.2]{PD}. This proves \eqref{eq:ap-progression-estimate} with the same model mean. The local density of the condition $q\mid u+1$ in this calculation is \[ g(q)=\begin{cases}0,&q\mid M,\\1/q,&q\nmid M.\end{cases} \] For $z$ larger than the prime divisors of $M$, \begin{equation}\label{eq:ap-sieve-density} \prod_{q\leq z}(1-g(q))=\frac{M}{\varphi(M)}V(z). \end{equation} The initial density $|U|/M$ therefore becomes $d_U$ at prime scale. Apply the positive block sieve \cite[Lemma~2.6]{PD}, equivalently the block construction of \cite[Lemma~2.9]{S}, with fixed even $h$ and \[ \gamma=\frac{c_0}{4h+3},\qquad z=x^\gamma. \] Its divisor level is at most $z^{4h+2}x^\gamma}} \Phi\left(\frac{n-1}{x}\right)B_U(n)W(n-1) \bigl(f_x(n-1)-C_x\bigr)\right| \ll \frac{e^{-h}}\gamma. \end{equation} The surviving constant may depend on the fixed progression and cutoff, but not on the number or positions of the fixed marking bands. The factor $m_W$ occurs in both sieve main terms. Errors depending on the particular array disappear in the $x$-limit. \subsection{Prime extraction and removal of the arrays} Expand the residue-class indicator as \begin{equation}\label{eq:ap-character-expansion} B_U(v)=\sum_{\chi\bmod M}b_\chi\chi(v),\qquad b_\chi=\frac1{\varphi(M)}\sum_{a\in U}\overline{\chi(a)}. \end{equation} The identity holds on nonunits as well. In the composite removal of \cite[Section~7]{PD}, a rough $v\asymp x$ is written as a product of a bounded number of prime factors, the bound depending on $\gamma$. Telescope each character term using \eqref{eq:ap-replacement-coefficient}. The other factors carry the corresponding multiplicative character values. All one-sided replacement errors have arbitrary logarithmic saving, while the predecessor core remains $f_x(v-1)-C_x$, clipped outside the required range if necessary. This clipping preserves its invariance under marking primes. In the subsequent allocation of active prime factors, retain $\chi(v)$ as a factor of the whole integer $v$. It is the same for every allocation of a fixed factorization. Thus the exact allocation counts and damping identities are unchanged. The errors in replacing thresholds and logarithms by their stripped versions are bounded by the same positive expressions as before, since $|\chi(v)|\leq1$; the positive estimates controlling unsuccessful allocations are likewise unchanged. The remaining invariant core $G(v_*)$ is therefore the original one. Every final two-sided correlation is \eqref{eq:ap-two-sided}. Lemma~\ref{lem:ap-two-sided} bounds these correlations with enough logarithmic saving to absorb the polynomial in $L$ cost of the finite expansions. Each composite contribution is $o(x/L)$. Consequently \eqref{eq:ap-presieve} also holds with its rough sum replaced by the sum over primes. For completeness, the last removal of the fixed arrays uses a positive estimate. Choose $b$ disjoint arrays $W_1,\ldots,W_b$, each with the sufficient fixed number $K$ of bands, and let $m_j$ be their model means. Put \[ Z_b(u)=\left|\frac1b\sum_{j=1}^b\frac{W_j(u)}{m_j}-1\right|^2. \] Apply \eqref{eq:ap-progression-estimate} without the giant factor to the expansion of this nonnegative square, followed by the upper sieve. The independent model for disjoint arrays, as in the deweighting step of \cite[Section~7]{PD}, gives \[ \limsup_{x\to\infty}\frac{L}{x} \sum_{p\ {\rm prime}}\Phi\left(\frac{p-1}{x}\right)B_U(p)Z_b(p-1) \ll\frac{C_K}{b}. \] Cauchy's inequality, the boundedness of $f_x-C_x$ on the support, and the prime-count upper bound now give \[ \limsup_{x\to\infty}\frac{L}{x} \left|\sum_{p\ {\rm prime}}\Phi\left(\frac{p-1}{x}\right)B_U(p) \bigl(f_x(p-1)-C_x\bigr)\right| \ll \frac{e^{-h}}\gamma+\sqrt{\frac{C_K}{b}}. \] First fix $h,\gamma,K,b$ and the arrays, and take $x\to\infty$. Next let $b\to\infty$ with $h,K$ fixed. Finally let the even integer $h\to\infty$, choosing a sufficient $K$ each time. Since $\gamma^{-1}=(4h+3)/c_0$, both errors vanish. This proves \eqref{eq:ap-centered}. The prime number theorem in the fixed residue classes, together with $C_x\to c_\eps$, proves \eqref{eq:ap-giant} and completes the proof of Proposition~\ref{prop:progressions}.