Is 7 prime or irreducible or something else in $\mathbb{Z}_{21}$

I thought I understood prime numbers pretty well, but now I'm told about this thing called irreducible, that sometimes numbers are irreducible but not prime (like 3 in $\mathbb{Z}[\sqrt{-5}]$) and sometimes prime but not irreducible (like 3 in $\mathbb{Z}_6$). To try to understand this concept, I started looking at $\mathbb{Z}_{21}$ but I have only confused myself more: I thought maybe 7 is also prime even though $7 \times 7 = 7$, but I also see $14 \times 14 = 7$. So what is 7 here?


Because 21 is not prime, $\mathbb{Z}_{21}$ is not an integral domain, which means it has nonzero elements that multiply to zero. Talking about irreducible elements is only really meaningful in an integral domain. Specifically in this case, $7 \times 3 = 0$ in $\mathbb{Z}_{21}$, so 7 is called a zero divisor. In fact, in any ring $\mathbb{Z}_n$, every element is either a unit or a zero divisor (or 0), and the study of irreducibility is always trivial, because it only applies to non-units in a ring without zero divisors.

7 also a prime element of $\mathbb{Z}_{21}$, which means that if $7 | ab$, then $7 | a$ or $7 | b$. This is made easier by the fact that 7 only divides 7, 14, and 0. (14 is also prime in $\mathbb{Z}_{21}$, because 2 is a unit. Primeness is a little weird in rings that have a lot of units.) You can establish for yourself that if $ab = 7$ or $ab = 14$, then either $a$ or $b$ is 7 or 14.


In a commutative ring $\,R\,$ with zero-divisors, factorization theory is much more complicated than in domains, e.g. $\rm\:x = (3+2x)(2-3x)\in \Bbb Z_6[x].\:$ Basic notions such as associate and irreducible generally bifurcate into at least a few inequivalent notions, e.g.

  • $\ a\sim b\ $ are $ $ associates $ $ if $\, a\mid b\,$ and $\,b\mid a,\ $ i.e. $\,(a) = (b)\,$ as ideals
  • $\ a\approx b\ $ are $ $ strong associates $ $ if $\, a = ub\,$ for some unit $\,u.$
  • $\ a \cong b\ $ are $ $ very strong associates $ $ if $\,a\sim b\,$ and $\,a\ne 0,\ a = rb\,\Rightarrow\, r\,$ unit

Each notion of associate leads to a corresponding notion of an irreducible element: $ $ if $\,a\in R\,$ is a nonunit then $\,a\,$ is $\,x$-irreducible if $\,a=bc\,\Rightarrow\, b\,$ or $\,c\,$ is $\,x$-associate to $\,a,\,$ for $\,x\,$ one of $ $ " ", "strongly", or "very strongly".

So, before posing such questions, I recommend that you familiarize yourself with these various generalizations so that you can determine which generalized notions of associate and irreducible elements are appropriate in your context. For an introduction to these generalizations see

Factorization in Commutative Rings with Zero-divisors.
D.D. Anderson, Silvia Valdes-Leon.
Rocky Mountain J. Math. Volume 28, Number 2 (1996), 439-480