On algebraic numbers

A complex number is algebraic if it is the root of some polynomial P(x) with rational coefficients. \sqrt{2} is algebraic (e.g. the polynomial x^2 -2); i is algebraic (e.g. the polynomial x^2 + 1); \pi and e are not. A complex number that is not algebraic is called transcendental.

Is the sum of algebraic numbers always algebraic? What about the product of algebraic numbers? For example, given that \sqrt{2} and \sqrt{3} are algebraic, how do we know \alpha = \sqrt{2} + \sqrt{3} is also algebraic?

We can try to repeatedly square the equation x = \sqrt{2} + \sqrt{3}. This gives us x^2 = 2 + 3 + 2\sqrt{6}. Then isolating the radical, we have x^2 - 5 = 2\sqrt{6}. Squaring again, we get x^4 - 10x^2 + 25 = 24, so \alpha is a root of x^4 - 10x^2 + 1. This is in fact the unique monic polynomial of minimum degree that has \alpha as a root (called the minimal polynomial of \alpha) which shows \alpha is algebraic. But a sum like \sqrt{2} + \sqrt{3} + \sqrt{5} + i would probably have a minimal polynomial of much greater degree, and it would be much more complicated to construct this polynomial and verify the number is algebraic.

It is also increasingly difficult to construct polynomials for numbers like \sqrt{2} + \sqrt[3]{3}. And, apparently there also exist algebraic numbers that cannot be expressed as radicals at all. This further complicates the problem.

In fact, the sum and product of algebraic numbers is algebraic – in fact, any number which can be obtained by adding, subtracting, multiplying and dividing algebraic numbers is algebraic. This means that a number like

    \[\frac{\sqrt{2} + i\sqrt[3]{25} - 2 + \sqrt{3}}{15 - 3i + 4e^{5i\pi / 12}}\]

is algebraic – there is some polynomial which has it as a root. But we will prove this result non-constructively; that is, we will prove that such a number must be algebraic, without providing an explicit process to actually obtain the polynomial. To establish this result, we will try to look for a deeper structure in the algebraic numbers, which is elucidated, perhaps surprisingly, using the tools of linear algebra.

Definition: Let S be a set of complex numbers that contains 0. We say S is an abelian group if for all x, y \in S, x + y \in S and x - y \in S. In other words, S is closed under addition and subtraction.

Some examples: \mathbb{Z}, \mathbb{Q}, \mathbb{R}, \mathbb{C}, the Gaussian integers \mathbb{Z}[i] (i.e. the set of expressions a+bi where a and b are integers)

Definition: An abelian group is a field if it contains 1 and for all x, y \in S, xy \in S, and if y \neq 0, x/y \in S. In other words, S is closed under multiplication and division.

We generally use the letters k, F, E for arbitrary fields. Of the previous examples, only \mathbb{Q}, \mathbb{R}, \mathbb{C} are fields.

Exercise: Show that if k is a field, \mathbb{Q} \subseteq k.

Exercise: Show that the set \{a + b\sqrt{2} \ | \ a, b \in \mathbb{Q} \} is a field. We call this field \mathbb{Q}(\sqrt{2}). (Hint: rationalize the denominator).

Exercise: Describe the the smallest field which contains both \sqrt{2} and \sqrt{3} (this is called \mathbb{Q}(\sqrt{2}, \sqrt{3}))

Generally if k is a field and x_1, \dots x_n some complex numbers, we will denote the smallest field that contains all of k and the elements x_1, \dots x_n as k(x_1, \dots x_n).

Definition: Let k be a field. A k-vector space is an abelian group V such that if c \in k, x \in V, then cx \in V. Intuitively, the elements of V are closed under scaling by k. (We also sometimes use the phrase “V is a vector space over k “)

Examples: \mathbb{Q}(\sqrt{2}, \sqrt{3}) and \mathbb{Q}(\sqrt{2}) are both \mathbb{Q}-vector spaces. In fact, \mathbb{Q}(\sqrt{2}, \sqrt{3}) is also a \mathbb{Q}(\sqrt{2}) vector space.

With this language in place, we can state the main goal of this post as follows:

Theorem: If \alpha_1, \dots \alpha_n are algebraic numbers and x \in \mathbb{Q}(\alpha_1, \dots \alpha_n), then x is algebraic.

Note how this encompasses our previous claim that any number obtained by adding, subtracting, multiplying and dividing algebraic numbers is algebraic. For example, we can deduce the giant fraction above is algebraic by applying the theorem to \mathbb{Q}(\sqrt{2}, i, \sqrt[3]{25}, \sqrt{3}, e^{5i/12}).

