Solution (source code)

= Solution

Assume (i). For $a,b\in R$, write the <ideal> $(a,b)=(d)$. Then $d=ra+sb$ for some $r,s\in R$. Since $a,b\in(d)$, the element $d$ divides both; and every common divisor of $a,b$ divides the displayed linear combination $d$. Thus $d$ is a greatest common divisor and (ii) holds.