Field Theory

Prerequisites: basic concepts of abstract algebra, group theory, and ring theory

Introduction

Field theory is the theory of fields.

This article mainly concerns the theory of field extensions. A field is an algebraic structure closed under addition, subtraction, multiplication, and division. In algorithm competitions, taking a modulus by a prime pp is equivalent to performing computations in the finite field Fp\mathbf F_p. As with the real field R\mathbf R, some problems are more conveniently solved in a larger field, namely the complex field C\mathbf C; a common example is using the fast Fourier transform to accelerate multiplication of polynomials with real coefficients. Similar operations can be performed over finite fields. Most readers are relatively unfamiliar with extensions of finite fields, so understanding the general theory of field extensions is useful. At the end of the article, we give several algorithmic applications that require extending finite fields, and briefly discuss extensions of integer rings that may be needed in some applications.

Closely related to field theory is Galois theory. It connects field extensions with their automorphism groups, making it possible to understand the properties of field extensions using tools from group theory. Although this theory is often a core part of algebra courses, it is far removed from the content of algorithm competitions, so this article will not introduce it in much detail. Interested readers should consult relevant specialized books.

Notation

When there is no ambiguity, this article may omit multiplication symbols in rings and fields, write the ring (R,+,⋅)(R,+,\cdot) as the ring RR, and write the field (F,+,⋅)(F,+,\cdot) as the field FF. The additive identity of a ring or field is called the zero element, and the multiplicative identity is called the unity. In this article, pp is always a prime, while qq is always a prime power and can be written as pnp^n, where nn is a positive integer.

Field extensions

As in the cases of groups and rings, we can define subfields and field homomorphisms.

Subfield

For a field FF, if its subring EE is also a field, then EE is called a subfield of FF.

Regardless of how the definitions of rings and subrings treat the unity, a subfield EE necessarily contains the unity of the field FF1.

Field homomorphism

A ring homomorphism from a field FF to a field EE, φ:F→E\varphi:F\rightarrow E, is also called a field homomorphism from FF to EE.

Unity under field homomorphisms

If, unlike the definition used in this article, ring homomorphisms are required to map the unity to the unity, then field homomorphisms naturally have the same requirement. Otherwise, the unity may also map to the zero element.

Since fields have only trivial ideals, a field homomorphism either maps the entire field to the zero element or is necessarily an embedding. Thus, discussing field homomorphisms can be reduced to discussing subfields.

For fields, the smaller field is often the more familiar one, so we usually take a subfield as the base point when studying a larger field. This is the concept of a field extension.

Field extension

For a field FF, if FF is a subfield of EE, then EE is called an extension (or an extension field) of FF, denoted by E/FE/F.

Notation for field extensions

Although the notation is formally the same, the concept of a field extension has nothing to do with quotient rings and should not be confused with them.

Example

The complex field C\mathbf C is an extension of the real field R\mathbf R, and the real field R\mathbf R is an extension of the rational field Q\mathbf Q.

Degree of a field extension

For a field extension E/FE/F, EE is always a vector space over FF. The dimension of this vector space is the degree of the field extension.

Degree of a field extension

The degree of a field extension E/FE/F is the dimension of EE viewed as a vector space over FF, namely dim⁡F(E)\dim_F(E), denoted by [E:F][E:F]. If the degree of a field extension is finite, it is called a finite extension; otherwise it is called an infinite extension.

Example

The degree of the extension C/R\mathbf C/\mathbf R, [C:R][\mathbf C:\mathbf R], is 22, so it is a finite extension. The extension R/Q\mathbf R/\mathbf Q is infinite.

The degree of field extensions satisfies the multiplicative law.

Theorem

Let F⊆K⊆EF\subseteq K\subseteq E be fields; their extension degrees satisfy [E:F]=[E:K][K:F][E:F]=[E:K][K:F].

Proof

In the case of infinite extension degrees, this is obvious. Otherwise, if {αi}\{\alpha_i\} is a basis of EE as a vector space over KK, and {βj}\{\beta_j\} is a basis of KK as a vector space over FF, then one can verify that {αiβj}\{\alpha_i\beta_j\} is a basis of EE as a vector space over FF.

This article mainly discusses finite field extensions.

Characteristic of a field

A natural starting point for studying field extensions is the smallest subfield containing the unity of FF, which is also called the prime subfield of FF.

The structure of the prime subfield is uniquely determined by the properties of the field's unity. The characteristic of a field summarizes these properties.

Characteristic of a field

The characteristic of a field FF is the smallest positive integer for which n⋅1=0n\cdot 1=0 holds, namely nn; if no such nn exists, the characteristic of the field FF is 00. Here, n⋅1n\cdot 1 means adding nn copies of the unity 11. If the characteristic of FF is not 00, then FF is said to have finite characteristic.

The characteristic of a field can be understood through ring homomorphisms. The integer ring Z\mathbf Z is the structure closed under repeated addition, subtraction, and multiplication starting from 00 and 11. It can be viewed as a kind of “prototype”: every ring containing a unity should “inherit” part of the structure of the integer ring2. Thus, for a field FF, consider the ring homomorphism φ:Z→F\varphi:\mathbf Z\rightarrow F satisfying φ(1)=1\varphi(1)=1. This ring homomorphism is uniquely determined: it maps n∈N+n\in\mathbf N_+ to n⋅1n\cdot 1, the sum of nn copies of the unity 11. Its image φ(Z)\varphi(\mathbf Z) embeds into the field FF, necessarily contains the unity, is commutative, and has no zero divisors, so it is an integral domain. Therefore, the kernel ker⁡φ\ker\varphi of the homomorphism is necessarily a prime ideal. The prime ideals of the integer ring Z\mathbf Z can only have the form (n)(n), where n=0n=0 or nn is prime. This nn is the characteristic of the field.

The characteristic of a field determines the structure of its prime subfield:

  1. When the characteristic is 00, the homomorphism φ\varphi is injective, so the integer ring Z\mathbf Z embeds into the field FF. The rational field Q\mathbf Q, as the smallest field containing the integer ring, can also be embedded into FF; it is the prime subfield of FF;
  2. When the characteristic is a prime pp, the image of the homomorphism φ\varphi, Z/pZ\mathbf Z/p\mathbf Z, embeds into the field FF. In this case, Z/pZ\mathbf Z/p\mathbf Z is already a field, denoted by Fp\mathbf F_p, and it is the prime subfield of FF.

These observations in fact establish the following conclusion:

Theorem

The characteristic of a field FF can only be 00 or a prime pp. A field of characteristic 00 has prime subfield Q\mathbf Q, while a field of characteristic pp has prime subfield Fp\mathbf F_p.

The Q\mathbf Q and Fp\mathbf F_p in the theorem are also called prime fields, that is, fields whose only subfield is themselves. A finite field necessarily has finite characteristic, because a field of characteristic 00 contains at least the subfield Q\mathbf Q.

Fields of finite characteristic and fields of characteristic zero often have different properties. For example, a field of finite characteristic has the following properties:

Theorem

Let FF have characteristic pp. Then:

  1. Every nonzero element of the additive group of FF has order pp, that is, for every x∈Fx\in F, px=0px=0;
  2. the “freshman's dream”: for every x,y∈Fx,y\in F, (x+y)p=xp+yp(x+y)^p=x^p+y^p. Consequently, the map x↦xpx\mapsto x^p is an injective endomorphism of FF, called the Frobenius endomorphism.
Proof

For the first property, it is enough to note that px=(p1)x=0x=0px=(p1)x=0x=0. For the second property, in the binomial expansion of (x+y)p(x+y)^p, all the coefficients other than those of xpx^p and ypy^p are multiples of pp, so the first property gives (x+y)p=xp+yp(x+y)^p=x^p+y^p. To verify that x↦xpx\mapsto x^p is an endomorphism, it remains only to verify (xy)p=xpyp(xy)^p=x^py^p, which follows because multiplication in a field is commutative. Finally, a ring homomorphism between fields that maps the unity to the unity is necessarily injective.

For a finite field, the Frobenius endomorphism is of course also surjective, and is therefore an automorphism of the field.

Simple extensions

As in the extension of the real field to the complex field, many extensions can be constructed by adjoining extra elements to a field and specifying their arithmetic properties. In general, to avoid the trouble caused by specifying these properties, consider a field extension E/FE/F and adjoin elements of E∖FE\setminus F to FF; the rules for operating on these extra elements and elements of FF have already been determined in the larger field EE.

Extension generated by a subset

Let E/FE/F be a field extension and S⊆ES\subseteq E; the extension generated by SS over FF (extension generated by SS over FF) is the smallest subfield containing both FF and SS in EE, denoted by F(S)F(S).

The simplest case is naturally the one in which the set SS contains only a few elements.

Finitely generated extension

Let E/FE/F be a field extension; if there is a finite set S={α1,⋯ ,αn}⊆ES=\{\alpha_1,\cdots,\alpha_n\}\subseteq E such that E=F(S)E=F(S), then EE is a finitely generated extension of FF, also written F(α1,⋯ ,αn)F(\alpha_1,\cdots,\alpha_n).

Simple extension

Let E/FE/F be a field extension; if there is an α∈E\alpha\in E such that E=F(α)E=F(\alpha), then EE is a simple extension of FF. The element α\alpha is called the primitive element of this simple extension.

Examples

All of these examples are obtained by adjoining elements to Q\mathbf Q from C\mathbf C.

  1. For a square-free integer D≠0,1D\neq 0,1, the quadratic field Q(D)\mathbf Q(\sqrt D) is the simple extension obtained by adjoining it to Q\mathbf Q, with D∈C∖Q\sqrt D\in\mathbf C\setminus\mathbf Q. Its degree is 22, because {1,D}\{1,\sqrt D\} is a basis.
  2. The field Q(2,3)\mathbf Q(\sqrt 2,\sqrt 3) is obtained from Q\mathbf Q by adjoining 2\sqrt 2 and 3\sqrt 3. Of course Q(2,3)=Q(2)(3)=Q(3)(2)\mathbf Q(\sqrt 2,\sqrt 3)=\mathbf Q(\sqrt 2)(\sqrt 3)=\mathbf Q(\sqrt 3)(\sqrt 2), meaning that the final extension is independent of the order and manner in which the elements are adjoined. This is also a simple extension, because Q(2,3)=Q(2+3)\mathbf Q(\sqrt 2,\sqrt 3)=\mathbf Q(\sqrt 2+\sqrt 3). Its degree is 44, because {1,2,3,6}\{1,\sqrt 2,\sqrt 3,\sqrt 6\} is a basis.
  3. The field Q(π)\mathbf Q(\pi) is also a simple extension, where π\pi is the circle constant. It is an infinite extension, because Q[π]⊆Q(π)\mathbf Q[\pi]\subseteq \mathbf Q(\pi) already has a basis {1,π,π2,⋯ }\{1,\pi,\pi^2,\cdots\}.
  4. The field Q(π,e)\mathbf Q(\pi,\mathrm e) is a finitely generated extension, but not a simple extension. Here, π\pi is the circle constant and e\mathrm e is the base of the natural logarithm.

These examples show that simple extensions can have very different properties. This depends on the nature of the elements being adjoined.

Algebraic extensions

To analyze all possible situations that can arise when elements are adjoined to a field, let us imitate the earlier discussion of the characteristic of a field and consider ring homomorphisms from the polynomial ring F[x]F[x] to an extension E/FE/F. Here, F[x]F[x] plays the role of the integer ring Z\mathbf Z: it is the “prototype” of the structure obtained in the field FF by adjoining the indeterminate xx and closing under addition, subtraction, and multiplication3.

Let a ring homomorphism φ:F[x]→E\varphi:F[x]\rightarrow E satisfy that φ\varphi restricts to the identity on FF and φ(x)=α\varphi(x)=\alpha, that is, let it map the indeterminate to an element of the extension EE. Since its image φ(F[x])=F[α]\varphi(F[x])=F[\alpha] is necessarily an integral domain, the kernel ker⁡φ\ker\varphi is necessarily a prime ideal of the polynomial ring F[x]F[x]. A polynomial ring over a field is a principal ideal domain, so the kernel necessarily has the form (f(x))(f(x)), where f(x)=0f(x)=0 or f(x)f(x) is an irreducible element of F[x]F[x]. There are two cases:

  1. When the kernel of the homomorphism is ker⁡φ={0}\ker\varphi=\{0\}, the polynomial ring F[x]F[x] embeds into EE, and its image F[α]F[\alpha] is an integral domain. Therefore, the smallest field in EE containing both FF and α\alpha is the field of fractions of F[α]F[\alpha], namely F(α)F(\alpha). This notation can be interpreted either as taking the indeterminate in the rational function field F(x)F(x) and substituting it with α\alpha, or as the simple extension generated over FF by α\alpha; these two interpretations give the same result in this context;

  2. When the kernel of the homomorphism is ker⁡φ=(f(x))\ker\varphi=(f(x)) and f(x)f(x) is irreducible, we have φ(f(x))=f(α)=0\varphi(f(x))=f(\alpha)=0, that is, α∈E\alpha\in E is a root over FF of the polynomial f(x)f(x). Since FF is a field, we may assume that f(x)f(x) is monic. The image of the homomorphism φ\varphi is then the field F(α)F(\alpha), so

    F[x]/(f(x))≅F(α).F[x]/(f(x))\cong F(\alpha).

    This case can be further divided into two cases:

    1. If f(x)f(x) is a linear polynomial, that is, f(x)=x−αf(x)=x-\alpha, then α∈F\alpha\in F, so the extension F(α)=FF(\alpha)=F is trivial;
    2. In all other cases, f(x)f(x) is an irreducible polynomial of degree greater than one, and α∈E∖F\alpha\in E\setminus F; the image F[α]F[\alpha] is already a field containing FF and α\alpha, so it is F(α)F(\alpha), the extension generated over FF by α\alpha, and F(α)⊃FF(\alpha)\supset F is nontrivial.

