Quaternions, Two by Two Matrices

Two by Two Matrices

Let R be the base ring, and map the quaternions over R into the 2 by 2 matrices over R. We want a ring homomorphism, hence 0 maps to 0 and 1 maps to the identity matrix. Select images for i j and k, and the entire map is determined. Of course i j and k must map onto a quaternion group Q8 inside the ring of matrices. If this can be done, then the map is a well defined ring homomorphism.

If the images of 1, i, j, and k are R-linearly independent, then the kernel is 0, and the map is an embedding. And if R is a field, then a 4 dimensional space lives inside a 4 dimensional space, and they are equal. In other words, the two rings are isomorphic. The quaternions are the same as the 2 by 2 matrices over R.

Let's do a couple of examples. Let p = 1 mod 4. If F is a larger finite field of characteristic p, with order w, let w = 1 mod 4. Let x be the square root of -1, which we can do by quadratic reciprocity; then apply the following map.

i → [x,0|0,-x]

j → [0,1|-1,0]

k → [0,x|x,0]

Verify that this forms the quaternion group Q8, then show linear independence. Actually I find it easier to show all the matrices are spanned. Use the images of 1 and i to span matrices that are empty except for an entry in the upper left, or an entry in the lower right. That's two of the four basis elements. Do the same with the images of j and k, and you're done. When a finite set maps onto another finite set of the same size, the map is injective. Or you can use the theory of vector spaces; mapping a 4 dimensional vector space onto another 4 dimensional vector space. In any case, we have a ring isomorphism.

Next let w = 3 mod 8, so that x is the square root of -½. Again, you'll want to verify Q8, and that all matrices are spanned.

i → [0,1|-1,0]

j → [-x,x|x,x]

k → [x,x|x,-x]

Finally let w = 7 mod 8, whence x is the square root of 2. Find a and c such that a2+2c2 = -1. A technical theorem proves this is always possible. apply the following map.

i → [0,x|-1/x,0]

j → [a,2c|c,-a]

k → [cx,-ax|-a/x,-cx]

Showing all matrices are spanned is not obvious at a glance, but the image of aj+cxk = [-1,0|0,1] takes you a long way. Combine this with the identity to span the upper left and the lower right. Then combine these matrices with j to span [0,2c|c,0]. Scale this to get [0,x|x/2,0]. This is the same as the image of i iff x/2 = -1/x. Thus x2 = -2. Yet x2 = 2, and 2 and -2 are not equal mod p. All matrices are spanned, and we're good to go.

Simple Ring

The quaternions over a finite field are equivalent to the ring of 2 by 2 matrices over that same field. The latter is well understood. It is a simple ring, with no proper nonzero ideals, and left or right ideals corresponding to the subspaces of the matrix.

Determinant

Wouldn't it be lovely if the norm of a quaternion equals the determinant of the corresponding matrix? Go back to w = 1 mod 4 and take the image of a+bi+cj+dk.

a+bx c+dx
-c+dx a-bx

Find the determinant, with the help of a computer, and get a2+b2+c2+d2, which is the norm of the corresponding quaternion.

Perform similar calculations for the other two maps. The norm is the determinant, and the quaternions with norm 1 are isomorphic to the normal subgroup with determinant 1, also known as the special linear group.

Since -1 maps to -1, mod out by the common center ±1, and both quotient groups are isomorphic. The matrix group mod its center is simple, and so is the corresponding quaternion group.

We may also equate the quaternions having norm ±1 with matrices having determinant ±1; or mod out by their common center ±1 and equate the two quotient groups. This extends to all quaternions with nonzero norm; but is generally not useful beyond ±1.

Alternate Construction

Here is a map that does not depend on p mod 8. It's a bit messy, so hang on.

i → [-1,-1|2,1]

j → [v,x|y,-v]

k → [-v-y,v-x|2v+y,2x-v]

Assume xy = -(v2+1), so that j2 = -1. Also assume y = 2x-2v, so that ij = -ji. This sets k as above.

Let v be arbitrary (for now), and substitute for y in the quadratic, giving 2x2-2vx = -(v2+1). Use this, along with the earlier relations, to prove the group is Q8.

