When I learned abstract algebra, we very nearly skipped over rings. Basically, we
spent a ton of time talking about groups; then we talked about rings pretty much as a
stepping stone to fields. Since then, I've learned more about rings, in the context of
category theory. I'm going to follow the order in which I learned things, and move on
to fields. From fields, I'll jump back a bit into some category theory, and look at
the category theoretic views of the structures of abstract algebra.
My reasoning is that I find that you need to acquire some understanding of what
the basic objects and morphisms mean, before the category theoretic view makes any
sense. Once you understand the basic concepts of abstract algebra, category theory
becomes very useful for understanding how things fit together. Many complicated things become clear in terms of category theoretic descriptions and structures - but first, you need to understand what the elements of those structures mean.
We started with groups. Groups describe a set of values with an operation with useful algebraic properties. It's a very abstract version of something with minimal
number-like behavior. From there, we moved on to rings. Rings add a second operation, with constraints on the relationship between the two operations, and by doing so,
creates an abstraction that models some of the most basic concepts of the integers. Our next step is fields, which add a few more properties to rings, and as a result, create an abstraction that describes things that behave like the real numbers.
A field is really quite simple. First, it's a ring, (R,+,×). In addition to
the standard ring properties, the × operator must be commutative, and the
identity values for + and × must be distict - that is,
1R≠0R. That gives you a non-trivial commutative
ring. Then you add one more property: for every value r∈R except 0
(where 0 is the additive identity), there is a multiplicative inverse value
r-1∈R such that r×r-1=1 (where 1 is the
Fields are fascinating things. There are a huge number of fascinating fields; I could spend a year doing nothing but writing about interesting sets of values that can form interesting fields. For now, I'll run through a quick list of interesting ones, including my own favorite, the nimbers.
First, there's the obvious ones:
- The set of rational numbers is, fairly obviously, a field with
standard addition and multiplication.
- The set of real numbers is a field, again with standard operations.
- The set of Complex numbers is a field, with standard complex operations.
Then there's some slightly less obvious, but still pretty obvious ones:
- The set of computable numbers is a field.
- If P is a prime number, then the set of integers from 0 to P-1 are a field,
using standard modulo arithmetic operations.
- The surreal numbers are a field - in fact, a super-field of the Reals.
- If you allow the collection of values in a field to be a proper class, then the nimbers are a field. (more in a minute)
There are some suprising ones, but they take a bit of work to explain, so I'll delay that for another post. To give you a sense for how something can behave very much like a number, and yet behave very counterintuitively, we can look at my favorite
warped type of number: the nimber. Nimbers were written about fairly extensively by John Conway in his book on the Surreal numbers. They're basically what you get from
building surreals with only one set, rather than a pair of sets, and then try to build a field around the result. They're quite cute. I did some fairly detailed writing about them a while ago; you can go read that for details.
The basic idea of the nimbers is to use an ordinal construction process. So you take the set of ordinal numbers, and associate them with construction steps. At ordinal 0, you have nothing but the empty set. So you call that the value 0. At ordinal 1, you've got nothing but 0 to work with, so you define the number 1 as the set containing 0. You can continue to construct numbers, where each number is produced at some ordinal. Each new ordinal introduces the next largest number
that can't be produced as the sum of any numbers produced by previous ordinal steps. So ordinal step 2 gives us 2, and also 2+1=3. .
What's odd about the nimbers is that there are no negative numbers. So what's the additive inverse of 1? Itself! What's the additive inverse of 2? 2!
This makes for some very interesting arithmetic. In nimbers, 15+6=9, 15+9=6, and 15+16=31. Howzat?
In nimbers, to add, you decompose nimbers into binary expansions, cancel repeated terms, and sum-up whatever's left. So looking back at those examples, 15 = 8+4+2+1,
and 6=4+2, so 15+6=8+4+2+1+4+2; re-order that, and you get 8+4+4+2+2+1; cancel pairs, giving 8+1=9. For 15+16, 16=16, 15=8+4+2+1; there are no repeated terms, so
we just add 'em up.
Multiplication also relies on a sort of binary expansion; but instead of
expanding in powers of 2, you expand in fermat 2-powers (numbers of the form 222...). If you use the fermat 2-power expansions, combined with the fact that multiplication is distributive over addition, you can define nimber multiplication relatively easily, once you know that
in number multiplication, the nimber product of any pair of fermat 2-powers (numbers of the form 222n) is their normal product; the nimber product of a fermat 2-power n with itself (the nimber square of n) is 3n/2 . Combine that with distributivity of addition, and you can
work out nimber products.
For example, suppose we wanted to multiply 6×2. The first Fermat powers
are 2 and 4 (220 and 221). So
we can break 6×2 = (4+2)×2 = 4×2 + 2×2 = 8 + 3×2/2 = 8+3 = 11.
For a more interesting example, try 12 × 5:
- 12=3×4; 5 = 4+1. So 12×5 = (3×4)×(4+1)
- Distributing, we get 3×4×4 + 3×4×1.
- Now, let's focus on the term 3×4×4:
- 3×4×4 = 3×((3/2)*4)
- That reduces to 3×6 = (2+1)×6
- Distributing, that gives us = 2×6 + 6
- Decomposing 6, that gives us = 2×(4+2) + (4+2)
- Distributing again, 2×4 + 2×2 + (4+2)
- Doing the multiplications on the Fermat 2-powers,
we get 8 + 3 + 4 + 2 = 8 + 2 + 1 + 4 + 2 = 13.
- Now, the term 3×4 = (2+1)×4 = 2×4 + 1×4 = 8 + 4 = 12.
- Putting the two solved subterms together, we get 13 + 12 = 1.
So 12×5 = 13 + 12 = 8 + 4 + 1 + 8 + 4 = 1. So 12 is the multiplicative inverse of 5!
The multiplicative inverse of nimbers in just plain weird. It exists, but it's pretty counterintuitive. Basically, given a nimber n, the multiplicative
inverse of n is the first-born nimber not in the set S, where 0 ∈ S, and if 0<n'<n, and m∈S, then (1+(n'-n)×m)/n' ∈ S. That's
a mess to understand; the easiest way to get a grip on it is to just work out
a multiplication table of nimbers. (I'll probably toss together a nimber implementation over the weekend and post it here for you to play with.) If you
work it out, you can find, for example, that 3 and 2 are multiplicative inverses, 4 and 15, and and 8 and 10 are multiplicative inverses. Not what you might expect at all! But it works, and satisfies all of the field definitions.
Nimbers aren't particularly important, but they're fun. They give you an interesting sense of how a definition that really seems to point towards numbers as
we generally understand them can be easily used to produce something that looks
sort of pathological and distinctly un-numberish.
In later posts, we'll see some of the interesting things that you can do with fields.