Definition: A field extension of a field k is just a field F that contains k. We will write this as “F \supseteq k is a field extension”.

Exercise: If F \supseteq k is a field extension, then F is a k-vector space

Consider a field like \mathbb{Q}(\sqrt{2}). Not only is it a field, but it is also a \mathbb{Q}-vector space – its elements can be scaled by rational numbers. We want to adapt concepts from ordinary linear algebra to this setting. We want to think of \mathbb{Q}(\sqrt{2}) as a two dimensional vector space, with basis 1 and \sqrt{2} – every element is can be uniquely written as a \mathbb{Q}-linear combination of 1 and \sqrt{2}. Similarly, we would like to think of \mathbb{Q}(\sqrt{2}, \sqrt{3}) as a \mathbb{Q}-vector space with basis 1, \sqrt{2}, \sqrt{3}, \sqrt{6}. Note that if we regard \mathbb{Q}(\sqrt{2}, \sqrt{3}) as a \mathbb{Q}(\sqrt{2})-vector space, its basis is 1, \sqrt{3}. This is because if an element is written as a + b\sqrt{2} + c\sqrt{3} + d\sqrt{6}, where the coefficients are rational, we can rewrite it as (a + b\sqrt{2})1 + (c + d\sqrt{2})\sqrt{3}, now with coefficients in \mathbb{Q}(\sqrt{2}).

On the other hand, consider \mathbb{Q}(\pi). Since \pi is not algebraic, no linear combination (with rational coefficients) of the numbers 1, \pi, \pi^2, \pi^3, \dots equals 0 without all the coefficients being zero. This makes them linearly independent – and makes \mathbb{Q}(\pi) an infinite-dimensional vector space.

This finite-versus-infinite dimensionality difference will lie at the crux of our argument. Here is a rough summary of the argument to prove the Theorem:

  1. If we add an algebraic number to a field, we get a finite-dimensional vector space over that field.
  2. By repeatedly adding algebraic numbers to \mathbb{Q}, the resulting field will still be a finite-dimensional \mathbb{Q}-vector space.
  3. Any element of a field which is a finite-dimensional \mathbb{Q}-vector space must be algebraic.

From here on, we will assume that the reader has some familiarity with ideas from linear algebra, such as the notions of linear combination, linear independence, and basis. We will only sketch proofs (maybe I will add details later). We would like to warn the reader that the proof sketches have many gaps and may be difficult to follow.

Definition: A field extension F \supseteq k is finite if there is a finite set of elements e_1, \dots e_n \in F such that every element of F can be represented as c_1e_1 + \dots c_ne_n, where all the c_i \in k. We say the elements e_1, \dots e_n generate (aka span) F over k. If, furthermore, every element can be represented uniquely in this form, then we say e_1, \dots e_n is a kbasis (or just basis) for F.

Examples: \mathbb{Q}(\sqrt{2})/\mathbb{Q} and \mathbb{Q}(\sqrt{2}, \sqrt{3})/\mathbb{Q} are finite extensions, while \mathbb{Q}(\pi)/\mathbb{Q} is not.

Exercise: Show \mathbb{C}/\mathbb{Q} is not a finite extension. (Hint: \mathbb{C} is uncountable)

Proposition 1: Every finite field extension F/k has a basis.

Proof sketch: This is a special case of a famous theorem in linear algebra. Assume e_1, \dots e_n generate F. Start with the last element. If e_n can be represented as a linear combination of e_1 \dots e_{n-1}, remove it from the list. If we removed e_n, we now have e_1 \dots e_{n-1}, and we can repeat the process with e_{n-1}. Continue this process until we cannot remove any more elements. Then (it can be checked that) we obtain a set whose elements are linearly independent. Then (it can be checked that) these form a k-basis for F. \square

For the next theorem, keep in mind the example of the extensions \mathbb{Q}(\sqrt{2})/\mathbb{Q} and \mathbb{Q}(\sqrt{2}, \sqrt{3})/\mathbb{Q}(\sqrt{2}).

Proposition 2: Suppose F \supseteq k and E \supseteq F are finite field extensions. Then E \supseteq k is a finite extension.

