Where is the fallacy in the argument using Prime Number Theorem

The arrow "$\to$" in $\frac{\log y}{\log x} \to 1$ is not the same as an equality sign ($=$). It means (see the "when $x \to \infty$" a couple of lines above) that $$\lim_{x \to \infty} \frac{\log y}{\log x} = \lim_{x \to \infty} \frac{\log \pi(x)}{\log x} = 1.$$

You cannot conclude from this that $\log y \to \log x$, simply because that statement isn't very meaningful. (E.g. if you use it to mean that $\displaystyle \lim_{x \to \infty} \log y = \log x$, then this is nonsensical as $x$ is a varying (increasing) variable on the left-hand-side of the equation, and what value does it take on the right-hand-side?)

As an example, consider the statement that $$\lim_{n \to \infty} \frac{n+1}{n} = 1.$$ This is a true statement, but you cannot use $\frac{n+1}{n} \to 1$ to conclude that $n+1 \to n$, nor can you then subtract $n$ from both sides to say that $1 \to 0$.


Edit: I see that there is some scope for confusion, because in the proof quoted in the question, they do seem to perform operations that look like they're taking logs on both sides of "$\to$" and treating it like an equality sign, etc. But this is not actually what they're doing, so let's rewrite the proof without the "$\to$" symbol to be clear. With $y = \pi(x)$, we have, by the Prime Number Theorem, $$\lim_{x \to \infty} \frac{y \log x}{x} = 1.$$ Now, we can "take logarithms" by using the fact that $\lim_{x \to \infty} \log g(x) = \log \lim_{x \to \infty} g(x)$ at good places, which is basically a consequence of the fact that $\log$ is a continuous function: see chain rule. So we get $$\lim_{x \to \infty} \log \frac{y \log x}{x} = \log 1 = 0.$$ This is the same as $$\lim_{x\to\infty} (\log y + \log \log x - \log x) = 0$$ Dividing throughout by $\log x$ (product rule), we get $$\lim_{x\to\infty} (\frac{\log y}{\log x} + \frac{\log \log x}{\log x} - \frac{\log x}{\log x}) = 0$$ Now using the facts $\frac{\log x}{\log x} = 1$ and $\lim_{x \to \infty}\frac{\log \log x}{\log x} = 0$ and $\lim_{x \to \infty}(a(x) + b(x)) = \lim_{x \to \infty} a(x) + \lim_{x\to\infty} b(x)$ when all exist ("sum rule"), this becomes $$\lim_{x\to\infty} \frac{\log y}{\log x} = 1$$ Finally, we have $$\lim_{x\to\infty} \frac{y\log y}{x} = \lim_{x\to\infty} (\frac{y\log x}{x}\frac{\log y}{\log x}) = \lim_{x\to\infty} \frac{y\log x}{x} \lim_{x\to\infty} \frac{\log y}{\log x} = 1 \cdot 1 = 1$$ as both limits exist; this is the "product rule" for limits again.


Conclusion: By default, you cannot freely perform operations on limits and expect them to work out. There are certain things you can do, but this must be justified. (BTW, taking antilog of both sides is something you can do: e.g. from $\displaystyle \lim_{x\to\infty}\frac{\log y}{\log x} = 1$, you can conclude that $\displaystyle \lim_{x\to\infty} e^{\frac{\log y}{\log x}} = e$. It's just that the expression $\log y \to \log x$ is meaningless.)

So rather than asking why we can't do certain things, the right question is to ask why we can do the operations we do, and examine them closely.


Consider this example: $${\log(1000x)\over\log x}\to1$$ but if you try your antilog technique you get $${1000x\over x}\to1$$ which is nonsense. Think about what happens in this simple example and you may be able to work out what the difficulty is.