Prime number
Prime elements in rings

A commutative ring is an algebraic structure where addition, subtraction and multiplication are defined. The integers are a ring, and the prime numbers in the integers have been generalized to rings in two different ways, prime elements and irreducible elements. An element p {\displaystyle p} of a ring R {\displaystyle R} is called prime if it is nonzero, has no multiplicative inverse (that is, it is not a unit), and satisfies the following requirement: whenever p {\displaystyle p} divides the product x y {\displaystyle xy} of two elements of R {\displaystyle R}, it also divides at least one of x {\displaystyle x} or y {\displaystyle y}. An element is irreducible if it is neither a unit nor the product of two other non-unit elements. In the ring of integers, the prime and irreducible elements form the same set,

In an arbitrary ring, all prime elements are irreducible. The converse does not hold in general, but does hold for unique factorization domains.

The fundamental theorem of arithmetic continues to hold (by definition) in unique factorization domains. An example of such a domain is the Gaussian integers Z {\displaystyle \mathbb {Z} }, the ring of complex numbers of the form a + b i {\displaystyle a+bi} where i {\displaystyle i} denotes the imaginary unit and a {\displaystyle a} and b {\displaystyle b} are arbitrary integers. Its prime elements are known as Gaussian primes. Not every number that is prime among the integers remains prime in the Gaussian integers; for instance, the number 2 can be written as a product of the two Gaussian primes 1 + i {\displaystyle 1+i} and 1 − i {\displaystyle 1-i}. Rational primes (the prime elements in the integers) congruent to 3 mod 4 are Gaussian primes, but rational primes congruent to 1 mod 4 are not. This is a consequence of Fermat's theorem on sums of two squares,which states that an odd prime p {\displaystyle p} is expressible as the sum of two squares, p = x 2 + y 2 {\displaystyle p=x^{2}+y^{2}}, and therefore factorable as p = (x + i y) (x − i y) {\displaystyle p=(x+iy)(x-iy)}, exactly when p {\displaystyle p} is 1 mod 4.
punctuation:no_comma