[proofplan]
The theorem is a direct consequence of the assumed weight-level dimension-one Brun fundamental lemma. We first name the sifted indicator as an actual map on $\mathcal A$, so that the pointwise majorization and minorization statements can be summed without ambiguity. The upper and lower estimates then follow by finite summation over $\mathcal A$, substitution of the divisor-counting identity $|\mathcal A_d|=Xg(d)+r_d$, and the level-$D$ bound defining $R(D)$. The universality and limiting behavior of $F$ and $f$ are exactly the final hypotheses included in the assumed fundamental lemma.
[/proofplan]
[step:Define the sifted indicator before applying the Brun weights]
Fix [real numbers](/page/Real%20Numbers) $z>1$ and $D\geq 1$, and put
\begin{align*}
s:=\frac{\log D}{\log z}.
\end{align*}
Define the sifted indicator map $I_z: \mathcal A \to \{0,1\}$ by the following rule: $I_z(a)=1$ exactly when $\gcd(a,P_z)=1$, and $I_z(a)=0$ otherwise. Since $\mathcal A$ is finite, summing this indicator over $\mathcal A$ gives
\begin{align*}
S_{\mathcal A,\mathcal P}(z)=\sum_{a\in\mathcal A}I_z(a).
\end{align*}
For every divisor $d$ of $P_z$, the integer $d$ is squarefree and belongs to $\mathcal D_\infty$, so the identity $|\mathcal A_d|=Xg(d)+r_d$ is available for every divisor that can occur in the weight sums.
[/step]
[step:Sum the upper majorant and isolate the remainder]
Assume that $s$ lies in a compact subinterval of $(1,\infty)$. By the upper clause of the assumed weight-level dimension-one Brun fundamental lemma, there are real weights $\lambda_d^+$ supported on squarefree divisors $d\mid P_z$ with $d\leq D$, satisfying $|\lambda_d^+|\leq 1$, such that for every $a\in\mathcal A$,
\begin{align*}
I_z(a)\leq \sum_{d\mid \gcd(a,P_z)}\lambda_d^+.
\end{align*}
Summing this pointwise inequality over the finite set $\mathcal A$ and interchanging the finite sums gives
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\leq \sum_{d\mid P_z}\lambda_d^+|\mathcal A_d|.
\end{align*}
Substituting $|\mathcal A_d|=Xg(d)+r_d$ for each $d\mid P_z$ gives
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\leq X\sum_{d\mid P_z}\lambda_d^+g(d)+\sum_{d\mid P_z}\lambda_d^+r_d.
\end{align*}
Because $\lambda_d^+=0$ unless $d\leq D$ and $|\lambda_d^+|\leq 1$, the triangle inequality gives
\begin{align*}
\left|\sum_{d\mid P_z}\lambda_d^+r_d\right|\leq \sum_{d\in\mathcal D(D)}|r_d|=R(D).
\end{align*}
Therefore
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\leq X\sum_{d\mid P_z}\lambda_d^+g(d)+R(D).
\end{align*}
[guided]
The purpose of the upper Brun weights is to replace the exact condition $\gcd(a,P_z)=1$ by a divisor sum that can be evaluated through the sieve axioms. The exact condition is already encoded by the map $I_z: \mathcal A\to\{0,1\}$, where $I_z(a)=1$ precisely when $a$ survives the sieving by primes in $\mathcal P$ below $z$.
Since $s=\frac{\log D}{\log z}$ is assumed to lie in a compact subinterval of $(1,\infty)$, the upper part of the weight-level dimension-one Brun fundamental lemma applies. Its hypotheses are exactly the data in the theorem statement: the divisors are squarefree and supported on $\mathcal P$, the density map $g: \mathcal D_\infty\to\mathbb R$ is multiplicative, and the level is $D$. The conclusion gives weights $\lambda_d^+\in\mathbb R$, supported on divisors $d\mid P_z$ with $d\leq D$, with $|\lambda_d^+|\leq1$, and with the pointwise majorization
\begin{align*}
I_z(a)\leq \sum_{d\mid \gcd(a,P_z)}\lambda_d^+
\end{align*}
for every $a\in\mathcal A$.
We now sum over $a\in\mathcal A$. This causes no convergence issue because $\mathcal A$ is finite and $P_z$ has only finitely many divisors. The divisor $d$ contributes to the inner sum exactly for those $a\in\mathcal A$ such that $d\mid a$, and those elements form $\mathcal A_d$. Hence
\begin{align*}
S_{\mathcal A,\mathcal P}(z)=\sum_{a\in\mathcal A}I_z(a)\leq \sum_{a\in\mathcal A}\sum_{d\mid\gcd(a,P_z)}\lambda_d^+=\sum_{d\mid P_z}\lambda_d^+|\mathcal A_d|.
\end{align*}
For each divisor $d\mid P_z$, the divisor is squarefree and supported on $\mathcal P$, so the sieve axiom applies to the same $d$ and gives $|\mathcal A_d|=Xg(d)+r_d$. Substitution yields
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\leq X\sum_{d\mid P_z}\lambda_d^+g(d)+\sum_{d\mid P_z}\lambda_d^+r_d.
\end{align*}
The last sum is the only part depending on the remainders. Since the weights vanish for $d>D$, every nonzero term has $d\in\mathcal D(D)$, and since $|\lambda_d^+|\leq1$, the triangle inequality gives
\begin{align*}
\left|\sum_{d\mid P_z}\lambda_d^+r_d\right|\leq \sum_{d\in\mathcal D(D)}|r_d|=R(D).
\end{align*}
Thus the upper majorization has reduced the sifted count to the weighted density sum, with error at most $R(D)$:
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\leq X\sum_{d\mid P_z}\lambda_d^+g(d)+R(D).
\end{align*}
[/guided]
[/step]
[step:Evaluate the upper weighted density sum]
The upper main-term clause of the assumed weight-level dimension-one Brun fundamental lemma applies to the same weights $\lambda_d^+$. It gives
\begin{align*}
\sum_{d\mid P_z}\lambda_d^+g(d)=V_{\mathcal P,g}(z)\{F(s)+\varepsilon_+(D,z;s)\}.
\end{align*}
Substitution into the upper inequality from the preceding step gives
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\leq X V_{\mathcal P,g}(z)\{F(s)+\varepsilon_+(D,z;s)\}+R(D).
\end{align*}
The asserted upper uniformity is inherited from the hypothesis that $\varepsilon_+(D,z;s)\to0$ uniformly whenever $s$ remains in a fixed compact subinterval of $(1,\infty)$.
[/step]
[step:Sum the lower minorant and isolate the remainder]
Assume now that $s$ lies in a compact subinterval of $(2,\infty)$. By the lower clause of the assumed weight-level dimension-one Brun fundamental lemma, there are real weights $\lambda_d^-$ supported on squarefree divisors $d\mid P_z$ with $d\leq D$, satisfying $|\lambda_d^-|\leq 1$, such that for every $a\in\mathcal A$,
\begin{align*}
I_z(a)\geq \sum_{d\mid \gcd(a,P_z)}\lambda_d^-.
\end{align*}
Summing over $\mathcal A$, interchanging finite sums, and substituting $|\mathcal A_d|=Xg(d)+r_d$ gives
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\geq X\sum_{d\mid P_z}\lambda_d^-g(d)+\sum_{d\mid P_z}\lambda_d^-r_d.
\end{align*}
The support condition $d\leq D$ and the bound $|\lambda_d^-|\leq1$ imply
\begin{align*}
\sum_{d\mid P_z}\lambda_d^-r_d\geq -\sum_{d\in\mathcal D(D)}|r_d|=-R(D).
\end{align*}
Therefore
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\geq X\sum_{d\mid P_z}\lambda_d^-g(d)-R(D).
\end{align*}
[guided]
The lower estimate is structurally the same finite-summation argument as the upper estimate, but the fundamental lemma supplies lower weights only in the stronger range $s\in(2,\infty)$. This is why the theorem states the lower bound on compact subintervals of $(2,\infty)$ rather than compact subintervals of $(1,\infty)$.
In this range, the lower part of the assumed weight-level dimension-one Brun fundamental lemma applies to the same sieve data. It gives weights $\lambda_d^-\in\mathbb R$, supported on squarefree divisors $d\mid P_z$ with $d\leq D$, with $|\lambda_d^-|\leq1$, and with the pointwise minorization
\begin{align*}
I_z(a)\geq \sum_{d\mid\gcd(a,P_z)}\lambda_d^-
\end{align*}
for every $a\in\mathcal A$.
Summing this inequality over the finite set $\mathcal A$ and reversing the order of the finite sums gives
\begin{align*}
S_{\mathcal A,\mathcal P}(z)=\sum_{a\in\mathcal A}I_z(a)\geq \sum_{a\in\mathcal A}\sum_{d\mid\gcd(a,P_z)}\lambda_d^- = \sum_{d\mid P_z}\lambda_d^-|\mathcal A_d|.
\end{align*}
Every divisor $d\mid P_z$ lies in $\mathcal D_\infty$, so the divisor-counting identity gives $|\mathcal A_d|=Xg(d)+r_d$. Hence
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\geq X\sum_{d\mid P_z}\lambda_d^-g(d)+\sum_{d\mid P_z}\lambda_d^-r_d.
\end{align*}
For a lower bound, the remainder sum must be bounded from below. Since the weights vanish outside $\mathcal D(D)$ and satisfy $|\lambda_d^-|\leq1$, each summand satisfies $\lambda_d^-r_d\geq-|r_d|$. Summing over the possible nonzero terms gives
\begin{align*}
\sum_{d\mid P_z}\lambda_d^-r_d\geq -\sum_{d\in\mathcal D(D)}|r_d|=-R(D).
\end{align*}
Thus the lower combinatorial inequality is
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\geq X\sum_{d\mid P_z}\lambda_d^-g(d)-R(D).
\end{align*}
[/guided]
[/step]
[step:Evaluate the lower weighted density sum]
The lower main-term clause of the assumed weight-level dimension-one Brun fundamental lemma applies to the lower weights $\lambda_d^-$. It gives
\begin{align*}
\sum_{d\mid P_z}\lambda_d^-g(d)=V_{\mathcal P,g}(z)\{f(s)+\varepsilon_-(D,z;s)\}.
\end{align*}
Substituting this identity into the lower inequality from the preceding step yields
\begin{align*}
S_{\mathcal A,\mathcal P}(z)\geq X V_{\mathcal P,g}(z)\{f(s)+\varepsilon_-(D,z;s)\}-R(D).
\end{align*}
The asserted lower uniformity is inherited from the hypothesis that $\varepsilon_-(D,z;s)\to0$ uniformly whenever $s$ remains in a fixed compact subinterval of $(2,\infty)$.
[/step]
[step:Record the universal functions and their limiting behavior]
The functions $F:(1,\infty)\to\mathbb R$ and $f:(2,\infty)\to\mathbb R$ used in the preceding estimates are the universal functions supplied by the assumed dimension-one Brun fundamental lemma. By hypothesis, their construction depends only on the dimension-one Brun combinatorics and not on the particular finite set $\mathcal A$, the parameter $X$, or the remainders $r_d$. The same assumed fundamental lemma includes the limiting relations
\begin{align*}
\lim_{s\to\infty}F(s)=1
\end{align*}
and
\begin{align*}
\lim_{s\to\infty}f(s)=1.
\end{align*}
Together with the upper estimate on compact subintervals of $(1,\infty)$ and the lower estimate on compact subintervals of $(2,\infty)$, this proves exactly the stated theorem.
[/step]