Given v, can we find x, and then y? Sometimes yes, sometimes no. The discriminant of the quadratic is -4v2-8. We can solve this whenever -v2-2 is a square. When v = 1 and p is 1 mod 3, the discriminant is -3, which is a square. So this is looking good for half the primes out there.

In general, v2 covers half the nonzero values in our finite field, along with 0. Negate this set, and subtract 2, to find a new set of the same size. This has to cover at least one square. There simply aren't enough nonsquares to accommodate a set of this size. Therefore there is a v, and an x, and a y, that implements the ring homomorphism.

What about linear independence? Subtract vi from k, giving [-y,2v-x|y,2x-2v]. The lower right is the same as y, and we can use the identity to subtract y from the upper left and lower right, giving [-2y,2v-x|y,0]. The upper right is the same as x-y. Subtract y×(i-1) from this to get [0,x|-y,0]. Add this to j, and add in v×1, and get [2v,2x|0,0]. Let's try to build another matrix with just the top row. Remember that [-2,-1|2,0] is i-1. Multiply by y and add 2×[0,x|-y,0], giving [-2y,2x-y|0,0]. Compare this with the previous top row [v,x]. Suppose -2xy = v×(2x-y). The right side is 2v2. So 2(v2+1) = 2v2, and that can't happen. The two top rows are linearly independent, and this separates the upper left and the upper right. Use the diagonal and antidiagonal matrices to isolate the lower left and lower right. Every matrix is spanned, and the map is a ring isomorphism.

The determinant calculations proceed as above. Build a quaternion a+bi+cj+dk and turn it into the following matrix.

a - b + cv - dv - dy -b + cx + dv - dx
2b + cy + 2dv + dy a + b - cv + 2dx - dv

Find the determinant, with the help of a computer, and get this.

- c2(v2+xy) - d2(v2+xy) - 2adv + 2adx - ady + 2bcv - 2bcx + bcy + a2 + b2

Apply the relationships among v, x, and y, and get a2+b2+c2+d2. Yes, the norm is the determinant, and the quaternions with norm 1 embed in the normal subgroup with determinant 1, also known as the special linear group. We already calculated the size of the quaternion group, and it agrees with the size of the matrix group. The embedding is actually onto, and the two groups are isomorphic.

Inverting the Map

If you care to invert the map, to go from matrices back to quaternions, then you only need invert the following matrix.

1 0 0 1
-1 -1 2 1
v x 2x-2v -v
v-2x v-x 2x 2x-v

The determinant is 4, which is a unit. We expected this, since the map is an isomorphism. The inverse is the following matrix, divided by 2. It is linear, which we also expect, since the inverse of a linear map is linear.

1 1 -v 2x-v
0 -2 2v-2x -2x
0 1 -x x-v
1 -1 v v-2x

The Reals

This doesn't work in the rationals, or the reals, or any field in between, or any subring thereof (such as the integers). Assume a generic matrix [a,b|c,d] squared is -1. The upper right entry tells us b(a+d) = 0. The lower left entry tells us c(a+d) = 0. Thus the matrix is diagonal, or its trace is 0. A diagonal matrix cannot have a square of -1, since -1 has no square root within the reals. So i j and k map to matrices with trace 0.

i → [a,b|c,-a]

j → [v,x|y,-v]

The upper left entry of i2 tells us bc = -(a2+1). Similarly, xy = -(v2+1).

If ij = -ji, then 2av + by + cx = 0. Write this as y = -(2av+cx)/b. Substitute this in xy = -(v2+1) and get x(2av+cx) = b(v2+1). This is a quadratic in x, with coefficients of c, 2av, and -b(v2+1). The discriminant is 4a2v2 + 4bc(v2+1). Is this a square? Divide through by 4; that doesn't matter. Replace bc with -(a2+1) and simplify, giving -a2-v2-1. This is a negative number, and cannot be a square. That rules out any subring of the reals.

Of course you could skip all this algebra and notice that the real quaternions form a division ring, while there are plenty of 2 by 2 matrices over the reals that are not invertible.

