6.2  Ideals and Greatest Common Divisors

Division with remainder is now available over every field. This section uses it to answer a question about two polynomials f and g: what do all the combinations af+bg, with polynomial coefficients a and b, look like? The answer is that they are exactly the multiples of one polynomial, and that polynomial is the greatest common divisor of f and g. Along the way we meet ideals, the subsets of F[x] adapted to multiplication, and we prove that each of them is generated by a single polynomial. The Euclidean algorithm then computes the greatest common divisor and the coefficients a,b by repeated division. Throughout, F is a field.

6.2.1. All the combinations of two polynomials

Take f=x2−1 and g=x2+x−2 in Q[x], and look at the set {af+bg:a,b∈Q[x]} of all their combinations with polynomial coefficients. It contains f (take a=1,b=0), g, and g−f=x−1.

Since f=(x−1)(x+1) and g=(x−1)(x+2), every combination is af+bg=(x−1)(a(x+1)+b(x+2)), a multiple of x−1. Conversely, every multiple h(x−1) is a combination, namely (−h)f+hg. So the set of combinations is exactly the set of multiples of x−1. Its non-zero members of smallest degree are the non-zero scalar multiples of x−1. By Proposition 6.1.2 (c), no non-zero constant is a multiple of x−1, so there is nothing of degree 0.

Two features of this set will carry the whole section. It is closed under addition, and it absorbs multiplication by any polynomial: if af+bg is in the set, so is h(af+bg)=(ha)f+(hb)g. Sets with these two features appear everywhere, so they get a name.

6.2.2. Ideals

In Chapter 1 we studied F[x] as a vector space and its subspaces: subsets closed under addition and under multiplication by scalars. But F[x] also has a multiplication of its own. The subsets that respect it are closed under multiplication by polynomials. Three recurring examples share this feature:

  • the multiples of a fixed polynomial p;
  • the combinations af+bg of two fixed polynomials;
  • the polynomials that vanish at a fixed point c: if f(c)=0, then (hf)(c)=h(c)⋅0=0 for every h.

An ideal is a set of polynomials that is closed under addition and swallows multiplication by anything.

Definition 6.2.1 (Ideal of F[x])

Let F be a field. A subset I⊆F[x] is an ideal of F[x] if

  • (I1) I is non-empty;
  • (I2) f+g∈I for all f,g∈I;
  • (I3) hf∈I for all f∈I and every h∈F[x].

For f1,…,fk∈F[x], write ⟨f1,…,fk⟩:={a1f1+⋯+akfk:a1,…,ak∈F[x]}. In particular ⟨p⟩={hp:h∈F[x]} is the set of all multiples of p.

In words: (I1) rules out the empty set. (I2) says sums stay inside. (I3) is the new clause: a member of I multiplied by any polynomial, not just by a constant, is still a member. Taking h=0 in (I3) shows 0∈I, and taking h=−1 shows −f∈I. Taking h=c constant shows I is closed under scalar multiplication, so every ideal is a subspace of F[x] by Theorem 1.2.1.

The angle brackets here have nothing to do with the inner products of later chapters: ⟨f,g⟩ is a set of polynomials, not a number.

Well-definedness. We have named the set ⟨f1,…,fk⟩, and must check that it is an ideal. It is in fact the smallest ideal containing f1,…,fk.

Proposition 6.2.1 (The Ideal Generated by Finitely Many Polynomials)

Let F be a field and f1,…,fk∈F[x], with k≥1. Then ⟨f1,…,fk⟩ is an ideal of F[x] containing f1,…,fk. Moreover, every ideal J of F[x] with f1,…,fk∈J satisfies ⟨f1,…,fk⟩⊆J.

Proof. Let I=⟨f1,…,fk⟩. Taking ai=1 and aj=0 for j≠i shows fi∈I; in particular (I1) holds. For (I2), ∑aifi+∑bifi=∑(ai+bi)fi∈I. For (I3), h∑aifi=∑(hai)fi∈I, using Theorem 0.8.1 in both cases. So I is an ideal.

Now let J be an ideal containing every fi. By (I3) for J, each aifi∈J, and by (I2) applied k−1 times, a1f1+⋯+akfk∈J. Hence I⊆J. This proves the proposition.

The ideal ⟨f1,…,fk⟩ is the ideal generated by f1,…,fk. An ideal of the form ⟨p⟩, generated by one polynomial, is called principal.

Example (First Ideals)

Check each of the following against Definition 6.2.1.

  • (a) {0} and F[x]; and any ideal containing a non-zero constant.
  • (b) Ic={f∈F[x]:f(c)=0} for a fixed c∈F.
  • (c) For A=(0100)∈M2(F), the set {p∈F[x]:p(A)=0}.

Solution.

  • (a) {0}=⟨0⟩ and F[x]=⟨1⟩ are ideals by Proposition 6.2.1. They are the degenerate cases, and the second one is the one to recognize: if an ideal I contains a non-zero constant c, then 1=c−1c∈I by (I3), and then h=h⋅1∈I for every h, so I=F[x]. An ideal that contains a non-zero constant is everything.

  • (b) 0∈Ic. If f(c)=g(c)=0, then (f+g)(c)=0 and (hf)(c)=h(c)f(c)=0 for every h∈F[x], by Theorem 0.8.5. So Ic is an ideal. By Theorem 6.1.3 (b), f(c)=0 exactly when x−c∣f, so Ic=⟨x−c⟩.

  • (c) Call the set I. The zero polynomial is in I. If p(A)=q(A)=0, then by Theorem 0.9.9, (p+q)(A)=p(A)+q(A)=0 and (hp)(A)=h(A)p(A)=h(A)⋅0=0 for every h. So I is an ideal. It contains x2, since A2=0. It contains no non-zero polynomial of degree at most 1: (a+bx)(A)=(ab0a)=0 forces a=b=0. The same argument works for any linear operator T in place of A, with Theorem 2.4.3. In Chapter 9 the ideal of all polynomials killing an operator is where the minimal polynomial comes from.

Now the non-example, by a minimal change. Take F[x]≤n for some n∈N. It is non-empty, closed under addition, and closed under multiplication by constants: it is a subspace of F[x] (Example (Polynomials of Bounded Degree)). But it fails (I3): xn∈F[x]≤n and x∈F[x], while x⋅xn=xn+1∉F[x]≤n. The exact clause that fails is “for every h∈F[x]”.

Why insist on every h, and not just constants? Because the main theorem below divides a member f of I by another member d and needs the remainder f−qd to lie in I again. The quotient q is an arbitrary polynomial, so we need qd∈I. With only closure under scalars, the argument breaks, and indeed F[x]≤n is not the set of multiples of any single polynomial. The name “ideal” is historical and says nothing about the definition.

Warning. Do not confuse ⟨f,g⟩ with span(f,g). The span uses scalar coefficients, the ideal uses polynomial coefficients. For example, span(x)={cx:c∈F} is a line in F[x], while ⟨x⟩ contains x2,x3,… and is infinite-dimensional. Every ideal is a subspace, but most subspaces, such as F[x]≤n or span(x), are not ideals.

Quick check. Is J={f∈R[x]:f(1)=0 or f(2)=0} an ideal of R[x]?

Solution. No. J is non-empty and satisfies (I3), since (hf)(c)=h(c)f(c). But it fails (I2): x−1∈J and x−2∈J, while their sum 2x−3 takes the values −1 at 1 and 1 at 2, so 2x−3∉J. The set with “and” in place of “or” is an ideal.

6.2.3. Every ideal is generated by one polynomial

The payoff of the definition is that ideals of F[x] are very simple: each one is the set of multiples of a single polynomial. The proof is the argument of the opening example, made general. We have met it before for integers, in Lemma 0.7.2, where the smallest positive combination ax+ny turned out to divide a and n.

Theorem 6.2.2 (Every Ideal of F[x] Is Principal)

Let F be a field and I an ideal of F[x]. If I≠{0}, there is exactly one monic polynomial d with I=⟨d⟩. Moreover, d is the unique monic polynomial of least degree in I.

Idea. Pick a non-zero d∈I of smallest degree, made monic. Every multiple of d is in I by (I3). For the other inclusion, divide any f∈I by d: the remainder r=f−qd lies in I and has degree smaller than deg⁡d. Minimality leaves only one option, r=0. Uniqueness is mutual divisibility of monic polynomials.

Proof. Suppose I≠{0}. The degrees of the non-zero elements of I form a non-empty set of natural numbers, so by Theorem 0.2.11 it has a least element m. Choose g∈I with deg⁡g=m, and let c be its leading coefficient. Put d=c−1g. Then d∈I by (I3), and d is monic of degree m.

(⊇) For every h∈F[x], hd∈I by (I3). Hence ⟨d⟩⊆I.

(⊆) Let f∈I. By Theorem 6.1.1, f=qd+r with deg⁡r<m. By (I3), −qd∈I, and by (I2), r=f+(−qd)∈I. If r≠0, then r is a non-zero element of I of degree less than m, contradicting the choice of m. Hence r=0, so f=qd∈⟨d⟩.

Therefore I=⟨d⟩. For uniqueness, let d′ be monic with I=⟨d′⟩. Then d∈⟨d′⟩ and d′∈⟨d⟩, so d′∣d and d∣d′. Both are monic, so d=d′ by Proposition 6.1.2 (d).

Finally, let e∈I be monic of least degree m. Then d∣e, so e=ud with deg⁡u=0 by Theorem 0.8.3, and comparing leading coefficients gives u=1. Hence e=d. This proves the theorem.

For I={0} the only generator is 0, since ⟨p⟩ contains p. So every ideal of F[x] is principal, with a canonical generator: 0 for the zero ideal, and the monic polynomial of least degree otherwise. The named move is: the smallest-degree element of an ideal generates it. In Example (First Ideals) (c), the ideal contains x2 and nothing non-zero of smaller degree, so it equals ⟨x2⟩.

The theorem also turns divisibility into containment. For p,q∈F[x], ⟨p⟩⊆⟨q⟩⟺q∣p, because ⟨p⟩⊆⟨q⟩ holds exactly when p∈⟨q⟩, by Proposition 6.2.1. The bigger the ideal, the smaller the generator.

Quick check. Find the monic generator of ⟨x2−1,x3−1⟩⊆Q[x] by finding an element of small degree in it.

Solution. The ideal contains (x3−1)−x(x2−1)=x−1. Both generators are multiples of x−1, since x2−1=(x−1)(x+1) and x3−1=(x−1)(x2+x+1), so every combination is a multiple of x−1 by Proposition 6.1.2 (b). A non-zero constant is not a multiple of x−1, so x−1 has least degree in the ideal. By Theorem 6.2.2, the ideal is ⟨x−1⟩.

6.2.4. The greatest common divisor

Apply Theorem 6.2.2 to the ideal ⟨f,g⟩ of all combinations. It has a canonical generator, and in the opening example that generator, x−1, was a common divisor of f and g. A naive attempt to define “the greatest common divisor” as “a common divisor of largest degree” runs into a problem at once: x−1, 2x−2 and −13x+13 are all common divisors of x2−1 and x2+x−2 of the largest possible degree. Degree cannot tell associates apart, and it also does not say how the common divisors relate to each other. The generator of the ideal fixes both problems.

The gcd of f and g is the monic polynomial whose multiples are exactly the combinations of f and g.

Definition 6.2.2 (Greatest Common Divisor)

Let F be a field and f,g∈F[x]. If f and g are not both zero, the greatest common divisor gcd(f,g) is the unique monic polynomial d∈F[x] with ⟨f,g⟩=⟨d⟩. We set gcd(0,0)=0.

In words: form the ideal of all combinations af+bg with a,b∈F[x]; it is generated by one polynomial; take the monic one. The definition refers to F[x] twice, in the coefficients a,b and in the generator d, so at first sight the gcd depends on the field. We show below that it does not change when the field is enlarged.

Well-definedness. By Proposition 6.2.1, ⟨f,g⟩ is an ideal. If f and g are not both zero, it contains a non-zero element, so by Theorem 6.2.2 there is exactly one monic d with ⟨f,g⟩=⟨d⟩. The convention gcd(0,0)=0 keeps the equation ⟨f,g⟩=⟨gcd(f,g)⟩ true in the remaining case. The definition is symmetric: gcd(f,g)=gcd(g,f).

Example (First Greatest Common Divisors)
  • (a) Let f≠0 have leading coefficient a. Find gcd(f,0) and gcd(f,c) for a non-zero constant c.
  • (b) Find gcd(x2−1,x2+x−2) in Q[x].
  • (c) Find gcd(x2+1,x+1) in Q[x] and in F2[x].

Solution.

  • (a) ⟨f,0⟩={af:a∈F[x]}=⟨f⟩=⟨a−1f⟩, and a−1f is monic, so gcd(f,0)=a−1f, the monic associate of f. This degenerate case shows why the gcd must be made monic: f itself generates the ideal too, but is not the canonical choice. Next, ⟨f,c⟩ contains the non-zero constant c, so it is F[x]=⟨1⟩ by Example (First Ideals) (a). Hence gcd(f,c)=1.

  • (b) The opening example showed ⟨x2−1,x2+x−2⟩=⟨x−1⟩, and x−1 is monic. So the gcd is x−1.

  • (c) In Q[x]: dividing, x2+1=(x−1)(x+1)+2. So 2=(x2+1)−(x−1)(x+1) lies in the ideal, which is therefore Q[x] by Example (First Ideals) (a). Hence gcd=1. In F2[x]: x2+1=(x+1)2, so x2+1∈⟨x+1⟩, and ⟨x2+1,x+1⟩=⟨x+1⟩ by Proposition 6.2.1. Hence gcd=x+1. The symbols are the same, but F2 is not a field containing Q, so the two answers need not agree.

For a non-example by minimal change, keep (b) but replace x−1 by the associate 3x−3. It is still a common divisor of largest degree and still generates the ideal, but it is not gcd(x2−1,x2+x−2): the clause “monic” fails. Or keep “monic” but lower the degree: 1 is a monic common divisor, and it does not generate the ideal, since 1∉⟨x−1⟩.

Why define the gcd through the ideal, rather than as “the largest common divisor”? Because the ideal definition delivers three things at once: existence and uniqueness (from Theorem 6.2.2), the fact that the gcd is a combination of f and g, and the fact that it is “greatest” in the strongest sense, namely that every common divisor divides it. Here is the last point.

Theorem 6.2.3 (Characterization of the gcd)

Let F be a field, f,g∈F[x], and d=gcd(f,g).

  • (a) d∣f and d∣g.
  • (b) If h∈F[x] satisfies h∣f and h∣g, then h∣d.
  • (c) If f,g are not both zero, then d is the only monic polynomial with properties (a) and (b).

Proof.

  • (a) f=1⋅f+0⋅g∈⟨f,g⟩=⟨d⟩, so d∣f. Similarly d∣g.

  • (b) Since d∈⟨d⟩=⟨f,g⟩, there are a,b∈F[x] with d=af+bg. If h∣f and h∣g, then h∣af+bg=d by Proposition 6.1.2 (b).

  • (c) Let e be monic with properties (a) and (b). Since d is a common divisor of f and g, property (b) for e gives d∣e. Since e is a common divisor, property (b) for d gives e∣d. Both are monic (e by assumption, and d by Definition 6.2.2, since f,g are not both zero), so d=e by Proposition 6.1.2 (d). This proves the theorem.

So gcd(f,g) is a common divisor that every common divisor divides. If f,g are not both zero, then d≠0, and by Proposition 6.1.2 (c) every common divisor has degree at most deg⁡d; “greatest” is true for degrees as well. The proof of (b) used one fact that deserves its own statement, because it is the most useful property of the gcd.

Corollary 6.2.4 (Bézout’s Identity for Polynomials)

Let F be a field and f,g∈F[x]. Then there exist a,b∈F[x] with gcd(f,g)=af+bg.

Proof. By Definition 6.2.2, gcd(f,g)∈⟨gcd(f,g)⟩=⟨f,g⟩, and the elements of ⟨f,g⟩ are exactly the combinations af+bg.

The coefficients are not unique: if d=af+bg, then also d=(a+g)f+(b−f)g. Bézout’s identity is the polynomial version of Lemma 0.7.2, and it will be the tool behind the Chinese Remainder Theorem and the splitting of kernels later in this chapter.

6.2.5. The Euclidean algorithm

The definition tells us what the gcd is, but not how to find it. Factoring f and g is usually hard. Division is easy, and one observation turns division into an algorithm: dividing does not change the ideal.

Lemma 6.2.5 (Dividing Does Not Change the Ideal)

Let F be a field and f,g,q,r∈F[x] with f=qg+r. Then ⟨f,g⟩=⟨g,r⟩. Consequently gcd(f,g)=gcd(g,r).

Proof. (⊇) The ideal ⟨f,g⟩ contains g, and r=f+(−q)g by (I2) and (I3). By Proposition 6.2.1, ⟨g,r⟩⊆⟨f,g⟩.

(⊆) The ideal ⟨g,r⟩ contains g and f=qg+r. By Proposition 6.2.1, ⟨f,g⟩⊆⟨g,r⟩.

Hence the two ideals are equal. The gcd is the canonical generator of the ideal (Definition 6.2.2), and f,g are both zero exactly when g,r are, so gcd(f,g)=gcd(g,r).

Now divide repeatedly. Each division replaces the pair (f,g) by (g,r), a pair with the same gcd and a smaller second entry.

Theorem 6.2.6 (Euclidean Algorithm)

Let F be a field and f,g∈F[x] with g≠0. Put r−1=f and r0=g. As long as rk≠0, divide rk−1 by rk (Theorem 6.1.1): rk−1=qk+1rk+rk+1,deg⁡rk+1<deg⁡rk. Then:

  • (a) the process stops: there is an index n with 0≤n≤deg⁡g such that rn≠0 and rn+1=0;
  • (b) if c is the leading coefficient of this last non-zero remainder rn, then gcd(f,g)=c−1rn.

Idea. Two things to see. The degrees deg⁡r0>deg⁡r1>deg⁡r2>⋯ strictly decrease, and natural numbers cannot decrease forever, so some remainder is 0. By Lemma 6.2.5, the ideal ⟨rk−1,rk⟩ never changes along the way; at the end it is ⟨rn,0⟩=⟨rn⟩, and making rn monic gives the gcd.

Proof.

  • (a) As long as r1,…,rj are all non-zero, their degrees are natural numbers with deg⁡g=deg⁡r0>deg⁡r1>⋯>deg⁡rj≥0. So r1,…,rj are j distinct values in {0,1,…,deg⁡g−1}, and j≤deg⁡g. Hence the remainders cannot all be non-zero for j=deg⁡g+1: there is a first index n+1 with rn+1=0, and n≤deg⁡g. Also n≥0 since r0=g≠0.

  • (b) We show by induction on k that ⟨rk−1,rk⟩=⟨f,g⟩ for k=0,1,…,n+1. For k=0 this is the definition of r−1,r0. If it holds for some k≤n, then rk−1=qk+1rk+rk+1, and Lemma 6.2.5 gives ⟨rk,rk+1⟩=⟨rk−1,rk⟩=⟨f,g⟩.

For k=n+1 this reads ⟨f,g⟩=⟨rn,0⟩=⟨rn⟩. Since c≠0, ⟨rn⟩=⟨c−1rn⟩, and c−1rn is monic. Because g≠0, Definition 6.2.2 gives gcd(f,g)=c−1rn. This proves the theorem.

If g=0, no division is needed: gcd(f,0) is the monic associate of f (or 0), as in Example (First Greatest Common Divisors) (a).

The algorithm also produces Bézout coefficients. Each remainder is a combination of the previous two, rk+1=rk−1−qk+1rk, so by induction each remainder is a combination of f and g. Keeping track of the coefficients gives the following procedure.

Algorithm. Extended Euclidean algorithm. Input: f,g∈F[x] with g≠0.

  1. Set (r−1,a−1,b−1)=(f,1,0) and (r0,a0,b0)=(g,0,1).
  2. For k=0,1,2,…, as long as rk≠0: divide rk−1=qk+1rk+rk+1, and set ak+1=ak−1−qk+1ak,bk+1=bk−1−qk+1bk.
  3. When rn+1=0, let c be the leading coefficient of rn. Output gcd(f,g)=c−1rn and the coefficients a=c−1an, b=c−1bn.

The invariant rk=akf+bkg holds for k=−1,0 by the choice in step 1. If it holds for k−1 and k, then rk+1=rk−1−qk+1rk=(ak−1−qk+1ak)f+(bk−1−qk+1bk)g=ak+1f+bk+1g. So at the end gcd(f,g)=c−1rn=af+bg. By hand, it is often quicker to write each division as “remainder =…” and substitute backwards, which is the same computation.

Example (The Euclidean Algorithm with Back-Substitution)

In Q[x], let f=x4−x3−3x2+x+2 and g=x3−2x−1. Find gcd(f,g) and polynomials a,b with gcd(f,g)=af+bg.

Solution. Divisions. First divide f by g. The leading terms give x, and f−xg=−x3−x2+2x+2; then −1, and adding g leaves −x2+1. So f=(x−1)g+r1,r1=1−x2. Next divide g by r1. The leading terms give x3/(−x2)=−x, and g−(−x)r1=x3−2x−1+x−x3=−x−1. So g=(−x)r1+r2,r2=−x−1. Next divide r1 by r2. Since (x−1)(−x−1)=−x2+1, r1=(x−1)r2+0. The last non-zero remainder is r2=−x−1, with leading coefficient −1. By Theorem 6.2.6, gcd(f,g)=x+1.

Back-substitution. From the first two divisions, r1=f−(x−1)g,r2=g+xr1. Substituting the first into the second, r2=g+x(f−(x−1)g)=xf+(1+x−x2)g. Multiplying by c−1=−1, x+1=(−x)f+(x2−x−1)g. In the notation of the algorithm, (a1,b1)=(1,1−x) and (a2,b2)=(x,1+x−x2).

Checks. Expanding, −x(x4−x3−3x2+x+2)=−x5+x4+3x3−x2−2x and (x2−x−1)(x3−2x−1)=x5−x4−3x3+x2+3x+1, which sum to x+1. As an independent check that x+1 divides both, f(−1)=1+1−3−1+2=0 and g(−1)=−1+2−1=0, so Theorem 6.1.3 applies.

6.2.6. Coprime polynomials

The most important value a gcd can take is 1. Then f and g share no non-constant factor, and Bézout’s identity writes 1 itself as a combination.

Definition 6.2.3 (Coprime Polynomials)

Let F be a field. Polynomials f,g∈F[x] are coprime (or relatively prime) over F if gcd(f,g)=1.

Proposition 6.2.7 (Coprime Means 1 Is a Combination)

Let F be a field and f,g∈F[x]. Then f and g are coprime if and only if there exist a,b∈F[x] with af+bg=1.

Proof. (⇒) This is Corollary 6.2.4 with gcd(f,g)=1.

(⇐) If af+bg=1, then 1∈⟨f,g⟩, so ⟨f,g⟩=F[x]=⟨1⟩ by Example (First Ideals) (a). In particular f,g are not both zero, and the monic generator is 1. Hence gcd(f,g)=1.

Examples: for distinct c,c′∈F, the polynomials x−c and x−c′ are coprime, since (c′−c)−1(x−c)−(c′−c)−1(x−c′)=(c′−c)−1(c′−c)=1. A non-zero constant is coprime to every polynomial (Example (First Greatest Common Divisors) (a)). The polynomial 0 is coprime only to the non-zero constants. Non-example: x2−1 and x+1 are not coprime, since x+1 divides both, so x+1∣gcd by Theorem 6.2.3 (b), and the gcd has degree at least 1.

Coprimality is what lets a divisor pass through a product.

Theorem 6.2.8 (A Coprime Factor Can Be Canceled)

Let F be a field and p,q,r∈F[x]. If p∣qr and gcd(p,q)=1, then p∣r.

Proof. By Proposition 6.2.7, there are a,b∈F[x] with ap+bq=1. Multiplying by r, r=(ar)p+b(qr). Here p∣p and p∣qr by hypothesis, so p∣r by Proposition 6.1.2 (b). This proves the theorem.

Warning. The coprimality hypothesis cannot be dropped. Take p=x2 and q=r=x. Then p∣qr=x2, but p∤r, since deg⁡x2>deg⁡x (Proposition 6.1.2 (c)). Here gcd(p,q)=x≠1: part of p is absorbed by q and part by r.

In the next section, Theorem 6.2.8 becomes Euclid’s lemma for irreducible polynomials, which is the heart of unique factorization.

Least common multiples, briefly. For f,g∈F[x], the intersection ⟨f⟩∩⟨g⟩ is again an ideal: it contains 0, so (I1) holds, and (I2) and (I3) hold in each of ⟨f⟩ and ⟨g⟩, hence in the intersection. Its members are the common multiples of f and g.

Definition 6.2.4 (Least Common Multiple)

Let F be a field and f,g∈F[x]. The least common multiple lcm(f,g) is the monic generator of the ideal ⟨f⟩∩⟨g⟩ if this ideal is non-zero, and 0 otherwise.

Exactly as for the gcd, lcm(f,g) is a common multiple of f and g that divides every common multiple, by Theorem 6.2.2. If f=0 or g=0, the only common multiple is 0; otherwise fg is a non-zero common multiple. For monic f and g, gcd(f,g)⋅lcm(f,g)=fg; this is proved in Exercise C3. For example, in Q[x], gcd(x2−1,x2+x−2)=x−1, so lcm(x2−1,x2+x−2)=(x−1)(x+1)(x+2).

6.2.7. The gcd does not depend on the field

A polynomial with rational coefficients is also a polynomial with real and with complex coefficients. Its gcd with another rational polynomial can be computed in Q[x], R[x] or C[x], and the definition does not obviously give the same answer, because the coefficients a,b in ⟨f,g⟩ range over a larger set. The Euclidean algorithm shows the answers agree. Recall that a subfield K of a field L is a subset closed under the field operations (Definition 1.9.1); then K[x]⊆L[x], with the same addition and multiplication.

Proposition 6.2.9 (The gcd Is the Same Over a Larger Field)

Let K be a subfield of a field L, and let f,g∈K[x]. Then the greatest common divisor of f and g computed in K[x] equals the one computed in L[x]. In particular, f and g are coprime over K if and only if they are coprime over L.

Proof. If g=0, both gcds are the monic associate of f (or 0), by Example (First Greatest Common Divisors) (a), and this does not depend on the field. Let g≠0, and run the Euclidean algorithm in K[x]: rk−1=qk+1rk+rk+1 with deg⁡rk+1<deg⁡rk, all in K[x]. Each of these equations also holds in L[x], with the same degree condition. By the uniqueness in Theorem 6.1.1 over L, they are exactly the divisions that the algorithm performs in L[x]. So both runs produce the same last non-zero remainder rn, and Theorem 6.2.6 gives the same gcd c−1rn in both. This proves the proposition.

Warning. The gcd does not see the field, but factorization does. Over Q, the polynomial x2−2 has no root, by Theorem 0.2.3, so it has no factor x−c with c∈Q (Theorem 6.1.3). Over R it factors as (x−2)(x+2). Yet gcd(x2−2,x2−2x), say, is the same over Q and over R. So “coprime” is a robust notion, while “cannot be factored” depends on the field; the next section makes the second notion precise.

A useful consequence: if f,g∈Q[x] are coprime over Q, then they have no common root in C. Indeed, af+bg=1 with a,b∈Q[x]⊆C[x], and evaluating at a common root z would give 0=1 by Theorem 0.8.5. So common complex roots can be detected by a computation that never leaves Q.

6.2.8. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define an ideal of F[x].
  • (b) State the theorem describing all ideals of F[x].
  • (c) Determine whether the following statement is true: “for all f,g∈F[x], span(f,g)=⟨f,g⟩.” Justify your answer.
  • (d) Is gcd(2x−2,4x2−4)=2x−2 in Q[x]? Justify your answer.
  • (e) Determine whether the following statement is true: “if af+bg=x−1 for some a,b∈Q[x], then gcd(f,g)=x−1.” Justify your answer.
  • (f) Name an algorithm that computes gcd(f,g) using only division with remainder (Theorem 6.1.1).

Solution.

  • (a) A subset I⊆F[x] is an ideal if it is non-empty, f+g∈I for all f,g∈I, and hf∈I for all f∈I and every h∈F[x] (Definition 6.2.1).
  • (b) If I≠{0} is an ideal of F[x], there is exactly one monic d with I=⟨d⟩, namely the monic polynomial of least degree in I (Theorem 6.2.2).
  • (c) False. Take f=g=x. Then span(x,x)={cx:c∈F} does not contain x2, while x2=x⋅x∈⟨x,x⟩. The span allows only scalar coefficients.
  • (d) No. The gcd is monic by definition. Since 4x2−4=(2x−2)(2x+2), we have ⟨2x−2,4x2−4⟩=⟨2x−2⟩=⟨x−1⟩, so the gcd is x−1.
  • (e) False. Take f=x and g=x−1, with a=0, b=1. Then af+bg=x−1, but gcd(x,x−1)=1, because x−(x−1)=1 (Proposition 6.2.7). What is true is that gcd(f,g) divides every combination af+bg, by Theorem 6.2.3 (a) and Proposition 6.1.2 (b).
  • (f) The Euclidean algorithm (Theorem 6.2.6).

B. Practice

Exercise (B1: gcd and Bézout Coefficients of Two Cubics)

In Q[x], let f=x3+x2+x+1 and g=x3+x+2. Use the Euclidean algorithm to find d=gcd(f,g) and polynomials a,b∈Q[x] with d=af+bg. Hence find all complex numbers that are roots of both f and g.

Solution. Divide f by g: f=1⋅g+r1 with r1=f−g=x2−1. Divide g by r1: x⋅r1=x3−x, and g−xr1=2x+2, so g=xr1+r2 with r2=2x+2. Divide r1 by r2: x2−1=12(x−1)(2x+2)+0. The last non-zero remainder is r2=2x+2, with leading coefficient 2, so d=x+1 by Theorem 6.2.6.

Back-substituting, r2=g−xr1=g−x(f−g)=−xf+(1+x)g. Dividing by 2, x+1=(−x2)f+x+12g. Check: −x2(x3+x2+x+1)+x+12(x3+x+2) equals 12(−x4−x3−x2−x+x4+x3+x2+3x+2)=x+1.

Hence: let z∈C. If f(z)=g(z)=0, then evaluating the identity above in C (Theorem 0.8.5) gives z+1=0. Conversely, x+1 divides f and g (Theorem 6.2.3 (a)), so −1 is a root of both. Therefore −1 is the only common complex root.

Exercise (B2: Ideal or Not?)

Determine which of the following subsets of R[x] are ideals. For each ideal, find its monic generator. Justify your answers.

  • (a) S1={f∈R[x]:f(1)=f(−1)}.
  • (b) S2={f∈R[x]:f(0)=0 and f(1)=0}.
  • (c) S3={f∈R[x]:deg⁡f≥3}∪{0}.
  • (d) S4={f∈R[x]:f(i)=0}, where f(i) means the value at i∈C of f regarded as a complex polynomial.

Solution.

  • (a) Not an ideal. S1 is a subspace, and 1∈S1. But x⋅1=x has x(1)=1≠−1=x(−1), so x∉S1, and (I3) fails.
  • (b) An ideal. The argument of Example (First Ideals) (b), applied at both points, gives (I1)–(I3). If f∈S2, then 0 and 1 are distinct roots of f, so x(x−1)∣f by Corollary 6.1.4. Conversely every multiple of x2−x vanishes at 0 and 1. Hence S2=⟨x2−x⟩, with monic generator x2−x.
  • (c) Not an ideal. x3∈S3 and −x3+x∈S3, but their sum x has degree 1 and is non-zero, so (I2) fails.
  • (d) An ideal: evaluation at i respects sums and products (Theorem 0.8.5 over C), so the argument of Example (First Ideals) (b) applies. It contains x2+1. A non-zero element of degree at most 1 would be a+bx with a,b∈R not both zero and a+bi=0, which is impossible since the real and imaginary parts give a=b=0. So the least degree of a non-zero element is 2. If d is the monic generator (Theorem 6.2.2), then deg⁡d=2 and d∣x2+1, so x2+1=ud with u constant, and comparing leading coefficients gives u=1. Hence S4=⟨x2+1⟩.
Exercise (B3: The gcd of xm−1 and xn−1)

Let F be a field. For integers m,n≥0, not both zero, let gcd(m,n) denote the largest positive integer dividing both.

  • (a) For m≥n≥1, verify that xm−1=xm−n(xn−1)+(xm−n−1).
  • (b) Prove that gcd(xm−1,xn−1)=xgcd(m,n)−1 in F[x] for all m,n≥0 not both zero, where x0−1=0.
  • (c) Hence compute gcd(x12−1,x18−1).

Hint for (b): Theorem 6.2.6, run on the exponents.

Solution.

  • (a) Expanding, xm−n(xn−1)+xm−n−1=xm−xm−n+xm−n−1=xm−1.
  • (b) We use strong induction on s=m+n≥1 (Theorem 0.2.10). If n=0, then m≥1, gcd(m,0)=m, and gcd(xm−1,0) is the monic associate of xm−1, which is xm−1 itself (Example (First Greatest Common Divisors) (a)). The case m=0 is the same, since both gcds are symmetric. Now let m,n≥1; by symmetry we may assume m≥n. By (a) and Lemma 6.2.5, gcd(xm−1,xn−1)=gcd(xn−1,xm−n−1). The pair (n,m−n) is not both zero and has sum m<m+n, so by the induction hypothesis the right side is xgcd(n,m−n)−1. Finally, gcd(n,m−n)=gcd(m,n): if k∣m and k∣n, then k∣m−n; and if k∣n and k∣m−n, then k∣(m−n)+n=m. So the two pairs have the same positive common divisors, and the same largest one. This completes the induction.
  • (c) By (b), gcd(x12−1,x18−1)=xgcd(12,18)−1=x6−1.

C. Going deeper

Exercise (C1: Polynomials Vanishing on a Set)

Let F be a field and S⊆F non-empty. Put I(S)={f∈F[x]:f(s)=0 for all s∈S}.

  • (a) Prove that I(S) is an ideal of F[x].
  • (b) Suppose S={s1,…,sk} is finite, with the si distinct. Prove that I(S)=⟨(x−s1)⋯(x−sk)⟩.
  • (c) Suppose S is infinite. Prove that I(S)={0}.
  • (d) Deduce from (b) and Exercise (C3: Equal Functions Over Fp) that I(Fp)=⟨xp−x⟩ for every prime p.

Solution.

  • (a) The zero polynomial vanishes everywhere, so I(S)≠∅. If f,g∈I(S) and h∈F[x], then for every s∈S, Theorem 0.8.5 gives (f+g)(s)=0+0=0 and (hf)(s)=h(s)⋅0=0. So (I2) and (I3) hold.
  • (b) Let P=(x−s1)⋯(x−sk). Every multiple hP vanishes at each si, since P(si)=0; so ⟨P⟩⊆I(S). Conversely, if f∈I(S), then s1,…,sk are distinct roots of f, and Corollary 6.1.4 gives P∣f. Hence I(S)=⟨P⟩, and since P is monic, it is the monic generator.
  • (c) Let f∈I(S), and suppose f≠0. Since S is infinite, it contains deg⁡f+1 distinct elements, all roots of f. This contradicts Corollary 6.1.4. Hence f=0.
  • (d) By (b), I(Fp)=⟨P⟩ with P=∏c∈Fp(x−c). The solution of Exercise (C3: Equal Functions Over Fp) (a) showed P=xp−x. Hence I(Fp)=⟨xp−x⟩.
Exercise (C2: A Non-Principal Ideal in Two Variables)

A polynomial in two variables over F is a finite sum P=∑i,jaijxiyj with aij∈F, only finitely many non-zero; two are equal when all coefficients agree. They are added coefficient by coefficient and multiplied by expanding and collecting, and the set F[x,y] of all of them satisfies the laws of Theorem 0.8.1, which you may use. Ideals of F[x,y] and ⟨P1,…,Pk⟩ are defined exactly as in Definition 6.2.1, and Proposition 6.2.1 holds with the same proof. For P≠0, let degy⁡P be the largest j with aij≠0 for some i, and define degx⁡P similarly.

  • (a) Prove that degy⁡(PQ)=degy⁡P+degy⁡Q for non-zero P,Q∈F[x,y]. By symmetry the same holds for degx.
  • (b) Show that ⟨x,y⟩ consists of the polynomials whose constant coefficient a00 is 0.
  • (c) Prove that ⟨x,y⟩≠⟨D⟩ for every D∈F[x,y].
  • (d) Explain precisely which step of the proof of Theorem 6.2.2 has no analogue in F[x,y].

Hint for (a): write P=∑jpj(x)yj with pj∈F[x], and use Corollary 0.8.4.

Solution.

  • (a) Group terms by the power of y: P=∑j=0spjyj and Q=∑j=0tqjyj with pj,qj∈F[x], s=degy⁡P, t=degy⁡Q, so ps≠0 and qt≠0. Expanding, the terms of PQ with y-power greater than s+t are all zero, and the terms with ys+t come only from psys⋅qtyt, giving (psqt)ys+t. By Corollary 0.8.4, psqt≠0 in F[x], so some coefficient of xiys+t in PQ is non-zero. Hence degy⁡(PQ)=s+t.
  • (b) Every Ax+By has constant coefficient 0, since each term of Ax and By involves x or y to a positive power. Conversely, if a00=0, then every term aijxiyj with i≥1 is a multiple of x, and every term with i=0, j≥1 is a multiple of y. Grouping them, P=Ax+By for some A,B∈F[x,y].
  • (c) Suppose ⟨x,y⟩=⟨D⟩. Since x∈⟨D⟩, x=HD for some H, so D≠0 and H≠0. By (a), 0=degy⁡x=degy⁡H+degy⁡D, so degy⁡D=0: D involves no y. Similarly y=KD gives degx⁡D=0. So D is a non-zero constant. But D∈⟨x,y⟩, so its constant coefficient is 0 by (b), that is, D=0. This contradiction shows that ⟨x,y⟩ is not principal.
  • (d) The proof of Theorem 6.2.2 picks a non-zero d∈I of least degree, writes each f∈I as f=qd+r with r smaller than d by Theorem 6.1.1, notes r=f−qd∈I, and concludes r=0 from minimality. Measure size in F[x,y] by the total degree, the largest i+j with aij≠0. Choosing d still works: by (b), every non-zero element of ⟨x,y⟩ has total degree at least 1, and those of total degree 1 are the ax+by with (a,b)≠(0,0). Let d be any of them. Then ⟨d⟩⊆⟨x,y⟩ by (I3), and the inclusion is strict by (c), so some f∈⟨x,y⟩ is not a multiple of d. For this f and every Q∈F[x,y], the element R=f−Qd lies in ⟨x,y⟩ and is non-zero, so its total degree is at least 1, the total degree of d. So no remainder smaller than d exists: the step with no analogue is division with remainder, the appeal to Theorem 6.1.1. Concretely, for d=x and f=y, every term of Qx contains x, so the term y survives in y−Qx. The underlying reason is that, viewed as a polynomial in y with coefficients in F[x], the leading coefficient x of d is not invertible in F[x], which is exactly the obstacle of the warning after Theorem 6.1.1.
Exercise (C3: gcd Times lcm)

Let F be a field and f,g∈F[x] monic. Put d=gcd(f,g) and write f=df1, g=dg1 with f1,g1∈F[x].

  • (a) Prove that gcd(f1,g1)=1.
  • (b) Prove that m=df1g1 is a monic common multiple of f and g that divides every common multiple of f and g.
  • (c) Deduce that lcm(f,g)=df1g1, and hence gcd(f,g)⋅lcm(f,g)=fg.
  • (d) Show by an example in Q[x] that the formula in (c) fails if f and g are not monic.

Hint for (b): use Theorem 6.2.8.

Solution.

  • (a) The quotients exist by Theorem 6.2.3 (a), and d≠0 since f≠0. By Corollary 6.2.4, d=af+bg=d(af1+bg1). Canceling d≠0 (Corollary 0.8.4 (2)) gives af1+bg1=1, so gcd(f1,g1)=1 by Proposition 6.2.7.
  • (b) Comparing leading coefficients in f=df1 with f,d monic shows f1 is monic; likewise g1. So m is monic, and m=fg1=gf1 is a common multiple. Let M be any common multiple, say M=fu. Since g∣M, write M=gv. Then df1u=dg1v, and canceling d gives f1u=g1v, so g1∣f1u. By (a) and Theorem 6.2.8, g1∣u, say u=g1w. Hence M=fg1w=mw, and m∣M.
  • (c) By (b), m∈⟨f⟩∩⟨g⟩, and every element of this ideal is a multiple of m. So ⟨f⟩∩⟨g⟩=⟨m⟩, and m is monic, hence lcm(f,g)=m by Definition 6.2.4 and Theorem 6.2.2. Then gcd(f,g)⋅lcm(f,g)=d⋅df1g1=(df1)(dg1)=fg.
  • (d) Take f=g=2x. Then gcd(f,g)=x and lcm(f,g)=x, both monic, so their product is x2, while fg=4x2. In general the two sides differ by the product of the leading coefficients.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.