These observations motivate the following definitions:

Algebraic and transcendental elements

For an extension E/FE/F, if an element α∈E\alpha\in E is a root over FF of a nonzero polynomial f(x)f(x), then α\alpha is algebraic over FF; otherwise, α\alpha is transcendental over FF.

Minimal polynomial

For an element algebraic over a field FF, namely α\alpha, the monic polynomial having α\alpha as a root and having smallest degree, f(x)f(x), is called its minimal polynomial.

This minimal polynomial is the irreducible polynomial f(x)f(x) in the analysis above. Of course, one can also prove directly that minimal polynomials are irreducible. The minimality of the minimal polynomial f(x)f(x) means that whenever a polynomial over FF has α\alpha as a root, it must have f(x)f(x) as a factor.

Examples
  1. 2\sqrt 2 is algebraic over Q\mathbf Q, and its minimal polynomial is x2−2x^2-2.
  2. 2\sqrt 2 is algebraic over R\mathbf R, and its minimal polynomial is x−2x-\sqrt 2.
  3. π\pi is transcendental over Q\mathbf Q.
  4. In general, an element algebraic over Q\mathbf Q is called an algebraic number, while a transcendental element is called a transcendental number. In particular, if the minimal polynomial of an algebraic number is monic, it is called an algebraic integer. All algebraic integers in an algebraic extension form a ring. For example, the algebraic integers in the quadratic field Q(D)\mathbf Q(\sqrt{D}) form the quadratic integer ring Z[ω]\mathbf Z[\omega]. The meaning of this notation is given on the quadratic integer ring page.
Algebraic and transcendental extensions

For an extension E/FE/F, if every element of the field EE is algebraic over FF, then EE is an algebraic extension of FF; otherwise, EE is a transcendental extension of FF.

Depending on the nature of the adjoined element, the result of a simple extension can be divided into two types. When the adjoined element is transcendental, the simple extension is always isomorphic to a rational function field. In this case, there is no possibility of further simplification. However, when the adjoined element is algebraic, the simple extension is actually F[α]F[\alpha], namely the result obtained by directly using α\alpha to replace the indeterminate in the polynomial ring F[x]F[x], namely xx. From an elementary point of view, compared with the transcendental case, elements in the extension field can have no denominator; this means that a process analogous to “rationalizing the denominator” in elementary arithmetic is always possible in a simple algebraic extension. Since the extensions involved in algorithm competitions are mainly simple algebraic extensions, the next section discusses their computation in greater detail.

The importance of simple algebraic extensions is also reflected in the following theorem:

Theorem

A field extension is finite if and only if it is a finitely generated algebraic extension.

Proof

Let FF be a field, and let E=F(α1,⋯ ,αn)E=F(\alpha_1,\cdots,\alpha_n) be a finitely generated algebraic extension of a field, that is, every αi\alpha_i is algebraic over FF. Let Ei=F(α1,⋯ ,αi)E_i=F(\alpha_1,\cdots,\alpha_i), so E0=FE_0=F and En=EE_n=E. Notice that αi\alpha_i is necessarily algebraic over Ei−1E_{i-1}, because the minimal polynomial of αi\alpha_i over the field FF is also a polynomial over Ei−1E_{i-1}; moreover, the degree of the minimal polynomial of αi\alpha_i over Ei−1E_{i-1} cannot exceed the degree of the minimal polynomial of αi\alpha_i over the field FF. Therefore, [Ei:Ei−1][E_i:E_{i-1}] is necessarily finite, and by the multiplicative law for field extension degrees, [E:F]=∏i=1n[Ei:Ei−1][E:F]=\prod_{i=1}^n[E_i:E_{i-1}] is also finite. Conversely, starting from E0=FE_0=F, for each EiE_i that has already been constructed, choose an element in E∖EiE\setminus E_i, namely αi+1\alpha_{i+1}, and adjoin it to EiE_i to obtain the extension Ei+1=Ei(αi+1)E_{i+1}=E_i(\alpha_{i+1}), until En=EE_n=E. Since the degree of the extension keeps decreasing, this process must terminate after finitely many steps. Therefore, every finite extension is a finitely generated algebraic extension.

This means that to understand the properties of finite extensions, it is enough to understand simple algebraic extensions. A finite extension can always be obtained through finitely many simple algebraic extensions.

Structure and computation of simple algebraic extensions

In this section, let FF be a number field, let EE be an extension of it, and let α∈E∖F\alpha\in E\setminus F be algebraic over FF. Let the minimal polynomial of α\alpha be f(x)f(x), and let f(x)f(x) be a monic polynomial of degree nn, namely

f(x)=xn+an−1xn−1+⋯+a1x+a0,f(x)=x^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0,

where a0,a1,⋯ ,an−1∈Fa_0,a_1,\cdots,a_{n-1}\in F and f(x)f(x) is irreducible over FF.

The isomorphism F(α)≅F[x]/(f(x))F(\alpha)\cong F[x]/(f(x)) shows that operations in the extension field F(α)F(\alpha) are computations with polynomials modulo f(x)f(x). By polynomial division with remainder, it is enough to consider the congruence classes of all polynomials of degree less than n=deg⁡f(x)n=\deg f(x). A natural basis for these polynomials is {1,α,⋯ ,αn−1}\{1,\alpha,\cdots,\alpha^{n-1}\}. Therefore, we have the following conclusion:

Theorem

Under the assumptions of this section, the extension field F(α)F(\alpha) can be written as

F(α)={λ(α)=λ0+λ1α+⋯+λn−1αn−1:λ0,λ1,⋯ ,λn−1∈F}.F(\alpha)=\{\lambda(\alpha)=\lambda_0+\lambda_1\alpha+\cdots+\lambda_{n-1}\alpha^{n-1}:\lambda_0,\lambda_1,\cdots,\lambda_{n-1}\in F\}.

Here, λ(x)\lambda(x) ranges over all polynomials of degree less than nn. Therefore, the extension degree [F(α):F]=n[F(\alpha):F]=n, namely, the degree of the minimal polynomial of α\alpha. In the extension field, addition of λ(α)\lambda(\alpha) and μ(α)\mu(\alpha) is polynomial addition, that is, the coefficients at corresponding positions are added; multiplication of λ(α)\lambda(\alpha) and μ(α)\mu(\alpha) has a result that can be written as ρ(α)\rho(\alpha), where ρ(x)\rho(x) is the remainder when the product λ(x)μ(x)\lambda(x)\mu(x) is divided by f(x)f(x).

As a field, one can of course also calculate division of elements in F(α)F(\alpha). According to the multiplication process described in the theorem, this amounts to solving a linear congruence equation over a polynomial ring. By analogy with the method for integers, to calculate the quotient λ(α)/μ(α)\lambda(\alpha)/\mu(\alpha), one can first determine the multiplicative inverse of μ(α)\mu(\alpha) and then multiply it by λ(α)\lambda(\alpha). To calculate the multiplicative inverse of μ(α)\mu(\alpha), it is enough to solve the congruence μ(x)ξ(x)≡1(modf(x))\mu(x)\xi(x)\equiv 1\pmod{f(x)}. This can be done using the extended Euclidean algorithm.

The details of the computation are illustrated below with several concrete examples.

Example

Consider the extension field Q(α)\mathbf Q(\alpha), where α\alpha is a root of the equation x3−2x−2=0x^3-2x-2=0. We want to calculate

1+α1+α+α2\frac{1+\alpha}{1+\alpha+\alpha^2}

its value.

The first step is to calculate the inverse of 1+α+α21+\alpha+\alpha^2, that is, to solve the congruence equation

(x2+x+1)ξ(x)+(x3−2x−2)ν(x)=1(x^2+x+1)\xi(x)+(x^3-2x-2)\nu(x)=1

Apply the extended Euclidean algorithm. First perform the Euclidean division, obtaining:

x3−2x−2=(x−1)(x2+x+1)+(−2x−1),x2+x+1=(−12x−14)(−2x−1)+34,−2x−1=(−83x−43)34.\begin{aligned} x^3-2x-2 &= (x-1)(x^2+x+1)+(-2x-1),\\ x^2+x+1 &= \left(-\frac12x-\frac14\right)(-2x-1)+\frac34,\\ -2x-1 &= \left(-\frac{8}{3}x-\frac{4}{3}\right)\frac{3}{4}. \end{aligned}

Next compute the coefficients in the congruence equation:

34=(x2+x+1)+(12x+14)(−2x−1)=(x2+x+1)+(12x+14)((x3−2x−2)−(x−1)(x2+x+1))=(−12x2+14x+54)(x2+x+1)+(12x+14)(x3−2x−2).\begin{aligned} \frac{3}{4} &=(x^2+x+1)+\left(\frac12x+\frac14\right)(-2x-1)\\ &=(x^2+x+1)+\left(\frac12x+\frac14\right)\left((x^3-2x-2)-(x-1)(x^2+x+1)\right)\\ &=\left(-\frac12x^2+\frac14x+\frac54\right)(x^2+x+1)+\left(\frac12x+\frac14\right)(x^3-2x-2). \end{aligned}

Therefore, the solution to the equation is

ξ(x)=−23x2+13x+53, ν(x)=23x+13.\xi(x)=-\frac23x^2+\frac13x+\frac53,\ \nu(x)=\frac23x+\frac13.

This shows that the inverse of 1+α+α21+\alpha+\alpha^2 is

−23α2+13α+53.-\frac23\alpha^2+\frac13\alpha+\frac53.

The second step is to calculate the product of the inverse and 1+α1+\alpha. We have

(1+α)(−23α2+13α+53)=−23α3−13α2+2α+53=−23(2α+2)−13α2+2α+53=−13α2+23α+13.\begin{aligned} (1+\alpha)\left(-\frac23\alpha^2+\frac13\alpha+\frac53\right) &=-\frac23\alpha^3-\frac13\alpha^2+2\alpha+\frac53\\ &=-\frac23(2\alpha+2)-\frac13\alpha^2+2\alpha+\frac53\\ &=-\frac13\alpha^2+\frac23\alpha+\frac13. \end{aligned}

This is the final answer.

In the example, we only used the condition that α\alpha is a root of the equation, without specifying which particular root it is. The polynomial x3−2x−2=0x^3-2x-2=0 has one real root and a pair of conjugate complex roots in the complex field C\mathbf C; adjoining any one of these roots to the rational field Q\mathbf Q gives an extension isomorphic to the others. In other words, from the algebraic point of view, these three distinct roots are indistinguishable.

In general, for a field FF and an irreducible polynomial f(x)f(x) over it, if it has distinct roots α≠β\alpha\neq\beta in an extension field, these roots have the same algebraic properties when they are separately used to form simple extensions of FF; the roots are called conjugates of one another. The usual notion of conjugation in the complex field is a special case of this concept for the field extension C/R\mathbf C/\mathbf R.

Example

Consider the extension field F2(α)\mathbf F_2(\alpha), where α\alpha is a root of the equation x2+x+1=0x^2+x+1=0. In general, the operations on a+bαa+b\alpha and c+dαc+d\alpha are

(a+bα)+(c+dα)=(a+c)+(b+d)α,(a+bα)(c+dα)=ac+(ad+bc)α+bdα2=(ac+bd)+(ad+bc+bd)α.\begin{aligned} (a+b\alpha)+(c+d\alpha)&=(a+c)+(b+d)\alpha,\\ (a+b\alpha)(c+d\alpha)&=ac+(ad+bc)\alpha+bd\alpha^2\\ &=(ac+bd)+(ad+bc+bd)\alpha. \end{aligned}

This provides arithmetic rules analogous to those in the complex field. Most readers will be unfamiliar with such a root α\alpha, but this does not prevent us from performing operations on elements of this field. In fact, [F2(α):F2]=2[\mathbf F_2(\alpha):\mathbf F_2]=2, so as a vector space ∣F2(α)∣=4|\mathbf F_2(\alpha)|=4; that is, the result is a finite field of size 44. We will see later that all finite fields are constructed in this way.

For small computations, reducing modulo a monic polynomial f(x)f(x) can usually be done by substituting

xn=−an−1xn−1−⋯−a1x−a0x^n=-a_{n-1}x^{n-1}-\cdots-a_1x-a_0

to lower the degree of the target polynomial. Moreover, for low-degree extensions, one can often directly derive the coefficient operation rules and use an implementation similar to a complex-number class, without carrying out a modular reduction every time.

As an example of a simple algebraic extension, see the reference implementation of finite fields below.

