Unique factorisation theorem for $\mathbb{Z} \setminus \{0\}$

Solution 1:

If you go on to study "abstract algebra" you will encounter the natural generalization you are looking for. Here's a brief look ahead.

A ring is a mathematical structure where addition and multiplication make sense and follow the usual rules. So the set $\mathbb{Z}$ of integers is ring, and so is the set $\mathbb{C}[z]$ of polynomials with complex coefficients.

A unit in a ring is an element whose reciprocal is also in the ring. The units in $\mathbb{Z}$ are $\pm 1$; the units in $\mathbb{C}[z]$ are the nonzero constant polynomials.

In an integral domain a nonunit $p$ is irreducible if whenever $p=rs$, one of $r$ or $s$ must be a unit. It's prime if when $p$ divides $ab$ it divides $a$ or $b$.

In the integers and a polynomial ring over a field these are equivalent, which is one of the key properties that makes unique factorization work:

The fundamental theorem of arithmetic says that every nonzero nonunit in the integers is uniquely a product of primes, where uniqueness means "up to order and to multiplication of the factors by units".

The fundamental theorem of algebra says that every complex polynomial of degree $n > 0$ has $n$ roots when you count them with the right multiplicities. Since roots correspond to linear factors, that says every nonconstant polynomial is "uniquely a product of primes" in the same sense.

You will also encounter interesting rings where the "fundamental theorem" fails because irreducible elements might not be prime.