# Exterior Algebra Notes #1: Matrices and Determinants

*(This is not really an intro to the subject. I don’t have an audience in mind for this. It’s notes that have been dressed up as a blog post, which may be useful if you’re trying to understand this stuff.)*

*(Vector spaces are assumed to be finite-dimensional and over with the standard inner product)*

Exterior algebra (also known as ‘multilinear algebra’, which is perhaps the better name) is a pretty technical subject. It’s used in advanced mathematics, mostly abstract algebra and differential geometry, and comes up in physics a lot, often in disguise.

I happen to think it deserves to be *far* more commonplace, because it turns out to take a lot of the mysteriousness out of the otherwise technical and tedious subject of linear algebra, and it’s actually used all over the place; it’s just not so easy to tell that right now.

I study mathematics for fun, and am not sure if there’s any particular goal to it – but in general I’m drawn to whatever makes computation and intuition simple, and this is it. In college I learned about determinants and matrix inverses and never really understood how they work; they were impressive constructions that I memorized and then mostly forgot. Exterior Algebra turns out to make them into simple intuitive procedures that you could rederive whenever you wanted.

This stuff took me a long time to understand, so I’ve written up a lot of notes explaining it to myself. Maybe it will save you time.

## 1. An example problem

Suppose: you’re writing a computer graphics library. You want to draw a bunch of objects lit up by the sun, which is in a fixed direction in the sky. Each surface will be drawn with a brightness based on the angle it makes with the light – because a surface that is pointed directly at the sun should be much brighter than one which is at an angle, right?

To represent the angle each surface faces, you store the *unit normal vector* , which points out of the surface. The formula for the brightness scaling factor of that surface is given by the dot product of the normal with the direction of the sun:

And this works fine, at first.

But eventually you want your object to be rotated, say, so you end up transforming its coordinates several times before doing this calculation. You store the transformation as a matrix , so a vertex transforms as . When it comes time to compute how the *normals* transform in the lighting calculation, you go with the obvious choice: . But nothing looks right – every surface is the wrong brightness. You’re confused. You give up and search online and find something like this:

There is one problem which I don’t know how to show directly so I’m going to show it in a diagram. We’re multiplying the normal by the u_world matrix to re-orient the normals. What happens if we scale the world matrix? It turns out we get the wrong normals.

…

I’ve never bothered to understand the solution but it turns out you can get the inverse of the world matrix, transpose it, which means swap the columns for rows, and use that instead and you’ll get the right answer.

And at that point you either shrug and say “alright” and compute … or you quit learning computer graphics entirely and go learn about exterior algebra. That’s what I did. Turns out it’s a deep rabbit hole.

There are other sources where you can learn all about bivectors and multivectors and everything else. I mention this to say that this stuff isn’t just abstract elegant nonsense; it’s got actual implications if you vector math in real life. Actually, I think it’s more far-reaching and important than, well, anyone seems to think it is, which is why I’m writing about it, but we’ll get back to that later.

The answer, by the way, is that a normal vector that we store as is actually bivector, since it represents a unit of area. We’re just storing it as a vector. Its true value is

Bivectors created from elements of are elements of a vector space called , which is spanned by . If vectors are transformed by a matrix , then bivectors transform according to a matrix called , which maps and is defined by the property:

and likewise for and . Applying this to :

And it turns out that, for instance, . We’ll get to that in a later post. (We need the fact that , plus that since it’s a rotation matrix.)

For a more concrete example of how this works, suppose our is the matrix which takes and leaves the other directions unchanged. The surface normal of an plane would naively be if you were only using vectors, and so would have , but that’s clearly wrong: only affects and does not transform the plane at all. The surface normal is actually , which is preserved by because .

It so happens that in , (if you treat your bivectors as vectors), which is how the computer graphics people get away with it.

## 2. Multivector Matrices

Here are some notes about how linear transformations work on multivectors, because it took me a while to understand this and I had to write it out.

Some useful notation for multivectors:

A multivector’s components are indexed by the basis elements of the space it lives in, so, just as a vector has a component, a bivector has a component. You could ask for the component, but that would be redundant, like asking for .