The algorithms described here can in practice handle only relatively low extension degrees, which is sufficient for most applications in algorithm competitions. When the extension degree is high enough to become a complexity bottleneck, appropriate polynomial techniques (fast Fourier transform, number-theoretic transform, fast polynomial remainder computation, polynomial Euclidean algorithm, and so on) should be used to accelerate the computations.

Splitting fields

The structure of simple algebraic extensions was discussed in detail above. However, such an extension is often not sufficient:

Example

Consider the extension Q(23)/Q\mathbf Q(\sqrt[3]{2})/\mathbf Q. The algebraic element 23\sqrt[3]{2} in the field Q\mathbf Q has minimal polynomial x3−2x^3-2. In the complex field C\mathbf C, the polynomial x3−2x^3-2 has three roots, namely 23,23ω,23ω2\sqrt[3]{2},\sqrt[3]{2}\omega,\sqrt[3]{2}\omega^2, where ω=e2πi/3\omega=\mathrm{e}^{2\pi\mathrm{i}/3} is a primitive third root of 11. Although Q(23)≅Q(23ω)≅Q(23ω2)\mathbf Q(\sqrt[3]{2})\cong\mathbf Q(\sqrt[3]{2}\omega)\cong\mathbf Q(\sqrt[3]{2}\omega^2), the other two roots are not in Q(23)\mathbf Q(\sqrt[3]{2}), so an operation such as 23+23ω\sqrt[3]{2}+\sqrt[3]{2}\omega cannot even be performed there. To fully study these three roots, we need to extend Q(23)\mathbf Q(\sqrt[3]{2}) further, namely to Q(23,23ω,23ω2)\mathbf Q(\sqrt[3]{2},\sqrt[3]{2}\omega,\sqrt[3]{2}\omega^2).

As explained above, such an extension can be made by successively forming simple extensions of the elements. It should be noted that the minimal polynomial of 23ω\sqrt[3]{2}\omega over Q\mathbf Q is different from its minimal polynomial over Q(23)\mathbf Q(\sqrt[3]{2}): the former is x3−2∈Q[x]x^3-2\in\mathbf Q[x], while the latter is x2+23x+43∈Q(23)[x]x^2+\sqrt[3]{2}x+\sqrt[3]{4}\in \mathbf Q(\sqrt[3]{2})[x], because

x3−2=(x−23)(x2+23x+43).x^3-2 = (x-\sqrt[3]{2})(x^2+\sqrt[3]{2}x+\sqrt[3]{4}).

After the original minimal polynomial factors into linear factors when the field is extended, the degree of the minimal polynomial of the remaining roots is lower than its degree over the original field. The process of continually extending the field is a process of continually “splitting” the polynomial. Therefore, every time a simple extension is formed, the minimal polynomial must be determined again.

Adjoining all the roots of a polynomial to a field gives its splitting field.

Splitting

Let FF be a field. If a polynomial f(x)f(x) can be factored in F[x]F[x] as a product of linear factors, then f(x)f(x) is said to split over FF.

Splitting field

For a field FF and a polynomial f(x)f(x) over it, if an extension E/FE/F makes f(x)f(x) split in EE but it does not split in any proper subfield of EE, then EE is the splitting field of f(x)f(x).

As with simple extensions, one can prove that the splitting field of a given polynomial is unique up to isomorphism, independently of the construction method. A splitting field is always a finite extension.

Normal extension

For an algebraic extension E/FE/F, if, for every α∈E\alpha\in E, the minimal polynomial of α\alpha splits in EE, then EE is a normal extension of FF.

Normal extensions play a foundational role in Galois theory.

Algebraically closed fields

Most of the extension concepts mentioned above are, in principle, defined inside a field larger than the extension. For simple extensions, polynomial rings allow us to construct a field extension without relying on a larger field, but there is no such method in general. For the rational field Q\mathbf Q and the real field R\mathbf R, we can always assume that algebraic extensions are contained in the complex field C\mathbf C. For finite fields, there is no analogous known field. In fact, every field has an algebraic closure, so all algebraic extensions of a field can be assumed to be formed inside its algebraic closure. This completely resolves the issue.

Algebraic closure

For a field FF, if a field F‾\overline F is an algebraic extension of FF and every f(x)∈F[x]f(x)\in F[x] splits in F‾\overline F, then F‾\overline F is an algebraic closure of FF.

An algebraic closure is a normal extension of the field. Its construction is essentially the process of adjoining the roots of all possible polynomials to the field. As with a splitting field, the algebraic closure of a field is also unique up to isomorphism.

Theorem

Every field FF has an algebraic closure.

Proof

The difficulty of the proof comes from set theory. Here we quote a proof by Artin.

The first part starts from FF and constructs an extension K1/FK_1/F such that every polynomial over FF has at least one root in K1K_1. For the field FF, consider the multivariable polynomial ring4 R=F[⋯ ,xf,⋯ ]R=F[\cdots,x_f,\cdots], where the subscript of the indeterminate xfx_f ranges over all monic polynomials over FF. Let all f(xf)f(x_f) generate an ideal II. First, I≠RI\neq R, so a maximal ideal M⊇IM\supseteq I exists. Otherwise, if 1∈I1\in I, there must be finitely many monic polynomials over a field FF, denoted fif_i, and corresponding elements in the ring RR, denoted gig_i such that g1f1(xf1)+⋯+gkfk(xfk)=1g_1f_1(x_{f_1})+\cdots+g_kf_k(x_{f_k})=1. Let F(α1,⋯ ,αk)F(\alpha_1,\cdots,\alpha_k) be the algebraic extension obtained by adjoining to FF roots of the polynomials fi(x)f_i(x), denoted by αi\alpha_i; in F(α1,⋯ ,αk)F(\alpha_1,\cdots,\alpha_k), substitute every xfix_{f_i} in the identity above with αi\alpha_i, and in each gig_i substitute for the other indeterminates xfx_f the value 00, and in F(α1,⋯ ,αk)F(\alpha_1,\cdots,\alpha_k) this gives the equality 0=10=1, a contradiction. Thus I≠RI\neq R, and the construction of the maximal ideal MM is valid. The quotient ring R/MR/M is a field, denoted by K1K_1, and every monic polynomial over FF, f(x)f(x), has a root in K1K_1, namely xf‾\overline{x_f}.

The second part inductively constructs an algebraically closed field containing FF, denoted by KK (the definition is given below). Repeating the construction above, from a field KiK_i we can construct a field Ki+1K_{i+1} in which every polynomial over KiK_i has at least one root in Ki+1K_{i+1}. Moreover, KiK_i embeds naturally into Ki+1K_{i+1}, so we can define their union K=⋃i=1∞KiK=\bigcup_{i=1}^\infty K_i. It is easy to verify that this is also a field, and the coefficients of every polynomial over KK must all be contained in some KiK_i, so one of its roots must appear in Ki+1⊆KK_{i+1}\subseteq K. This shows that every polynomial over KK has at least one root in KK, so KK is an algebraically closed field.

Finally, let the set of all elements of KK that are algebraic over FF be denoted by F‾\overline F. It is clearly a field, because for any α,β∈F‾\alpha,\beta\in\overline F, we have α±β,αβ,α/β∈F(α,β)⊆F‾\alpha\pm\beta,\alpha\beta,\alpha/\beta\in F(\alpha,\beta)\subseteq\overline F. It is also an algebraic extension of FF, because all its elements are algebraic over FF. For a polynomial over FF, namely f(x)f(x), all its roots are algebraic over FF, so they also lie in F‾\overline F and therefore it must split into a product of linear factors. This proves that F‾\overline F is an algebraic closure of FF.

Examples
  1. The algebraic closure of the real field R\mathbf R is the complex field C\mathbf C.
  2. The algebraic closure of the rational field Q\mathbf Q is the set of all algebraic numbers (that is, the set of algebraic elements in the field extension C/Q\mathbf C/\mathbf Q), denoted by Q‾\overline{\mathbf Q}.

Every algebraic extension of an algebraic closure is trivial. Such a field is called an algebraically closed field.

Algebraically closed field

If a field FF has every nonconstant polynomial f(x)f(x) with at least one root α∈F\alpha\in F, then FF is called an algebraically closed field.

In fact, it has the following equivalent definitions:

Theorem

For a field FF, the following properties are equivalent:

  1. The field FF is algebraically closed;
  2. every polynomial over FF, namely f(x)f(x), splits;
  3. the only irreducible polynomials over FF are linear polynomials;
  4. FF has no nontrivial algebraic extensions;
  5. FF has no nontrivial finite extensions;
  6. FF is the algebraic closure of some field.
Proof

The equivalence of the first five properties is obvious from the definitions. For the sixth, an algebraically closed field is clearly its own algebraic closure, because it has no nontrivial algebraic extensions. Conversely, we prove that the algebraic closure of a field FF is necessarily algebraically closed. Let F‾\overline F be the algebraic closure of FF, and let f(x)f(x) be a polynomial over F‾\overline F. Let α\alpha be a root of f(x)f(x) in the splitting field of f(x)f(x), and let the set of nonzero coefficients of f(x)f(x) be S⊆F‾S\subseteq\overline F. Since F(S)(α)=F(S∪{α})F(S)(\alpha)=F(S\cup\{\alpha\}) is a finite extension, α\alpha must also be algebraic over FF; therefore, by the definition of an algebraic closure, the minimal polynomial of α\alpha over FF splits in the field F‾\overline F, so α∈F‾\alpha\in\overline F. This shows that every polynomial over F‾\overline F has at least one root.

Finally, the fundamental theorem of algebra 5 shows that C\mathbf C is algebraically closed. An irreducible polynomial over the real field R\mathbf R has degree at most two, or equivalently, its algebraic extensions have degree at most two, because the largest field obtainable through algebraic extensions is C\mathbf C.

Separable extensions

The concept of a splitting field guarantees that for any polynomial over any field, there is always an extension that contains all its roots, and the splitting field precisely gives the smallest such extension. The properties of a polynomial are closely related to the properties of its splitting field. However, if we want to study the properties of a polynomial through its splitting field, we first face the problem that the splitting field is independent of the multiplicities of the roots of the polynomial. Therefore, whenever possible, we should consider a kind of “simplest representation” of the polynomial. Motivated by this, a polynomial that has no repeated roots even in the algebraic closure of the field is called a separable polynomial.

Separable polynomial

For a field FF, if a polynomial f(x)f(x) has no repeated roots, that is, if f(x)f(x) has no repeated factors in the algebraic closure of the field FF, F‾\overline F, then its factorization into linear factors has no repeated factors, and f(x)f(x) is called separable.

Because we always extend to the algebraic closure of FF when discussing this, whether a polynomial is separable is actually independent of the choice of the field FF. However, because the coefficients of the polynomial lie in FF, we should give a test that can determine whether a polynomial is separable over FF without explicitly constructing its extension.

Readers familiar with analysis know that whether a polynomial function has repeated roots can be determined using its derivative: a repeated root of a polynomial function is also a root of its derivative. Although polynomials and polynomial functions are not identical concepts, the method for determining whether a polynomial function has repeated roots can be transferred to polynomials by analogy. The derivative of a polynomial can be defined formally as follows:

Formal derivative

For the polynomial over a field FF

f(x)=a0+a1x+a2x2+⋯+an−1xn−1+anxn=∑i=0naixif(x)=a_0+a_1x+a_2x^2+\cdots+a_{n-1}x^{n-1}+a_nx^n=\sum_{i=0}^na_ix^i

its (formal) derivative (derivative), denoted by Df(x)Df(x), is defined as the polynomial

Df(x)=a1+2a2x+⋯+(n−1)an−1xn−1+nanxn−1=∑i=1niaixi−1.Df(x)=a_1+2a_2x+\cdots+(n-1)a_{n-1}x^{n-1}+na_nx^{n-1}=\sum_{i=1}^nia_ix^{i-1}.

This definition applies to polynomials over every field and does not depend on any topological structure; here the derivative operator DD merely maps one polynomial to another. Moreover, by comparing coefficients, one can verify that familiar differentiation rules, such as D(f(x)g(x))=(Df(x))g(x)+f(x)(Dg(x))D(f(x)g(x))=(Df(x))g(x)+f(x)(Dg(x)), still hold for formal derivatives.

Consequently, to check whether the polynomial f(x)f(x) and its derivative Df(x)Df(x) have a common root in the splitting field, we need not explicitly construct this splitting field, but can determine it through their greatest common divisor; this is because the roots of a polynomial always occur in its minimal polynomial, and a repeated root means that the corresponding minimal-polynomial factor is also repeated. Thus, the criterion for repeated roots is as follows:

Theorem

For a field FF, for a polynomial f(x)f(x), if f(x)f(x) has a repeated root α\alpha, then its derivative Df(x)Df(x) also has the same root α\alpha. Consequently, a necessary and sufficient condition for the polynomial f(x)f(x) to be separable is that f(x)f(x) and its derivative Df(x)Df(x) are coprime, namely, gcd⁡(f(x),Df(x))=1\gcd(f(x),Df(x))=1.

Proof

