Gauss's lemma holds more generally over arbitrary unique factorization domains. There the content c(P) of a polynomial P can be defined as the greatest common divisor of the coefficients of P (like the gcd, the content is actually a set of associate elements). A polynomial P with coefficients in a UFD R is then said to be primitive if the only elements of R that divide all coefficients of P at once are the invertible elements of R; i.e., the gcd of the coefficients is one.
Primitivity statement: If R is a UFD, then the set of primitive polynomials in R[X] is closed under multiplication. More generally, the content of a product of polynomials is the product of their individual contents.
Irreducibility statement: Let R be a unique factorization domain and F its field of fractions. A non-constant polynomial in is irreducible in if and only if it is both irreducible in and primitive in .
(For the proofs, see #General version below.)
Let be a unique factorization domain with field of fractions . If is a polynomial over then for some in , has coefficients in , and so – factoring out the gcd of the coefficients – we can write for some primitive polynomial . As one can check, this polynomial is unique up to the multiplication by a unit and is called the primitive part (or primitive representative) of and is denoted by . The procedure is compatible with product: .
The construct can be used to show the statement:
Indeed, by induction, it is enough to show is a UFD when is a UFD. Let be a non-zero polynomial. Now, is a unique factorization domain (since it is a principal ideal domain) and so, as a polynomial in , can be factorized as:
where are irreducible polynomials of . Now, we write for the gcd of the coefficients of (and is the primitive part) and then:
Now, is a product of prime elements of (since is a UFD) and a prime element of is a prime element of , as is an integral domain. Hence, admits a prime factorization (or a unique factorization into irreducibles). Next, observe that is a unique factorization into irreducible elements of , as (1) each is irreducible by the irreducibility statement and (2) it is unique since the factorization of can also be viewed as a factorization in and factorization there is unique. Since and are uniquely determined by up to unit elements, the above factorization of is a unique factorization into irreducible elements.
The condition that "R is a unique factorization domain" is not superfluous because it implies that every irreducible element of this ring is also a prime element, which in turn implies that every non-zero element of R has at most one factorization into a product of irreducible elements and a unit up to order and associate relationship. In a ring where factorization is not unique, say pa = qb with p and q irreducible elements that do not divide any of the factors on the other side, the product (p + qX)(a + qX) = pa + (p+a)qX + q2X2 = q(b + (p+a)X + qX2) shows the failure of the primitivity statement. For a concrete example one can take R = Z[i√5], p = 1 + i√5, a = 1 − i√5, q = 2, b = 3. In this example the polynomial 3 + 2X + 2X2 (obtained by dividing the right hand side by q = 2) provides an example of the failure of the irreducibility statement (it is irreducible over R, but reducible over its field of fractions Q[i√5]). Another well-known example is the polynomial X2 − X − 1, whose roots are the golden ratio φ = (1 + √5)/2 and its conjugate (1 − √5)/2 showing that it is reducible over the field Q[√5], although it is irreducible over the non-UFD Z[√5] which has Q[√5] as field of fractions. In the latter example the ring can be made into an UFD by taking its integral closure Z[φ] in Q[√5] (the ring of Dirichlet integers), over which X2 − X − 1 becomes reducible, but in the former example R is already integrally closed.
Let be a commutative ring. If is a polynomial in , then we write for the ideal of generated by all the coefficients of ; it is called the content of . Note that for each in . The next proposition states a more substantial property.
A polynomial is said to be primitive if is the unit ideal .[4] When (or more generally when is a Bézout domain), this agrees with the usual definition of a primitive polynomial. (But if is only a UFD, this definition is inconsistent with the definition of primitivity in #Statements for unique factorization domains.)
Proof: This is easy using the fact[5] that implies
Proof: () First note that the gcd of the coefficients of is 1 since, otherwise, we can factor out some element from the coefficients of to write , contradicting the irreducibility of . Next, suppose for some non-constant polynomials in . Then, for some , the polynomial has coefficients in and so, by factoring out the gcd of the coefficients, we write . Do the same for and we can write for some . Now, let for some . Then . From this, using the proposition, we get:
That is, divides . Thus, and then the factorization constitutes a contradiction to the irreducibility of .
() If is irreducible over , then either it is irreducible over or it contains a constant polynomial as a factor, the second possibility is ruled out by the assumption.
Proof of the proposition: Clearly, . If is a prime ideal containing , then modulo . Since is a polynomial ring over an integral domain and thus is an integral domain, this implies either or modulo . Hence, either or is contained in . Since is the intersection of all prime ideals that contain and the choice of was arbitrary, .
We now prove the "moreover" part. Factoring out the gcd's from the coefficients, we can write and where the gcds of the coefficients of are both 1. Clearly, it is enough to prove the assertion when are replaced by ; thus, we assume the gcd's of the coefficients of are both 1. The rest of the proof is easy and transparent if is a unique factorization domain; thus we give the proof in that case here (and see [note 4] for the proof for the GCD case). If , then there is nothing to prove. So, assume otherwise; then there is a non-unit element dividing the coefficients of . Factorizing that element into a product of prime elements, we can take that element to be a prime element . Now, we have:
Thus, either contains or ; contradicting the gcd's of the coefficients of are both 1.
It follows from Gauss's lemma that for each unique factorization domain , the polynomial ring is also a unique factorization domain (see #Statements for unique factorization domains). Gauss's lemma can also be used to show Eisenstein's irreducibility criterion. Finally, it can be used to show that cyclotomic polynomials (unitary units with integer coefficients) are irreducible.
Gauss's lemma implies the following statement:
If , then it says a rational root of a monic polynomial over integers is an integer (cf. the rational root theorem). To see the statement, let be a root of in and assume are relatively prime. In we can write with for some . Then
is a factorization in . But is primitive (in the UFD sense) and thus divides the coefficients of by Gauss's lemma, and so
with in . Since is monic, this is possible only when is a unit.
A similar argument shows:
The irreducibility statement also implies that the minimal polynomial over the rational numbers of an algebraic integer has integer coefficients.