Prime Number Theorem/GRH versus estimations Sometimes I believe elementary clues are lacking to me:
First instance (PNT). I have a Schwartz function $\phi$, whose Fourier transform $\widehat{\phi}$ has support in $(-2,2)$. Why does prime number theorem implies that
$$\sum_p \widehat{\phi}\left(\frac{2\log p}{\log R}\right)\frac{2\log p}{p\log R} = \frac{1}{2} \phi(0) + O\left(\frac{1}{\log R}\right) ?$$
is there any transformation hiding behing this fact? (I have tried replacing the Fourier transform by its definition and operating in order to get some Mertens' estimates to do...)
Second instance (GRH). With the same assumptions as above, $f$ an holomorphic cusp form of weight $k$ and level $N$, $\lambda_f(p^2)$ its Hecke eigenvalues, why does the Riemann hypothesis for $L(s, \mathrm{sym}^2 f)$ (which has coefficients $\lambda_f(p^2)$) implies that
$$\sum_p \lambda_f(p^2) \widehat{\phi}\left(\frac{2\log p}{\log R}\right)\frac{2\log p}{p\log R} = O\left(\frac{\log \log kN}{\log R}\right) ?$$
Thanks in advance!
 A: I see you're reading ILS! Anyway, since the support of $\widehat{\phi}$ is in $(-2,2)$, we can write the first sum as
\[\frac{2}{\log R} \sum_{p \leq R} \widehat{\phi}\left(\frac{2 \log p}{\log R}\right) \frac{\log p}{p}.\]
We use partial summation to write this as
\[\frac{2}{\log R} \widehat{\phi}\left(\frac{2 \log R}{\log R}\right) \sum_{p \leq R} \frac{\log p}{p} - \frac{2}{\log R} \int_{1}^{R} \sum_{p \leq t} \frac{\log p}{p} \frac{d}{dt} \widehat{\phi}\left(\frac{2 \log t}{\log R}\right) \, dt.\]
The first term vanishes as the support of $\widehat{\phi}$ is in $(-2,2)$. By the prime number theorem,
\[\sum_{p \leq t} \frac{\log p}{p} = \log t + O(1).\]
We use this split the integral into two sums. Using integration by parts, the main term is equal to
\[\frac{2}{\log R} \int_{1}^{R} \frac{1}{t} \widehat{\phi}\left(\frac{2 \log t}{\log R}\right) \, dt.\]
We make the change of variables $u = \frac{2 \log t}{\log R}$, so that it becomes
\[\int_{0}^{2} \widehat{\phi}(u) \, du,\]
which, by the fact that $\widehat{\phi}(u)$ is even and supported in $(-2,2)$, is equal to
\[\frac{1}{2} \int_{-\infty}^{\infty} \widehat{\phi}(u) \, du = \frac{1}{2} \phi(0).\]
For the error term, we note that
\[\frac{1}{\log R} \int_{1}^{R} \left|\frac{d}{dt} \widehat{\phi}\left(\frac{2 \log t}{\log R}\right)\right| \, dt = \frac{2}{(\log R)^2} \int_{1}^{R} \frac{1}{t} \left|\widehat{\phi}'\left(\frac{2 \log t}{\log R}\right)\right| \, dt.\]
Since $\widehat{\phi}$ is supported in $(-2,2)$, so is $\widehat{\phi}'$, and so
\[\int_{1}^{R} \frac{1}{t}  \left|\widehat{\phi}'\left(\frac{2 \log t}{\log R}\right)\right| \, dt \ll \int_{1}^{R} \frac{1}{t} \, dt = \log R.\]
Putting everything together, we see that
\[\sum_{p} \widehat{\phi}\left(\frac{2 \log p}{\log R}\right) \frac{2 \log p}{p \log R} = \frac{1}{2} \phi(0) + O\left(\frac{1}{\log R}\right).\]
For the second sum in your question, we use the same method of proof, writing this as
\[\frac{2}{\log R} \widehat{\phi}\left(\frac{2 \log R}{\log R}\right) \sum_{p \leq R} \frac{\lambda_f(p^2) \log p}{p} - \frac{2}{\log R} \int_{1}^{R} \sum_{p \leq t} \frac{\lambda_f(p^2) \log p}{p} \frac{d}{dt} \widehat{\phi}\left(\frac{2 \log t}{\log R}\right) \, dt.\]
Then the generalised Riemann hypothesis for $L(s, \mathrm{sym}^2 f)$ implies that
\[\sum_{p \leq t} \frac{\lambda_f(p^2) \log p}{p} = O(\log \log kN),\]
from which the result follows.
A: I'd think you only need to say that $\zeta(s)$ has no zeros on $\Re(s) = 1$ : 

Let $F(s) = \frac{-\zeta'(s)}{\zeta(s)}-\zeta(s)$. Then $f(\xi)= F(1+2 i\pi \xi)$ is the Fourier transform of the distribution $$\sum_{n=1}^\infty \frac{\Lambda(n)-1}{n} \delta(x-\ln n)$$  where $\Lambda(n) = \ln p$ if $n = p^k$ (which is almost the same as $\vartheta(n) = \ln p$ if $n=p$)
Let $\phi_A(x) = \phi(Ax)$ so that
$$ \sum_{n=1}^\infty \frac{\Lambda(n)-1}{A n} \hat{\phi}(\frac{\ln n}{A}) = \langle \hat{\phi}_A,\sum_{n=1}^\infty \frac{\Lambda(n)-1}{n} \delta(x-\ln n)\rangle = \langle \phi_A, f \rangle$$
Since $\zeta(s)$ has no zeros on $\Re(s) = 1$, then $f$ is continuous at $0$ and polynomially bounded, and since $\phi$ is $C^\infty_c$ 
$$\langle \phi_A, f \rangle = \mathcal{O}(1/A )$$
So it leaves us with
$$\sum_{n=1}^\infty \frac{1}{A n} \hat{\phi}(\frac{\ln n}{A}) $$
....