First, because division with remainder remains valid in an extension, the result of the Euclidean algorithm is also independent of the choice of extension, so it is enough to discuss their common factors in the splitting field. Let α\alpha be a root of f(x)f(x) of multiplicity k>1k>1; then in the splitting field we have the factorization f(x)=(x−α)kg(x)f(x)=(x-\alpha)^kg(x), so its derivative Df(x)=k(x−α)k−1g(x)+(x−α)kDg(x)Df(x)=k(x-\alpha)^{k-1}g(x)+(x-\alpha)^kDg(x) necessarily also has the root α\alpha. Conversely, if both f(x)f(x) and Df(x)Df(x) have the root α\alpha, then for the factorization f(x)=(x−α)g(x)f(x)=(x-\alpha)g(x) in the splitting field, we have Df(x)=(x−α)Dg(x)+g(x)Df(x)=(x-\alpha)Dg(x)+g(x), so α\alpha is also a root of g(x)g(x) and hence α\alpha is a repeated root of f(x)f(x). This proves the first part of the theorem. Furthermore, f(x)f(x) has a repeated root α\alpha if and only if x−αx-\alpha is a factor of gcd⁡(f(x),Df(x))\gcd(f(x),Df(x)). Therefore, f(x)f(x) is inseparable if and only if the degree of gcd⁡(f(x),Df(x))\gcd(f(x),Df(x)) is at least one.

A polynomial over a field can always be factored as a product of irreducible polynomials. Since distinct irreducible polynomials (up to associates) always have distinct roots, repeated roots are naturally related to repeated polynomial factors. Then, if the factorization of a polynomial has no repeated irreducible factors, can we determine that the polynomial is separable? In other words, are all irreducible polynomials separable? Unfortunately, in general the answer cannot be affirmative. The problem occurs over fields of finite characteristic.

For a field FF, let f(x)f(x) be an irreducible polynomial; the polynomial gcd⁡(f(x),Df(x))\gcd(f(x),Df(x)), as a factor of f(x)f(x), can only have two possibilities, namely 11 or f(x)f(x). In the former case, the polynomial f(x)f(x) is naturally separable; the problem occurs in the latter case. However, because the definition of the derivative already guarantees that Df(x)=0Df(x)=0 or deg⁡Df(x)<deg⁡f(x)\deg Df(x)<\deg f(x), the fact that f(x)f(x) is a factor of Df(x)Df(x) can only mean that Df(x)=0Df(x)=0. This is possible over fields of finite characteristic.

For a field of characteristic pp, denoted FF, if Df(x)=0Df(x)=0, then all nonzero coefficients of the polynomial can occur only in terms whose degrees are exactly multiples of pp, that is, the polynomial f(x)f(x) can be written as

f(x)=a0+apxp+a2px2p+⋯+a(k−1)px(k−1)p+akpxkp.f(x)=a_0+a_px^p+a_{2p}x^{2p}+\cdots+a_{(k-1)p}x^{(k-1)p}+a_{kp}x^{kp}.

If a field FF has a polynomial f(x)f(x) that is both irreducible and inseparable, it can only have this form. However, if every element of the field FF has a pp-th root, that is, for every coefficient ajpa_{jp} there is a bj∈Fb_j\in F such that ajpa_{jp} can be written in the form bjpb_j^p, then, by the Frobenius endomorphism, we have

f(x)=a0+apxp+a2px2p+⋯+a(k−1)px(k−1)p+akpxkp=b0p+b1pxp+b2px2p+⋯+bk−1px(k−1)p+bkpxkp=(b0+b1x+b2x+⋯+bk−1xk−1+bkxk)p.\begin{aligned} f(x)&=a_0+a_px^p+a_{2p}x^{2p}+\cdots+a_{(k-1)p}x^{(k-1)p}+a_{kp}x^{kp}\\ &=b_0^p+b_1^px^p+b_2^px^{2p}+\cdots+b_{k-1}^px^{(k-1)p}+b_k^px^{kp}\\ &=\left(b_0+b_1x+b_2x+\cdots+b_{k-1}x^{k-1}+b_kx^k\right)^p. \end{aligned}

Therefore, no irreducible polynomial of this form exists over such a field FF. Consequently, all irreducible polynomials over such a field are separable. Such a field is called a perfect field.

Perfect field

If all irreducible polynomials over the field FF are separable polynomials, then the field is called a perfect field.

For a perfect field, the concept of a separable polynomial is equivalent to the concept of a polynomial without a square factor in its unique factorization.

Theorem

Let FF be a perfect field; then a polynomial over FF is separable if and only if it can be written as a product of several distinct irreducible polynomials (up to associates).

The discussion in this section is actually enough to provide a method for removing repeated factors from a polynomial; it is a key step in polynomial factorization algorithms. But this is beyond the scope of this article, and interested readers can consult the relevant references at the end.

These observations also give a characterization of perfect fields:

Theorem

A field FF is perfect if and only if the characteristic of FF is zero, or the characteristic of FF is pp and every element x∈Fx\in F has a pp-th root (that is, the Frobenius endomorphism is also an automorphism).

The rational field Q\mathbf Q and the finite field Fq\mathbf F_q discussed below are both perfect fields.

When the field is not perfect, inseparable irreducible polynomials do indeed exist.

Example

Consider F2\mathbf F_2, its rational function field F2(t)\mathbf F_2(t), and the polynomial x2−tx^2-t over that field. Since F2(t)\mathbf F_2(t) is the field of fractions of the unique factorization domain F2[t]\mathbf F_2[t], and tt is a prime element of F2[t]\mathbf F_2[t], applying Eisenstein's criterion to the prime element tt shows that x2−tx^2-t is irreducible in F2[t]\mathbf F_2[t], and hence also irreducible in F2(t)\mathbf F_2(t). However, its derivative is 00, so x2−tx^2-t is not separable. In fact, in the extension F2(t)(t)\mathbf F_2(t)(\sqrt t), it has the double root t\sqrt t.

We now return to the discussion of field extensions.

Separable extension

For an algebraic extension E/FE/F, if, for every α∈E\alpha\in E, the minimal polynomial of α\alpha is a separable polynomial, then EE is called a separable extension of FF.

Algebraic extensions over perfect fields are all separable extensions. This can also serve as an equivalent definition of a perfect field.

If an algebraic extension is both a normal extension and a separable extension, it is also called a Galois extension. In a Galois extension, every irreducible polynomial has no repeated roots, and the number of roots is exactly equal to the degree of the polynomial, so permutations of the roots can fully reflect the properties of the field extension and the polynomial. Such extensions provide the foundation for establishing Galois theory. Interested readers can consult the relevant references at the end.

Cyclotomic fields

As a simple example of field extensions, this section discusses cyclotomic fields. Another simple example of a field extension is a quadratic field.

Group of roots of unity

In the complex field C\mathbf C, the roots of the polynomial xn=1x^n=1 are called nn-th roots of unity (nn-th root of unity). Let ζn=e2πi/n\zeta_n=\mathrm{e}^{2\pi\mathrm{i}/n}. Then all nn-th roots of unity form the set Cn={ζnk:k∈Z}C_n=\{\zeta_n^k:k\in\mathbf Z\}. Under multiplication, CnC_n forms a cyclic group of order nn, which can be written as ⟨ζn⟩\langle\zeta_n\rangle and is called the group of nn-th roots of unity. The generators of the group CnC_n, that is, those elements whose order is exactly nn, are called primitive nn-th roots of unity (primitive nn-th root of unity). The set of primitive nn-th roots of unity is Pn={ζnk:k∈Z,k⊥n}P_n=\{\zeta_n^k:k\in\mathbf Z,k\perp n\}, and it has exactly φ(n)\varphi(n) elements, where φ(n)\varphi(n) is the Euler totient function. Classifying the elements of the group of roots of unity CnC_n by their orders gives the following decomposition:

Cn=⋃d∣nPd.C_n=\bigcup_{d|n}P_d.

Counting the elements on both sides gives the identity n=∑d∣nφ(d)n=\sum_{d\mid n}\varphi(d).

Cyclotomic fields

A cyclotomic field is an extension obtained by adjoining roots of unity to the rational field.

Cyclotomic field

The extension obtained by adjoining the complex nn-th root of unity ζn=e2πi/n\zeta_n=\mathrm{e}^{2\pi\mathrm{i}/n} to the rational field Q\mathbf Q, namely Q(ζn)\mathbf Q(\zeta_n), is called the nn-th cyclotomic field (nn-th cyclotomic field).

Because all nn-th roots of unity form the cyclic group ⟨ζn⟩\langle\zeta_n\rangle under multiplication, the cyclotomic field Q(ζn)\mathbf Q(\zeta_n) also contains all these nn-th roots of unity. In fact, Q(ζn)\mathbf Q(\zeta_n) is precisely the splitting field over Q\mathbf Q of the polynomial xn−1x^n-1.

Theorem

The cyclotomic field Q(ζn)\mathbf Q(\zeta_n) is the splitting field over the rational field Q\mathbf Q of the polynomial xn−1x^n-1.

Proof

Let FF be the splitting field over the rational field Q\mathbf Q of the polynomial xn−1x^n-1. Since Q(ζn)\mathbf Q(\zeta_n) contains all complex roots of the polynomial xn−1x^n-1, we have F⊆Q(ζn)F\subseteq\mathbf Q(\zeta_n). Conversely, since ζn∈F\zeta_n\in F, we necessarily have Q(ζn)=F\mathbf Q(\zeta_n)=F. This shows that F=Q(ζn)F=\mathbf Q(\zeta_n).

This can serve as an equivalent definition of a cyclotomic field. In fact, adjoining any primitive nn-th root of unity to the field gives Q(ζn)\mathbf Q(\zeta_n).

Cyclotomic polynomials

The cyclotomic field Q(ζn)\mathbf Q(\zeta_n) is a simple algebraic extension of the rational field Q\mathbf Q. According to the preceding analysis, such a field is always isomorphic to a quotient ring of some polynomial ring. To obtain this isomorphism, we need to analyze ζn\zeta_n's minimal polynomial f(x)f(x). Since ζn\zeta_n is a root of xn−1x^n-1, f(x)f(x) must be a factor of xn−1x^n-1. This means that we need to consider the factorization of xn−1x^n-1 in Q[x]\mathbf Q[x]. By Gauss's lemma, it can necessarily be factored in Z[x]\mathbf Z[x] as a product of monic irreducible polynomials.

Since Q(ζn)\mathbf Q(\zeta_n) is a splitting field, the polynomial xn−1x^n-1 has the factorization:

xn−1=∏ζ∈Cn(x−ζ)=∏d∣n∏ζ∈Pd(x−ζ).x^n-1=\prod_{\zeta\in C_n}(x-\zeta)=\prod_{d\mid n}\prod_{\zeta\in P_d}(x-\zeta).

Since roots of unity of different orders have different algebraic properties, they cannot be roots of the same irreducible polynomial. Therefore, to study the minimal polynomial of ζn\zeta_n, it is enough to consider the factor in the above factorization

Φn(x)=∏ζ∈Pn(x−ζ)\Phi_n(x)=\prod_{\zeta\in P_n}(x-\zeta)

The minimal polynomial of the root of unity ζn\zeta_n must be a factor of Φn(x)\Phi_n(x). Moreover, the Φn(x)\Phi_n(x) defined in this way has the following property:

Theorem

Φn(x)\Phi_n(x) is a monic polynomial with integer coefficients and is irreducible in Z[x]\mathbf Z[x].

Proof

By definition, Φn(x)\Phi_n(x) is clearly monic. First, we prove that Φn(x)∈Z[x]\Phi_n(x)\in\mathbf Z[x]. By Gauss's lemma, the polynomial xn−1x^n-1 has the same factorization in Z[x]\mathbf Z[x] and Q[x]\mathbf Q[x], and every factor is a monic polynomial with integer coefficients. In this factorization, every factor f(x)f(x) is irreducible over Q[x]\mathbf Q[x] and splits in Q(ζn)\mathbf Q(\zeta_n); all its roots are nn-th roots of unity and necessarily have the same order, so these roots must all belong to a single PdP_d rather than being distributed among different PdP_d. This means that every factor f(x)f(x) is a factor of some Φd(x)\Phi_d(x). Therefore, Φn(x)\Phi_n(x) can be written as a product of monic polynomials with integer coefficients, and is necessarily itself a monic polynomial with integer coefficients.

