I don't understand. The end of the proof says r/p is a fraction, presumably because r must be an integer. But why must r be an integer?
There seems to be an implicit assumption that m is an integer, but the explicit assumptions only give the much weaker statement that "m is not a perfect square".
r is a shorthand for (m-n^2)q-2np, which is an integer because m,n,p,q are all integers.
> There seems to be an implicit assumption that m is an integer, but the explicit assumptions only give the much weaker statement that "m is not a perfect square".
Yes, it would have been more explicit to say "m is an integer that is not a perfect square."
On the other hand, this is pretty clear from the context. This is like looking at a computer program and saying "foo has no side-effect" without stating that "foo is a function".
There seems to be an implicit assumption that m is an integer, but the explicit assumptions only give the much weaker statement that "m is not a perfect square".