[proofplan]
The existence of a generator for each ideal is exactly the defining property of a principal ideal domain. The only point requiring proof is uniqueness of a generator up to multiplication by a unit. If two principal ideals agree, each generator lies in the ideal generated by the other; in the nonzero case, the integral-domain cancellation law then shows that the two coefficients are inverse units. The zero case is handled separately before cancellation is used.
[/proofplan]
[step:Use the definition of a principal ideal domain to generate the ideal]
Let $I \trianglelefteq R$ be an ideal. By the definition of a [principal ideal domain](/page/Principal%20Ideal%20Domain), every ideal of $R$ is principal. Therefore there exists $a \in R$ such that $I = (a)$.
[/step]
[step:Convert equality of principal ideals into two divisibility relations]
Assume $a,b \in R$ satisfy $(a) = (b)$. Since $a \in (a) = (b)$, there exists an element $c \in R$ such that $a = cb$. Since $b \in (b) = (a)$, there exists an element $d \in R$ such that $b = da$.
[guided]
Assume $a,b \in R$ and $(a) = (b)$. The equality of ideals means that every element generated by $a$ is also generated by $b$, and conversely every element generated by $b$ is also generated by $a$.
First, $a$ belongs to its own principal ideal $(a)$. Since $(a) = (b)$, this places $a$ in $(b)$. By the definition of the principal ideal generated by $b$, there is some coefficient $c \in R$ with $a = cb$.
Second, $b$ belongs to $(b)$. Since $(b) = (a)$, this places $b$ in $(a)$. Hence there is some coefficient $d \in R$ with $b = da$.
At this stage $c$ and $d$ are only elements of $R$. We have not yet shown that either one is a unit; that will come from the integral-domain property in the nonzero case.
[/guided]
[/step]
[step:Handle the zero generator before using cancellation]
If $a = 0_R$, then $(b) = (a) = (0_R)$. Since $b \in (b)$, this implies $b \in (0_R)$, so $b = 0_R$. Taking $u = 1_R$, which is a unit of $R$, gives $a = 0_R = 1_R b = ub$. Thus the desired conclusion holds when $a = 0_R$.
[/step]
[step:Cancel the nonzero generator to prove the coefficient is a unit]
Now assume $a \ne 0_R$. Substituting $b = da$ into $a = cb$ gives $a = cda$. Equivalently, $a(1_R - cd) = 0_R$. Because $R$ is a principal ideal domain, it is an integral domain. By the zero-product property in an integral domain, applied to the equality $a(1_R - cd)=0_R$ and the nonzero factor $a \ne 0_R$, we obtain $1_R - cd = 0_R$. Hence $cd = 1_R$. Therefore $c$ is a unit of $R$, with inverse $d$. Setting $u = c \in R^\times$, the relation $a = cb$ becomes $a = ub$. This proves that any two generators of the same principal ideal differ by multiplication by a unit, and completes the proof.
[/step]