Next, we prove that Φn(x)\Phi_n(x) is irreducible in Z[x]\mathbf Z[x]. Suppose it factors as f(x)g(x)f(x)g(x), with f(x)f(x) irreducible in Z[x]\mathbf Z[x]; it is therefore enough to prove that f(x)f(x) contains all nn-th primitive roots of unity. In other words, let ζ\zeta be a root of f(x)f(x); we need to prove that for every k⊥nk\perp n, ζk\zeta^k is also a root of f(x)f(x); since kk can always be decomposed as a product of primes, it suffices to prove that for every prime p⊥np\perp n, ζp\zeta^p is a root of f(x)f(x). Suppose otherwise that ζp\zeta^p is a root of g(x)g(x). Thus, ζ\zeta is a common root in Z[x]\mathbf Z[x] of the polynomials f(x)f(x) and g(xp)g(x^p). Since f(x)f(x) is the minimal polynomial of ζ\zeta over Q\mathbf Q, f(x)f(x) must divide g(xp)g(x^p); equivalently, there exists h(x)∈Z[x]h(x)\in\mathbf Z[x] such that g(xp)=f(x)h(x)g(x^p)=f(x)h(x). Reducing both sides modulo pp gives over Fp[x]\mathbf F_p[x] the equation g‾(xp)=f‾(x)h‾(x)\overline{g}(x^p)=\overline{f}(x)\overline{h}(x). By the Frobenius endomorphism, g‾(x)p=f‾(x)h‾(x)\overline{g}(x)^p=\overline{f}(x)\overline{h}(x). Since Fp[x]\mathbf F_p[x] is also a unique factorization domain, g‾(x)\overline{g}(x) and f‾(x)\overline{f}(x) must have a nontrivial common factor; therefore, xn−1‾=f‾(x)g‾(x)x^n-\overline 1=\overline{f}(x)\overline{g}(x) is inseparable over Fp\mathbf F_p. However, since p⊥np\perp n, its formal derivative nxn−1nx^{n-1} is coprime to it, contradicting its inseparability. Hence ζp\zeta^p must indeed be a root of f(x)f(x), and therefore f(x)f(x) contains all nn-th primitive roots of unity; it is Φn(x)\Phi_n(x).

This shows that it is the minimal polynomial of ζn\zeta_n, also called the nn-th cyclotomic polynomial (nn-th cyclotomic polynomial). The definition above shows that it has φ(n)\varphi(n) complex roots, and these complex roots are exactly all nn-th primitive roots of unity; here, φ(n)\varphi(n) is the Euler totient function. This also shows that Q(ζn)/Q\mathbf Q(\zeta_n)/\mathbf Q is an extension of degree φ(n)\varphi(n).

The ring of algebraic integers in the cyclotomic field Q(ζn)\mathbf Q(\zeta_n) is Z[ζn]\mathbf Z[\zeta_n]. In addition, when φ(n)=2\varphi(n)=2, the cyclotomic field is a quadratic extension. Specifically, Q(ζ4)\mathbf Q(\zeta_4) is the quadratic field Q(−1)\mathbf Q(\sqrt{-1}); Q(ζ3)\mathbf Q(\zeta_3) and Q(ζ6)\mathbf Q(\zeta_6) are the same, and both are the quadratic field Q(−3)\mathbf Q(\sqrt{-3}).

Using cyclotomic polynomials, the polynomial xn−1x^n-1 has the unique factorization in Z[x]\mathbf Z[x]

xn−1=∏d∣nΦd(x).x^n-1=\prod_{d\mid n}\Phi_d(x).

Therefore, (xd−1)∣(xn−1)(x^d-1)\mid(x^n-1) if and only if d∣nd\mid n. Moreover, applying Möbius inversion to this formula yields

Φd(x)=∏d∣n(xd−1)μ(n/d).\Phi_d(x)=\prod_{d\mid n}(x^d-1)^{\mu(n/d)}.

Using this expression, all cyclotomic polynomials can be computed recursively. Here are examples of the first few cyclotomic polynomials, so that readers can become familiar with them.

Cyclotomic polynomials

The first 1010 cyclotomic polynomials are as follows:

Φ1(x)=x−1,Φ2(x)=x+1,Φ3(x)=x2+x+1,Φ4(x)=x2+1,Φ5(x)=x4+x3+x2+x+1,Φ6(x)=x2−x+1,Φ7(x)=x6+x5+x4+x3+x2+x+1,Φ8(x)=x4+1,Φ9(x)=x6+x3+1,Φ10(x)=x4−x3+x2−x+1.\begin{aligned} \Phi_1(x) &= x-1,\\ \Phi_2(x) &= x+1,\\ \Phi_3(x) &= x^2+x+1,\\ \Phi_4(x) &= x^2+1,\\ \Phi_5(x) &= x^4+x^3+x^2+x+1,\\ \Phi_6(x) &= x^2-x+1,\\ \Phi_7(x) &= x^6+x^5+x^4+x^3+x^2+x+1,\\ \Phi_8(x) &= x^4+1,\\ \Phi_9(x) &= x^6+x^3+1,\\ \Phi_{10}(x) &= x^4-x^3+x^2-x+1. \end{aligned}

An interesting fact is that, although these cyclotomic polynomials appear to have coefficients only 00 and ±1\pm1, this is not true for general nn. The first counterexample occurs at Φ105(x)\Phi_{105}(x), and it can be proved that as nn grows, its coefficients can attain arbitrarily large values.

Using the Möbius inversion formula above, we can summarize the following properties to simplify computation of Φn(x)\Phi_n(x):

Properties

For the cyclotomic polynomial Φn(x)\Phi_n(x), we have:

  1. If p∣np\mid n for a prime p, then Φpn(x)=Φn(xp)\Phi_{pn}(x)=\Phi_n(x^p);
  2. If p⊥np\perp n for a prime p, then Φpn(x)=Φn(xp)Φn(x)\Phi_{pn}(x)=\dfrac{\Phi_n(x^p)}{\Phi_n(x)};
  3. In particular, if nn is odd, then Φ2n(x)=Φn(−x)\Phi_{2n}(x)=\Phi_n(-x);
  4. For a prime pp, we have Φp(x)=1+x+⋯+xp−1\Phi_{p}(x)=1+x+\cdots+x^{p-1};
  5. In particular, Φ2k(x)=x2k−1+1\Phi_{2^k}(x)=x^{2^{k-1}}+1.

These properties show that, when computing cyclotomic polynomials, the key cases are those in which the degree is an odd square-free number. For such cases, prime factors can be added one at a time using Property 2; adding each prime factor requires only one polynomial division.

Cyclotomic polynomials have many other properties.

Theorem

Let Φn(x)\Phi_n(x) be the n-th cyclotomic polynomial for n>1n>1, whose degree is φ(n)\varphi(n). Then:

  1. Φn(x)\Phi_n(x) is a palindromic polynomial; its coefficient of degree jj equals that of degree φ(n)−j\varphi(n)-j, that is, Φn(x)=xφ(n)Φn(1/x)\Phi_n(x)=x^{\varphi(n)}\Phi_n(1/x);
  2. The coefficient of degree φ(n)−1\varphi(n)-1 of the polynomial equals the Möbius function −μ(n)-\mu(n);
  3. If nn is a prime power pkp^k, then Φn(1)=p\Phi_n(1)=p; otherwise, Φn(1)=1\Phi_n(1)=1;
  4. Let b>1b>1, and let pp be a prime factor of Φn(b)\Phi_n(b); then p∣np\mid n, or nn is the order in the multiplicative group (Z/pZ)×(\mathbf Z/p\mathbf Z)^\times of bb, and these two cases cannot occur simultaneously.
Proof

The first three properties follow just by using Möbius inversion. For 1, directly consider the Möbius inversion form of Φn(x)\Phi_n(x), namely Φd(x)=∏d∣n(xd−1)μ(n/d)\Phi_d(x)=\prod_{d\mid n}(x^d-1)^{\mu(n/d)}; for 2, let the coefficient of Φn(x)\Phi_n(x) of degree φ(n)−1\varphi(n)-1 be f(n)f(n); comparing on both sides of xn−1=∏d∣nΦd(x)x^n-1=\prod_{d\mid n}\Phi_d(x) the coefficients of degree n−1n-1 gives ∑d∣nf(d)=−[n=1]\sum_{d\mid n}f(d)=-[n=1], and we then apply Möbius inversion; for 3, divide both sides of xn−1=∏d∣nΦn(x)x^n-1=\prod_{d\mid n}\Phi_n(x) by Φ1(x)=x−1\Phi_1(x)=x-1, then substitute x=1x=1, obtaining n=∏d∣n,d≠1Φn(1)n=\prod_{d\mid n,d\neq 1}\Phi_n(1), and apply Möbius inversion.

We now prove the fourth property. First, if nn is the order in the multiplicative group (Z/pZ)×(\mathbf Z/p\mathbf Z)^\times of bb, then nn is the smallest positive integer satisfying p∣bn−1p\mid b^n-1, and hence p∣Φn(b)p\mid\Phi_n(b). Conversely, if p∣Φn(b)p\mid\Phi_n(b), then bn≡1(modp)b^n\equiv 1\pmod p; but if nn is not the order in the multiplicative group (Z/pZ)×(\mathbf Z/p\mathbf Z)^\times of bb, let its order be kk; then necessarily k∣nk\mid n and p∣Φk(b)p\mid\Phi_k(b). Thus, Φk(x)\Phi_k(x) and Φn(x)\Phi_n(x) have the common root in the field Fp\mathbf F_p of bb, which means that xn−1x^n-1 has the multiple root bb. This implies p∣np\mid n; otherwise, xn−1x^n-1 is coprime to its derivative and hence separable over Fp\mathbf F_p, so it cannot have a multiple root. Therefore, Φn(b)\Phi_n(b) has a prime factor pp, and it falls into only two cases: p∣np\mid n, or nn is the order in the multiplicative group (Z/pZ)×(\mathbf Z/p\mathbf Z)^\times of bb. These cases are mutually exclusive, because the latter implies n∣p−1n\mid p-1.

Cyclotomic polynomials can also be used to solve certain problems in number theory and algebra. For example, the length of the repetend when a fraction is written as a decimal in a given base is closely related to cyclotomic polynomials. Readers interested in these specific applications may consult the references at the end.

Finite fields

Finite field (finite field), also called a Galois field (Galois field), is a field with only finitely many elements. The structure of a finite field is uniquely determined by the number of its elements, and that number must be a power of a prime.

Theorem

A field of size qq exists if and only if qq has the form of a prime power pnp^n. Moreover, such a field is unique up to isomorphism and is denoted by Fq\mathbf F_q. The prime pp is the characteristic of the field Fq\mathbf F_q, and the positive integer nn is the degree of the field extension Fq/Fp\mathbf F_q/\mathbf F_p. Finally, Fq\mathbf F_q is the splitting field over Fp\mathbf F_p of the polynomial xq−xx^q-x, and contains exactly the distinct roots of xq−xx^q-x, namely the qq roots$.

Proof

Let FF be a finite field. The characteristic of FF is necessarily finite; denote it by pp; thus, FF has the prime subfield Fp\mathbf F_p. Moreover, FF must be a finite extension of Fp\mathbf F_p; denote its degree by nn. As a vector space over Fp\mathbf F_p of dimension nn, the field FF has q=pnq=p^n elements. The nonzero elements of FF form the group F×F^\times, whose order is q−1q-1, so xq−1=1x^{q-1}=1. Therefore, every element of F=F×∪{0}F=F^\times\cup\{0\} satisfies xq=xx^q=x; that is, they are the distinct roots of the polynomial xq−xx^q-x, namely the qq roots. Thus, in FF, the polynomial xq−xx^q-x has the factor ∏α∈F(x−α)\prod_{\alpha\in F}(x-\alpha); but this factor already has degree qq and leading coefficient 11, so xq−x=∏α∈F(x−α)x^q-x=\prod_{\alpha\in F}(x-\alpha). This shows that xq−xx^q-x splits over FF. Any field over which xq−xx^q-x splits, since xq−xx^q-x has qq distinct roots, must have at least qq elements. Thus, FF is the smallest field over which xq−xx^q-x splits, that is, the splitting field of xq−xx^q-x. In summary, a finite field of size qq must be the splitting field over its prime subfield of the polynomial xq−xx^q-x. Since splitting fields are unique up to isomorphism, a field of size qq is unique as well.

Conversely, given a prime pp and its power q=pnq=p^n, it suffices to show that the splitting field over Fp\mathbf F_p of the polynomial xq−xx^q-x has exactly qq elements to establish the existence of all fields of prime-power order qq. Since the splitting field over Fp\mathbf F_p of the polynomial xq−xx^q-x always exists, let the set of all roots of the polynomial xq−xx^q-x in that splitting field be FF. We now prove that FF is a field, and hence is the splitting field of xq−xx^q-x itself. Iterating the Frobenius endomorphism nn times shows that x↦xqx\mapsto x^q is also an endomorphism; therefore, for any α,β∈F\alpha,\beta\in F, we have (α±β)q=αq±βq(\alpha\pm\beta)^q=\alpha^q\pm\beta^q, (αβ)q=αqβq(\alpha\beta)^q=\alpha^q\beta^q, and (α−1)q=(αq)−1(\alpha^{-1})^q=(\alpha^q)^{-1}. Hence, FF is closed under addition, subtraction, multiplication, and division, so it is a field. This shows that FF is the splitting field over Fp\mathbf F_p of the polynomial xq−xx^q-x.

Corollary

In the finite field Fq\mathbf F_q (q>2q>2), the sum of all nonzero elements is 00, and their product is −1-1.

Proof

The nonzero elements of a finite field are exactly the roots of the polynomial xq−1−1x^{q-1}-1, namely the q−1q-1 roots$; the result follows from Vieta's formulas.

In the prime field Fp\mathbf F_p, the conclusion about the product in this corollary is precisely (part of) the Wilson theorem in number theory.

Multiplicative structure

The multiplicative group F×=F∖{0}\mathbf F^\times=\mathbf F\setminus\{0\} of a finite field is always a cyclic group.