Proof: By Proposition 1, both these field extensions have bases. Label the F-basis of E as e_1, \dots e_n, and the k-basis for f as e'_1, \dots e'_m. Then every element of F can be uniquely represented as c_1e_1 + \dots + c_ne_n, for c_i \in F. Furthermore, each c_i can be written uniquely as c_i = a_{i, 1}e'_1 + \dots + a_{i, m}e'_m for a_{i, j} \in k. Plugging these in for the c_i shows that the mn elements of the form e_ie'_j form a k-basis for E. \square

Proposition 3: If \alpha is algebraic, then k(\alpha) \supseteq k is a finite extension.

Proof sketch: Suppose x \in k(\alpha). First we will show every element in k(\alpha) is a polynomial in \alpha with coefficients in k. k(\alpha) consists of all numbers that can be obtained by repeatedly adding, subtracting, multiplying and dividing \alpha and elements of k. By performing some algebraic manipulations and combining fractions, we can see that every element can be written in the form p(\alpha)/q(\alpha), where p and q are polynomials with coefficients in k.

Now I claim that for any polynomial q where q(\alpha) \neq 0, there exists a polynomial s such that s(\alpha) = 1/q(\alpha). Let m be the minimal polynomial of \alpha. Since q(\alpha) \neq 0 and m(\alpha) = 0, q and m are relatively prime as polynomials. So there exist polynomials r and s such that rq+sm = 1. Plugging in \alpha into the polynomials gives us r(\alpha)q(\alpha) + s(\alpha)m(\alpha) = 1. Since m(\alpha) = 0, s(\alpha) = 1/q(\alpha), as desired.

Thus any element in k(\alpha), written as p(\alpha)/q(\alpha), can be written as p(\alpha)s(\alpha) for an appropriate polynomial s; in other words, every element of k(\alpha) is a polynomial of \alpha with coefficients in k. Now, suppose the minimal polynomial of \alpha is a_nx^n + \dots a_1x + a_0. Then \alpha^n = \frac{1}{a_n}(-a_0 - a_1\alpha \dots - a_{n-1}\alpha^{n-1}). So \alpha^n (and all higher powers of \alpha) can be written as rational linear combinations of 1, \alpha, \dots \alpha^{n-1}. Then it can be verified that every element in k(\alpha) can be written uniquely as a k-linear combination of 1, \alpha, \dots \alpha^{n-1}. This establishes that k(\alpha)/k is a finite extension; in particular, it has the basis 1, \alpha, \dots \alpha^{n-1}. \square

Proposition 4: Suppose k \supseteq \mathbb{Q} is a finite extension. Then any x \in k is algebraic.

Proof sketch: Consider the elements 1, x, x^2, \dots…. They cannot all be linearly independent. This is because in a finite-dimensional vector space of dimension n any set with at least n+1 elements must be linearly dependent. So there must be some linear combination of them which equals zero. But this simply means that for some constants a_i and positive integer n, a_nx^n + \dots a_1x + a_0 = 0. Letting the a_i be the coefficients of a polynomial P, P(x) = 0, so x is algebraic. \square

We have developed enough theory now to prove the result.

Proof of main Theorem: Let \alpha_1, \alpha_2, \dots \alpha_n be some collection of algebraic numbers. Then by Proposition 3, \mathbb{Q}(\alpha_1, \dots \alpha_n) \supseteq \mathbb{Q}(\alpha_1, \dots \alpha_{n-1}), \dots \mathbb{Q}(\alpha_1, \alpha_2) \supseteq \mathbb{Q}(\alpha_1), \mathbb{Q}(\alpha_1) \supseteq \mathbb{Q} are all finite field extensions. Applying Proposition 2 repeatedly gives us \mathbb{Q}(\alpha_1, \dots \alpha_n) \supseteq \mathbb{Q} is a finite extension. Then by Proposition 4, any element of \mathbb{Q}(\alpha_1, \dots \alpha_n) is algebraic.

This theorem essentially says that given a collection of algebraic numbers, by repeatedly adding, subtracting, multiplying and dividing them, we can only obtain algebraic numbers. But what about radicals? For example, we have now established that \sqrt{2} + \sqrt{3} + \sqrt{5} is algebraic. Is \sqrt{\sqrt{2} + \sqrt{3} + \sqrt{5}} algebraic as well?

In fact, we can generalize our result to the following: any number obtained by repeatedly adding, subtracting, multiplying, dividing algebraic numbers, as well as taking m-th roots (for positive integers m) will be algebraic.

This is not too hard now that we have the main theorem. It suffices to show that if x is algebraic, \sqrt[m]{x} is algebraic. If x is algebraic, then there exist constants a_0, \dots a_n such that a_nx^n + \dots a_1x + a_0 = 0. This can be rewritten as a_n(\sqrt[m]{x})^{mn} + \dots a_1(\sqrt[m]{x})^m + a_0 = 0. Thus \sqrt[m]{x} is algebraic.

