How does  Yitang Zhang use Cauchy's inequality and Theorem 2 to obtain the  error term coming from the $S_2$ sum I have been reading Yitang Zhang's paper now for one and a half weeks and also volunteered to give a popular talk on the paper next week at Stockholm University. 
Today I  found a detail in the proof that seems outright wrong, and I am starting to worry that it is a serious problem (in particular since I promised to give a talk about the result next week).
Can anyone explain the last three lines on page 22, or if there indeed is a mistake on those lines give an alternative argument for obtaining the error term that we want to have?   Zhang has the following sum
$$ \mathcal E_i= \sum_{ d < D^2, d |  \mathcal P } \tau_3(d) \rho_2(d) \sum_{ c \in \mathcal C_i ( d ) } | \Delta( \theta,d,c) | .   $$
Then he says: By Cauchy's inequality and Theorem 2 we have 
$$ \mathcal E_i \ll x \mathcal L^{-A}. $$
Here  $\mathcal L$ denotes  $\log x$.  I do not see this. The reason is that Theorem 2 which is given in the following way: For $ 1 \leq i \leq k_0 $ we have
$$ \sum_{ d < D^2 , d | \mathcal P }  \sum_{ c \in \mathcal C_i(d) } | \Delta (\theta,d,c)|\ll x \mathcal L^{-A}, $$
is given in $L^1$-norm, Cauchy's inequality would need something in $L^2$-norm. The natural inequality to use would be  $$  \| f g \|_1  \leq \| f \| _\infty \| g \| _1, $$ where the first function would be the divisor function $\tau_3(d) \rho_2(d)$ and the second would be the sum in $c$. Thus it seems that Theorem 2 in its current form should not really give anything better than
$$  \mathcal  E_i  \ll \left( \max_{ d < D^2, d | \mathcal P} \tau_3(d) \rho_2(d) \right)   \sum_{ d < D^2, d | \mathcal P } \sum_{ c \in \mathcal C_i(d) } | \Delta( \theta,d,c ) | \ll  \left( \max_{ d < D^2, d | \mathcal P } \tau_3(d) \rho_2(d) \right) x \mathcal L^{-B}  $$
for any $B>0$. Here $ D^2 $ is a little more than $\sqrt x$ (to be precise $ x^{ 1 / 2  + 1 / 584 } $), and $\mathcal P$ is the product of all primes up to a small power of $x$.
Now the sup norm for the divisor function $\tau_3(n)$ certainly grows faster than any power of $\log x$ (even on square free numbers, e.g on primorials), even if it on the average grows like a power of $\log x$). The function $\rho_2(d)$ is defined on page 7 is multiplicative, has support on square free numbers and defined to be $v_p-1$ on the primes, where $v_p$ are the number of residue classes of $\mathcal H$ mod p. With the exception of finitely many $p$ this will be $k_0-1 =3.5\cdot 10^6-1$, i.e really large and contribute much more than the divisor function. Thus this should not get what we need, i.e. a bound of the form $x \mathcal L^{-B}$.
If my concerns are correct, I guess that you can start looking closely at the proof of theorem 2 and see if the same proof holds with the divisor functions thrown in.
If I have made som simple error in the above reasoning  I would appreciate your help to understand it, since I would like to understand at least all details on how Theorem 1 implies Theorem 2 before my talk next week (Of course as much as possible of the proof of Theorem 2 also).
Reference: Yitang Zhang: Bounded gaps between primes
           http://annals.math.princeton.edu/articles/7954 
 A: After a conversation with Prof. Terry Tao, he told me to use weighted C-S or split the sum, 
However, I realized that this can be done by splitting the sum and using the trivial bound, and without appealing to C-S at all. 
First sum is 
$$\sum_{f(d) < L^B} f(d) |\Delta(d)|\ll_A xL^BL^{-A}$$
Second sum is the remaining ones
$$\sum_{f(d)>L^B} f(d) |\Delta(d)|\ll\sum_d \frac{f(d)^2}{L^B} \frac{xL}{d}\ll\frac{xL^C}{L^B}$$
for some absolute constant $C$. 
Then choose $B>C$, and $A>B$. 
A: The incorporation of the factor of divisor function, $\tau_?(d)$, in the Bombieri-Vinogradov Theorem is familiar feature in sieve application. For example, this occurs in GPY and Graham's paper "Small gaps between product of two primes" page 748.
A: That also puzzled me first, but I think it is ok. By Cauchy-Schwarz,
$$ \mathcal E_i \leq \left(\sum_{ d < D^2, d |  \mathcal P }\sum_{ c \in \mathcal C_i ( d ) } \tau_3^2(d) \rho_2^2(d)  | \Delta( \theta,d,c) |\right)^{1/2}\left(\sum_{ d < D^2 , d | \mathcal P }  \sum_{ c \in \mathcal C_i(d) } | \Delta (\theta,d,c)|\right)^{1/2}.$$
In the first parenthesis, $| \Delta( \theta,d,c) |\ll x\mathcal{L}/d$ by trivial estimation (for $d < x$), hence the first parenthesis is $\ll x\mathcal{L}^B$ for some fixed $B>0$. The second parenthesis, on the other hand, is $\ll  x\mathcal{L}^{-A}$ for any $A>0$. Combining these,
$\mathcal E_i \ll  x\mathcal{L}^{-C} $ for any $C>0$, and this is sufficient.
P.S. The first display on page 5 requires a small correction: $\mathcal{E}$ should be multiplied by $\mathcal{L}^{2k_0+2l_0}$, because $\lambda(n)^2$ in (2.2) is not
bounded (cf. (9.7) in [6]). Of course this does not affect the main argument. 
A: The argument is OK (in fact it appears already -- probably as sketchily -- in Goldston, Pintz, Yildirim and certainly many other papers involving the Selberg sieve for instance. The point is to use Cauchy-Schwarz with the square root of the modulus of the error term $\Delta$, and one uses a trivial bound on the error term (it could be of size $D(\log D)^{A}$ for some $A$) in one factor, and Theorem 2 in the second: in other words, one writes
$\sum_d f(d) |\Delta(d)|\leq (\sum_d f(d)^2|\Delta(d)|)^{1/2}  (\sum_d |\Delta(d)|)^{1/2}.$