Theorem

Every finite subgroup of the multiplicative group of a field FF is cyclic.

Proof

Let GG be a subgroup of the multiplicative group of a field FF, with ∣G∣=n|G|=n. Thus, GG is a finite Abelian group. By the fundamental theorem of finite Abelian groups, GG has the invariant factor decomposition Cn1×⋯×CnsC_{n_1}\times\cdots\times C_{n_s} with n1∣⋯∣nsn_1\mid\cdots\mid n_s. Therefore, every element of GG, say xx, satisfies xns=1x^{n_s}=1. In other words, the elements of GG are roots over the field FF of the polynomial xns−1x^{n_s}-1. However, the polynomial xns−1x^{n_s}-1 has at most nsn_s distinct roots, so n≤nsn\le n_s. On the other hand, ns≤nn_s\le n, and hence ns=nn_s=n. This shows that G≅CnsG\cong C_{n_s}, that is, GG is cyclic.

Corollary

The multiplicative group of a finite field Fq\mathbf F_q satisfies Fq×≅Cq−1\mathbf F_q^\times\cong C_{q-1}.

The cyclic group Fq×\mathbf F_q^\times has φ(q−1)\varphi(q-1) generators, called primitive elements of the finite field; here, φ(n)\varphi(n) is the Euler totient function.

Primitive element

A generator of the multiplicative group of a finite field Fq\mathbf F_q is called a primitive element of Fq\mathbf F_q (primitive element).

Primitive elements in simple extensions and finite fields are different

Although primitive elements in simple extensions and primitive elements in finite fields have the same name, they are not the same. A primitive element in a simple extension is a generator of the corresponding simple extension, whereas a primitive element in a finite field is a generator of the corresponding multiplicative group (viewed as a cyclic group). A primitive element of a finite field considered as a simple extension of its prime subfield need not be a primitive element of the finite field itself. For example, in F25≅F5[x]/(x2+x+1)\mathbf F_{25}\cong\mathbf F_5[x]/(x^2+x+1), x‾\overline x is a primitive element of the field extension, but it is not a primitive element of the field F25\mathbf F_{25}, because its order is 33.

Primitive elements in Fq\mathbf F_{q} and primitive roots modulo qq are also different

For a finite field Fq\mathbf F_{q} of odd characteristic, there always exists a primitive root modulo qq. However, it should not be confused with a primitive element in the finite field Fq\mathbf F_{q}. Although both are generators of their respective multiplicative structures when viewed as cyclic groups, (Z/qZ)×(\mathbf Z/q\mathbf Z)^\times and Fq\mathbf F_q are not the same when qq itself is not prime. For example, the order of the former is φ(q)\varphi(q), while that of the latter is q−1q-1, so the two multiplicative groups do not have the same size.

Let α\alpha be a primitive element of the finite field Fq\mathbf F_q. Then, for every x∈Fqx\in\mathbf F_q, there is a unique natural number k<q−1k<q-1 such that x=αkx=\alpha^k; this kk is called the discrete logarithm over Fq\mathbf F_q of the element xx with respect to the base α\alpha. As in the case of Fp\mathbf F_p, the complexity of discrete logarithm algorithms is relatively high.

Through multiplication, a primitive element can already generate all nonzero elements of the field. This shows that a finite field is necessarily a simple extension of each of its subfields.

Theorem

For a finite field Fq\mathbf F_q, let FF be a subfield of Fq\mathbf F_q; then Fq\mathbf F_q is a simple algebraic extension of FF; moreover, if α\alpha is a primitive element of Fq\mathbf F_q, then Fq=F(α)\mathbf F_q=F(\alpha).

The minimal polynomial of a primitive element is an irreducible polynomial over a subfield of the finite field.

Inclusion relations

The subfields of a finite field are also finite fields. The inclusion relations among finite fields are completely determined by their orders.

Theorem

Let Fq\mathbf F_q and Fr\mathbf F_r be finite fields; then Fr\mathbf F_r is a subfield of Fq\mathbf F_q if and only if there exists kk such that q=rkq=r^k. In other words, Fpd\mathbf F_{p^d} is a subfield of Fpn\mathbf F_{p^n} if and only if d∣nd\mid n.

Proof

If Fr\mathbf F_r is a subfield of Fq\mathbf F_q, then they necessarily have the same characteristic pp. The field extensions Fq/Fr\mathbf F_q/\mathbf F_r, Fr/Fp\mathbf F_r/\mathbf F_p, and Fq/Fp\mathbf F_q/\mathbf F_p are all simple algebraic extensions; denote their degrees by k,d,nk,d,n, respectively; then the degrees necessarily satisfy n=kdn=kd. Moreover, r=pdr=p^d and q=pnq=p^n, and q=pn=pkd=(pd)k=rkq=p^n=p^{kd}=(p^d)^k=r^k.

Conversely, we prove that for every d∣nd\mid n, Fpd\mathbf F_{p^d} is a subfield of Fpn\mathbf F_{p^n}. Let r=pdr=p^d and q=pnq=p^n. Let FF be the set of all roots in the finite field Fq\mathbf F_q of the equation xr−x=0x^r-x=0. The Frobenius endomorphism shows that FF is a field; the key is to prove that there are exactly rr such roots, which gives F≅FrF\cong\mathbf F_r. Since d∣nd\mid n, we have (pd−1)∣(pn−1)(p^d-1)\mid(p^n-1), so (xpd−1−1)∣(xpn−1−1)(x^{p^d-1}-1)\mid(x^{p^n-1}-1), that is, (xr−x)∣(xq−x)(x^r-x)\mid (x^q-x). Hence, xr−xx^r-x splits over Fq\mathbf F_q, and therefore has distinct roots in Fq\mathbf F_q, namely rr roots. This shows that F≅FrF\cong\mathbf F_r is a subfield of Fq\mathbf F_q.

This theorem shows that the inclusion relations among finite fields Fpn\mathbf F_{p^n} correspond to the divisibility relations among the exponents in their orders pnp^n, namely nn. The lattice formed by all finite fields of characteristic pp, namely Fpn\mathbf F_{p^n}, is therefore isomorphic to the lattice formed by the integers nn under divisibility. Of course, for intersections and similar operations among finite fields Fpn\mathbf F_{p^n} to make sense, all fields of characteristic pp must be embedded into an algebraic closure of Fp\mathbf F_p.

Theorem

Let FF be an algebraic closure of Fp\mathbf F_p; then the set of roots in FF of the polynomial xpn−xx^{p^n}-x forms the finite field Fpn\mathbf F_{p^n}. Then:

  1. F=⋃n=1∞FpnF=\bigcup_{n=1}^\infty\mathbf F_{p^n}, that is, the algebraic closure of Fp\mathbf F_p is the union of all finite fields of characteristic pp;
  2. The lattice formed by all finite fields of characteristic pp, namely Fpn\mathbf F_{p^n}, under inclusion is isomorphic to the lattice formed by the integers nn under divisibility. In particular, the intersection of Fpn\mathbf F_{p^n} and Fpm\mathbf F_{p^m} is Fpn∩Fpm=Fpgcd⁡(n,m)\mathbf F_{p^n}\cap\mathbf F_{p^m}=\mathbf F_{p^{\gcd(n,m)}}, while the smallest field containing both Fpn\mathbf F_{p^n} and Fpm\mathbf F_{p^m} is FpnFpm=Fplcm⁡(n,m)\mathbf F_{p^n}\mathbf F_{p^m}=\mathbf F_{p^{\operatorname{lcm}(n,m)}}.
Proof

The key is to prove the first part, namely that ⋃n=1∞Fpn\bigcup_{n=1}^\infty\mathbf F_{p^n} is an algebraic closure of FpF_p. The second part is a simple consequence of the preceding theorem about subfields of finite fields.

Note that for any α∈⋃n=1∞Fpn\alpha\in\bigcup_{n=1}^\infty\mathbf F_{p^n}, there necessarily exists n∈N+n\in\mathbf N_+ such that α∈Fpn\alpha\in\mathbf F_{p^n}; hence α\alpha is algebraic over Fp\mathbf F_p; therefore, ⋃n=1∞Fpn\bigcup_{n=1}^\infty\mathbf F_{p^n} is an algebraic extension of Fp\mathbf F_p. For any polynomial over Fp\mathbf F_p of degree mm, denoted f(x)f(x), the algebraic closure FF contains at most mm distinct roots {αi}i=1m\{\alpha_i\}_{i=1}^m of it. Let the degree of the minimal polynomial of the root αi\alpha_i be nin_i; then αi\alpha_i must lie in the field Fpni\mathbf F_{p^{n_i}}; hence all roots of f(x)f(x) lie in the set α∈⋃n=1∞Fpn\alpha\in\bigcup_{n=1}^\infty\mathbf F_{p^n}, that is, f(x)f(x) splits over the set α∈⋃n=1∞Fpn\alpha\in\bigcup_{n=1}^\infty\mathbf F_{p^n}. By the definition of an algebraic closure, α∈⋃n=1∞Fpn\alpha\in\bigcup_{n=1}^\infty\mathbf F_{p^n} is the algebraic closure of Fp\mathbf F_p.

Automorphism groups

The subfields of a finite field Fq\mathbf F_q are all sets of roots of polynomials of the form xr−xx^r-x. In other words, they are fixed-point sets of some map x↦xrx\mapsto x^r. This in fact reveals a deep correspondence between subfields of finite fields and subgroups of their automorphism groups.

Every field of characteristic pp has the Frobenius endomorphism σp:x↦xp\sigma_p:x\mapsto x^p. For a finite field Fq\mathbf F_q, this is also an automorphism; this shows that all finite fields Fq\mathbf F_q are perfect fields. The automorphism group of the field Fq\mathbf F_q is the cyclic group of order nn, written ⟨σp⟩\langle \sigma_p\rangle, and one of its generators is the Frobenius endomorphism σp\sigma_p.

Theorem

The automorphism group of a finite field Fq\mathbf F_q, Aut⁡(Fq)=⟨σp⟩\operatorname{Aut}(\mathbf F_q)=\langle\sigma_p\rangle, is a cyclic group of order nn, and its generator σp\sigma_p is the Frobenius endomorphism x↦xpx\mapsto x^p.

Proof

First, the Frobenius endomorphism σp\sigma_p is an automorphism on the finite field Fq\mathbf F_q, because an injective map on a finite set is necessarily surjective. Thus, σp∈Aut⁡(Fq)\sigma_p\in\operatorname{Aut}(\mathbf F_q).

Next, the order of σp\sigma_p is nn. This is because for every x∈Fqx\in\mathbf F_q, σpn(x)=xpn=x\sigma_p^n(x)=x^{p^n}=x, so xpnx^{p^n} is the identity map; moreover, for every k<nk<n, σpk\sigma_p^k is not the identity map, since otherwise all elements of Fq\mathbf F_q would be roots of xpk−xx^{p^k}-x, which is impossible.

Finally, Aut⁡(Fq)\operatorname{Aut}(\mathbf F_q) has at most nn elements. Let α\alpha be a primitive element of Fq\mathbf F_q; then an automorphism σ∈Aut⁡(Fq)\sigma\in \operatorname{Aut}(\mathbf F_q) is uniquely determined by its value at α\alpha, namely σ(α)\sigma(\alpha). However, σ\sigma must map α\alpha to one of its conjugates; otherwise, α\alpha and σ(α)\sigma(\alpha) would no longer be roots of the same minimal polynomial. There are only nn such conjugates, which shows that Aut⁡(Fq)\operatorname{Aut}(\mathbf F_q) also has at most nn elements.

Therefore, the elements of Aut⁡(Fq)\operatorname{Aut}(\mathbf F_q), numbering nn in total, are exactly ⟨σp⟩\langle\sigma_p\rangle. The theorem follows.

The subgroups of the automorphism group Aut⁡(Fq)\operatorname{Aut}(\mathbf F_q) are in one-to-one correspondence with the subfields of the finite field Fq\mathbf F_q.

Theorem

Let Fq\mathbf F_q be a finite field, let F\mathcal F be the set of all its subfields, and let G\mathcal G be the set of all subgroups of its automorphism group Aut⁡(Fq)\operatorname{Aut}(\mathbf F_q). Then:

  1. For F∈FF\in\mathcal F, let Aut⁡(Fq/F)\operatorname{Aut}(\mathbf F_q/F) be the set of automorphisms in Aut⁡(Fq)\operatorname{Aut}(\mathbf F_q) that leave FF invariant, namely Aut⁡(Fq/F)={σ∈Aut⁡(Fq):∀x∈F(σ(x)=x)}\operatorname{Aut}(\mathbf F_q/F)=\{\sigma\in\operatorname{Aut}(\mathbf F_q):\forall x\in F(\sigma(x)=x)\}; then Aut⁡(Fq/F)≤Aut⁡(Fq)\operatorname{Aut}(\mathbf F_q/F)\le\operatorname{Aut}(\mathbf F_q);
  2. For G∈GG\in\mathcal G, let FGF^G be the intersection of the fixed-point sets of all automorphisms in GG, namely FG={x∈Fq:∀σ∈G(σ(x)=x)}F^G=\{x\in\mathbf F_q:\forall\sigma\in G(\sigma(x)=x)\}; then FGF^G is a subfield of Fq\mathbf F_q;
  3. The maps F→Aut⁡(Fq/F)F\rightarrow\operatorname{Aut}(\mathbf F_q/F) and G→FGG\rightarrow F^G are inverse to each other and give a one-to-one correspondence between F\mathcal F and G\mathcal G;
  4. This one-to-one correspondence maps extension relations between subfields to inclusion relations between subgroups: for any F1⊆F2F_1\subseteq F_2, we have Aut⁡(Fq/F2)≤Aut⁡(Fq/F1)\operatorname{Aut}(\mathbf F_q/F_2)\le\operatorname{Aut}(\mathbf F_q/F_1).

