Lecture 6 · Week 2· 18:22

Fields

Field axioms; Q, R, C and the finite fields Zp.

Play: Lecture 6: Fields
Lecture · 18:22 · Open on YouTube · Report a problem with this video
TranscriptThe full text of the lecture. Click any sentence to play the video from there.

Which numbers can be scalars?

Welcome back. In every lecture so far, our scalars have been real numbers. We have scaled vectors by numbers like two, minus one, or one half. Today we ask a question that sounds simple. Which numbers are we allowed to use as scalars? Look back at how we proved the rules of vector algebra in lecture two. Every rule came down to a rule of arithmetic for real numbers, applied one entry at a time. For example, a plus b, times v, equals a v plus b v, because in each entry, the distributive law holds for real numbers. And when we solve equations, we use one more thing. To solve two x equals six, we divide both sides by two, and find that x is three. We need to be able to divide by any number that is not zero.

So what linear algebra really needs from its scalars is a short list. We must be able to add, subtract, multiply, and divide by anything that is not zero, and the usual laws of arithmetic must hold. A number system with these properties is called a field. The real numbers form one field, but not the only one. The fractions form a field. The complex numbers form a field. And, more surprisingly, there are fields with only finitely many elements, such as the arithmetic of a clock with five hours. Finite fields are not a curiosity. They are the arithmetic behind the error correcting codes in QR codes and in data storage, and behind much of modern cryptography. And the linear algebra we build in this course works in all of them, word for word.

In week six, we will define vector spaces over any field. Today we lay the foundation: what a field is, what follows from its rules, and the most important examples.

The field axioms

Here is the definition. A field is a set F, together with two operations, called addition and multiplication. Each takes two elements of F, and gives an element of F. And together, they must obey nine rules, called the field axioms. The first four rules are about addition. Addition is associative and commutative. There is a zero element, with a plus zero equal to a. And every element a has a negative, minus a, with a plus minus a equal to zero. The next four rules say the same things about multiplication. Multiplication is associative and commutative. There is a one element, different from zero, with one times a equal to a. And every element a that is not zero has an inverse, a to the minus one, with a times a to the minus one equal to one.

The last rule connects the two operations. It is the distributive law: a times the sum b plus c equals a b plus a c. Notice the one difference between the two lists. Every element has a negative, but only the nonzero elements need an inverse. Zero never has one, because zero times anything is zero, as we will prove in a moment. With these rules, subtraction and division come for free. a minus b means a plus the negative of b. And a divided by b, for b not zero, means a times the inverse of b.

Let's test the definition. The real numbers satisfy all nine axioms; they are exactly the rules of arithmetic we have used all along. So the real numbers form a field, called R. The rational numbers, the fractions, also form a field, called Q. The key check is that the operations never leave the set. A sum or a product of two fractions is again a fraction. And a nonzero fraction, such as two thirds, has the inverse three halves, which is again a fraction. Now a set that fails. The integers can be added, subtracted and multiplied, and they satisfy eight of the nine axioms. But two has no inverse among the integers: two times x equals one has no whole number solution. So the integers are not a field.

In the same way, the natural numbers, zero, one, two and so on, are not a field, because minus one is missing. To be a field, a set must be closed under all four operations.

What follows from the axioms

In a field, everything we know about arithmetic must now be proved from the nine axioms alone. The reward is that the result then holds in every field at once, including the strange finite ones. Let's prove the three facts we will use most. The first fact looks almost too obvious to prove. For every element a of a field, zero times a equals zero. It may look trivial, but none of the axioms says it directly. And it matters. It is the reason that zero can never have an inverse, and the same argument showed in lecture two that zero times a vector is the zero vector.

The next three proofs are short, but proving things from axioms is a new skill, and each line leans on one specific rule. Feel free to pause on each line, or to watch the proofs again slowly, and name the axiom behind every step. Here is the proof. Start with zero times a. Since zero plus zero is zero, we can replace the first zero by zero plus zero. By the distributive law, zero plus zero, times a, is zero a, plus zero a. So zero a equals zero a plus zero a.

Now add the negative of zero a to both sides. The left side becomes zero. On the right, one copy of zero a cancels, and what is left is zero a. So zero a equals zero. The second fact is that minus one times a equals minus a. To prove it, we show that minus one times a does the job of the negative of a: added to a, it gives zero. a plus minus one times a is one times a, plus minus one times a. By the distributive law, that is one plus minus one, times a. That is zero times a, which is zero, by the first fact. An element has only one negative, as the book proves, so minus one times a is minus a.

The third fact is the one that makes fields so useful. If a product a b is zero, then a is zero, or b is zero. We say that a field has no zero divisors. Here is the proof. Suppose a b equals zero, and a is not zero. Then a has an inverse, and we multiply both sides by it. On the left, a inverse times a b is one times b, which is b. On the right, a inverse times zero is zero, by the first fact. So b is zero. Here is why we care. In any field, an equation a x equals b, with a not zero, has exactly one solution. Multiplying both sides by a inverse gives the solution x equals a inverse b.