Note that the orderings of basis multivectors like vs are arbitrary. It’s convenient to use to use as a basis for , but the math doesn’t care – different orderings are a basis change away. Same as how you’re free to use as the basis of , if you want.

I like to use *multi-indexes* to refer to multivector components, which are labeled with capital letters like and refer to tuples: (usually it’s obvious what is). means:

I like to abbreviate multi-indexes with just their digits, so might be

### 2.1 Linear Transformations on

Suppose we have a linear transformation . For any , also generates as a linear transformation , which we write as (some people write it as ):

It’s defined by its action on any vector :

Since is just a linear transformation, we can write it out as a matrix. If and , then and , so is an matrix.

The key insight for understanding matrices such as is that they are *just matrices*, albeit in a different vector space (), and all of the usual matrix knowledge applies.

Each column of is the action of on a particular -vector, which results in a linear combination of -vectors. It does not matter what order we write the columns in.

Important special cases:

- is just .
- If , then . That is, it’s the
**determinant**of , except considered as a linear transformation from , meaning that it has basis vectors attached rather than being a dimensionless scalar.- The scalar value is the coefficient of
- Sometimes it’s useful to write the coefficient as a trace:
- is a linear transformation between
*volumes*of to volumes of . - Most of the properties of follow directly from this interpretation. (eg: non-linearly-independent matrix degenerate volume 0 determinant; composition of transformations multiplicativity of determinants.)

- If then is (almost) the adjugate matrix of , except that it is written in the basis, and is almost , except that it is written in the basis – more on that in a later post.
- It’s useful to define as .

**Example:**

Consider the sloped rectangle in formed by the points . Two of its sides are given by and , and its area is a bivector:

It’s a linear combination of some area on the and planes. Its total scalar area can be computed by taking the magnitude of this bivector (), which shows how areas and -volumes in general obey a version of the Pythagorean theorem (more on that in the next post).

Suppose

Its action on is:

We see that does not multiply by a scalar, but rather takes it to .

### 2.2 Multivector Matrices

In this section let . Then:

Let’s write out componentwise. It’s a matrix: it has three columns and each of those is a bivector with three components.

To keep track of rows and columns I am going to use superscripts for column indexes and subscripts for row indexes. So, as you will, as you go down a column, the upper index changes but the lower index stays the same.

Here’s the column of :

Here’s the row of :

With a regular matrix we can extract components by contracting with a basis vector on each side; for instance . We can do the same here:

Each component of is the determinant of a minor of : the minor created by the columns and the rows (possible with a minus sign, depending on the permutations of your bases). I prefer this notation because it emphasizes exactly the meaning of that value: that it is a component of the matrix .

Minors on the diagonal are called principle minors. The diagonal elements of are the determinants of these. For instance:

Note that we can take expand a matrix in its columns or rows first and get the same answer. Also note that in general, , at least in finite dimensional spaces (I think?), so we can compute either of . Either way you end up with coordinates on each of the pairs of the basis vectors.

This notation gets pretty confusing. I propose that we allow ourselves to just write when we mean . It’s smoothe. Here’s a summary:

### 2.3 Maps between spaces with different dimensions

If is a map between two vector spaces with different dimensions, we can still talk about . Intuitively, this is a linear transformation which maps areas (or -volumes) in one space to areas (-volumes) in the other, and there’s no requirement that they have the same dimension for that to make sense.

If and and , then, as mentioned above, can be written as a matrix.

Suppose , and we label the by basis vectors . Then:

Concretely:

No matter what, is a map between , and if or then one of those spaces is zero-dimensional and is just 0. In the case above, .

Note that if the spaces don’t have the same dimension, then there’s no concept of a scalar ‘determinant’ to linear transformations between them.

(Technically there is nothing stopping us from discussing a linear transformation which maps, like, areas in one space to volumes in another. But those are not going to be common – they are not geometrically ‘natural’. I have only ever come across maps from -vectors to -vectors.)

Other articles related to Exterior Algebra: