Solution (source code)

= Solution

A <Euclidean domain> is an <integral domain> $R$ with a function $\nu:R\setminus\{0\}\to\mathbb N$ such that for each $a\in R$ and $b\ne0$ there are $q,r\in R$ with $a=qb+r$ and either $r=0$ or $\nu(r)<\nu(b)$. Some conventions add a multiplicative monotonicity condition; it is unnecessary for this implication.

Let $I$ be a nonzero <ideal>. Choose $d\in I\setminus\{0\}$ minimizing $\nu(d)$, possible because the values lie in the nonnegative integers. For $a\in I$, division by $d$ gives $a=qd+r$, with $r=a-qd\in I$. A nonzero remainder would contradict minimality, so $r=0$ and $a\in(d)$. Since $d\in I$, the reverse inclusion also holds. The zero <ideal> is $(0)$. Thus
$$
\boxed{\text{every ideal is principal, so every Euclidean domain is a principal ideal domain}.}
$$