Characteristic 2

Characteristic 2 fails as well. The quaternions are abelian, but the matrices are not. Multiply [1,0|1,1] by [1,1|0,1] in either order.

Mod pk

The aforementioned isomorphism, between the ring of quaternions and the ring of 2 by 2 matrices, holds mod pk, and the norm is still the determinant.

either -1, -2, or 2 is a square mod p; let's extend this to pk. The group of units mod pk consists of two parallel cycles, one of length p-1 and one of length pk-1. Since p is odd, any index in the second can be divided by 2. By assumption, the index in the first is even, since the integer in question is a square mod p. So divide both indexes by 2 and find the square root mod pk. This is the element we called x at the top of this page.

Use x to build one of the three maps from the quaternions into the matrices. The third map, with p = 7 mod 8, is a bit more complicated. Find a and c with a2+2c2 = -1 mod p, then add an appropriate multiple of p to a to make the equation true mod p2. (This works because c can't be the square root of -1/2, so a is nonzero.) We could then add a multiple of p2 to a to make the equation true mod p3, and so on. Eventually we have the constants a c and x, and the third map can be applied. This is a ring homomorphism, and we're on our way.

Proving the map is surjective takes a little more work. Recall that I generated matrices with only one element in each of the four positions. Something like [x,0|0,0]. These span the entire ring if F is a field. But if F is not a field, these isolated elements have to be units. In the first map, 1 and i combine to isolate 2x in the upper left, with zeros elsewhere. Well x is a unit, and 2 is a unit, so that is fine. The other isolated elements, under the three maps, are units as well. The only tricky one is x/2 + 1/x in the third map. This becomes x2+2 over 2x. The denominator is a unit, and the numerator is 4, which is also a unit. So the map is onto.

The quaternion ring has size p4k, and the ring of matrices has the same size. Thus our surjective map is also injective. We have a ring isomorphism.

The algebra that equates norm and determinant is still valid, hence the norm of the quaternion equals the determinant of the corresponding matrix.

Mod n

The ring isomorphism, and the norm determinant relationship, is valid mod n. It's valid for every prime power, so apply the chinese remainder theorem, and you're done.

p-adic numbers

Let R be the ring of p-adic integers, where p is still odd. Recall that x is the square root of -1, -2, or 2. Extend x to a p-adic integer in R by hensel's second lemma.

If p = 7 mod 8, and you are given a2+2c2 = -1, keep c as an integer between 0 and p, and write a as the square root of -1-2c2. This is a valid equation mod p. We already showed the right side is nonzero, whence a is nonzero. Hensel's second lemma applies, and a expands to a root in R.

The map is a valid ring homomorphism; prove it is surjective as we did above for prime powers. The value we called x retains its first digit, its value mod p. Since this first digit is nonzero, x is a unit. And 2 and 4 are also units, so every matrix is spanned.

Suppose the map is not injective. Some nonzero quaternion leads to the zero matrix. Let F be the p-adic numbers, the fraction field of R. Extend our linear map to F. The map is still surjective, and since dimension 4 maps onto dimension 4, it is also injective. A nonzero quaternion cannot produce a zero matrix, even if its coefficients all lie in R. Thus the quaternions and the 2 by 2 matrices are isomorphic, over the p-adic integers or the p-adic numbers. In either world, the latter is the fraction field of the former.

A Slice of the p-adic Numbers

Start with the p-adic numbers and take the subring that starts with 1/p2. These are the laurent series that start two digits ahead of the units place. Then (optionally) take the quotient ring mod p3, and call the result R. An element of R is a linear combination of p2, p, 1, 1/p, and 1/p2.

Since R contains -1, -2, and 2, derive x, and build our now familiar map. In fact x, and the resulting map, are the same as those for the integers mod p3, or the p-adic integers if you didn't take the quotient ring. The fractions go along for the ride. The reverse map, inverse of the linear transformation, also consists of integers mod p3 or p-adic integers. Since the map can be reversed, it is surjective and injective, and the rings are isomorphic.