This conclusion is a special case of the fundamental theorem of Galois theory; it connects field extensions with group theory, allowing field-extension problems to be solved using group-theoretic methods.

Irreducible polynomials

Irreducible polynomials over a finite field Fq\mathbf F_q are particularly easy to determine. Every irreducible polynomial over the finite field Fq\mathbf F_q of degree nn corresponds to an algebraic extension of degree nn, and such an extension is unique; therefore, the roots of all degree-nn irreducible polynomials can be found in Fqn\mathbf F_{q^n}. This shows that every irreducible polynomial over Fq\mathbf F_q of degree nn is a factor of xqn−xx^{q^n}-x. To determine all irreducible polynomials over Fq\mathbf F_q of degree nn, we need to consider the factorization of xqn−xx^{q^n}-x over Fq\mathbf F_q. This is very similar to the cyclotomic-polynomial case.

Algebraic elements over the rational-number field Fq\mathbf F_q can be classified according to the degree of their minimal polynomials. Let PnP_n be the set of algebraic elements whose minimal polynomial has degree exactly nn, then

Fqn=⋃d∣nPd.\mathbf F_{q^n} = \bigcup_{d\mid n}P_d.

This corresponds to the factorization

xqn−x=∏d∣n∏ζ∈Pd(x−ζ).x^{q^n}-x = \prod_{d|n}\prod_{\zeta\in P_d}(x-\zeta).

Since a degree-nn irreducible polynomial has nn roots, and the minimal polynomials of these roots all have degree nn, every degree-nn irreducible polynomial must be a factor of the polynomial

∏ζ∈Pn(x−ζ)=∏d∣n(xqd−x)μ(n/d)\prod_{\zeta\in P_n}(x-\zeta) = \prod_{d\mid n}\left(x^{q^d}-x\right)^{\mu(n/d)}

a factor; this expression is obtained by applying Möbius inversion to the preceding factorization. Since the degree of this polynomial is

∑d∣nμ(d)qn/d,\sum_{d\mid n}\mu(d)q^{n/d},

Therefore, over Fq\mathbf F_q, the total number of monic irreducible polynomials of degree nn is

1n∑d∣nμ(d)qn/d\frac1n\sum_{d\mid n}\mu(d)q^{n/d}

.This is exactly the number of necklaces formed from qq colored beads with length nn, up to rotation (proof); hence it is also called the necklace polynomial (necklace polynomial).

Theorem

There exist irreducible polynomials of every degree over the finite field Fq\mathbf F_q.

Because irreducible polynomials over finite fields have a simple structure, factoring polynomials over finite fields is quite easy. For example, to determine all degree-nn irreducible factors of a given polynomial, it suffices to find the greatest common divisor of the given polynomial and xqn−xx^{q^n}-x6. Similarly, if a degree-nn polynomial is coprime, for every k<nk<n, to the polynomial xqk−1x^{q^k}-1, then it can be concluded that the degree-nn polynomial is irreducible over Fq\mathbf F_q.

As noted above, the roots of an irreducible polynomial over a finite field need not be primitive elements of the corresponding extension field. A primitive element of the finite field Fq\mathbf F_q has a minimal polynomial over its prime subfield Fp\mathbf F_p, which is also called a primitive polynomial7 over the field Fp\mathbf F_p (primitive polynomial). Using such a polynomial to construct an extension guarantees that x‾\overline x is a primitive element of the extension. Primitive polynomials over the field Fp\mathbf F_p of degree nn can be obtained by factoring over Fp\mathbf F_p the cyclotomic polynomial Φn(x)\Phi_n(x).

Theorem

Let pp be a prime, let nn be a positive integer, and suppose p⊥np\perp n. Let dd be the order in the multiplicative group (Z/nZ)×(\mathbf Z/n\mathbf Z)^\times of the element pp. Then, the cyclotomic polynomial Φn(x)\Phi_n(x) over the field Fp\mathbf F_p factors as the product of φ(n)d\dfrac{\varphi(n)}{d} Fp\mathbf F_p primitive polynomials of degree dd. In particular, the cyclotomic polynomial Φn(x)\Phi_n(x) is irreducible over Fp\mathbf F_p if and only if pp is a primitive root modulo nn.

Proof

If we note that the roots of the nn-th cyclotomic polynomial are all primitive roots of unity of Fp\mathbf F_p of order nn, and that the minimal polynomial of an nn-th primitive root of unity has degree dd, which is the number of its conjugates (including itself) and also its orbit length under the automorphism group ⟨σp⟩\langle\sigma_p\rangle, then dd is the orbit length of the cyclic subgroup acting on {ζi:i⊥n}\{\zeta^i:i\perp n\} by ζi↦ζip\zeta^i\mapsto\zeta^{ip}; namely, in the multiplicative group (Z/nZ)×(\mathbf Z/n\mathbf Z)^\times, it is the order of pp. If one does not want to rely on Galois theory, this can also be proved by showing that dd is the smallest positive integer for which (xn−1)∣(xpd−1−1)(x^n-1)\mid(x^{p^d-1}-1) holds. The remaining conclusions are obvious.

Although irreducible polynomials are important for constructing finite fields, there is no particularly good deterministic method for finding, over a finite field Fq\mathbf F_q, an irreducible polynomial of degree nn. In general, a random method can be used to generate such an irreducible polynomial. Since, among all monic polynomials of degree nn, irreducible polynomials account for a proportion Θ(1/n)\Theta(1/n), we can first generate a monic polynomial of degree nn at random and then test whether it is reducible. In this way, an irreducible polynomial can be found after generating an expected Θ(n)\Theta(n) monic polynomials. Of course, an irreducible polynomial generated this way need not be primitive, and its coefficients need not be simple. In practice, if the size of the finite field is known in advance, one can often find a primitive polynomial with simple coefficients by consulting a table8, which facilitates subsequent computations.

Reference implementation

This section provides a naive implementation of a finite field for reference only. The code implements a method for randomly generating an irreducible polynomial.

Reference implementation
#include <iostream>
#include <random>
#include <vector>

class FiniteField {
  int p, k;
  std::vector<int> mod;  // Monic.

  // Remove leadings zeros of a polynomial.
  static void trim(std::vector<int>& poly) {
    int m = poly.size();
    for (; m && !poly[m - 1]; --m);
    poly.resize(m);
  }

  // Binary exponentiation mod p.
  int pow(int a, int b) const {
    int res = 1, po = a;
    while (b) {
      if (b & 1) res = (long long)res * po % p;
      po = (long long)po * po % p;
      b >>= 1;
    }
    return res;
  }

  // Multiplicative inverse mod p.
  int inv(int a) const { return pow(a, p - 2); }

  // Polynomial GCD. Inputs are supposed to have no leading zeros.
  std::vector<int> poly_gcd(const std::vector<int>& lhs,
                            const std::vector<int>& rhs) const {
    if (lhs.size() < rhs.size()) {
      return poly_gcd(rhs, lhs);
    } else if (rhs.size()) {
      auto rem = lhs;  // remainder.
      long long v = inv(rhs.back());
      for (int i = rem.size() - rhs.size(); i >= 0; --i) {
        auto d = v * (p - rem[i + rhs.size() - 1]) % p;
        for (int j = 0; j < rhs.size(); ++j) {
          rem[i + j] = (rem[i + j] + d * rhs[j]) % p;
        }
      }
      trim(rem);  // Remove leading zeros.
      return poly_gcd(rhs, rem);
    } else {
      return lhs;
    }
  }

  // Polynomials Ex-GCD. Inputs are supposed to have no leading zeros.
  void poly_ex_gcd(const std::vector<int>& lhs, const std::vector<int>& rhs,
                   std::vector<int>& x, std::vector<int>& y) const {
    if (lhs.size() < rhs.size()) {
      poly_ex_gcd(rhs, lhs, y, x);
    } else if (rhs.size()) {
      std::vector<int> quo(lhs.size() - rhs.size() + 1);  // quotient.
      auto rem = lhs;                                     // remainder.
      long long v = inv(rhs.back());
      for (int i = rem.size() - rhs.size(); i >= 0; --i) {
        quo[i] = v * rem[i + rhs.size() - 1] % p;
        long long d = p - quo[i];  // d = -quo[i].
        for (int j = 0; j < rhs.size(); ++j) {
          rem[i + j] = (rem[i + j] + d * rhs[j]) % p;
        }
      }
      trim(rem);  // Remove leading zeros.
      // Recursively ex_gcd.
      poly_ex_gcd(rhs, rem, y, x);
      // y -= a/b*x.
      if (y.size() < quo.size() + x.size() - 1) {
        y.resize(quo.size() + x.size() - 1, 0);
      }
      for (int i = 0; i < quo.size(); ++i) {
        for (int j = 0; j < x.size(); ++j) {
          y[i + j] = (y[i + j] - (long long)quo[i] * x[j]) % p;
          if (y[i + j] < 0) y[i + j] += p;
        }
      }
      trim(y);  // Remove leading zeros.
    } else {
      // x = 1, y = 0.
      x.assign(1, inv(lhs.back()));
      y.clear();
    }
  }

 public:
  // Class for Finite Field Elements.
  struct Element {
    const FiniteField* gf;
    std::vector<int> a;

    // Element initialization as zero.
    Element(const FiniteField* gf) : gf(gf), a(gf->k) {}

    // Element initialization from the numeric representation.
    Element(const FiniteField* gf, int id) : gf(gf), a(gf->k) {
      for (int i = 0; i < gf->k; ++i) {
        a[i] = id % gf->p;
        id /= gf->p;
      }
    }

    // Generate the numeric representation from an element.
    int idx() const {
      int id = 0;
      for (int i = gf->k - 1; i >= 0; --i) {
        id = id * gf->p + a[i];
      }
      return id;
    }

    // Access the i-th coefficient.
    int& operator[](int i) { return a[i]; }

    // Addition.
    Element& operator+=(const Element& rhs) {
      for (int i = 0; i < gf->k; ++i) {
        a[i] += rhs.a[i];
        if (a[i] >= gf->p) a[i] -= gf->p;
      }
      return *this;
    }

    // Addition.
    Element operator+(const Element& rhs) const {
      Element res(*this);
      res += rhs;
      return res;
    }

    // Subtraction.
    Element& operator-=(const Element& rhs) {
      for (int i = 0; i < gf->k; ++i) {
        a[i] -= rhs.a[i];
        if (a[i] < 0) a[i] += gf->p;
      }
      return *this;
    }

    // Subtraction.
    Element operator-(const Element& rhs) const {
      Element res(*this);
      res -= rhs;
      return res;
    }

    // Multiplication by a scalar.
    Element& operator*=(int x) {
      for (int i = 0; i < gf->k; ++i) {
        a[i] = (long long)a[i] * x % gf->p;
      }
      return *this;
    }

    // Multiplication by a scalar.
    Element operator*(int x) const {
      Element res(*this);
      res *= x;
      return res;
    }

    // Multiplication by x.
    Element& shift() {
      long long d = gf->p - a.back();  // d = -a[k-1].
      for (int i = gf->k - 1; i >= 0; --i) {
        a[i] = ((i ? a[i - 1] : 0) + d * gf->mod[i]) % gf->p;
      }
      return *this;
    }

    // Multiplication.
    Element& operator*=(const Element& rhs) {
      Element prod(*this);
      *this *= rhs.a[0];
      for (int j = 1; j < gf->k; ++j) {
        prod.shift();
        *this += prod * rhs.a[j];
      }
      return *this;
    }

    // Multiplication.
    Element operator*(const Element& rhs) const {
      Element res(*this);
      res *= rhs;
      return res;
    }

    // Binary exponentiation.
    Element pow(int b) const {
      Element res(gf, 1);
      Element po(*this);
      while (b) {
        if (b & 1) res *= po;
        po = po * po;
        b >>= 1;
      }
      return res;
    }

    // Multiplicative inverse.
    Element inv() const {
      Element res(gf);
      auto& x = res.a;
      std::vector<int> y;
      auto lhs = a;
      trim(lhs);
      auto rhs = gf->mod;
      gf->poly_ex_gcd(lhs, rhs, x, y);
      x.resize(gf->k);
      return res;
    }

    // Division.
    Element& operator/=(const Element& rhs) {
      *this *= rhs.inv();
      return *this;
    }

    // Division.
    Element operator/(const Element& rhs) const {
      Element res(*this);
      res /= rhs;
      return res;
    }
  };

