In the same spirit as this question, I would like to prove explicitely that if $R$ is a domain which is not a UFD, then it is not a PID.
I am interested in the case where there is an element $a\in R$ which has at least two non equivalent decompositions.
Without any loss of generality, we may assume that $a=u \pi_1\cdots,\pi_r=u' \pi'_1\cdots\pi's,$ where $r,s\geq 1$, and for all $i,j$ ,$ \pi$ and $\pi'_j$ are not associate (the case $r=0$ or $s=0$ is not possible since we want two distinct decompositions)
What I can prove. I can prove that there exists a $j$ such that $(\pi_1,\pi'_j)$ is not a principal ideal .
Sketch. Assume to the contrary that $(\pi_1,\pi_j')$ is generated by some $\alpha_j$, for all $j$. Then $\alpha_j$ is a common divisor of $\pi_1$ and $\pi_j'$, so it is invertible since these irreducible elements are non associate. Thus $(\pi_1,\pi'_j)=R$ for all $j$. Hence there is a Bézout relation between $\pi_1$ and $\pi'_j$, and multipliying all these relations and rearranging yield a Bézout relation between $\pi_1$ and $a$. Since $\pi_1$ divides $a$, this yields the contradiction that $\pi_1$ is invertible.
My question is: is this result the best resut we may expect? More explicitely:
Question. Assume $a=u \pi_1\cdots,\pi_r=u' \pi'_1\cdots\pi's,$ where $r,s\geq 1$, and for all $i,j$ ,$ \pi$ and $\pi'_j$ are not associate
- Is true that for all $j$, the ideal $(\pi_1,\pi_j')$ is not a principal ideal ?
or
- can we produce an example where $(\pi_1,\pi'_k)=R$ for some $k$ and $(\pi_1,\pi'_j)\neq R$ for some $j$ ?
In this case, it would be nice to have an example with $R=\mathbb{Z}[\sqrt{d}]$. I would prefer $d\not\equiv 1 \ [4]$ (because if $d\equiv 1 \ [4]$, i know another method to produce an explicit non principal ideal).
I finally found an explicit example, proving that the principality of $(\pi_1,\pi'_j)$ depends on $j$.
Let $R=\mathbb{Z}[\sqrt{-21}]$. Then $2,3, 7,11,1\pm \sqrt{-21}$ are irreducible, pairwise non associate, and $2\cdot 3\cdot 7\cdot 11=-(\sqrt{-21})^2(1-\sqrt{-21})(1+\sqrt{-21})$.
Then, there is no Bézout relation $2z+z'(1-\sqrt{-21})=1$ (otherwise, multiply by $1+\sqrt{-21}$ to get a contradiction) , so $(2,1-\sqrt{-21})$ is not principal.
However, we have $2\cdot 11+(\sqrt{-21})^2=1$, so $(2,\sqrt{-21})$ is a principal ideal.