Contents / Linear Algebra / Matrix Algebra
Chapter 3
Matrix Algebra
Matrix operations, inverses, elementary and block matrices, and the Invertible Matrix Theorem.
Introduction
A matrix is a rectangular array of numbers, and at first sight that is all it is: a table. What makes matrices the central object of linear algebra is that the table carries an algebra. You can add matrices, scale them, multiply them, sometimes invert them — and every one of those operations has a meaning. The meaning is always the same one: a matrix records a linear map, and matrix algebra is the algebra of linear maps.
That single idea explains everything in this chapter. Addition is defined entrywise because adding two linear maps means adding their outputs. Multiplication has its strange-looking row-times-column rule because composing two linear maps forces exactly that rule and no other. Multiplication fails to commute because doing one thing and then another is generally not the same as doing them in the opposite order. The inverse exists exactly when the map can be undone.
The chapter runs in the order that dependency suggests. First the linear operations — sum, scalar multiple, transpose — together with the trace, and all their algebraic laws proved rather than listed. Then the product, derived from composition, with associativity and the reversal rule proved from the index formula. Then the inverse: what it is, why it is unique, the formula derived rather than quoted. Then elementary matrices, which turn row reduction itself into matrix multiplication and explain why the algorithm works. Those tools let us state and prove the Invertible Matrix Theorem, the long list of conditions that all say the same thing. Finally: partitioned matrices, the standard named families of special matrices, and three applications — computer graphics, economics, and Markov chains — that show the algebra doing work.
You will need the language of systems and row reduction from the previous chapter. Everything else is built here.
3.1Matrix notation, the linear operations, and the trace
We begin with the vocabulary, because almost every error in a first linear algebra course is a shape error rather than an arithmetic one.
Definition 3.1 (Matrix). An matrix is a rectangular array of scalars with rows and columns. The scalar in row and column is the entry, written or , and we write
The pair is the size or shape of . The matrix is square when , and then the entries form its main diagonal. Two matrices are equal when they have the same size and for every and .
The row index always comes first. Reading as "row , column " is the single most common slip in the whole subject, and it survives for pages before it produces a visible contradiction.
A matrix has two useful decompositions, and both are worth naming now. Writing for the columns of — each a vector in — we write
and similarly is a stack of row vectors, each in . Almost every theorem about matrices is easier from one of these two views than from the entrywise view, and a large part of learning the subject is learning which view to take.
Three matrices have standard names. The zero matrix has every entry zero. The identity matrix is the square matrix with ones on the main diagonal and zeros elsewhere; its entry is the Kronecker delta , equal to if and otherwise. A diagonal matrix has whenever .
Definition 3.2 (Sum and scalar multiple). Let and be matrices of the same size , and let be a scalar. Their sum and the scalar multiple are the matrices defined entry by entry:
We write for and for .
The equal-size hypothesis is not bureaucracy. If is and is there is simply no entry of sitting in the position of , so the formula has nothing to evaluate. The sum is undefined — not zero, not "whatever fits", undefined.
Because both operations act entry by entry, every algebraic law they satisfy is inherited directly from the corresponding law for numbers. That is worth stating once and proving once, because it is the last time in this chapter that a proof will be this easy.
Theorem 3.3 (Algebra of the linear operations). Let be matrices and scalars. Then
Proof. Every identity asserts that two matrices of the same size are equal, so it suffices to check that their entries agree for all . For (i), the entry of is and the entry of is ; these are equal because addition of scalars is commutative. For (vi), the entry of is , which is the entry of , by distributivity of scalars. The remaining six identities follow the same way, each from the corresponding scalar law.∎
These eight laws are exactly the vector space axioms. So the set of all matrices, with these two operations, is a vector space — it behaves like with the entries relabelled. Chapter 4 will make that observation official; for now it means you may move matrices around inside a sum with the same freedom you use on numbers.
Definition 3.4 (Transpose). The transpose of an matrix is the matrix whose entry is the entry of :
Equivalently, the rows of become the columns of , in order.
Note the shape change: transposing a matrix gives a matrix. Only for square matrices does have the same shape as , and only then can we ask whether .
Proposition 3.5 (Transpose laws). For matrices of compatible sizes and any scalar ,
Proof. Each side of each identity has the same size, so compare entries. First, . Second, . Third, .∎
The transpose also interacts with the product, and there the order reverses: . That rule needs the product to be defined first, so it is proved in the next section.
Definition 3.6 (Symmetric and skew-symmetric). A square matrix is symmetric if , that is for all ; it is skew-symmetric (or antisymmetric) if , that is .
Symmetric matrices are the most important special class in the subject. Covariance matrices in statistics, Hessians in optimisation, inertia tensors in mechanics and adjacency matrices of undirected graphs are all symmetric, and Chapter 8 will show that a real symmetric matrix always has real eigenvalues and an orthonormal basis of eigenvectors — a conclusion that fails badly for general matrices.
Skew-symmetry has an immediate consequence worth extracting: setting in gives , hence and . Every diagonal entry of a skew-symmetric matrix is zero.
Proposition 3.7 (Symmetric–skew decomposition). Every square matrix can be written in exactly one way as with symmetric and skew-symmetric, namely
Proof. These and certainly sum to . They have the required types: and , using the transpose laws. For uniqueness, suppose with symmetric and skew. Transposing gives . Adding the two equations gives , so ; subtracting gives .∎
The last of the entrywise notions in this section attaches a single number to a square matrix.
Definition 3.8 (Trace). The trace of an matrix is the sum of its diagonal entries,
The trace ignores every off-diagonal entry, which makes it look like a crude summary. It is not. It is linear, it is blind to the order of a product, and it is unchanged by a change of basis — and those three facts together make it one of the two basic invariants of a matrix (the determinant is the other).
Theorem 3.9 (Properties of the trace). Let and be and a scalar. Then
and, for any of size and of size ,
Proof. The first three are immediate from the definition: ; ; and transposing fixes every diagonal entry, since .
For the last, write out both sides with the product formula proved in the next section. Then
while
The two double sums run over exactly the same set of pairs and have the same summand , since scalars commute. Therefore they are equal.∎
Notice how much the last identity says and how little it assumes. and need not even have the same size — if is and is then is and is — and yet their traces agree. When and are both square, and are almost never equal as matrices, and their traces are always equal anyway.
Corollary 3.10 (Similarity invariance of the trace). If is invertible and , then .
Proof. Apply with and :
Similar matrices are the same linear map written in two different bases (Chapter 5). The corollary says the trace is a property of the map, not of the coordinates we happened to choose — which is why the trace turns up later as the sum of the eigenvalues.
Intuition. Think of an matrix as a spreadsheet with rows and columns. Adding two spreadsheets means adding them cell by cell, which is only possible if the grids line up. Scaling multiplies every cell by the same factor. Transposing pivots the sheet about its top-left corner, so what was a row now reads down a column. The trace reads off only the cells on the top-left-to-bottom-right diagonal and adds them: a single number summarising a table of numbers, and remarkably, one that does not change if you re-label the axes.
Example 3.11 (Sum, scalar multiple, transpose, trace). For and , compute , , , , and decide whether is symmetric.
Solution. Add entry by entry:
For , scale first and then subtract:
The transpose swaps the off-diagonal entries: , since moves to position .
The trace is . Sanity check against : the diagonal of is also , and the traces agree.
Finally, is not symmetric, because while .□
Example 3.12 (Splitting a matrix into symmetric and skew parts). Write as with symmetric and skew-symmetric.
Solution. First transpose: . Then
Check the types: is symmetric because its two off-diagonal entries are both ; is skew because and its diagonal is zero, as the definition forces. Sanity check the sum: .□
Example 3.13 (Trace of a non-square product). Let (size ) and (size ). Verify .
Solution. The product is : , so .
The product is , with :
Its trace is . The two matrices are nothing like each other — one is a number, the other a array — and their traces agree, exactly as the theorem promises.□
Pitfall. is a statement about two factors and does not extend naively. For three factors only the cyclic rotations are guaranteed equal:
and in general . Also note that is almost never : for the left side is and the right side is .
3.2Matrix multiplication
Matrix multiplication is the operation that gives the subject its content, and the only one whose definition looks arbitrary. It is not arbitrary; it is forced. We derive it rather than declare it.
Start with the matrix–vector product, which the previous chapter introduced as shorthand for a linear system. If has columns and , then
This map from to is linear, and every linear map arises this way, with the image of the -th standard basis vector.
Now suppose sends and sends . The composition is a linear map , so it too has a matrix. Call it . What must its columns be? Column of any matrix is the image of , so
where is the -th column of . There is nothing left to choose.
Definition 3.14 (Matrix product). Let be and let be , with columns . The product is the matrix
Entrywise, this is the row–column rule
the -th row of paired term by term with the -th column of . The product is defined only when the number of columns of equals the number of rows of .
The two descriptions agree: the -th entry of is row of dotted with , which is .
The shape rule is easiest to remember in the form
the inner dimensions must match and then cancel; the outer dimensions survive. A times a is a ; a times a is undefined.
Counting the arithmetic is also useful. Each of the entries of costs multiplications, so forming takes scalar multiplications. Multiplying two matrices by the definition therefore costs multiplications — which is why, for large , people care a great deal about the order in which a chain of products is evaluated.
Proposition 3.15 (Row and column rules). With of size and of size :
Proof. The column statement is the definition. For the row statement, the -th entry of row of is , which is exactly the -th entry of the matrix obtained by multiplying the row by .∎
These two rules save enormous amounts of work. If a problem asks only for one column of a product, compute one matrix–vector product, not the whole thing.
Theorem 3.16 (Algebra of the product). Whenever the sizes make the expressions defined, and for any scalar :
Proof. For (i), let be , be and be , so both sides are . Compute the entry of each. Using the row–column rule twice,
Both are the same finite double sum of the products over all pairs ; only the order of summation differs, and a finite sum may be reordered freely. Hence the entries agree.
For (ii), . Part (iii) is the mirror image, and (iv) follows from .
For (v), , since every term with vanishes.∎
Associativity is worth a second look, because it is the law that makes the whole subject work and the one whose proof students most often skip. There is a proof with no indices at all: both and are the matrix of the same composed function , and composition of functions is associative by definition. Two matrices representing the same linear map are equal, so the two products coincide. The index computation above is the same statement with the scaffolding shown.
Now the law that fails.
Theorem 3.17 (Multiplication is not commutative). There exist matrices and with .
Proof. Take and . Then
and these differ in every entry except the and positions.∎
This is not a technical annoyance; it is the mathematical content of the statement that order of operations matters. Rotating a book about a vertical axis and then about a horizontal one leaves it in a different position than doing the two in the other order — try it. Two further consequences deserve their own warning.
Pitfall. Three familiar laws of numbers fail for matrices.
Commutativity fails. So , which equals only when and commute. Likewise , not .
Cancellation fails. does not imply . With , and , both products equal .
Zero divisors exist. does not imply or : take , so that but .
All three failures disappear when is invertible — which is one reason the next sections care so much about invertibility.
Since requires the columns of to match its own rows, powers make sense only for square matrices.
Definition 3.18 (Powers of a square matrix). For a square matrix and integer , is the product of copies of , and .
Associativity is what makes this unambiguous: without it, " " would depend on the bracketing. The usual index laws and follow, but does not, for exactly the reason above.
Finally, the promised transpose rule.
Theorem 3.19 (Transpose of a product). If is and is , then
Proof. Both sides are , so it suffices to compare entries. For any and ,
where the third equality just rewrites and and uses commutativity of scalar multiplication to reorder the factors.∎
The order must reverse, and you can see why from shapes alone before doing any arithmetic: would be times , which is undefined unless . By induction, .
Corollary 3.20 ( is symmetric). For any matrix , both and are symmetric.
Proof. , using the reversal rule and . The same computation gives .∎
This little corollary is the engine of least squares (Chapter 7): is square and symmetric no matter how badly shaped is.
Intuition. Think of as a machine that takes a -dimensional input and produces an -dimensional output, and as a second machine that eats that -dimensional output and produces an -dimensional one. Bolting them together gives a single machine, and is its instruction table. The inner dimensions must match because the output plug of has to fit the input socket of . The order in reads right to left because runs first — the same convention as .
Example 3.21 (A product, and one column of it). Let and . Compute , and then find column of on its own.
Solution. Shapes: times gives . Apply the row–column rule nine times. Row of is :
Row is : the entries are , , . Row is : , , . So
For column alone, the column rule says compute where :
which matches the middle column of . Three multiplications' worth of work instead of twenty-seven.□
Example 3.22 (Powers of a shear). Let . Compute and , guess a formula for , and prove it.
Solution. Directly, , and then .
The pattern suggests . Prove it by induction. It holds for . If it holds for , then
which is the claim for . Geometrically is a shear that slides each point horizontally by its own height; applying it times slides by times the height. Sanity check with : the formula gives , as it should.□
Example 3.23 (A rotation matrix and the angle-addition identities). Let . Compute .
Solution. Multiply out:
Every entry is an angle-addition formula in disguise, and the product collapses to
That is exactly what composition should give: rotating by and then by is rotating by . Note as a bonus that rotations do commute with each other, since — non-commutativity is the general rule, not a universal one. Sanity check: setting gives .□
Example 3.24 (Verifying the reversal rule). With and , check and show is something else.
Solution. First , so .
Now and , so
matching. By contrast , which is not . The order genuinely matters.□
3.3The inverse of a matrix
Division is missing from the list of matrix operations, and it stays missing: there is no useful . What there is, for some square matrices, is a multiplicative inverse — a matrix that undoes what does.
Definition 3.25 (Invertible matrix). An matrix is invertible (or nonsingular) if there exists an matrix with
Such a is called an inverse of . A square matrix with no inverse is singular.
Two restrictions are built into the definition. The matrix must be square: if is with , then and have different sizes and cannot both be an identity. And both products are demanded. For square matrices it will turn out that either one implies the other (a consequence of the Invertible Matrix Theorem), but that is a theorem, not a definition.
Theorem 3.26 (The inverse is unique). If is invertible, its inverse is unique. We may therefore write .
Proof. Suppose and both satisfy the definition, so and . Then
using associativity in the middle step. So any two inverses coincide.∎
The proof is three lines and uses only associativity, but look at what it actually shows: any left inverse equals any right inverse. That is a stronger statement than uniqueness and gets reused constantly.
Proposition 3.27 (Inverse of a matrix). Let and set . If then is invertible, with
If then is not invertible.
Proof. Define — swap the diagonal entries, negate the off-diagonal ones. Multiply it out both ways:
If , dividing by shows satisfies both halves of the definition.
If , suppose for contradiction that were invertible. From we get , so and ; but the zero matrix is certainly not invertible, since . Contradiction.∎
The number is the determinant of , studied properly in Chapter 6; here we need only the case. In words, the recipe is: swap the diagonal, negate the off-diagonal, divide by the determinant.
Theorem 3.28 (Inverse laws). Let and be invertible matrices and a scalar. Then each of the following is invertible, with the stated inverse:
More generally , and .
Proof. In each case we exhibit a matrix and verify the definition; uniqueness then says it is the inverse.
The equations are symmetric in and , so they say both that inverts and that inverts ; hence .
For the product, compute using associativity:
For the transpose, apply the reversal rule to : transposing gives , and transposing gives . So is a two-sided inverse of .
For the scalar, and similarly on the other side. The general product rule follows by induction on , and is the special case .∎
The reversal in is not an algebraic accident. To undo "put on socks, then put on shoes", you take off the shoes first. The last operation applied is the first one undone.
Theorem 3.29 (Invertibility solves systems). If is an invertible matrix, then for each the equation has the unique solution .
Proof. Existence. Put . Then .
Uniqueness. If , multiply both sides on the left by : , so . Hence any solution equals the one we found.∎
Note that "multiply on the left by " is the only legal move; multiplying on the right would produce , which is not even defined. Because multiplication does not commute, left and right must be specified every time.
This theorem is a beautiful formula and a poor algorithm. Solving a single system by row reduction costs about operations; computing first costs roughly and then you still have to multiply. In numerical practice one almost never forms explicitly. The inverse earns its place as a theoretical tool — as a way of writing down and manipulating the solution symbolically — rather than as a computational one.
Intuition. A matrix is a machine that transforms space; its inverse is the machine that reverses the transformation. Rotate by and the inverse rotates by . Stretch every length by and the inverse shrinks by . But a matrix that flattens the plane onto a line has thrown information away permanently: two different points now sit on top of each other, and no machine can decide which one to send back. That is exactly what "singular" means, and it is why — the condition that the two columns lie on one line — is precisely the condition for failure.
Example 3.30 (A inverse, with verification). Find for and use it to solve .
Solution. The determinant is , which is nonzero, so the inverse exists:
Verify before using it:
Now . Sanity check in the original equation: .□
Example 3.31 (Solving a matrix equation for an unknown matrix). Let and be invertible matrices. Solve for .
Solution. Strip the factors one at a time, always saying which side you are multiplying on. Multiply on the left by :
Now multiply on the right by :
So . Sanity check by substituting back: .□
Pitfall. There is no cancellation of a non-invertible factor, and there is no "dividing both sides". From you may conclude only after multiplying on the left by , which requires to be invertible. And the expression is meaningless: write or , which are generally different matrices.
Pitfall. . Take : the left side is and the right side is . Worse, the sum of two invertible matrices need not be invertible at all — take , giving the zero matrix. There is no useful formula for the inverse of a sum.
3.4Elementary matrices and the algorithm
For matrices larger than we need an algorithm, and the right one comes from a beautiful observation: the row operations of the previous chapter are themselves matrix multiplications.
Definition 3.32 (Elementary matrix). An elementary matrix is a matrix obtained from the identity by performing a single elementary row operation. Correspondingly there are three types:
- Interchange : swap rows and of .
- Scaling with : multiply row of by .
- Replacement : add times row of to row (with ).
For , for example,
Theorem 3.33 (Row operations are left multiplications). Let be the elementary matrix obtained by performing a row operation on . Then for every matrix , the matrix is the result of performing that same row operation on .
Proof. By the row rule, row of equals (row of ) times , which is the linear combination of the rows of whose coefficients are the entries of row of . So it is enough to check that row of carries the right coefficients, and by construction it does.
Concretely: in row is , so row of is row of , and symmetrically — the two rows are swapped, all other rows of being unchanged rows of and therefore reproducing the corresponding rows of . In row is , so row of is times row of . In row is , so row of is (row of ) (row of ). In all three cases the other rows are untouched.∎
So row reduction is nothing but repeated left multiplication. If is reduced to by the operations corresponding to in that order, then
Note the order: the first operation performed sits closest to .
Proposition 3.34 (Elementary matrices are invertible). Every elementary matrix is invertible, and its inverse is the elementary matrix of the same type that undoes the operation:
Proof. Each elementary row operation is reversible by an operation of the same type: swapping rows and twice restores the original; scaling row by and then by restores it (this is where is needed); adding times row to row and then adding times row restores it. Let and be the elementary matrices of an operation and its reverse. Applying the operation and then its reverse to gives , by the previous theorem applied twice, and applying them in the other order gives . So .∎
Everything now falls out.
Theorem 3.35 (Row equivalence to the identity). An matrix is invertible if and only if is row equivalent to . In that case, the same sequence of row operations that reduces to transforms into .
Proof. () Suppose row operations with elementary matrices reduce to , so . Write . Each is invertible, so is invertible as a product of invertible matrices, with . From we get , and therefore is invertible with .
() Suppose is invertible. Let be the reduced echelon form of , so for an invertible (a product of elementary matrices). Then is invertible, being a product of invertible matrices. A square reduced echelon matrix that is invertible must be : if it had a row of zeros, say row , then row of would be zero for every , so would be impossible. With no zero rows, an reduced echelon matrix has pivots, one in each row, and since pivots move strictly right as you go down, the pivot in row must be in column . Reduced echelon form then forces every other entry of those columns to be zero, so .
For the final claim, , so applying the same operations to — that is, forming — produces .∎
That last sentence is the whole justification of the standard algorithm, and it is worth reading twice. Row-reducing multiplies it on the left by ; carrying along in the same rows multiplies by the same ; and turns out to be .
Method 3.36 (Inverting a matrix by row reduction). To compute for an matrix :
- Form the augmented matrix .
- Row-reduce the whole thing to reduced echelon form, applying every operation to both blocks.
- If the left block becomes , the right block is : the reduced matrix is .
- If at any point the left block produces a row of zeros, stop: is singular and has no inverse.
Intuition. Imagine and sitting side by side and undergoing identical surgery. Each row operation is a small invertible transformation applied to both. You keep operating until has been ground down to . Whatever total transformation achieved that is, it must be — and the copy of riding along has recorded it faithfully, because starting from and applying a transformation just writes that transformation down.
Example 3.37 (A inverse by row reduction). Find for .
Solution. Augment and reduce:
Clear the second column below the pivot with :
The left block is now upper triangular with pivots , so is invertible. Clear upward: and give
and finally :
Hence
Sanity check one entry of : row of times column of is , as required. Row times column : .□
Example 3.38 (Detecting a singular matrix). Attempt to invert by row reduction.
Solution.
The left block has a row of zeros, so it can never be reduced to : the algorithm has stalled, and is singular. The formula agrees, since . The geometric reason is visible in the columns: , so both columns lie on one line and the map crushes the plane onto that line.□
Example 3.39 (Factoring a matrix into elementary matrices). Write as a product of elementary matrices.
Solution. Reduce to , recording operations. First , with elementary matrix , gives . Then , with , gives .
So , hence , that is
Sanity check: that product is . As a by-product, .□
Remark. Because every invertible matrix is a product of elementary matrices, any theorem you can prove for elementary matrices and that survives taking products is automatically true for all invertible matrices. Chapter 6 uses exactly this trick to prove .
Pitfall. Row operations correspond to multiplication on the left. Multiplying on the right by an elementary matrix performs the analogous column operation instead: is with a column operation applied. Mixing the two up silently produces the transpose of what you wanted.
3.5The Invertible Matrix Theorem
We now have enough machinery to prove the central structural theorem about square matrices. It says that a long list of apparently different conditions — about pivots, about solutions, about columns, about maps — are all the same condition wearing different clothes.
Theorem 3.40 (The Invertible Matrix Theorem). Let be an matrix. The following statements are equivalent: either all are true of , or all are false.
- (a) is invertible.
- (b) is row equivalent to .
- (c) has pivot positions.
- (d) The equation has only the trivial solution .
- (e) The columns of are linearly independent.
- (f) The map is one-to-one.
- (g) The equation has at least one solution for every .
- (h) The columns of span .
- (i) The map is onto .
- (j) There is an matrix with (a left inverse).
- (k) There is an matrix with (a right inverse).
- (l) is invertible.
- (m) , equivalently the null space of is .
- (n) .
Proof. We prove the cycle , and then attach the remaining statements to it.
: take .
: if and , then .
: the solution set of has a free variable for every non-pivot column. If some column of were not a pivot column there would be a free variable and hence infinitely many solutions, contradicting (d). So all columns are pivot columns, giving pivots.
: is with pivots, so every row contains a pivot and every column contains a pivot. In reduced echelon form the pivots are s that move strictly right as we move down, so the pivot in row lies in column ; and reduced form makes every other entry of a pivot column zero. Therefore the reduced echelon form of is .
: this is the theorem on row equivalence to the identity proved in the previous section — writing with each elementary and invertible gives , a product of invertible matrices.
The cycle is closed, so (a), (b), (c), (d) and (j) are equivalent.
Now (e) and (f). Saying the columns are linearly independent means the only scalars with are all zero, which is literally statement (d) rewritten with the column picture of . And a linear map is one-to-one exactly when its kernel is trivial: if then , so (d) forces ; conversely if (d) fails, some has , so the map is not one-to-one. Hence (d) (e) (f). Statement (m) is the same content once more: counts pivot columns, so is (c).
Next (g), (h), (i), (k). Statement (h) says every is a linear combination of the columns, which by the column picture is (g), and (i) is the same sentence in the language of maps. If (a) holds then solves the system, giving (g), and gives (k). Conversely assume (k), so . For any , the vector satisfies , so (g) holds. And (g) implies (c): if had fewer than pivots then some row of its echelon form would be zero, and choosing to make that row's augmented entry nonzero gives an inconsistent system. Since (c) is in the cycle, (g), (h), (i) and (k) all join it. In particular, for square matrices a one-sided inverse is automatically two-sided, and by the uniqueness proof.
For (l): if is invertible then transposing gives , so is invertible. Applying that implication to in place of gives the converse, since .
Statement (n) is proved in Chapter 6, where the determinant is defined for all ; the bridge is that row operations change in controlled, nonzero-preserving ways, so if and only if reduces to , which is (b). For we proved it directly in the inverse formula.∎
Two consequences deserve to be singled out.
Corollary 3.41 (One-sided inverses suffice). If and are and , then both and are invertible, and .
Proof. is statement (k) for , so is invertible by the theorem. Multiplying on the left by gives , and an inverse is itself invertible.∎
This fails without squareness. With and we have , but and neither matrix is invertible — they are not square.
Corollary 3.42 (Products of invertible matrices). If and are and is invertible, then both and are invertible.
Proof. Let . Then , so has a right inverse and is invertible by (k). Also , so has a left inverse and is invertible by (j).∎
Intuition. Every condition in the list is a way of asking: does this matrix lose information? A matrix loses information exactly when some nonzero vector is sent to zero (d), exactly when its columns are redundant (e), exactly when two inputs collide (f), exactly when row reduction runs out of pivots (c). And a matrix that loses nothing must also reach everything: in dimensions you cannot be injective without being surjective, because the independent columns have nowhere to live but all of . That last equivalence is special to square matrices and finite dimensions; it is false for maps between spaces of different sizes and false in infinite dimensions.
Example 3.43 (Using the theorem instead of computing). Decide whether is invertible.
Solution. Look at the columns before computing anything. Row is exactly times row , so produces a zero row and the echelon form has at most pivots. By (c), is not invertible.
Equivalently, via (d): a zero row in the echelon form of the coefficient matrix means a free variable, so has nontrivial solutions. Indeed one can read one off: solving the reduced system gives, for instance, , and .□
Example 3.44 (For which is the matrix invertible?). Find all values of for which fails to be invertible.
Solution. By the criterion, is invertible exactly when , that is when . So is singular precisely when , and invertible for every other value of .
Sanity check at : the matrix is , whose second column is twice the first — dependent columns, so (e) fails, as it must.□
Example 3.45 (Deducing invertibility from an algebraic identity). Suppose the square matrix satisfies . Show is invertible and find as a polynomial in .
Solution. Rearrange to isolate the identity:
Divide by :
So has a right inverse, and by the corollary on one-sided inverses it is invertible with
Sanity check on the other side: , since commutes with (both are polynomials in ).□
Remark. The Invertible Matrix Theorem is a square-matrix theorem, and every one of its equivalences can fail for rectangular . A matrix may have independent columns (injective) yet never be surjective onto ; a matrix may be surjective yet never injective. The theorem is really the statement that in a fixed finite dimension, "loses nothing" and "reaches everything" are the same condition.
3.6Partitioned (block) matrices
Large matrices in practice are not shapeless grids of numbers; they have structure, and the notation should show it. Partitioning draws horizontal and vertical lines through a matrix and treats the resulting rectangles as entries in their own right.
Definition 3.46 (Partitioned matrix). A partition of a matrix is a division of its rows into consecutive groups and its columns into consecutive groups. Writing for the submatrix in row-group and column-group , we display as a matrix of blocks, for example
For instance,
Sums and scalar multiples of partitioned matrices work blockwise in the obvious way, provided both matrices are partitioned identically. The substantial fact is that multiplication does too.
Theorem 3.47 (Block multiplication). Let be partitioned into blocks and be partitioned so that the column grouping of matches the row grouping of . Then may be computed blockwise by the ordinary row–column rule applied to blocks:
Proof. Consider first the extreme partition in which is split into its columns and into its rows. Then the claimed formula reads
a sum of outer products. Check it entrywise: the entry of is , so the entry of the sum is . This proves the column–row expansion.
A general conforming partition groups these terms into consecutive bundles: the bundle collects the indices in group , and its contribution to the rows of group and columns of group is precisely , again by the entrywise computation above restricted to those rows and columns. Summing the bundles recovers the total, which gives .∎
The conformability hypothesis is exactly the shape rule one level up: for to be defined, the number of columns in column-group of must equal the number of rows in row-group of . If you partition the two matrices inconsistently, the formula is meaningless — precisely as the ordinary product is undefined when inner dimensions clash.
Two kinds of block structure are common enough to be named. A matrix is block diagonal if all off-diagonal blocks are zero, and block upper triangular if all blocks below the diagonal are zero. For these, inverses are easy.
Proposition 3.48 (Inverse of a block triangular matrix). Let with and square. Then is invertible if and only if and are both invertible, and in that case
In particular, for block diagonal we get .
Proof. Suppose and are invertible, and let denote the displayed matrix. Multiply blockwise:
since . A similar computation gives , so .
Conversely, suppose is invertible. If then , so by the Invertible Matrix Theorem applied to ; hence is invertible, again by the theorem. For : given any , invertibility of gives with , whose lower block reads . So the columns of span, and is invertible.∎
When the lower-left block is not zero, one more idea is needed.
Definition 3.49 (Schur complement). For with square and invertible, the Schur complement of in is
The Schur complement is what block elimination leaves behind. Performing the block row operation "subtract times the first block row from the second" gives the factorisation
which you can verify by multiplying the right side out. Since the first factor is block triangular with identity diagonal blocks, it is always invertible, so is invertible exactly when and are — a clean criterion, and the standard route to the general block inverse formula. This is Gaussian elimination performed on blocks instead of numbers, and it is how large structured systems are actually solved.
Intuition. Blocks let you zoom out. A matrix arising from a network of two weakly connected communities may look like noise entrywise, but as a array of blocks it reads "two big diagonal blocks, small blocks off the diagonal" — and the algebra respects that reading, because block multiplication obeys the same row–column rule. Nothing new has to be learnt; the entries are simply matrices instead of numbers, with the single caveat that these entries do not commute, so must be kept in that order.
Example 3.50 (Multiplying in blocks). Compute where
Solution. Partition both into blocks. Then with , and with . Block multiplication gives
Since ,
Four block operations replaced sixty-four scalar multiplications. Sanity check the entry directly: row of is , column of is , and their product is . Notice also that these matrices commute, since .□
Example 3.51 (A block triangular inverse). Invert using the block formula.
Solution. Partition into blocks: , , , lower-left block zero.
The pieces: (determinant , swap-and-negate) and .
Compute the corner block. First , then
so . Assembling,
Sanity check the entry of : row of is , column of is , and the product is .□
Pitfall. Blocks do not commute, so every block formula must preserve order. It is , never or . And the block formula is false in general — it holds for block triangular matrices in the form , and otherwise you need the Schur complement.
3.7Special families of matrices
Certain shapes of matrix recur so often that they have names, and each name comes with a computational shortcut. This section is the catalogue.
Definition 3.52 (Diagonal and triangular). A square matrix is diagonal if whenever . It is upper triangular if whenever (everything below the diagonal is zero), and lower triangular if whenever .
Diagonal matrices are the easiest objects in the subject. If then
and scales row of by while scales column of by . Much of the rest of linear algebra is an attempt to make a given matrix look diagonal by choosing a clever basis; that is what diagonalisation (Chapter 5) and the spectral theorem (Chapter 8) are for.
Triangular matrices are the next best thing. Products and inverses of upper triangular matrices are upper triangular, and a triangular system is solved directly by back substitution () or forward substitution () at a cost of about operations rather than . That is the point of the LU factorisation from the previous chapter: elimination is done once, and then each new right-hand side costs only two cheap triangular solves.
Proposition 3.53 (Triangular matrices are closed under products). If and are upper triangular, so is , and .
Proof. Take ; we must show . Now . A term can survive only if , which needs , and , which needs . Together these force , impossible when . So every term vanishes. For the diagonal, take : the same inequalities force , leaving the single term .∎
Definition 3.54 (Orthogonal matrix). A square matrix is orthogonal if
equivalently if its columns form an orthonormal set. Then .
The equivalence is worth spelling out: the entry of is (row of ) times (column of ), which is . So says exactly that : the columns are unit vectors, mutually perpendicular. And since is square, already gives by the one-sided-inverse corollary.
Orthogonal matrices are the rigid motions of fixing the origin: they preserve every length and every angle, because
They are also the matrices whose inverse is free — no elimination, just a transpose — which makes them the numerical analyst's favourite object. Rotations have and reflections .
Definition 3.55 (Idempotent matrix). A square matrix is idempotent if .
Idempotent matrices are precisely the projections: applying the map a second time changes nothing, because the output is already in the target set. If is idempotent so is , since ; the pair splits every vector as into a part that is fixed and a part that is annihilated.
Proposition 3.56 (Eigenvalues of an idempotent matrix). If and with , then .
Proof. Apply twice: . But , so , that is . Since we get , so .∎
Consequently an idempotent matrix is invertible only if it is the identity: an invertible matrix cannot have as an eigenvalue, so all eigenvalues are , and multiplied by gives directly.
Definition 3.57 (Nilpotent matrix). A square matrix is nilpotent if for some positive integer . The least such is its index of nilpotency.
Nilpotent matrices are the opposite extreme from invertible ones: every strictly triangular matrix (triangular with zero diagonal) is nilpotent, and repeated application eventually destroys everything. They are never invertible for , since with invertible would give . Their one convenient feature is a finite geometric series:
which you verify by multiplying out and watching the sum telescope to .
Definition 3.58 (Permutation matrix). A permutation matrix is a square matrix with exactly one in each row and each column and zeros elsewhere; equivalently, its columns are the standard basis vectors in some order.
Proposition 3.59 (Permutation matrices are orthogonal). Every permutation matrix satisfies , hence .
Proof. The columns of are the standard basis vectors in some order, so they are unit vectors and any two distinct ones are orthogonal — . Therefore , that is .∎
Multiplying by a permutation matrix permutes: reorders the rows of , reorders its columns. Products of permutation matrices are permutation matrices, and the interchange elementary matrices are exactly the permutation matrices corresponding to a single swap. They are what the " " in the general factorisation records.
Intuition. Each family is a way of being simple. Diagonal: the axes do not interact, so the matrix is really separate numbers. Triangular: the interaction goes only one way, so you can solve for the unknowns one at a time. Orthogonal: nothing stretches — the shape is rigid, a rotation or a reflection. Idempotent: the map is a shadow, and shadows of shadows are the same shadow. Nilpotent: the map is a conveyor belt that pushes everything one step towards the end and off the edge. Permutation: the map only relabels the axes.
Example 3.60 (Identifying a matrix from its defining property). For , decide which of the named properties hold.
Solution. Transpose first: .
Orthogonal? . Yes, and free of charge. Geometrically is the rotation.
Symmetric? , so no. Skew-symmetric? , so yes — consistent with its zero diagonal.
Idempotent? , so no. Nilpotent? , and since is invertible it can never be nilpotent.
Permutation? No: a permutation matrix has entries and only, and has a .□
Example 3.61 (A projection matrix). Show that is idempotent, find , and describe what it does.
Solution. Square it:
so is idempotent. Its trace is .
To see what it does, apply it: , which always lands on the line , and fixes every point already on that line. So is the orthogonal projection onto the line . The trace is exactly the dimension of the line it projects onto — a general fact about projections.□
Example 3.62 (Nilpotency and the geometric series). For , find the index of nilpotency and compute .
Solution. Square: , which is nonzero. Cube: . So the index is .
Then :
Sanity check: is , and multiplying gives row times column equal to , row times column equal to , and the diagonal entries . So the product is .□
3.8Three applications
Matrix algebra was not invented to be admired. Three short applications show the operations of this chapter doing real work — and each points forward to a later chapter.
The first is computer graphics. A rotation, a scaling and a shear of the plane are all linear maps, so each is a matrix, and composing them is a matrix product. A translation is not linear — it moves the origin — and so has no matrix. The fix is a famous trick.
Definition 3.63 (Homogeneous coordinates). The point of the plane is represented in homogeneous coordinates by the vector . A linear map with matrix and a translation by are then both realised by matrices acting on these vectors:
The bottom row keeps the last coordinate equal to , so the representation is preserved and such matrices can be composed freely. That is the entire content of the trick, and it is why every graphics pipeline in existence multiplies matrices to move three-dimensional objects: an affine map becomes a linear one, one dimension up.
Example 3.64 (Rotating about a point that is not the origin). Find the homogeneous matrix that rotates the plane by counterclockwise about the point .
Solution. Decompose the motion into three steps: translate to the origin, rotate, translate back. In homogeneous coordinates,
The composite is — rightmost factor applied first. First
since, for example, the entry is . Then
Two sanity checks. The centre must be fixed: . And the point , one unit to the right of the centre, should land one unit above it: .□
The second application is economics. In Leontief's input–output model an economy has sectors; producing one unit of output in sector consumes units from sector . Collecting these into the consumption matrix , a production vector consumes internally, leaving for outside demand . The model is therefore
If is invertible, the production needed to meet any demand is — a single matrix inverse answers the question for every demand vector at once, which is exactly what makes the inverse valuable as a theoretical object.
Example 3.65 (A two-sector Leontief model). An economy has two sectors with consumption matrix . Find the production levels meeting an external demand of .
Solution. Form , whose determinant is , so it is invertible:
Then
Sanity check directly in the model: , and . Each sector must produce units: half is eaten by the economy itself, half reaches the outside world.□
The third application points ahead. A stochastic matrix (or Markov transition matrix) is a square matrix with non-negative entries whose columns each sum to ; entry is the probability of moving from state to state in one step. If is a probability vector describing the current distribution across states, then
so the long-run behaviour of the system is a question about the powers of a matrix.
Example 3.66 (A two-state Markov chain). A city's residents move between downtown () and the suburbs () with transition matrix . Verify that is a steady state, meaning .
Solution. Check that is stochastic: the columns sum to and . Now multiply:
Sanity check that is a probability vector: its entries are non-negative and sum to .
Two thirds of the population downtown is a self-sustaining split: the flow out of downtown, , exactly balances the flow in, .□
The equation says is an eigenvector of with eigenvalue , which is the subject of Chapter 5. Finding steady states is finding eigenvectors; the matrix algebra of this chapter is what makes the question askable.
Summary. The operations of this chapter and what they cost. Addition and scalar multiplication act entrywise and require matching shapes. The product requires the inner dimensions to agree, costs multiplications, is associative and distributive but not commutative, and represents composition of maps. Transposition reverses products, , and fixes the trace. The trace is linear and cyclic, , hence invariant under similarity. The inverse exists only for square matrices, is unique when it exists, reverses products, , and is computed by row-reducing — which works because row reduction is left multiplication by elementary matrices. The Invertible Matrix Theorem collects fourteen equivalent ways of saying that a square matrix loses no information.
- **Assuming . ** Matrix multiplication is almost never commutative. This propagates: and unless and commute.
- Mismatching dimensions. of size can only multiply on the left if has rows. Check shapes before computing anything; most "impossible" answers are shape errors.
- **Reading backwards.** Row index first, always. An off-by-one transposition error can survive for pages before it contradicts anything.
- Cancelling a non-invertible factor. gives only after multiplying on the left by , which needs invertible. Likewise does not force or .
- Forgetting that inverses and transposes reverse order. and . Writing is the single most common algebra error in this chapter.
- **Writing . ** False, and there is no repair: the sum of two invertible matrices need not be invertible at all.
- Multiplying on the wrong side. From you get , never . Say "left" or "right" out loud each time.
- Applying row operations on the right. Left multiplication by an elementary matrix does a row operation; right multiplication does a column operation.
- **Using the inverse formula when . ** There is no inverse; the formula divides by zero and the matrix is singular.
- Expecting a one-sided inverse to be enough for non-square matrices. For square matrices implies ; for rectangular ones it does not, and neither matrix is invertible.
- Treating blocks as if they commuted. Block formulas must preserve the order of the factors, and is not .
- Confusing the transpose with the inverse. only when is orthogonal.