Epistemic Status: evergreen tree Evergreen


A note on terminology

Non-Commutative Algebra might not be the right term for this. It made sense to me at the time.

I’m writing this post mostly for myself, since I know it will come up again sometime in the future, and I’ll save myself some time later by having it.

Recently at work, I was working on a project that ended up involving transformations of 3D orientations, and we’re mostly using quaternions to represent them. In some places we’re using transformation matrices. I was struggling to understand how to rearrange some of the equations we were working with, and it all came down to not understanding how to deal with non-commutative operations, i.e. operations where abbaab \neq ba.

After thinking about it a little bit and realizing this is really an abstract algebra question, it doesn’t matter what the underlying group is, I consulted my copy of A Book of Abstract Algebra.

Some basic group theory

In chapter 3 we’re given a basic definition of a group.

By a group we mean a set GG with an operation \cdot which satisfies the axioms:

  • (G1) The operator \cdot is associative, i.e. a(bc)=(ab)ca \cdot (b \cdot c) = (a \cdot b) \cdot c
  • (G2) There is an element ee in GG such that ae=aa \cdot e = a and ea=ae \cdot a = a for every element aa in GG
  • (G3) For every element aa in GG, there is an element a1a^{-1} in GG such that aa1=ea \cdot a^{-1} = e and a1a=ea^{-1} \cdot a = e.

Usually, this operator is referred to as multiplication but we have to remember that these sets and operators may not be numbers and multiplication. They just have to be sets of things that follow these rules. They could be complex things like matrices and quaternions, or even more exotic things.

Critically, in the definition of a group, the operator \cdot is not commutative. This describes things like matrix multiplication, and quaternion multiplication, which are both non-commutative.

Where I was getting tripped up was understanding how you can move things from one side of an equation to the other when the operator is non-commutative. Chapter 4 provides some answers. It explains the cancellation law using the inverse of the operator, denoted as a1a^{-1}.

First it provides this theorem:

Theorem 1 If GG is a group and aa, bb, and cc are elements of GG, then
(i) ab=acab = ac implies b=cb = c and
(ii) ba=caba = ca implies b=cb = c

Then the proof:

Suppose ab=acab = ac
Then

a1(ab)=a1(ac)(a1a)b=(a1a)cby the associative law, from G1eb=ecby the cancellation law, from G3b=cby the identity law, from G2\begin{align*} a^{-1}(ab) &= a^{-1}(ac) \\ (a^{-1}a)b &= (a^{-1}a)c && \text{by the associative law, from G1} \\ eb &= ec && \text{by the cancellation law, from G3} \\ b &= c && \text{by the identity law, from G2} \\ \end{align*}

Part (ii) is proved analogously.

In general, we cannot cancel aa in the equation ab=caab = ca.

This gave me some of the answers, but not all of them. The important thing to note here is that left-multiplication is canceled by multiplying by the inverse on the left and the same for right-multiplication. What you cannot do is cancel left-multiplication with right-multiplication by the inverse, or vise-versa.

Generalizing to moving terms around

I don’t necessarily want to cancel things out. I just want to be able to move terms around. We just have to remember that left-multiplication is not the same as right-multiplication and not mix them up.

Suppose I take the equation ab=caab = ca and I want to isolate bb, I can do the following.

ab=ca(a1)ab=(a1)caleft-multiply by the inverse(a1a)b=a1cafrom G1eb=a1cafrom G3b=a1cafrom G2\begin{align*} ab &= ca \\ (a^{-1})ab &= (a^{-1})ca && \text{left-multiply by the inverse} \\ (a^{-1}a)b &= a^{-1}ca && \text{from G1} \\ eb &= a^{-1}ca && \text{from G3} \\ b &= a^{-1}ca && \text{from G2} \\ \end{align*}

We could also right-multiply in the first step and end up with a similar result.

We can’t simplify the right any further because multiplication in this group is non-commutative. We can’t get the a1a^{-1} and aa to cancel because cc is stuck in the middle.

More details on dealing with inverses

The above should be enough for most things, but there are a few more things from Chapter 4 that are helpful to remember.

Theorem 2 *The proof is left as an exercise for the reader. gives us a nice definition of inverses.

Theorem 2 if GG is a group and aa and bb are elements of GG, then
ab=eab = e implies a=b1a = b^{-1} and b=a1b = a^{-1}

Then Theorem 3 gives us some nice information for computing inverses.

Theorem 3 If GG is a group and aa and bb are elements of GG, then
(i) (ab)1=b1a1(ab)^{-1} = b^{-1}a^{-1} and
(ii) (a1)1=a(a^{-1})^{-1} = a

The proof of (i) is as follows by showing that (ab)(b1a1)=e(ab)(b^{-1}a^{-1}) = e:

(ab)(b1a1)=a[(bb1)a1]from G1=a[ea1]from G3=aa1from G2=e\begin{align*} (ab)(b^{-1}a^{-1}) &= a[(bb^{-1})a^{-1}] && \text{from G1} \\ &= a[ea^{-1}] && \text{from G3} \\ &= aa^{-1} && \text{from G2} \\ &= e \\ \end{align*}

Since the product of abab and b1a1b^{-1}a^{-1} is equal to ee, it follows by Theorem 2 that they are each other’s inverses. Thus, (ab)1=b1a1(ab)^{-1} = b^{-1}a^{-1}.

Through associativity this generalizes to:

(a1a2an)1=an1a21a11\begin{align*} (a_1 a_2 \cdots a_n)^{-1} = a_n^{-1} \cdots a_2^{-1} a_1^{-1} \end{align*}

That is, the inverse of a product is the product of the inverses in reverse order. This can be useful for quickly rearranging an equation.

If you liked this post, you might also like to read my other post about abstract algebra.