TITLE: The necessary and sufficient condition for a unit element in Euclidean Domain
QUESTION [10 upvotes]: I am trying to prove that in Euclidean domain D with Euclidean function d, u in D is a unit if and only if d(u)=d(1).
Suppose u is a unit, then there exist v in D such that uv=1, this implies u\1 so d(u)<=d(1), but obviously 1 divides u so d(1)<=d(u). Hence, d(u)=d(1).
Conversely, suppose  d(u)=d(1), since u is not zero, there exist q and r in D such that  1=uq+r with r=0 or d(r)< d(u).
If r=0 then u is a unit. Else d(r)< d(u) =d(1), this implies d(r)< d(1). I stop here, because I failed to argue that r must be zero.
Can anyone help me? Thanks.

REPLY [13 votes]: From the text of your question I assume that your $d$ function satisfies $d(x)\le d(z)$ if $x$ divides $z$. (BTW, this is the same as saying that $d(x)\le d(xy)$.)
Since $1$ divides every element, we have $d(1)\le d(x)$ for all $x$. If $u$ is a unit, then $u$ divides $1$ and so $d(u)\le d(1)$. This implies $d(u)=d(1)$.
Conversely, as you have remarked, $1=uq+r$ with $r=0$ or $d(r)< d(u)$. But if $d(u)=d(1)$, then if $r\ne0$ you'd get $d(r)<d(1)$, which contradicts $d(1)\le d(x)$ for all $x$. Hence $r=0$ and $u$ is a unit.