And there is no other. If two numbers solved the equation, their difference d would satisfy a d equals zero. Since a is not zero, d is zero by the third fact, so the two solutions are the same. Solving one equation by division is the single step that Gaussian elimination repeats, over and over.

The complex numbers

Our next field extends the real numbers. In the real numbers, the equation x squared equals minus one has no solution, because a square is never negative. So we bring in a new number, i, whose square is minus one. A complex number is an expression a plus b i, where a and b are real numbers. We picture it as a point in the plane: the real part a along the horizontal axis, and the imaginary part b up the vertical axis. We add complex numbers part by part, just like vectors in the plane. Take one plus two i, and three minus i. The real parts give one plus three, which is four. The imaginary parts give two plus minus one, which is one. So the sum is four plus i.

We multiply by expanding the brackets, and replacing i squared by minus one. Let's multiply one plus two i by three minus i. Expanding gives three, minus i, plus six i, minus two i squared. Since i squared is minus one, minus two i squared is plus two. The real parts give three plus two, which is five, and the imaginary parts give minus one plus six, which is five. So the product is five plus five i. These operations obey all the rules of a field. The associative, commutative and distributive laws are routine algebra, and the book checks them. The only rule that needs an idea is the inverse.

To invert a plus b i, multiply it by its conjugate, a minus b i. The product is a squared plus b squared, a positive real number whenever a plus b i is not zero. So the inverse of a plus b i is a minus b i, divided by a squared plus b squared. For example, take one plus two i. Its conjugate is one minus two i, and one squared plus two squared is five. So the inverse is one fifth, minus two fifths i. Let's check. One plus two i, times one minus two i, is one minus four i squared, which is one plus four, or five. Divided by five, that is one. So the complex numbers form a field, called C.

One thing is lost. The complex numbers cannot be put in order: there is no sensible way to say whether i is bigger or smaller than zero. Lengths and angles rely on the order of the real numbers, so over C they will need extra care. Complex numbers return in week eleven, where matrices that rotate the plane turn out to be best understood with complex numbers. Appendix B of the book reviews them in more detail.

Finite fields

Now for the surprise: a field with only five elements. Take the numbers zero, one, two, three and four, and arrange them around a clock with five hours. To add, we count around the clock. Three plus four is seven, but on this clock, seven steps from zero land on two. In other words, we take the ordinary sum, and keep only its remainder after dividing by five. So here, three plus four equals two. Multiplication works the same way. Three times four is twelve, and twelve leaves the remainder two after dividing by five. So three times four is also two.

This number system is called the integers modulo five, written Z five. In general, for any whole number n of at least two, Z n is the set of numbers from zero up to n minus one, where we add and multiply as usual, and then take the remainder after dividing by n. The laws of addition and multiplication carry over from the integers, and the book checks them. Zero and one play their usual roles. On the clock, plus moves forward and minus moves backward. So minus two is two steps back from zero, which lands on three. Indeed, two plus three is five, which is zero on the clock. The real question is inverses. Here is the multiplication table of Z five.

To find the inverse of an element, we look along its row for a one. In the row of one, the one sits under one, so one is its own inverse. In the row of two, the one sits under three: two times three is six, which is one modulo five. So two and three are inverses of each other. And four times four is sixteen, which is also one, so four is its own inverse. Every nonzero element has an inverse, so Z five is a field. Notice that each nonzero row is a rearrangement of the numbers zero to four, so a one is sure to appear.

Now try a clock with six hours. In Z six, two times three is six, which is zero. Two nonzero elements have the product zero. But we proved that a field has no zero divisors, so Z six is not a field. Indeed, the row of two reads zero, two, four, zero, two, four, and a one never appears. The difference is that five is a prime number, and six is not. This is the theorem: Z n is a field exactly when n is prime. The proof combines the field axioms with a fact about prime numbers, so it is worth pausing on, and watching again if any step is unclear.

First, suppose that n is not prime, so n equals a times b, with a and b between two and n minus one. Then a and b are nonzero elements of Z n, but their product is n, which is zero. A field has no zero divisors, so Z n is not a field. Now suppose that n is a prime p, and take a nonzero element a. Multiply a by each of the p elements of Z p. We claim that the p results are all different. If a x and a y left the same remainder, their difference would be a multiple of p, because the remainders cancel. That difference is a times x minus y, so p divides a times x minus y. When a prime divides a product, it divides one of the factors. It cannot divide a, which lies between one and p minus one. So p divides x minus y. But x and y both lie between zero and p minus one, so x minus y is smaller than p in size, and the only multiple of p that small is zero. So x equals y.

