This post will be a little random. I plan on talking about a couple sufficient criteria for a ring $R$ to be a UFD, and then use (one of) them to show that the group ring $R[\Z^n]$ is a UFD when $R$ is ^{1}. These criteria will involve the concept of localizing a ring, which is something I have wanted to talk about on this blog for a while now, so let’s start with that.
Localization
Localization ^{2} is just about the nicest algebraic operation ^{3} one can apply; although this is not apparent from its definition. In essense, localization gives us a way to invert a subset of elements of a ring $R$. In this way, it is a generalization of the field of fractions of a ring. Before constructing the localization of a ring, we need to know which subsets of elements we can invert. Throughout this post, all rings are commutative with unity.
Note that when $R$ is a domain (and $0\not\in S$), the condition on equality of fractions becomes the usual $a/b=c/d\iff ad=bc$. Note furthermore that $\sinv R\subset\Frac(R)$ and $\Frac(\sinv R)=\Frac(R)$. Finally, $\sinv R=0\iff0\in S$. In order to prevent me from saying something technically false, for the rest of the post, assume that $0\not\in S$ for any multiplicative set we consider.
 $S=\{1,x,x^2,\dots\}$ for some $x\in R$. In this case, we write $\sinv R=R\sqbracks{\frac1x}\simeq R[y]/(1xy)$
 $S=R\sm\mfp$ where $\mfp\subset R$ is a prime ideal. In this case we write $\sinv R=R_\mfp$
Note that when $R$ is a domain and $\mfp=(0)$, we get $R_{(0)}=\Frac(R)$. In general, the second example above is particularly prevalent because it let’s you study rings “one prime at a time”. In particular,…
In addition to this, localization also respects many properties of the original ring. For example, we have the following theorems.
I think this should be everything we need for this post. With that done, when is a ring a UFD?
UFD Criteria
I always hate trying to prove rings are UFDs because my goto tactics are to prove something stronger (e.g. its a PID), but this clearly isn’t always possible. The definition of a UFD is kind of messy, so it’s nice to have alternative, sufficient conditions for the property. One^{4} such condition is
$(\impliedby)$ For this direction, let $S$ be the set of all (finite) products or prime elements of $R$ (including the empty product so $1\in S$). Then, $0\not\in S$ and $S$ is clearly multiplicative, so we can form the (nonzero) ring $A=\sinv R$. We claim that $A$ is a field. Pick any nonzero nonunit $r\in R$. Suppose that $1/r\not\in A$, so $(r)\subsetneq A$ meaning that it is contained in some maximal ideal $\mfm\subset A$. Then, $\mfp=\mfm\cap R$ is prime, and hence contains a principal prime ideal $(\pi)$. But this means that $\sinv(\pi)\subset\sinv\mfm\subsetneq A$ which is impossible as $\pi\in S$ so it's definitely a unit in $A$. Thus, $1/r\in A$, so we can write $$\frac1r=\frac b{\pi_1\dots\pi_n}\in A$$ where $b\in R$ and the $\pi_i\in R$ are all prime. We now prove by induction on $n$ that $r$ is the product of prime elements. If $n=1$, then $rb=\pi_1$ so since primes are irreducible and $r$ is not a unit, $r$ must itself be prime. For $n>1$, we have $rb=\pi_1\dots\pi_n$ so each $\pi_i$ divides $r$ or $b$. If some $\pi_j$ divides $b$, then $b=c\pi_j$, so $rc$ is a product of $n1$ primes, meaning $r$ is a product of primes by induction. Otherwise, each $\pi_i$ divides $r$ so $\parens{\frac r{\pi_1\dots\pi_n}}b=1$, making $b$ a unit and $r$ a product of primes. Hence, we have that every element of $R$ is a product of primes, and so $R$ is a UFD.
It is maybe worth mentioning that the above ^{5} can be proven without localizing. You replace the supposition that $(r)\subsetneq\sinv R$ with the supposition that $(r)\cap S=\emptyset$ to eventually show that $rb=\pi_1\dots\pi_n$ for some $b$. When doing this, you have to use Zorn’s lemma to show that there’s some prime ideal of $R$ containing $(r)$ that is disjoint from $S$ whereas we get the analagous fact more easily by considering an appropriate maximal ideal of $\sinv R$^{6}.
So UFDs are integral domains where every element is a product of primes or are integral domains where each prime ideal contains a principle prime ideal. To me, these conditions ^{7} sound more reasonable to prove than the original unique factorization into irreducibles formulation. As an application of the second of them, we also prove the following.
If that’s not a clean proof, then I don’t know what is. If you think about it, the above really proves the following more general theorem. ^{8}
 $\phi(a)$ is irreducible whenver $a$ is irreducible; and
 $\inv\phi(\mfp)\neq(0)$ for all nonzero primes $\mfp\subset R$
If you read the first footnote, then you may be wondering if I’ll prove that $R$ UFD $\implies R[x]$ UFD. I won’t ^{9}.
An Interesting Conjecture
First, a crash course on group rings.
 $R[G]$ is commutative iff $G$ is abelian.
 $R[G]$ has zero divisors if $G$ has a torsion element. Indeed, if $x^n=1$ in $G$, then $(1e_x)\in R[G]$ is a zero divisor (where by $1$ we technically mean $1e_1$).
 For $G=\Z$, we have $R[G]\simeq R[t,\inv t]\simeq R[t,s]/(1st)$
Now, I came across Kaplansky’s Criterion while a friend and I were trying to resolve the following:
This turns out to be true with a simple proof once you know that localization preserves UFDness.
At this point, the only remaining question is why would I care about that. Well, one of my friends mentioned the following problem, and I was surprised that this is not already known to be true, so we set about convincing ourselves it held in the simplest possible case: finitely generated abelian groups.
I should maybe mention that this is only one of Kaplansky’s conjectures, so the name isn’t welldefined.

Depending on how I’m feeling when I get to that part, I might also say why I care about this fact and/or “plug a hole” in this blog by proving that R[x] is a UFD when R is a UFD since I didn’t last time I had a chance to. ↩

I won’t get into why it’s called this, but it’s related to studying functions defined near a point of a space by looking at the functions that do not vanish at that point. ↩

“functor” ↩

Two? ↩

theorem, not lemma or corollary ↩

The kicker is that proving that any ideal is contained in a maximal one involves using Zorn’s lemma, so we still appeal to Zorn’s lemma; we just do so more implicitly. ↩

Or at least the second one ↩

I’m not gonna lie: Kaplansky’s Criterion has way more applications than I realized when I started writing this post. Why isn’t it more popular? ↩

I mistakingly thought that Kaplansky’s Criterion gave a simple proof of this along the lines of the localization proof: “Pick a prime ideal I of R[x] and intersect it with R to get a prime ideal J of R. Then J contains a prime element p which remains prime in R[x] so I contains the prime element p. Apply Kaplansky and you win.” The issue with this is that J may be the zero ideal of R, in which case you have to go through all the annoyingness of the standard proof that I’d rather avoid writing up. ↩