$\mathbb{Z}[\sqrt{2}]$ is a euclidean domain

euclidean-domainintegral-domainring-theory

I need to prove that $\mathbb{Z}[\sqrt{2}]$ is a euclidean domain.

I can use the function

$$\phi:\mathbb{Z}[\sqrt{2}]\backslash\{0\}\rightarrow\mathbb{N} \\
\phi(a+b\sqrt{2})=|a^2-2b^2|
$$

It was easy to prove $\phi$ is multiplicative, so, $\phi(r_{1}r_{2})\ge\phi(r_{1}).$

Now I need to prove that for all $r_{1},r_{2}\in\mathbb{Z}[\sqrt{2}]$, exists $q,r\in\mathbb{Z}[\sqrt{2}]$ such that

$$a=qb+r\quad\textrm{and}\quad\phi(r)<\phi(b).$$

I saw answer here dividing $a$ by $b$… but why can I do that? I have a domain, not a field, so not necessarily $b$ has an inverse $b^{-1}$ in $\mathbb{Z}[\sqrt{2}].$

Is that answer right? If yes, why? And if not, how can I find $p,q$?

Best Answer

in the answer you cited $x$ and $y$ are rational, we work in $\mathbb{Q}[\sqrt{2}]$ that is a field and then we approximate those $x$ and $y$ by the nearest integer.