I am reading 'Introductory Algebraic Number Theory' written by Saban Alaca and Kenneth S. Williams.
Theorem 2.3.1 says that
Let m be a positive squarefree integer. If there exist distinct odd primes p and q such that $$\left( \frac mp \right) = \left( \frac mq \right) = -1$$ and positive integers $t$ and $u$ such that $pt + qu = m$, $p \nmid t$, $q \nmid u$ and an integer $r$ such that $r ^2 ≡ pt \mod m$, then $\mathbb{Z} + \mathbb{Z}\sqrt m$ is not Euclidean with respect to $\phi_m$
where $\phi_m(a + b \sqrt m) = \vert a^2 - mb^2 \vert $ and $()$ is Legendre symbol for quadratic residues.
In the proof, the author assumes that $\mathbb{Z} + \mathbb{Z}\sqrt m$ is Euclidean and then applies Euclidean algorithm to $r\sqrt m$ and $m$ and arrives statement that there are $x$ and $y$ in integers (more specifically $x + y \sqrt m$ is a qoutient obtained when we apply Euclidean algorithm to $r\sqrt m$ and $m$) such that $mx^2 - (my - r)^2 = -pt \text{ or } qu$. Take $X = x$ and $Y = my - r$ so that we will have $$ mX^2 - Y^2 = -pt \text{ or } qu$$ Suppose $$ mX^2 - Y^2 = -pt $$ By hypothesis we must have $p \nmid m$ since $\left( \frac mp \right ) = -1 $. Now the author claims that
Also, as $p \nmid t$ we have $p \, \, \vert \vert −pt$. Hence $p \nmid X$ and $p \nmid Y$.
and arrives at contradiction. I do not see the logic used to conclude $p \nmid X$ and $p \nmid Y$. In the other case also the author makes similar claim. Since $p$ divides $pt$ and $p \nmid m$, $p$ should divide both of $X$ and $Y$ or none of them. So it is enough to show that one of them is not divisible by $p$. I do not see any reason to think $p \nmid x$ or $p \nmid my - r$. Where I am missing the logic?
Given a binary quadratic form $$ f(x,y) = a x^2 + b xy+ c y^2 $$ with $a,b,c$ integers. Given $$ \Delta = b^2 - 4 a c, $$ where we require that $\Delta,$ if non-negative, is not a square (so also $\Delta \neq 0,1$).
Proposition: given an odd prime $q$ such that $q$ does not divide $\Delta$ and, in fact, $$ (\Delta| q) = -1, $$ whenever $$ f(x,y) \equiv 0 \pmod q, $$ then BOTH $$ x \equiv 0 \pmod q, \; \; \; \; \; y \equiv 0 \pmod q. $$
Proof: the integers taken $\pmod q$ form a field; every nonzero element has a multiplicative inverse. If either $a,c$ were divisible by $q,$ we would have $\Delta $ equivalent to $b^2$ mod $q,$ which would cause $(\Delta|q)$ to be $1$ rather than $-1.$ As a result, neither $a$ nor $c$ is divisible by $q.$
Next, $q$ is odd, so that $2$ and $4$ have multiplicative inverses mod $q,$ they are non zero in the field. Put togethaer, $$4a \neq 0 \pmod q$$
Now, complete the square: $$ a x^2 + b xy+ c y^2 \equiv 0 \pmod q $$ if and only if $$ 4a(a x^2 + b xy+ c y^2) \equiv 0 \pmod q, $$ $$ 4a^2 x^2 + 4abxy + 4ac y^2 \equiv 0 \pmod q, $$ $$ 4a^2 x^2 + 4abxy + (b^2 y^2 - b^2 y^2) + 4ac y^2 \equiv 0 \pmod q, $$ $$ 4a^2 x^2 + 4abxy + b^2 y^2 - (b^2 y^2 - 4ac y^2) \equiv 0 \pmod q, $$ $$ (4a^2 x^2 + 4abxy + b^2 y^2) - (b^2 - 4ac) y^2 \equiv 0 \pmod q, $$ $$ (2ax + by)^2 - (b^2 - 4ac) y^2 \equiv 0 \pmod q, $$ $$ (2ax + by)^2 - \Delta y^2 \equiv 0 \pmod q, $$ $$ (2ax + by)^2 \equiv \Delta y^2 \pmod q. $$
Now, ASSUME that $y \neq 0 \pmod q.$ Then $y$ has a multiplicative inverse which we are allowed to call $1/y,$ and we have $$ \frac{(2ax + by)^2}{y^2} \equiv \Delta \pmod q, $$ $$ \left( \frac{2ax + by}{y} \right)^2 \equiv \Delta \pmod q. $$ However, the HYPOTHESIS that $ (\Delta| q) = -1 $ says that this is impossible, thus contradicting the assumption that $y \neq 0 \pmod q.$
So, in fact, $y \equiv 0 \pmod q.$ The original equation now reads $$ a x^2 \equiv 0 \pmod q $$ with the knowledge that $a \neq 0 \pmod q,$ so we also get $$ x \equiv 0 \pmod q, \; \; \; \; \; y \equiv 0 \pmod q. $$ $$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$