Lecture 34 · Week 9· 22:29
The determinant defined
Permutations, sign, the Leibniz formula, multilinearity.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Today: one formula for every size
Welcome back. In the last lecture we met the determinant of a two by two matrix: the matrix with the first row a, b, and the second row c, d, has determinant a d minus b c. It is the signed area of the parallelogram spanned by the columns, and its sign records the orientation. Look at the two products in this formula. a d takes one entry from each row, and one from each column. So does b c. The formula is a sum of such products, each with a sign. Today we turn this observation into a definition, for square matrices of every size, with entries in any field F. Geometry cannot guide us in dimension ten, or over the field Z two.
Without pictures, today is more abstract than most lectures: we build the tools and prove that they work. From the next lecture on, we use them on examples and problems, and that is where they become concrete. The plan. First permutations, then the sign of a permutation, then the Leibniz formula, which defines the determinant. Finally, two properties: it is linear in each row, and it is alternating. Together they pin it down.
Permutations
A permutation of the numbers one up to n is a bijection from this set to itself: a map that is one to one and onto, as in lecture thirty. The set of all permutations of one up to n is written S n. We can write a permutation sigma in two lines: the numbers one up to n on top, and below each number i, its image sigma of i. For example, this sigma sends one to two, two to three, and three to one. We can also draw it. Put the numbers in a row at the top and again at the bottom, and draw a string from each i at the top down to sigma of i at the bottom. Since sigma is a bijection, every bottom number receives exactly one string.
Permutations can be composed. Sigma after tau, written sigma tau, first applies tau, then sigma. As a composition of bijections it is again a bijection, so it lies in S n. In the picture we stack the diagram of tau on top of the diagram of sigma, and follow each string down. Here tau swaps one and two, and sigma is the permutation we just drew. Following the strings, one goes to two and then to three, two goes to one and then to two, and three stays at three and then goes to one. So sigma tau sends one to three, two to two, and three to one. The identity permutation leaves every number where it is, and every permutation sigma has an inverse, sigma inverse, which undoes it. In the picture, sigma inverse is the diagram of sigma turned upside down.
How many permutations are there? For sigma of one there are n choices. Sigma of two must differ from it, which leaves n minus one choices. Then n minus two for sigma of three, and so on, down to one choice for sigma of n. So S n has n factorial elements. For three numbers, that is three factorial, which is six. Here are all six permutations of S three, each written in one line by its bottom row. The simplest permutations swap two numbers. For k different from l, the transposition k l swaps k and l and leaves every other number where it is. In the diagram, two strings cross, and all the others go straight down.
The sign of a permutation
Each permutation has a sign, plus one or minus one. To define it, we count the pairs that sigma puts out of order. An inversion of sigma is a pair of positions i less than j with sigma of i greater than sigma of j. The sign of sigma is minus one to the power of the number of inversions. We call sigma even if its sign is plus one, and odd if its sign is minus one. In the string diagram, two strings starting at i less than j cross exactly when their ends are in the opposite order, that is, when sigma of i is greater than sigma of j. So the number of inversions is the number of crossings.
Here is S three. The identity has no crossings, so its sign is plus one. The three transpositions each have an odd number of crossings, one or three, so they are odd. The two remaining permutations, which move all three numbers around a circle, have two crossings each, so they are even. To prove that signs multiply, we first write the sign as a product of fractions: the sign of sigma is the product, over all pairs i less than j, of sigma of j minus sigma of i, divided by j minus i. For the sigma we drew, the three pairs give three minus two over two minus one, then one minus two over three minus one, then one minus three over three minus two. The product is one times minus one times minus two, over one times two times one, which is one. The two negative fractions belong to the two inversions.
Here is why the formula holds. Since sigma is a bijection, it sends the pairs of positions to the pairs of values, each pair exactly once. So the numerators are the same differences as the denominators, up to sign, and the absolute value of the product is one. A fraction is negative exactly when sigma of j is less than sigma of i: that is, exactly when the pair is an inversion. So the product is minus one to the number of inversions, which is the sign of sigma. Next, the key theorem about signs. For all permutations sigma and tau in S n, the sign of sigma tau is the sign of sigma times the sign of tau. This proof is demanding, so take it slowly, and pause or rewatch it if you need to.
Write the sign of sigma tau as a product of fractions, and multiply each fraction above and below by tau of j minus tau of i, which is not zero. Each fraction splits into two: sigma of tau of j, minus sigma of tau of i, over tau of j minus tau of i; times tau of j minus tau of i, over j minus i. The second factors multiply to the sign of tau. In the first factors, put k equal to tau of i, and l equal to tau of j. The fraction sigma of l minus sigma of k, over l minus k, does not change when k and l are swapped, so it depends only on the pair k l. And as i j runs through all pairs once, so does k l, because tau is a bijection. So the first factors multiply to the sign of sigma, and the sign of sigma tau is the sign of sigma times the sign of tau.
Three consequences. First, the identity has no inversions, so its sign is one. Second, every transposition is odd. Take k less than l. The pair k l is an inversion, and for each m between k and l, both the pair k m and the pair m l are inversions. No other pair is: a pair without k or l keeps its order, since those numbers stay put, and so does a pair of k or l with a number outside the range from k to l. That makes one plus twice the number of m's in between: an odd number. Here is the transposition two five in S five. The pair two five crosses, and so do the pairs two three, two four, three five, and four five. That is five crossings, one plus twice two.
Third, sigma times sigma inverse is the identity, so the sign of sigma times the sign of sigma inverse is one. Both signs are plus or minus one, so they are equal: a permutation and its inverse have the same sign.
The Leibniz formula
Now the definition. Let A be an n by n matrix over a field F, with entries a i j. The determinant of A is the sum, over all permutations sigma in S n, of the sign of sigma, times a one sigma of one, times a two sigma of two, and so on, up to a n sigma of n. Each term picks, in row i, the entry in column sigma of i. Since sigma is a bijection, every column is used exactly once: one entry from each row and each column. The sign of sigma decides whether the product is added or subtracted. In the field F, plus one and minus one are the field's one and minus one. For a one by one matrix, the determinant is the single entry. For n equal to two, S two has two permutations. The identity gives plus a one one times a two two. The transposition one two is odd, and gives minus a one two times a two one. This is a d minus b c, the formula of lecture thirty three.
For n equal to three, the six permutations give six terms. The three even permutations give plus signs, starting with a one one a two two a three three. The three transpositions give minus signs, starting with a one one a two three a three two. Let's compute one example. The matrix A has the first row one, two, three, the second row zero, four, five, and the third row one, zero, six. We go through the six terms in the same order. The identity gives one times four times six, which is twenty four. The next even permutation gives two times five times one, which is ten. The last even one gives three times zero times zero, which is zero.
The transpositions: one times five times zero is zero, two times zero times six is zero, and three times four times one is twelve, and these three are subtracted. So the determinant of A is twenty four plus ten plus zero, minus zero, minus zero, minus twelve, which is twenty two. The formula has n factorial terms. For a four by four matrix that is twenty four, and for a ten by ten matrix more than three and a half million. So the Leibniz formula is a definition, not a method. In lecture thirty five we compute determinants by row reduction, using the facts from today.
Try it yourself
You can try this yourself, on this lecture's page at opensemester.com. On the left is the matrix A of our example, and on the right the string diagram of a permutation. The boxed entries are the ones it picks: one in every row and every column. It starts with the identity, with no crossings. Its term is plus one times four times six, which is twenty four. Now tap two and three on the bottom row to swap where their strings end. The strings cross once, so the sign flips. The term is minus one times five times zero, which is zero.
Keep swapping until you have found all six permutations. The terms add up to twenty two, the determinant we computed. Then try a four by four matrix, with its twenty four terms.
Two consequences of Leibniz
Some determinants can be read off at once. A square matrix is triangular if all its entries below the diagonal are zero, or all its entries above the diagonal are zero, as in lecture fifteen. If A is triangular, its determinant is the product of the diagonal entries. In particular, the determinant of the identity matrix is one. Here is the proof. Take a permutation sigma other than the identity. The numbers sigma of one up to sigma of n are the numbers one up to n in another order, so they have the same sum. If sigma of i were at least i for every i, then all these inequalities would be equalities, and sigma would be the identity. So some sigma of i is less than i, and in the same way, some sigma of j is greater than j. The term of sigma contains the entry a i sigma of i, which lies below the diagonal, and the entry a j sigma of j, which lies above it. One of them is zero, so the whole term is zero. Only the identity is left, and its term is the product of the diagonal entries, with sign plus one.
Next, the transpose. For every square matrix A, the determinant of A transpose equals the determinant of A. The proof reorganises the sum, so take it slowly. The entry in row i and column j of A transpose is a j i. So the term of sigma for A transpose is the sign of sigma, times a sigma of one one, times and so on, up to a sigma of n n. Its factors are entries a sigma of j j: the column is j, and the row is sigma of j. Reorder these factors by their rows. Put i equal to sigma of j; then j is sigma inverse of i. Multiplication in F is commutative, so the product is a one sigma inverse of one, times and so on, up to a n sigma inverse of n. And the sign of sigma equals the sign of sigma inverse.
So the term of sigma for A transpose is the term of sigma inverse for A. As sigma runs through S n, its inverse also runs through S n, each permutation exactly once, because the inverse of sigma inverse is sigma. So the two sums have the same terms, and the determinants are equal.
Linear in each row
The first key property. Write A by its rows, r one up to r n. Fix all rows except row i. Then the determinant is a linear function of row i: if row i is b times u plus c times w, then the determinant is b times the determinant with u in row i, plus c times the determinant with w in row i. We say that the determinant is multilinear in the rows: linear in each row, when the other rows are held fixed. The proof looks at one term. The term of sigma contains exactly one entry from row i, namely the entry in column sigma of i, which is b times the entry of u, plus c times the entry of w. Multiplying out, the term of sigma for A is b times the term of sigma with u in row i, plus c times the term of sigma with w in row i. Summing over all sigma gives the theorem.
For example, the matrix with the first row two, four, and the second row one, three, has determinant two times three minus four times one, which is two. Its first row is two times the row one, two, and the matrix with that row has determinant three minus two, which is one. Indeed, two is two times one. Two quick consequences. If a row of A is zero, then the determinant is zero: the zero row is zero times itself, so the determinant is zero times a determinant. And scaling the whole matrix by c scales each of the n rows by c, so the determinant of c A is c to the n times the determinant of A. Careful: multilinear does not mean linear in the whole matrix. The identity matrix of size two has determinant one, but the identity plus the identity has determinant four, not two. In general, the determinant of A plus B is not the determinant of A plus the determinant of B.
In the plane, linearity has a picture. By the transpose theorem, the determinant is also linear in each column, and the columns span the parallelogram. Keep the column v fixed as the base. The area is the base times the height. The height of u plus u prime above the line of v is the height of u plus the height of u prime, so the area for u plus u prime is the sum of the two areas.
Alternating
The second key property. Let A be a square matrix. First, if two rows of A are equal, then the determinant of A is zero. Second, if B is obtained from A by swapping two rows, then the determinant of B is minus the determinant of A. We say that the determinant is alternating. The proof of the first part pairs the terms off. It is demanding, so take it slowly. Say rows k and l of A are equal, with k less than l, and let tau be the transposition k l. For every permutation sigma, the sign of sigma tau is minus the sign of sigma, because tau is odd. So sending sigma to sigma tau maps the even permutations to the odd ones. It is a bijection, since doing it twice gives sigma back. So every term of the sum is either the term of an even sigma, or the term of sigma tau for exactly one even sigma.
Now compare the two terms. Sigma tau agrees with sigma except at k and l: it sends k to sigma of l, and l to sigma of k. So the product for sigma tau has the factors a k sigma of l, and a l sigma of k. Since rows k and l are equal, these are a l sigma of l and a k sigma of k, which are factors of the product for sigma. All other factors are the same, so the two products are equal. The products are equal and the signs are opposite, so the two terms cancel. The determinant is a sum of such cancelling pairs, so it is zero. The second part follows from the first and multilinearity. Put r k plus r l into both row k and row l. This matrix has two equal rows, so its determinant is zero. Expand it, first in row k and then in row l, into four determinants. Two of them have r k twice, or r l twice, so they are zero. The other two are the determinant of A and the determinant of B. So the determinant of A plus the determinant of B is zero.
Why prove the parts in this order? From the second part alone, two equal rows would only give that the determinant equals minus itself, so two times the determinant is zero. In the field Z two, two is zero, so that says nothing. The order we used works over every field. For example, swapping the rows of the matrix with the first row two, four, and the second row one, three, gives the first row one, three, and the second row two, four. Its determinant is one times four minus three times two, which is minus two: the sign has changed. By the transpose theorem, columns behave like rows: the determinant is multilinear in the columns, it is zero when two columns are equal, and it changes sign when two columns are swapped.
The determinant is unique
These properties are not just consequences. They characterise the determinant. Let phi be a function from the n by n matrices over F to F, which is multilinear in the rows, and which is zero whenever two rows are equal. Then phi of A equals phi of the identity, times the determinant of A, for every A. In particular, the determinant is the only such function with value one at the identity. The proof has five steps, and it is the most demanding part of this lecture, so take it slowly. First, phi also changes sign when two rows are swapped. The proof of part two of the alternating theorem used only multilinearity and the zero value at equal rows, so it applies to phi as well. Now write each row of A as a combination of the rows of the identity: row i is a i one times e one transpose, plus and so on, up to a i n times e n transpose.
Expand phi of A using linearity in row one, then in row two, and so on. In each row i we choose one column, j i. This gives a sum, over all choices j one up to j n, of a one j one, times and so on, up to a n j n, times phi of the matrix with rows e j one transpose, up to e j n transpose. For a two by two matrix, the choices give four terms: the matrices with rows e one, e one, then e one, e two, then e two, e one, and finally e two, e two. If two of the chosen columns are the same, that matrix has two equal rows, and phi of it is zero. So only the choices with all columns different survive. Those are exactly the permutations: j i equals sigma of i. The matrix with rows e sigma of one transpose, up to e sigma of n transpose, is the permutation matrix P sigma of lecture eighteen.
It remains to show that phi of P sigma is the sign of sigma times phi of the identity. Sort the rows of P sigma by swaps: first swap e one transpose into row one, then e two transpose into row two, and so on, until we reach the identity. Swapping rows k and l of P sigma gives P of sigma times the transposition k l. So each swap changes the sign of phi, by the first step, and it changes the sign of the permutation, since a transposition is odd. At the end, the permutation is the identity, with sign one, and both sides equal phi of the identity. Each swap changed both sides by the same factor, so they were equal at the start: phi of P sigma is the sign of sigma, times phi of the identity. By steps three and four, phi of A is the sum, over sigma, of the sign of sigma times a one sigma of one up to a n sigma of n, times phi of the identity. That is phi of the identity times the determinant of A.
So the determinant is the one and only way to assign a number to a square matrix that is linear in each row, alternating, and one at the identity. These three properties are the rules for areas and volumes from lecture thirty three, now for rows and for every n. One more consequence. Taking phi to be the determinant itself, step four says that the determinant of the permutation matrix P sigma is the sign of sigma.
Summary
To summarise. S n is the set of the n factorial permutations of one up to n. The sign is minus one to the number of inversions. It is multiplicative, and every transposition is odd. The determinant of an n by n matrix is the Leibniz sum of signed products, one entry from each row and each column. The determinant of a triangular matrix is the product of its diagonal, and a matrix and its transpose have the same determinant. The determinant is multilinear and alternating in the rows and in the columns, and it is the only such function with value one at the identity.
Before the next lecture, read section seven point two of the course book, try the problems on sheet nine about permutations and the Leibniz formula, and do the lecture check on this lecture's page at Open Semester dot com. Next time, we put these properties to work and compute determinants efficiently. See you there.
In this lecture
Materials
Try it
Pick a permutation
Check yourself
3 questions, from warm-up to stretch
Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.
- Question 1 of 3 Warm-up
Let in one-line notation, so , , , . How many inversions does have? Find and .
Hint 1 of 2
An inversion is a pair of positions with (Definition 7.2.5). There are six pairs in : go through them one by one.
Hint 2 of 2
For the pair : , so it is an inversion. Then , and Corollary 7.2.9 (c) compares with .
Worked solution
- The six pairs : : , an inversion. : , an inversion. : , an inversion. : , not one. : , not one. : , an inversion.
- So and (Definition 7.2.5): is even.
- By Corollary 7.2.9 (c), .
- Check directly: , whose inversions are , , and , again four.
- Question 2 of 3 Core
Let . In the Leibniz formula for , find the term of , that is . Then find .
Hint 1 of 2
For the term picks , , , one entry in each row and each column (Definition 7.2.10). Its sign is : count the inversions.
Hint 2 of 2
The six permutations of give six terms (Example 7.2.11): . Several of them contain a .
Worked solution
- For : , , , so the term uses , , . The inversions are and , so and the term is .
- The six terms: : . : . : . : . : . : .
- So .
- Question 3 of 3 Stretch
Let be a matrix over with rows and . Find ; , where has rows , , ; and , where is with its first two rows swapped.
Hint 1 of 2
Use the rules of this lecture: (Proposition 7.2.16), linearity in a row (Theorem 7.2.15), equal rows and row swaps (Theorem 7.2.17), and (Theorem 7.2.14).
Hint 2 of 2
Split the third row of : . The second matrix has two equal rows.
Worked solution
- has rows . Taking the factor out of each row (Theorem 7.2.15) gives (Proposition 7.2.16).
- The third row of is . By linearity in that row (Theorem 7.2.15), , since a matrix with two equal rows has determinant (Theorem 7.2.17 (a)).
- (Theorem 7.2.14), and swapping two rows changes the sign (Theorem 7.2.17 (b)), so .
How did it go?