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

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$$?

• I think you miss what the answer says right beneath the division: "where $x$ and $y$ are rational" Yes, we are mainly concerned about $\Bbb Z[\sqrt 2]$, but nothing is stopping us from using $\Bbb Q[\sqrt 2]$ in our intermediate calculations. – Arthur Sep 3 at 11:58
• @Mateus Rocha, I guess Arthur's point is to be noted, though there might not be inverses in $\mathbb{Z}[\sqrt{2}]$ you can always work in $\mathbb{Q}[\sqrt{2}]$ and try moving from one ring to another via rationalization as in the answer you pointed. – Rick Sep 3 at 12:25

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.
You need to check that for $$a,b\in \mathbb{Z}[\sqrt2]$$, $$b \neq 0$$ there exist $$q$$ and $$r$$ in $$\mathbb{Z}[\sqrt2]$$ s.t. $$a=qb+r$$ and either $$r=0$$ or $$\phi(r)<\phi(b)$$.
So you can assume $$b \neq 0$$.
• You got the question wrong. OP doesn't seem to be confused about what is meant with Euclidean division. Rather they link to an answer in which someone literally considers an element $a/b$ in $\mathbb Q(\sqrt{2})$. – Wojowu Sep 3 at 13:09