Determinants, Elementary Row Operations

Elementary Row Operations

An elementary row operation on a matrix scales a row, swaps two rows, or subtracts a scaled version of one row from another.  We've already seen what these do to the determinant.  Scaling a row scales the determinant, permuting rows negates the determinant if the permutation is odd, and row subtraction leaves the determinant unchanged.  Note that gaussian elimination uses only elementary row operations.

A matrix e is elementry if e*M performs an elementary row operation on M, or if M*e performs an elementary column operation.  The identity matrix is considered elementary; it doesn't change a thing.

Replace ej,j with x and e*M multiplies the jth row by x, while M*e multiplies the jth column by x.  The determinant of e is x, so det(e*M) = det(e)×det(M).

To save time, we can replace all the diagonal elements with scaling factors, and scale all the rows at once.  The determinant of M is multiplied by all the scaling factors, which is det(e).

Let e be a permutation matrix if it contains exactly one 1 in each row and column.  Write down the column numbers in the order they are used, and you get a permutation on the numbers 1 through n.  This permutation is applied to the rows or columns in e*M and M*e respectively.  Note that det2(e) is -1 for an odd permutation, and 1 for an even permutation.  Meanwhile, the determinant of M is multiplied by -1 when an odd permutation is applied to its rows or columns.  Thus det(e*M) = det(e)×det(M).

Finally, e could have ones down the main diagonal and x somewhere else.  Now e*M adds x times one row to another.  Note that e is a triangular matrix; its determinant is 1.  Thus det(e*M) = det(e)×det(M).

The Determinant of the Product of two Matrices

And now, the reason for all these elementary row operations.  We would like to prove that det(AB) = det(A)×det(B), for any two matrices A and B.

To start, assume B is a singular matrix, with determinant 0.  In other words, the vectors of B do not span the entire space.  If A is another matrix, each row in A*B is a linear combination of the rows of B.  The space spanned by A*B is also spanned by B.  This is a proper subspace, not the entire space, hence A*B is singular and its determinant is 0.

Next assume B is nonsingular, hence it has a nonzero determinant.  Premultiply B by a series of elementary matrices that perform the elementary operations associated with gaussian elimination.  Thus t = e1e2e3e4…ejB, where t is the upper triangular matrix that results from gaussian elimination.  Since the determinant is nonzero, the main diagonal of t contains all nonzero entries.

Premultiply t by yet more elementary matrices to perform back substitution.  In other words, scaled versions of the bottom row are subtracted from all the others, clearing out the last column.  Then the second to last column is cleared, and so on, until a diagonal matrix is left.  Write this as d = e1e2e3…ejB, where d is the diagonal matrix.  The determinant of d is the determinant of B times the determinants of the elementary matrices.  Of course most of these determinants are 1, except for the matrices that swap two rows.

Verify that every elementary matrix has an inverse, and let fi be the inverse of ei.  These inverses are also elementary matrices, hence det(fi*M) = det(fi)×det(M).  Now B = f1f2f3…fjd.  Replace A*B with A times a bunch of elementary matrices times d, and fold each elementary matrix into A, one at a time.  Each time the determinant commutes with multiplication.  This also holds for d.  When everything is multiplied together, det(A*B) = det(A)×det(B).

For any two matrices A and B, the determinant of the product is the product of the determinants.  Restrict attention to nonsingular matrices, and the determinant implements a group homomorphism into the base ring.

Zero Divisors

The above proof, which is standard in linear algebra textbooks, is somewhat unsatisfying, because the base ring has to be a field, or at least an integral domain that you can embed in a field.  This is necessary for gaussian elimination to work properly, using elementary row operations.  What if the base ring has zero divisors?  Isn't there a more direct proof?

There is, but it's technical, and very messy.  Consider det2 of C = A*B.  There are n factorial terms, and if each term appears exactly once in det(A)*det(B), we're all right.  I'm going to consider the first term in det(C), and the others should follow along by example.

