Lecture 4: Operations on Linear Maps and Matrices
These notes are interactive: click a section title to open it, click any dotted term to unfold its exact definition or statement in place, click ▸ Proof to expand a proof, and try the exercises — answers are checked instantly.
4.1 Sums and scalar multiples
Lecture 3 ended with a dictionary: linear maps on one side, matrices on the other, each determining the other exactly. A dictionary is only useful if it translates operations as well as objects. Maps can be added and scaled, because their outputs are vectors and vectors can be added and scaled. This section asks what those operations look like on the matrix side, and the answer is the simplest one imaginable — which is precisely why matrix addition is defined the way it is.
Let be functions and let . Their sum and the scalar multiple are the functions defined pointwise: The right-hand sides are the vector operations of Lecture 1, performed in after both functions have been evaluated.
If are linear maps and , then and are linear maps.
Take and a scalar . Using the definition of , then linearity of and of , then regrouping by the arithmetic of vectors: and The argument for is the same two lines with one function in place of two.
□Let and be matrices of the same size , and let . Then and are the matrices with entries Both operations act entry by entry; neither is defined for matrices of different sizes. The matrix of all zeros is written , and means .
Let be linear maps with matrices and , and let . Then the matrix of is , and the matrix of is .
By the matrix-of-a-linear-map theorem, the matrix of a linear map has -th column the image of the standard basis vector . So the -th column of the matrix of is the sum of the -th columns of and of . Adding matrices entrywise is exactly adding them column by column, so that sum is the -th column of . Since the two matrices agree in every column they are equal. Replacing by gives and the same conclusion for .
□Read the theorem backwards. Once maps can be added pointwise — and there is no other sensible way to add functions whose values are vectors — the operation on matrices is forced: it must send to the matrix whose columns are . Entrywise addition is not a convention chosen for convenience; it is what pointwise addition of maps becomes when the maps are written as matrices. The same reading will explain, in the next section, the far less obvious formula for the matrix product.
Let send each vector to its shadow on the -axis and let send it to its shadow on the -axis: Reading each matrix off the images of and gives and then which says is the identity map — as the picture demands: a vector is the sum of its two shadows. Note also has matrix , the map that projects and then doubles.
For matrices and scalars :
Every identity is an identity between matrices, so it suffices to check one entry at a time. In position each statement reads as the corresponding law for real numbers — for instance by commutativity in .
□The eight rules above are precisely the rules obeyed by vectors in . That is no accident: an matrix is numbers in a rectangular arrangement, and for the purposes of addition and scaling the arrangement is irrelevant — the set of matrices behaves exactly like . What makes matrices more than a reshaped list of numbers is the product defined in the next section.
Let and . What is the entry of ?
has entry ; add the entry of .
Let be linear. Which of these is not guaranteed to be a linear map?
A linear map sends to ; check what the third function does to .
4.2 Composition and the matrix product
Applying one map and then another is the most common thing one does with maps: rotate, then project; scale, then shear. The result is again a map, and — as we are about to check — again a linear one, so by the dictionary it has a matrix of its own. That matrix is not the entrywise product of the two matrices (there is no such thing worth having); it is a genuinely new operation, and the strange-looking row-times-column formula you may have met before is simply what “do first, then ” becomes in coordinates.
Let and be functions, the target of being the source of . Their composition is the function Read it right to left: acts first. If the target of and the source of are different spaces, is not defined at all.
If and are linear, so is .
For and a scalar , apply the definition, then linearity of inside, then linearity of outside:
□Let be and let be with columns . The product is the matrix whose -th column is : The product is defined only when the number of columns of equals the number of rows of ; the result inherits the rows of and the columns of :
With and as above, the entry of is the row–column product of the -th row of with the -th column of :
The -th column of is , and by the definition of the matrix–vector product the -th entry of is the row–column product of row of with , which is the displayed sum.
□Let have matrix and let have matrix . Then the matrix of is ; equivalently
By the previous proposition is linear, so by the matrix-of-a-linear-map theorem it has a unique matrix, whose -th column is . Compute that column: using — picking out the -th column — in the middle. So the -th column of the matrix of is , which is by definition the -th column of . The two matrices agree in every column, hence are equal.
For the displayed identity, both sides are the value at of the same linear map : the left side is computed in two steps, the right side is the one-step matrix form just established.
□The theorem is the reason the matrix product looks the way it does. Every feature that seems arbitrary is forced by composition: the product exists only for matching sizes because exists only for matching spaces; is because maps to ; and means `` first, then '' because does. In particular the order in is not a matter of taste, and the next results show it cannot be reversed.
Let so is and is . Both products exist, and they are not even the same size: which is , while which is .
Check one entry by each recipe. Column view: the first column of is . Entry view: .
Let be the rotation matrix of Lecture 3. Rotating by and then by turns every vector through , so composition gives . Multiply the matrices out and read the first column: Comparing with entry by entry recovers the angle-addition formulas and . A geometric fact about turning has become a trigonometric identity, proved by one matrix multiplication.
Whenever the sizes make the products defined:
- Associativity: .
- Distributivity: and .
- Scalars: for every scalar .
- Identity: for of size , where is the matrix with on the diagonal and elsewhere.
- Transpose: — the order reverses.
(1) This one is free. By the previous theorem the matrices , , correspond to linear maps , , , and both and are the matrix of — the two bracketings and are the same function, since each sends to . Two linear maps that are equal have, by the correspondence, the same matrix. (The entrywise proof is a rearrangement of a double sum; the map argument says why the identity holds: composing functions is associative for the trivial reason that both sides mean ``do , then , then ''.)
(2) The -th column of is , which equals by the linearity of — and that is the -th column of . For the second identity, entry of is .
(3) Each side has entry , since a scalar may be moved through a finite sum and through each product of reals.
(4) The -th column of is , so ; and the -th row of is the row–column product of with the columns of , which reproduces row of .
(5) Entry of is entry of , namely . Entry of is . The two sums have the same terms, so the matrices agree; and the sizes work out because is and is , giving a matrix as must be.
□Even when and are square of the same size, so that both and are defined and of that size, they are usually different. Take Then Not merely unequal — they have no nonzero entry in common. Geometry makes the failure unsurprising. Let be a quarter turn and let be the reflection in the -axis. Then Reflecting and then turning is not the same as turning and then reflecting: the two are reflections in perpendicular lines. Order is part of the data, so is a special property of a particular pair, never a law.
Let be an matrix. Its powers are so with factors; by associativity the placement of parentheses does not matter. Powers are defined only for square matrices, since requires the number of columns of to equal its number of rows. In terms of maps, if then, by the composition theorem, is the matrix of ( times): apply repeatedly. Counting factors gives the familiar exponent laws so powers of the same matrix always commute. The laws that mix two matrices, however, can fail because the product is not commutative: , which need not equal , and , which equals only when .
Rotating times by is rotating by , so by the rotation example ; in particular . At the other extreme, since sends . A nonzero matrix can have a zero power — such a matrix is called nilpotent — another way in which matrix arithmetic differs from arithmetic of numbers, as the next example shows again.
Let . What is the entry of ?
Compute and guess the pattern: , since each factor of adds row to row .
Let although neither factor has a single zero entry. (Order matters here too: .) For numbers, forces or ; for matrices that inference is simply false, and the next proposition says exactly what does mean.
Let be and be with columns . Then that is, exactly when every column of is a solution of the homogeneous system . Consequently there exists a nonzero with if and only if has a nonzero solution, which by Lecture 3 happens exactly when the columns of are linearly dependent.
The -th column of is , and a matrix is zero exactly when all of its columns are zero; that is the first equivalence, and the second is the definition of a solution. For the consequence: if has a nonzero solution , put that in one column of and zeros elsewhere — then and . Conversely, if and , some column is nonzero and solves .
□The failure has a familiar-looking consequence: does not in general allow us to cancel and conclude , since only says , and by the proposition may be a nonzero matrix whose columns all solve . With as above, and satisfy with .
The proposition also says exactly when cancellation is allowed. For an matrix the following are equivalent:
- implies , for all matrices and (any );
- has only the trivial solution;
- the columns of are linearly independent.
Let and . What is the entry of ?
Row of against column of : .
is and is . Which statement is true?
would need the columns of () to match the rows of ().
Let . Among the vectors , , , how many are columns that could appear in a matrix with ?
A column may appear exactly when it solves , that is .
4.3 Inverses and elementary matrices
A map that is bijective can be undone: every output came from exactly one input, so “go back” is itself a well-defined map. On the matrix side, undoing means finding a matrix with . Two questions follow. Which square matrices have one, and how do we compute it? The answers turn out to be the elimination we already know, packaged as multiplication: each row operation is itself a matrix, and running Gaussian elimination on is the same as multiplying by a string of them.
A square matrix is invertible (or nonsingular) if there is an matrix with A matrix with no such is called singular.
If and both satisfy and , then . We may therefore speak of the inverse of , written .
Using the identity rule and associativity,
□Let be and let be the associated linear map . Then is invertible if and only if is bijective, and in that case is the matrix of the inverse map .
Suppose is invertible with inverse , and let . By the composition theorem, has matrix and has matrix , so both composites are the identity map. Hence is injective (if , apply to get ) and surjective (given , the vector maps to it), so is bijective with .
Conversely, suppose is bijective and let be its inverse function, which exists because each has exactly one preimage. is linear: given and a scalar , write ; then and , so applying gives and . Being linear, has a matrix , and since and are both the identity map, whose matrix is , the composition theorem gives and .
□Let be an invertible matrix. Then for every the system has the unique solution . In particular the -th column of is the unique solution of
If then multiplying on the left by and using associativity gives , so there is at most one solution; and shows it is one. Taking , the solution is , which is the -th column of .
□The theorem turns the inverse into linear systems . They share the same coefficient matrix, so the same row operations solve all of them: place all right-hand sides side by side and reduce If the left block cannot be driven to — some column ends up without a pivot — then is not invertible, as the theorem after next explains. Solving a single system is not a reason to compute : reducing does one system's work instead of .
Let . Reduce , clearing the first column, then the second, then the third: Three pivots have appeared, so will reduce to . The last pivot is , so scaling it to brings in fractions. Scale the last row, then clear upward: So and the check is worth doing once by hand; the factor can wait until the end, since times the integer matrix is . Read the first column: is the solution of . Although has integer entries, its inverse does not: here the pivot forced a division by .
The method of computing works for any matrix equation , where is and is with columns , and the unknown is . Neither nor need be square, and need not be invertible. Since the -th column of is (the definition of the product), the single equation is the list of systems all with the same coefficient matrix. So reduce once, and read off each column separately. has a solution exactly when every one of the systems is consistent, that is, when no zero row of is next to a nonzero entry of . The free variables are the same for every column, and by the structure theorem each column of a solution is a particular solution plus a solution of ; equivalently, if is one solution, all solutions are with (compare the proposition on ). The solution is unique exactly when the columns of are independent. When is square and invertible the reduction ends in and ; taking recovers the inverse algorithm.
Solve for where the unknown is . Reduce , with the bar after column : The left block has only two pivots, so is not invertible and there is no to compute. But the zero row of the left block is next to zeros on the right, so both systems are consistent. The variable is free in each. Reading column of the right block: , , ; column : , , . Hence the solutions are a particular solution plus a matrix whose columns are multiples of the solution of , with an independent parameter for each column. Check the particular solution: and .
Not every works. The same row operations turn a right-hand column into one whose last entry is , so a column of is allowed exactly when . Both columns above satisfy it; replacing either by would make have no solution.
Let and be invertible matrices and a scalar. Then , , and are invertible, with
, not : to undo `` first, then '' one undoes first, then . Socks then shoes; shoes off then socks off.
For with , as multiplying out confirms: both products equal before the scalar is applied. For example has and inverse . When the matrix is not invertible: its columns are then dependent, so has a nonzero solution.
An matrix is elementary if it is obtained from by a single elementary row operation. There are three kinds, illustrated for :
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 .
Row of a product is the row–column product of row of against the columns of ; writing for the rows of , if row of is then row of is . Now read off the three kinds. A swap of and makes row of equal to , so row of is , and symmetrically for row ; every other row of is unchanged and reproduces its own row of . Scaling by makes row of equal , giving . Adding times to makes row of equal , giving . In each case is with that one operation performed.
□Every elementary matrix is invertible, and is the elementary matrix of the reverse operation — so is itself elementary.
Each elementary row operation is undone by an operation of the same kind: a swap of undoes itself; scaling by is undone by scaling by ; adding times to is undone by adding times to . Let be the elementary matrix of the reverse operation. Applying the operation and then its reverse to returns , so by the previous lemma ; doing them in the other order gives .
□For an matrix the following are equivalent:
- is invertible;
- can be transformed into by a sequence of elementary row operations;
- an echelon form of has pivots, one in every row and every column;
- has only the trivial solution;
- has a (unique) solution for every .
(1) (5) is the column theorem: solves the system and is the only solution.
(5) (3): the map is surjective and injective, so by Lecture 3 the number of pivots satisfies (from injectivity) — and with every row has a pivot too.
(3) (2): a pivot in every column means the reduced echelon form has a leading in each column and zeros elsewhere in that column; an matrix in reduced echelon form with pivots is . Since elimination reaches that form by row operations, becomes .
(2) (1): let be the elementary matrices of the operations used, so by the action lemma . Put , which is invertible by the invertibility lemma and the product rule for inverses. From we get , and hence also ; so is invertible with .
(3) (4) is the existence–uniqueness theorem: is consistent, and its solution is unique exactly when there are no free variables, that is when every column is a pivot column.
□The proof of (2) (1) delivered from alone. That is a general fact for square matrices: if then forces , so by the theorem is invertible, and multiplying on the right by gives . For square matrices one side suffices — but the squareness is essential.
An matrix is invertible if and only if is a product of elementary matrices.
() A product of invertible matrices is invertible by the product rule, and each elementary matrix is invertible by the invertibility lemma.
() Let be invertible. By the previous theorem there are elementary matrices with . Multiplying on the left by in turn — or, equivalently, inverting both sides and using — gives and each is elementary by the same lemma.
□Reduce to in three operations, recording each as an elementary matrix: Hence , and inverting each factor, which multiplies back to — a shear, a scaling, and another shear. Every invertible matrix factors this way, so every bijective linear map is a finite sequence of these three elementary motions.
Let . What is the entry of ?
Here , so .
An matrix has an echelon form with a row of zeros. Which statement is false?
A zero row means fewer than pivots. But always gives a consistent system.
Let be the elementary matrix for the operation . What is the entry of ?
performs the reverse operation .
Two threads are now open. First, the invertibility theorem lists five equivalent conditions and will keep growing — each new idea in the course adds a line to it, and by the end it is the single most useful theorem we have. Second, deciding invertibility currently costs a full elimination; for small matrices the quantity of the formula answered the question with one number, and next week we look for the general such number: the determinant.
Index of statements
- Definition 4.1 (Sum and scalar multiple of maps)
- Proposition 4.2 (Sums and multiples of linear maps are linear)
- Definition 4.3 (Sum and scalar multiple of matrices)
- Theorem 4.4 (The dictionary respects sums and multiples)
- Remark 4.5 (Why entrywise is the only option)
- Example 4.6 (Two projections that add to the identity)
- Proposition 4.7 (Arithmetic of matrix addition)
- Remark 4.8 (Matrices as vectors)
- Definition 4.9 (Composition)
- Proposition 4.10 (Composition of linear maps is linear)
- Definition 4.11 (Matrix product)
- Proposition 4.12 (The entry formula)
- Theorem 4.13 (Matrix product = composition)
- Remark 4.14 (How to read the definition)
- Example 4.15 (Sizes, and a product both ways)
- Example 4.16 (Composing rotations)
- Theorem 4.17 (Properties of the product)
- Example 4.18 (The product is not commutative)
- Definition 4.19 (Powers of a square matrix)
- Example 4.20 (Powers of a rotation and a nilpotent matrix)
- Example 4.21 (A product of nonzero matrices can be zero)
- Proposition 4.22 ( and the equation )
- Remark 4.23 (When cancellation is allowed)
- Definition 4.24 (Invertible matrix)
- Proposition 4.25 (The inverse is unique)
- Theorem 4.26 (Invertible matrices are the bijective maps)
- Theorem 4.27 (The inverse, column by column)
- Remark 4.28 (Computing : solve systems at once)
- Example 4.29 (Inverting a matrix)
- Remark 4.30 (Solving the matrix equation )
- Example 4.31 (A matrix equation with a singular coefficient matrix)
- Proposition 4.32 (Arithmetic of inverses)
- Remark 4.33 (Why the order reverses)
- Example 4.34 (The formula)
- Definition 4.35 (Elementary matrix)
- Lemma 4.36 (Row operations are left multiplications)
- Lemma 4.37 (Elementary matrices are invertible)
- Theorem 4.38 (Invertible row reduces to )
- Remark 4.39 (A one-sided inverse is enough)
- Theorem 4.40 (Invertible a product of elementary matrices)
- Example 4.41 (Factoring a matrix into elementary matrices)
- Remark 4.42 (Looking ahead)