Show that every principal ideal domain is a unique factorisation domain

I have to show that every principal ideal domain is a unique factorisation domain.

I can show that every non invertible element that is not equal to $0$ can be written as product of irreducible elements.

However, I have troubles showing that if

$$p_1 \dots p_n = q_1 \dots q_m$$ where $q_i, p_i$ are irreducibles elements, then $n = m$ (I already showed that every $p_j = u_iq_i$ with $u_i$ invertible)

Any hints?

• Have you bothered to read any book of abstract algebra, e.g., Dummit and Foote? This result is very standard. – Xam Nov 25 '17 at 14:41
• This is actually part of a proof in my textbook of ring theory, but the details of my question were left as an exercise for the reader. – user370967 Nov 25 '17 at 14:46
• You should include what book are you studying. Remember that is a good idea in this site to give as many context as possible. – Xam Nov 25 '17 at 14:49
• It is a textbook made by my professor in a language that's not English, so therefore I didn't include it. – user370967 Nov 25 '17 at 15:02

You know that in a PID a element is irreducible if and only if it is prime. Then, if $p_1$ on the left divides $q_1 \cdot \ldots \cdot q_m$ then it must divide one of this factors, lets say $q_i$. But $q_i$ is irreducible, thus

$$p_1 = uq_i$$

where $u$ is invertible. By induction, you can then show that $m=n$

after $k$ times, if $m$ is less than $k$ (which happen only when $m<n$) $$p_k \cdot \ldots \cdot p_n = u_k$$ Which is a contraddiction (the product of prime elements cannot be invertible). So $m \geq k$ and $$p_k \cdot \ldots \cdot p_n = u_k q_k \cdots q_m$$ We can then apply the same argument I explained on top.

If otherwise m > n eventually you will have $$1 = u_n q_n \cdot \ldots \cdot q_m$$ which is a contraddiction, as shown before

• Would this be correct? -> If we continue the process you described, we find that every $p_i$ can be written as $p_i = uq_j$. where the $q_j's$ are distinct from each other. Hence, we have $n \leq m$, but we can do the same argument with $q_i = u p_j$, showing that $m \leq n$, and hence $m = n$ – user370967 Nov 25 '17 at 14:18
• Sure, you are actually costructing two iniective maps between the sets $\{ p_1, \ldots, p_n \}$ and $\{ q_1, \ldots, q_m\}$. This is clearly enogh since they are finite sets – JayTuma Nov 25 '17 at 14:22

According to JayTuma you get (w.l.o.g. $i=1$):

$q_1\ldots q_m=p_1\ldots p_n=u_1q_1p_2\ldots p_n$

so $q_2\ldots q_m=u_1p_2\ldots p_n$ since every PID is an integral domain. Now substitute $p_2$ by (w.l.o.g.) $u_2q_2$ to get $q_3\ldots q_m=u_1u_2p_3\ldots p_n$ and so on. From this you easily deduce that $n$ has to be equal to $m$.

• If we continue this, we can only deduce that $m \geq n$. But we can reverse the roles of $p's$ and $q's$ and it then follows that $n \geq m$? – user370967 Nov 25 '17 at 14:22