 private:
  // Check whether the current MOD is irreducible.
  bool checkIrreducible() const {
    Element f(this, p);
    for (int j = 1; j < k; ++j) {
      // F = X^{p^j} mod MOD.
      f = f.pow(p);
      // G = X^{p^j}-X mod MOD.
      auto g = f.a;
      g[1] = g[1] ? g[1] - 1 : p - 1;
      trim(g);
      // H = MOD.
      auto h = mod;
      // Reducible if deg(GCD(G,H))>0.
      if (poly_gcd(h, g).size() > 1) return false;
    }
    return true;
  }

 public:
  FiniteField(int p, int k) : p(p), k(k), mod(k + 1, 1) {
    do {  // Randomly generate a polynomial.
      for (int i = 0; i < k; ++i) {
        mod[i] = rand() % p;
      }
    } while (!checkIrreducible());
  }
};

int main() {
  int p = 13331, k = 50;
  FiniteField gf(p, k);
  FiniteField::Element e1(&gf, rand() + 1);
  FiniteField::Element e2(&gf, rand() + 1);
  FiniteField::Element e3(&gf, rand() + 1);
  // Test Frobenius endomorphism.
  std::cout
      << ((e1 * e2 + e3).pow(p) - e1.pow(p) * e2.pow(p) - e3.pow(p)).idx();
  // Test inverse.
  std::cout << ((e1 * e2).inv() - e1.inv() / e2).idx();
  return 0;
}

Finite fields of characteristic 22 are the most commonly used in cryptography. For such finite fields, elements can be stored as 01 strings, and operations in the field can be implemented using bitwise operations.

Applications

This section lists some applications of field extensions in algorithmic competitions. The main situation is when, while evaluating an arithmetic expression over a field, we need to introduce intermediate elements that do not originally exist in the field, thereby making direct computation possible. Readers should be familiar with solving real-number problems using complex numbers; this is an example of an extension of the real field; what readers may be less familiar with is extension over finite fields. Therefore, we focus here on extensions of finite fields, especially extensions of the prime field Fp\mathbf F_p.

In some cases, field extensions can reduce computational complexity and are therefore necessary, such as the fast Fourier transform over the real field; in other cases, a field extension is merely one of many ways to solve a problem, and a method with similar complexity can usually avoid using a field extension, such as the computation of the Fibonacci sequence discussed next. While understanding these applications, readers should compare the advantages and disadvantages of the different methods so that they can choose an appropriate method when solving problems.

Fibonacci sequence

For computing the Fibonacci sequence, common methods include the O(n)O(n) linear recurrence and O(log⁡n)O(\log n) matrix exponentiation by squaring. In fact, it can also be solved using a field extension, with the same time complexity O(log⁡n)O(\log n). The Fibonacci sequence has the closed-form formula:

f(n)=15((1+52)n−(1−52)n).f(n) = \frac{1}{\sqrt{5}}\left(\left(\frac{1+\sqrt{5}}{2}\right)^n-\left(\frac{1-\sqrt{5}}{2}\right)^n\right).

We now compute the value of f(n)f(n) modulo a prime p≠5p\neq 59. Translating this problem into a computation over the finite field Fp\mathbf F_p, the first issue is the meaning of 5\sqrt 5 in Fp\mathbf F_p. Algebraically, it is a square root of the element 55. Therefore, if in Fp\mathbf F_p there exists a square root of 55, that is, if 55 is a quadratic residue modulo pp, we can compute the square root and substitute it directly; otherwise, we need to compute in the extension Fp(5)≅Fp[x]/(x2−5)\mathbf F_p(\sqrt 5)\cong\mathbf F_p[x]/(x^2-5).

Of course, when computing in an extension, it is not necessary to adjoin 5\sqrt 5 specifically. For example, for the Fibonacci sequence, we can let ϕ\phi be a root of the polynomial x2−x−1x^2-x-1, so that f(n)f(n) can be written as

f(n)=ϕn−(−ϕ)−n2ϕ−1=ϕn−(1−ϕ)n2ϕ−1.f(n)=\frac{\phi^n-(-\phi)^{-n}}{2\phi-1}=\frac{\phi^n-(1-\phi)^n}{2\phi-1}.

If 55 is not a quadratic residue modulo pp, then the polynomial x2−x−1x^2-x-1 is irreducible. We can then compute in the extension Fp(θ)≅Fp[x]/(x2−x−1)\mathbf F_p(\theta)\cong\mathbf F_p[x]/(x^2-x-1) and obtain the same result as above.

The method for computing the Fibonacci sequence can of course be generalized to other situations. However, one point deserves attention: the irreducibility of polynomials over finite fields does not agree with that over the field of rational numbers. For example, x4−10x2+1x^4-10x^2+1 is irreducible over Q\mathbf Q, and its splitting field is Q(2+3)=Q(2,3)\mathbf Q(\sqrt 2+\sqrt 3)=\mathbf Q(\sqrt 2,\sqrt 3); however, in Fp\mathbf F_p, if 22 and 33 are both quadratic nonresidues modulo pp, it is a product of two irreducible polynomials, so in the extension field Fp(2)\mathbf F_p(\sqrt 2) the square root 3\sqrt{3} already exists and no further extension is needed.

Extensions to Rings

As the previous section demonstrated, field extensions have various limitations. For computing the Fibonacci sequence, using only field-extension methods can handle only the case where the modulus pp is prime and 55 is a quadratic nonresidue modulo pp. However, the discussion in the section on algebraic extensions shows that if division is not required in the extended structure, rings can also be extended10. This section briefly discusses this method using the computation of the Fibonacci sequence under an arbitrary modulus nn as an example. Other common situations that do not involve much division, including determinant computation and the fast Fourier transform, can also make use of this method when appropriate.

Let mm be any positive integer, and let f(n)f(n) be the nn-th term of the Fibonacci sequence. The problem is to compute the value of f(n) mod mf(n)\bmod m. In principle, this requires computation in Z/mZ\mathbf Z/m\mathbf Z. However, as the previous section showed, the reducibility of the polynomial x2−x−1x^2-x-1 and whether it has repeated roots differ for different moduli, so the closed form of the Fibonacci sequence may differ greatly. Moreover, if Z/mZ\mathbf Z/m\mathbf Z itself is not a field, elements in the extension often do not have valid inverses (for example, modulo 55, the denominator 5\sqrt 5 is simply zero). Despite these many problems, under the condition that coefficients are reduced modulo mm, it actually suffices to compute the remainder

(1−x)n−xnmod  x2−x−1(1-x)^n-x^n\mod{x^2-x-1}

and take its constant term. Comparing this with the closed form above, the rationale for this approach is clear: this seems to be computing inside the “extension” (Z/mZ)[x]/(x2−x−1)(\mathbf Z/m\mathbf Z)[x]/(x^2-x-1)

f(n)=(1−ϕ)n−ϕn1−2ϕf(n)=\frac{(1-\phi)^n-\phi^n}{1-2\phi}

where ϕ\phi is a root of x2−x−1x^2-x-1.

Although it is less obvious, this method is also valid. Note that in the extension Q(ϕ)≅Q[x]/(x2−x−1)\mathbf Q(\phi)\cong\mathbf Q[x]/(x^2-x-1) of the rational field, the closed form holds. This means that in Q[x]\mathbf Q[x],

(1−x)n−xn≡f(n)(1−2x)(modx2−x−1)(1-x)^n-x^n \equiv f(n)(1-2x) \pmod{x^2-x-1}

holds. This involves only polynomials with integer coefficients, and therefore it also holds in Z[x]\mathbf Z[x]. Writing it as a polynomial-division-with-remainder identity and reducing the coefficients on both sides modulo mm gives an identity in (Z/mZ)[x](\mathbf Z/m\mathbf Z)[x]. This conclusion holds for every mm.

In general, if an expression can be computed in an extension of the rational field Q\mathbf Q, then clearing denominators can always yield a conclusion in Z[x]\mathbf Z[x], and reducing modulo mm then gives a conclusion in (Z/mZ)[x](\mathbf Z/m\mathbf Z)[x]. The key to making this idea work is that clearing denominators must not cause an “irreversible” consequence. For example, when computing the Fibonacci sequence, if instead of using the coefficient of the constant term we use the coefficient of the linear term, then because the coefficient has a factor of 22, 22 has no inverse when mm is even, so there is no way to recover the value of f(n)f(n); likewise, for the Fibonacci sequence, if we use a closed-form formula containing a (−ϕ)−n(-\phi)^{-n} term, clearing denominators introduces factors that are difficult to handle, so it is impossible to draw a conclusion from the result after taking remainders. Therefore, the choice of computation process is crucial to applying this technique.

Cipolla Algorithm

This is a typical example of using an extension of a finite field for computation. For a modulus p≠2p\neq 2, consider a quadratic residue aa, and find its square root by solving x2≡a(modp)x^2\equiv a\pmod p for xx. Although this is a problem over Fp\mathbf F_p, the Cipolla algorithm performs the computation over the finite field Fp2\mathbf F_{p^2}. This section explains the algorithm in the language of field theory. An elementary number-theoretic proof can be found at the linked page.

Specifically, the Cipolla algorithm first chooses rr such that r2−ar^2-a is a quadratic nonresidue modulo pp, which means that x2−(r2−a)x^2-(r^2-a) is irreducible. Thus, letting u=r2−au=r^2-a, we can consider the extension Fp(u)\mathbf F_p(\sqrt u). Because the Frobenius endomorphism can only map an element to its conjugate, and such a conjugate is unique in a quadratic extension, we have (r−u)p=r+u(r-\sqrt u)^p=r+\sqrt u. Therefore, (r−u)p+1=(r+u)(r−u)=r2−u=a(r-\sqrt u)^{p+1}=(r+\sqrt u)(r-\sqrt u)=r^2-u=a. Hence, to determine the square root, it suffices to compute (r−u)(p+1)/2(r-\sqrt u)^{(p+1)/2}. This value must lie in Fp\mathbf F_p, because the splitting field of x2−ax^2-a is Fp\mathbf F_p itself.

Exercises

Finally, we list some problems that directly apply the content of this article, to deepen understanding. However, note that much of the content is not a standard topic in algorithm competitions.

References and Notes

Footnotes

  1. This is because the field EE's multiplicative identity 1E1_E must satisfy the relation over FF given by x2−x=0x^2-x=0, and the latter has only two roots in the field FF: 0F0_F and 1F1_F, while the definition of a field requires 1E≠0E1_E\neq 0_E, so it follows that 1E=1F1_E=1_F and 0E=0F0_E=0_F. ↩

  2. In category-theoretic language, this says that Z\mathbf Z is the initial object in the category of rings with identity. ↩

  3. Strictly speaking, this refers to the polynomial ring R[x]R[x] and its universal property (universal property). ↩

  4. This polynomial ring has infinitely many indeterminates. To define such a polynomial ring, one must first define monomials. Let the set of indeterminates be XX, and let its monomials be all functions α:X→N\alpha:X\rightarrow\mathbf N that are nonzero at only finitely many indeterminates and can be written as xi1α(ii)⋯xikα(ik)x_{i_1}^{\alpha(i_i)}\cdots x_{i_k}^{\alpha(i_k)}, where i1,⋯ ,iki_1,\cdots,i_k are the indices of all indeterminates at which α\alpha is nonzero. A polynomial is a linear combination of finitely many monomials. Under the corresponding addition and multiplication operations, they form a ring. For the case of finitely many indeterminates, one can prove that this definition agrees with the result obtained from the recursive definition in the section on multivariable polynomial rings. ↩

  5. Although it is called the fundamental theorem of algebra, this result is not purely algebraic, because constructing the real field requires a topological structure. ↩

  6. This statement is not fully precise, because irreducible factors of degrees d∣nd\mid n are also obtained. However, because algorithm implementations usually separate factors starting from smaller degrees, when separating an irreducible polynomial factor of degree nn, the smaller factors should already have been separated, so the statement is acceptable. ↩

  7. Do not confuse this name with the primitive polynomial in polynomial theory (that is, a polynomial whose coefficients have greatest common divisor one). ↩

  8. For example, the appendix of Hansen, T., & Mullen, G. L. (1992). Primitive polynomials over finite fields. Mathematics of computation, 59(200), 639-643 provides such a list. ↩

  9. When p=5p=5, the characteristic equation x2−x−1=0x^2-x-1=0 of the Fibonacci sequence has a repeated root x=3x=3, so over F5\mathbf F_5, the closed-form formula for the Fibonacci sequence is f(n)=n3n−1f(n)=n3^{n-1}. ↩

  10. The phrase “extension of a ring” usually has two meanings: one is a generalization of a group extension, and the other is a generalization of a field extension. This article uses the second meaning. More specifically, the extensions considered in this section are integral extensions of commutative rings with identity, and this is the generalization of the concept of algebraic extensions of fields to commutative rings with identity. ↩

This content comes from OI Wiki: Field Theory. See the original for authors and revision history. AIOJ has adapted the formatting, in-site links, and resource paths.

Content is shared under CC BY-SA 4.0 and SATA license; additional terms are governed by the original notice. Thanks to the OI Wiki authors and contributors; per the SATA terms, please visit the OI Wiki repository and star it to show your support.