# gcd in principal ideal domain

Let $R$ be a principal ideal domain. Show that any pair of nonzero elements $a, b\in R$ have a greatest common divisor and that for any greatest common divisor $d$, we have $d$ in $aR + bR$. Show also that $a, b$ are relatively prime if and only if $1\in aR + bR$.

My attempt: $aR + bR$ is an ideal of R. Let $(aR+bR) =(d)$. That is $(aR+bR)$ is generated by element $d$ in $R$. $a\in aR+bR$ , hence $a = dm$ for some $m\in R$. Now, $b\in aR+bR$, hence $b = dn$ for some $n\in R$. That shows $a$ and $b$ has a common divisor. But I don't know how to go further to turn $d$ into the greatest common divisor.

For b) Suppose $\gcd(a,b)=1$, then $1$ is in $aR+bR=R=(1)$. Conversely, if $1$ is in $aR + bR$, then $aR+bR=(1)=R$, $\gcd(a,b)=1$.

Let $$\,(a,b) = (d).\,$$ Then $$\,a,b \in (d)\,\Rightarrow\, d\mid a,b,\,$$ so $$\,d\,$$ is a common divisor of $$\,a,b.\,$$
Conversely $$\,d\in (a,b)\,$$ so $$\,d = r a + sb,\ r,s\in R,\$$ so $$\ c\mid a,b\,\Rightarrow\, c\mid d = ra+sb.\,$$
Hence $$\,d\,$$ is a common divisor of $$\,a,b\,$$ that is divisible by every common divisor. Therefore, by definition $$\,d\,$$ is a greatest common divisor of $$\,a,b.$$
Hint for $$(b):\$$ $$\,1\in (a,b)\iff (1) = (a,b) = (\gcd(a,b))\$$ by above
• @user73195 Above $\,c\,$ is any common divisor of $\,a,b.\,$ To show that $\,d\,$ is a greatest common divisor we must show that it is divisible by every such common divisor $\,c, \$ Here "greatest" is with respect to divisibility. Commented Apr 9, 2015 at 0:41
• @user73195 Yes, there are two steps/directions. the inclusion $\,(a,b)\subseteq (d)\,$ yields that $\,d\,$ is a common divisor of $\,a\,b,\,$ and the reverse inclusion $\,(a,b)\supseteq (d)\,$ yields that it is greatest, because it yields the Bezout identity expressing $\,d\,$ as an $R$-linear combination of $\,a,b.\,$ Such linear common divisors are always greatest, as the proof shows. Commented Apr 9, 2015 at 0:49