Take the product of the elements on the main diagonal of C.  This is the first term in det(C).  The element in the upper left is the dot product of the first row of A with the first column of B.  The next element is the dot product of the second row of A with the second column of B, and so on.  The product of these n dot products expands into quite a few terms.  Let's have a look at one term in the expansion.

Choose a sequence of n integers between 1 and n.  There are nn possible sequences; I'm just going to choose one for illustration.  Say 5 3 4 1 2 (if n = 5).  I'm going to concentrate on sequences where numbers are not repeated, i.e. permutation sequences.  We'll deal with sequences like 5 2 2 1 1 later, because they are indeed part of det(C).  But for now, 5 3 4 1 2 creates the following subterm, inside the first term of det(C).

A1,5B5,1 A2,3B3,2 A3,4B4,3 A4,1B1,4 A5,2B2,5

Group the A's and B's together.  This becomes a term from det(A) times a term from det(B).  Both terms represent even or odd permutations.  Thus both terms have the same sign, and the product is positive, as it should be, coming from the main diagonal of C.

Another term in det(C) multiplies the first three diagonal elements by C4,5 and C5,4.  This is an odd permutation - everything is subtracted.  Pick the same sequence 5 3 4 1 2, and find a term in det(A) times a term in det(B).

A1,5B5,1 A2,3B3,2 A3,4B4,3 A4,1B1,5 A5,2B2,4

Looking inside det(A) and det(B), one permutation is even while the other is odd.  The product is negated, as we expect from this particular permutation of C.

Is each term from det(A), times each term from det(B), used once and only once?  Given a term from det(A), and a term from det(B), we need to reverse engineer the two sequences - the two permutations.  One permutation describes the term from det(C), and the other is the magic numbers we use to find a subterm within the expansion of this term.  The second permutation is established first, by looking at the term in det(A).  This permutation is joined to the term of det(B), and the result is the permutation that arranges rows and columns in det(C).  I can't spell it all out here; it just works out.

What about a sequence that is not a permutation, like 5 3 4 1 1?  Apply this to the two terms in det(C) described above, going down the main diagonal, and C1,1C2,2C3,3C4,5C5,4.  We get the following two expressions.

A1,5B5,1 A2,3B3,2 A3,4B4,3 A4,1B1,4 A5,1B1,5

A1,5B5,1 A2,3B3,2 A3,4B4,3 A4,1B1,5 A5,1B1,4

These are equivalent, thanks to the properties of multiplication; yet they have opposite parity in det(C), so they drop out.  A sequence like 5 3 1 1 1 produces 6 equivalent expressions, 3 positive and 3 negative.  Yes indeed, all the sequences that aren't permutations lead to 0.

That completes the outline of the proof.  It's just brute force algebra; perhaps you can fill in the details.  I checked it with a symbolic math package for n = 1 2 and 3.  The latter entails 18 variables, building two 3×3 matrices.  Here s is the product of determinants, and t is the determinant of the product.  Sure enough, the expressions are identical.


s="a*e*i+b*f*g+c*d*h-a*f*h-b*d*i-c*e*g" * "j*n*r+k*o*p+l*m*q-j*o*q-k*m*r-l*n*p"
t="a*j+b*m+c*p"*"d*k+e*n+f*q"*"g*l+h*o+i*r"
t=t+"a*k+b*n+c*q"*"d*l+e*o+f*r"*"g*j+h*m+i*p"
t=t+"a*l+b*o+c*r"*"d*j+e*m+f*p"*"g*k+h*n+i*q"
t=t-"a*l+b*o+c*r"*"d*k+e*n+f*q"*"g*j+h*m+i*p"
t=t-"a*k+b*n+c*q"*"d*j+e*m+f*p"*"g*l+h*o+i*r"
t=t-"a*j+b*m+c*p"*"d*l+e*o+f*r"*"g*k+h*n+i*q"
s-t