On P.D. Magnus. forallX: an Introduction to Formal Logic (Solutions) (pp. 98, exercise 6), is shown this solution:
$ \def\fitch#1#2{\quad\begin{array}{|l}#1\\\hline#2\end{array}} \fitch{}{ \fitch{Q(a)}{ Q(a) && \text{R 1} }\\ Q(a) \to Q(a) &&\mathbf{\to I} \text{ 1-2}\\ \exists x(Q(a) \to Q(x)) && \mathbf{\exists I}\text{ 3}\\ \forall y \exists x(Q(a) \to Q(x)) && \mathbf{\forall I}\text{ 3} } $
I thought that, in order to reach that conclusion, where a quantification over two variables is shown, I needed to assume, for example, $$Q(a)$$ and reach $$Q(b)$$ in order to infer $Q(a) \to Q(b)$. The book only uses only a, and repetition rule.
Could someone explain the concept behind that? Perhaps, I am missing something simple.
Just because some formula contains different variables does not mean that those variables have to refer to different objects.
In fact, consider the formula $\forall x \exists y \ y=x$
This is a logical truth, since for any object $x$ you pick, you can point to some object that is identical to $x$ ... namely $x$ itself! In fact, $x$ is the only object of being identical to $x$, so you have to pick $x$ for $y$.
Your formula is not very different: of course for anything that has property $Q$ you can find something that has property $Q$: the very first object!
So, logically, it all makes sense that for formulas like this the $y$ and the $x$ would refer to the same object.
OK, but do the formal rules allow for this? Sure! Look at the proof you posted and go through it line by line. Is there any step that does not make logical sense or that violates any of the rules as formally defined? No. And again, that's a good thing, because in cases like this, the only way to prove it is by having the $x$ and the $y$ point to the same object.