I don't know much (anything) about sieves, but as I read the section on the Selberg upper bound sieve from Greaves's *Sieves in Number Theory*, there is a theorem 4 which says that
If $Y\ge X \ge 2$, then


\begin{equation}
\pi(Y)-\pi(Y-X) \leq \frac{2X}{\log X} + O\left(\frac{X}{\log^2 X}\right).
\end{equation}


1. I would be interested in knowing what the best available bound is.
2. Also, I notice that this bound holds irrespective of the value of $Y$. Are there ways to improve it for say $Y = 2X$ or $X= \sqrt{Y}$?


Thank you in advance!


Here, $\pi(X) = \sum\_{p\leq x} 1$.



Best available bounds for $\pi(Y)-\pi(Y-X)$?
If $Y\geq X\geq 2$, then as Daniel Johnston wrote, [Montgomery and Vaughan](https://deepblue.lib.umich.edu/bitstream/handle/2027.42/152543/mtks0025579300004708.pdf) proved that


$$\pi(Y)-\pi(Y-X)\leq \frac{2X}{\log X}.$$


Whether this constitutes a "best bound" requires a definition of what you consider to be "best". Expounding on Noam Elkies' comment, it follows from work of [Heath-Brown](https://gdz.sub.uni-goettingen.de/id/PPN243919689_0389?tify=%7B%22view%22:%22info%22,%22pages%22:%5B26%5D%7D) (building on Hoheisel, Tchudakov, Heath-Brown and Iwaniec, Huxley, and many others) that if $Y^{7/12}\leq X\leq Y$, then


$$\pi(Y)-\pi(Y-X)\sim\frac{X}{\log Y}.$$


Therefore, for all $\epsilon>0$ there exists $Y\_0(\epsilon)>0$ such that if $Y\geq Y\_0(\epsilon)$ and $Y^{7/12}\leq X\leq Y$, then


$$\Big|\pi(Y)-\pi(Y-X)-\frac{X}{\log Y}\Big|\leq \epsilon \frac{X}{\log Y}.$$


(This can be made more precise using known error terms in the prime number theorem for short intervals.) The notion of "best" depends on context.


