An element p of a commutative ring R is said to be prime if it is not the zero element or a unit and whenever pdividesab for some a and b in R, then p divides a or p divides b. With this definition, Euclid's lemma is the assertion that prime numbers are prime elements in the ring of integers. Equivalently, an element p is prime if, and only if, the principal ideal(p) generated by p is a nonzero prime ideal.[1] (Note that in an integral domain, the ideal (0) is a prime ideal, but 0 is an exception in the definition of 'prime element'.)
Interest in prime elements comes from the fundamental theorem of arithmetic, which asserts that each nonzero integer can be written in essentially only one way as 1 or −1 multiplied by a product of positive prime numbers. This led to the study of unique factorization domains, which generalize what was just illustrated in the integers.
Being prime is relative to which ring an element is considered to be in; for example, 2 is a prime element in Z but it is not in Z[i], the ring of Gaussian integers, since 2 = (1 + i)(1 − i) and 2 does not divide any factor on the right.
Prime elements should not be confused with irreducible elements. In an integral domain, every prime is irreducible[2] but the converse is not true in general. However, in unique factorization domains,[3] or more generally in GCD domains, primes and irreducibles are the same.
Examples
The following are examples of prime elements in rings: