## Exercises 17.8 Sage Exercises

###### 1.

Consider the polynomial \(x^3-3x+4\text{.}\) Compute the most thorough factorization of this polynomial over each of the following fields: (a) the finite field \({\mathbb Z}_5\text{,}\) (b) a finite field with 125 elements, (c) the rationals, (d) the real numbers and (e) the complex numbers. To do this, build the appropriate polynomial ring, and construct the polynomial as a member of this ring, and use the `.factor()`

method.

###### 2.

“Conway polynomials” are irreducible polynomials over \({\mathbb Z}_p\) that Sage (and other software) uses to build maximal ideals in polynomial rings, and thus quotient rings that are fields. Roughly speaking, they are “canonical” choices for each degree and each prime. The command `conway_polynomial(p, n)`

will return a database entry that is an irreducible polynomial of degree \(n\) over \({\mathbb Z}_p\text{.}\)

Execute the command `conway_polynomial(5, 4)`

to obtain an allegedly irreducible polynomial of degree 4 over \({\mathbb Z}_5\text{:}\) \(p = x^{4} + 4x^{2} + 4x + 2\text{.}\) Construct the right polynomial ring (i.e., in the indeterminate \(x\)) and verify that `p`

is really an element of your polynomial ring.

First determine that p has no linear factors. The only possibility left is that `p`

factors as two quadratic polynomials over \({\mathbb Z}_5\text{.}\) Use a list comprehension with *three* `for`

statements to create *every* possible quadratic polynomial over \({\mathbb Z}_5\text{.}\) Now use this list to create every possible product of two quadratic polynomials and check to see if `p`

is in this list.

More on Conway polynomials is available at Frank Lübeck's site.

###### 3.

Construct a finite field of order \(729\) as a quotient of a polynomial ring by a principal ideal generated with a Conway polynomial.

###### 4.

Define the polynomials \(p = x^3 + 2x^2 + 2x + 4\) and \(q = x^4 + 2x^2\) as polynomials with coefficients from the integers. Compute `gcd(p, q)`

and verify that the result divides both `p`

and `q`

(just form a fraction in Sage and see that it simplifies cleanly, or use the `.quo_rem()`

method).

Proposition 17.10 says there are polynomials \(r(x)\) and \(s(x)\) such that the greatest common divisor equals \(r(x)p(x)+s(x)q(x)\text{,}\) *if the coefficients come from a field*. Since here we have two polynomials over the integers, investigate the results returned by Sage for the extended gcd, `xgcd(p, q)`

. In particular, show that the first result of the returned triple is a multiple of the gcd. Then verify the “linear combination” property of the result.

###### 5.

For a polynomial ring over a field, every ideal is principal. Begin with the ring of polynomials over the rationals. Experiment with constructing ideals using two generators and then see that Sage converts the ideal to a principal ideal with a single generator. (You can get this generator with the ideal method `.gen()`

.) Can you explain how this single generator is computed?