So multiplying by a gives p different results, and every element of Z p appears exactly once. In particular, one appears, and the element that a sends to one is its inverse. That completes the proof. The smallest field of all is Z two, with only zero and one. Here, one plus one is zero. It is the arithmetic of bits, or of even and odd. Addition in Z two is the exclusive or of computer science, and multiplication is and.

Try it yourself

You can explore these clocks yourself, in an interactive figure on the page of this lecture on the course website, at the address on the screen. Choose the number of hours with the buttons at the top: here, seven. The table shows every product, and a green ring marks the one in each row.

Click a row, say the row of three, and the clock shows multiplication by three as arrows. Every hour is hit once, and the figure tells us that the inverse of three is five: three times five is fifteen, which leaves one. Every nonzero row of Z seven has a ring, so Z seven is a field, and seven is prime.

Now choose eight hours, and click the row of two. This row has no ring: two hours land on each even hour, and the figure shows that two times four is zero. So Z eight is not a field.

Try other clocks, and watch the theorem at work for yourself.

Linear algebra over any field

Why does all this matter for linear algebra? Because our methods only ever use the field axioms. Take any field F. Lists of n elements of F form the space F n, and we add and scale them entry by entry, just as in R n. For example, take two vectors with entries in Z five, (three, four) and (four, two). In the first coordinate, three plus four is seven, which is two. In the second coordinate, four plus two is six, which is one. So the sum is (two, one). Every rule of vector algebra from lecture two still holds in F n, with the same proof, because each step of that proof used the field axioms, one entry at a time, with rule eight needing both the distributive law and commutativity.

Let's solve a system of equations over Z five. The first equation is x plus y equals one. The second is x plus two y equals four. Subtract the first equation from the second. The x terms cancel, and we are left with y equals four minus one, which is three. Then x equals one minus y, which is one minus three, or minus two. In Z five, minus two is three. So x is three, and y is three.

Let's check, with arithmetic modulo five. In the first equation, three plus three is six, which is one. In the second, three plus two times three is nine, which is four. Both equations hold. Division works too. To solve two x equals three in Z five, we multiply both sides by the inverse of two, which is three. So x is three times three, which is nine, or four. And indeed, two times four is eight, which is three. This is exactly the method we build in the next two lectures, on systems of linear equations and Gaussian elimination, and it works over every field.

One caution. A few ideas use more than the field axioms. Lengths and angles, from lecture four, need the order of the real numbers and their square roots. They have no meaning in Z five, and over the complex numbers they need a change, which we make in week twelve.

Summary

Let's summarise. A field is a set with an addition and a multiplication that obey nine axioms. Every element has a negative, and every nonzero element has an inverse, so we can subtract, and divide by anything that is not zero. From the axioms alone, zero times anything is zero, minus one times a is minus a, and a product is zero only when one of its factors is zero. So an equation a x equals b, with a not zero, has exactly one solution. The rational numbers, the real numbers and the complex numbers are fields, and the integers are not. The integers modulo n form a field exactly when n is prime, which gives finite fields such as Z two and Z five.

The vector algebra we have built works over any field, and so does the elimination method we are about to build. Before the next lecture, read section two point one of the course book, where every axiom check is written out, try the problems on sheet two, and do the lecture check on this lecture's page at Open Semester dot com. Next time, we turn to the central problem of the course, systems of linear equations, and look at them in two different pictures. See you there.

Try it

Which clocks are fields?

Hours n

Pick the number of hours n. In the table, a green ring marks the 1 in each row: that column is the inverse. Click a row to see multiplication by that number on the clock. For a field, every nonzero row must contain a 1.

Check yourself

3 questions, from warm-up to stretch

Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.

  1. Question 1 of 3 Warm-up

    Work on a clock with eleven hours, in . Compute , and .

    Hint 1 of 2

    Compute as usual, then take the remainder after dividing by . Plus moves forward on the clock, minus moves backward.

    Hint 2 of 2

    and . For , start at and take four steps back.

    Worked solution
    1. , and , so in .
    2. , and , so in .
    3. Four steps back from on the clock land on , so . Check: , which is .
  2. Question 2 of 3 Core

    Find the inverse of the complex number . Write it as with and real.

    Hint 1 of 2

    Multiply by its conjugate . The product is a positive real number.

    Hint 2 of 2

    , so .

    Worked solution
    1. The conjugate of is , and .
    2. So : and .
    3. Check: .
  3. Question 3 of 3 Stretch

    In , solve . Then: is a field?

    a field?
    Hint 1 of 2

    Find the inverse of in : which number times leaves the remainder ? For , is prime?

    Hint 2 of 2

    , which is in , so . Multiply both sides of by . And .

    Worked solution
    1. In , , so .
    2. Multiply both sides of by : , which is in . Check: , which is .
    3. is not prime, so is not a field: , which is , although and are nonzero.

Found a mistake, or something not working on this page? Report it and we'll fix it. See what we've corrected.