Acknowledgements: Thanks to Anton Cao and Nagaganesh Jaladanki for reviewing this article.

Odd and even permutations

A standard part of the theory of permutations is the classification of permutations into “odd” and “even” types. In this post I will develop the theory of odd and even permutations, focusing on adjacent permutations.

Let X be an finite ordered set. A permutation of X is a rearrangement of X; formally, it is a bijection \sigma: X \to X. For simplicity, we will label the elements of X as 1, 2, \dots n, and we will represent a permutation \sigma by the list \sigma(1)\sigma(2)\dots\sigma(n). Thus if X has five elements, then the permutation that reverses X can be written as 54321.

The set of permutations of X naturally forms a group. That is, given two permutations \sigma_1 and \sigma_2, we can form their product \sigma_2 \dot \sigma_1 (or \sigma_2\sigma_1 for short), which is defined by performing \sigma_1 first and then \sigma_2, following the convention for composition of functions. For example, the product of the permutations 13425 \cdot 21345 is 31425.

Here are some standard permutations. The identity permutation is the permutation that does nothing. A transposition is a permutation that swaps two elements. If a transposition swaps a and b, we will denote it as (a \ b). An adjacent transposition is a transposition that swaps two adjacent elements (so it is denoted (a \ a+1)).

An important property of a permutation is its inversion number. An inversion of a permutation \sigma is a pair i, j \in \{1, 2, \dots n\} where i < j such that \sigma(i) > \sigma(j). In other words, it is a pair of elements whose relative positions have been switched by the permutation. The inversion number of \sigma is the size of its set of inversions. Thus the inversion number is at most {n \choose 2} (this occurs when the permutation reverses X). A permutation has inversion number 0 if and only if it is the identity permutation. Also, a permutation has inversion number 1 if and only if it is an adjacent transposition.

A permutation is called odd if its inversion number is odd, and even if its inversion number is even. We would like to show that the product of odd and even permutations behaves like addition of odd and even numbers. To show this, we will use the following lemma:

Every permutation is a product of adjacent transpositions.

This can be proved by using insertion sort, an algorithm which effectively writes any permutations as a product of adjacent transpositions.

Here is how it works. Consider, for example, the permutation \sigma given by 23154. Let us try to sort this list. Insertion sort first moves 1 to the front by repeated swaps, first swapping the second and third position and then the first and second positions. Then we get 12354. Then insertion sort would swap the fourth and fifth positions, and then finish with 12345. So, if we do these transpositions in reverse, we get our original permutation. That is, \sigma = (2 3)(1 2)(4 5). We can see that using this process, insertion sort can write any permutation as a product of adjacent transpositions.

We need one more lemma:

If \sigma is a permutation and \rho an adjacent transposition, then \sigma and \sigma\rho have opposite parity. That is, one is odd and one is even.

Here is why. After performing \sigma, if we swap two adjacent elements a and a+1, then the only change to the set of inversions is a, a+1, since a and a+1 haven’t moved relative to any other element. So, the only possible change is that a, a+1 was an inversion and no longer is, or it wasn’t an inversion and now is. So the inversion number has either been increased or decreased by one – so the parity has been switched.

So, if a permutation \sigma is written as a product of n adjacent transpositions, then its parity is equal to the parity of n. This establishes that the product of odd and even permutations behaves like addition of odd and even numbers (formally, what we are saying is that “parity” defines a homomorphism from the permutation group to \mathbb{Z}/2\mathbb{Z}).

Another interesting fact is that every transposition is odd. We can see this (without needing to count inversions) by noticing that we can obtain any transposition (a \ b) (with a < b) by repeatedly swapping adjacent elements till the element in place a is moved to place b, and then repeatedly swapping the other direction till the element originally in place b is moved to place a. If we write this out we see that (a \ b) = (a \ a+1)(a+1 \ a+2) \dots (b-2 \ b-1)(b-1 \ b)(b-2 \ b-1) \dots (a \ a+1), which has an odd number of terms.

Thus every permutation can be written only either as a product of an odd number or an even number of transpositions. Since the identity permutation is clearly even, we have the following remarkable fact: given any list, it is impossible, after performing an odd number of swaps, to obtain the original list.

Acknowledgements: Thanks to Anton Cao for suggestions. Thanks to Jessica Meng for reminding me the correct convention for composition order.