Linear Algebra — Lecture 4

Lecture 4: Operations on Linear Maps and Matrices

Shuhong Gao  ·  Clemson University

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

💡 Intuition

Lecture 3 ended with a dictionary: linear maps ℝn→ℝm\mathbb{R}^n \to \mathbb{R}^m on one side, m×nm \times n 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.

Definition 4.1 (Sum and scalar multiple of maps)

Let f,g:ℝn→ℝmf, g \colon \mathbb{R}^n \to \mathbb{R}^m be functions and let c∈ℝc \in \mathbb{R}. Their sum f+gf + g and the scalar multiple cfc f are the functions ℝn→ℝm\mathbb{R}^n \to \mathbb{R}^m defined pointwise: (f+g)(𝐱)=f(𝐱)+g(𝐱),(cf)(𝐱)=cf(𝐱)for every 𝐱∈ℝn.(f+g)(\mathbf{x}) = f(\mathbf{x}) + g(\mathbf{x}), \qquad (c f)(\mathbf{x}) = c\, f(\mathbf{x}) \qquad \text{for every } \mathbf{x} \in \mathbb{R}^n . The right-hand sides are the vector operations of Lecture 1, performed in ℝm\mathbb{R}^m after both functions have been evaluated.

Proposition 4.2 (Sums and multiples of linear maps are linear)

If f,g:ℝn→ℝmf, g \colon \mathbb{R}^n \to \mathbb{R}^m are linear maps and c∈ℝc \in \mathbb{R}, then f+gf + g and cfc f are linear maps.

Definition 4.3 (Sum and scalar multiple of matrices)

Let A=(aij)A = (a_{ij}) and B=(bij)B = (b_{ij}) be matrices of the same size m×nm \times n, and let c∈ℝc \in \mathbb{R}. Then A+BA + B and cAcA are the m×nm \times n matrices with entries (A+B)ij=aij+bij,(cA)ij=caij.(A+B)_{ij} = a_{ij} + b_{ij}, \qquad (cA)_{ij} = c\,a_{ij} . Both operations act entry by entry; neither is defined for matrices of different sizes. The m×nm \times n matrix of all zeros is written 0\mathbf{0}, and −A-A means (−1)A(-1)A.

Theorem 4.4 (The dictionary respects sums and multiples)

Let f,g:ℝn→ℝmf, g \colon \mathbb{R}^n \to \mathbb{R}^m be linear maps with matrices AA and BB, and let c∈ℝc \in \mathbb{R}. Then the matrix of f+gf + g is A+BA + B, and the matrix of cfcf is cAcA.

Remark 4.5 (Why entrywise is the only option)

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 (A,B)(A, B) to the matrix whose columns are 𝐚j+𝐛j\mathbf{a}_j + \mathbf{b}_j. 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.

Example 4.6 (Two projections that add to the identity)

Let P:ℝ2→ℝ2P \colon \mathbb{R}^2 \to \mathbb{R}^2 send each vector to its shadow on the xx-axis and let QQ send it to its shadow on the yy-axis: P(xy)=(x0),Q(xy)=(0y).P\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} x \\ 0 \end{pmatrix}, \qquad Q\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 0 \\ y \end{pmatrix}. Reading each matrix off the images of 𝐞1\mathbf{e}_1 and 𝐞2\mathbf{e}_2 gives A=(1000),B=(0001),A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, \qquad B = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}, and then A+B=(1001)=I2,A + B = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = I_2 , which says P+QP + Q is the identity map — as the picture demands: a vector is the sum of its two shadows. Note also 2P2P has matrix (2000)\begin{pmatrix} 2 & 0 \\ 0 & 0 \end{pmatrix}, the map that projects and then doubles.

Proposition 4.7 (Arithmetic of matrix addition)

For m×nm \times n matrices A,B,CA, B, C and scalars c,dc, d: A+B=B+A,(A+B)+C=A+(B+C),A+0=A,A+(−A)=0,c(A+B)=cA+cB,(c+d)A=cA+dA,(cd)A=c(dA),1A=A.\begin{array}{lll} A + B = B + A, &\quad (A+B)+C = A+(B+C), &\quad A + \mathbf{0} = A, \\[2pt] A + (-A) = \mathbf{0}, &\quad c(A+B) = cA + cB, &\quad (c+d)A = cA + dA, \\[2pt] (cd)A = c(dA), &\quad 1A = A. & \end{array}

Remark 4.8 (Matrices as vectors)

The eight rules above are precisely the rules obeyed by vectors in ℝm\mathbb{R}^m. That is no accident: an m×nm \times n matrix is mnmn numbers in a rectangular arrangement, and for the purposes of addition and scaling the arrangement is irrelevant — the set of m×nm \times n matrices behaves exactly like ℝmn\mathbb{R}^{mn}. What makes matrices more than a reshaped list of numbers is the product defined in the next section.

Exercise 4.1 auto-check

Let A=(120−1)A = \begin{pmatrix} 1 & 2 \\ 0 & -1 \end{pmatrix} and B=(3−241)B = \begin{pmatrix} 3 & -2 \\ 4 & 1 \end{pmatrix}. What is the (2,1)(2,1) entry of 2A+B2A + B?

Answer:
Exercise 4.2 auto-check

Let f,g:ℝn→ℝmf, g \colon \mathbb{R}^n \to \mathbb{R}^m be linear. Which of these is not guaranteed to be a linear map?

4.2  Composition and the matrix product

💡 Intuition

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 BB first, then AA” becomes in coordinates.

Definition 4.9 (Composition)

Let f:ℝp→ℝnf \colon \mathbb{R}^p \to \mathbb{R}^n and g:ℝn→ℝmg \colon \mathbb{R}^n \to \mathbb{R}^m be functions, the target of ff being the source of gg. Their composition g∘f:ℝp→ℝmg \circ f \colon \mathbb{R}^p \to \mathbb{R}^m is the function (g∘f)(𝐱)=g(f(𝐱)).(g \circ f)(\mathbf{x}) = g\bigl(f(\mathbf{x})\bigr) . Read it right to left: ff acts first. If the target of ff and the source of gg are different spaces, g∘fg \circ f is not defined at all.

2026-09-09T18:18:52.991004 image/svg+xml Matplotlib v3.10.9, https://matplotlib.org/ ℝ p x ℝ n f ( ) x ℝ m g f ( ( ) ) x f g g f ∘
Composition. A vector 𝐱\mathbf{x} in ℝp\mathbb{R}^p is carried by ff to f(𝐱)f(\mathbf{x}) in ℝn\mathbb{R}^n, and that vector is carried by gg to g(f(𝐱))g(f(\mathbf{x})) in ℝm\mathbb{R}^m. The outer arrow is the single map g∘fg \circ f that does both at once; the middle space is where the two maps must agree, which is why the sizes m×nm \times n and n×pn \times p must match.
Proposition 4.10 (Composition of linear maps is linear)

If f:ℝp→ℝnf \colon \mathbb{R}^p \to \mathbb{R}^n and g:ℝn→ℝmg \colon \mathbb{R}^n \to \mathbb{R}^m are linear, so is g∘f:ℝp→ℝmg \circ f \colon \mathbb{R}^p \to \mathbb{R}^m.

Definition 4.11 (Matrix product)

Let AA be m×nm \times n and let BB be n×pn \times p with columns 𝐛1,…,𝐛p∈ℝn\mathbf{b}_1, \dots, \mathbf{b}_p \in \mathbb{R}^n. The product ABAB is the m×pm \times p matrix whose jj-th column is A𝐛jA\mathbf{b}_j: AB=(A𝐛1A𝐛2⋯A𝐛p).AB = \begin{pmatrix} A\mathbf{b}_1 & A\mathbf{b}_2 & \cdots & A\mathbf{b}_p \end{pmatrix} . The product is defined only when the number of columns of AA equals the number of rows of BB; the result inherits the rows of AA and the columns of BB: (m×n)⏟A⋅(n×p)⏟B=(m×p)⏟AB.\underbrace{(m \times n)}_{A} \cdot \underbrace{(n \times p)}_{B} = \underbrace{(m \times p)}_{AB} .

Proposition 4.12 (The entry formula)

With AA and BB as above, the (i,j)(i,j) entry of ABAB is the row–column product of the ii-th row of AA with the jj-th column of BB: (AB)ij=ai1b1j+ai2b2j+⋯+ainbnj=∑k=1naikbkj.(AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{in}b_{nj} = \sum_{k=1}^{n} a_{ik} b_{kj} .

Theorem 4.13 (Matrix product = composition)

Let f:ℝp→ℝnf \colon \mathbb{R}^p \to \mathbb{R}^n have matrix BB and let g:ℝn→ℝmg \colon \mathbb{R}^n \to \mathbb{R}^m have matrix AA. Then the matrix of g∘fg \circ f is ABAB; equivalently A(B𝐱)=(AB)𝐱for all 𝐱∈ℝp.A(B\mathbf{x}) = (AB)\mathbf{x} \qquad \text{for all } \mathbf{x} \in \mathbb{R}^p .

Remark 4.14 (How to read the definition)

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 g∘fg \circ f exists only for matching spaces; ABAB is m×pm \times p because g∘fg \circ f maps ℝp\mathbb{R}^p to ℝm\mathbb{R}^m; and ABAB means ``BB first, then AA'' because g∘fg \circ f does. In particular the order in ABAB is not a matter of taste, and the next results show it cannot be reversed.

Example 4.15 (Sizes, and a product both ways)

Let A=(10231−1),B=(120140),A = \begin{pmatrix} 1 & 0 & 2 \\ 3 & 1 & -1 \end{pmatrix}, \qquad B = \begin{pmatrix} 1 & 2 \\ 0 & 1 \\ 4 & 0 \end{pmatrix}, so AA is 2×32 \times 3 and BB is 3×23 \times 2. Both products exist, and they are not even the same size: AB=(10231−1)(120140)=(92−17),AB = \begin{pmatrix} 1 & 0 & 2 \\ 3 & 1 & -1 \end{pmatrix} \begin{pmatrix} 1 & 2 \\ 0 & 1 \\ 4 & 0 \end{pmatrix} = \begin{pmatrix} 9 & 2 \\ -1 & 7 \end{pmatrix}, which is 2×22 \times 2, while BA=(120140)(10231−1)=(72031−1408),BA = \begin{pmatrix} 1 & 2 \\ 0 & 1 \\ 4 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 & 2 \\ 3 & 1 & -1 \end{pmatrix} = \begin{pmatrix} 7 & 2 & 0 \\ 3 & 1 & -1 \\ 4 & 0 & 8 \end{pmatrix}, which is 3×33 \times 3.

Check one entry by each recipe. Column view: the first column of ABAB is A(104)T=1(13)+0(01)+4(2−1)=(9−1)A\begin{pmatrix} 1 & 0 & 4 \end{pmatrix}^{T} = 1\begin{pmatrix} 1 \\ 3 \end{pmatrix} + 0\begin{pmatrix} 0 \\ 1 \end{pmatrix} + 4\begin{pmatrix} 2 \\ -1 \end{pmatrix} = \begin{pmatrix} 9 \\ -1 \end{pmatrix}. Entry view: (AB)12=1⋅2+0⋅1+2⋅0=2(AB)_{12} = 1\cdot 2 + 0 \cdot 1 + 2 \cdot 0 = 2.

Example 4.16 (Composing rotations)

Let RθR_\theta be the rotation matrix of Lecture 3. Rotating by β\beta and then by α\alpha turns every vector through α+β\alpha + \beta, so composition gives RαRβ=Rα+βR_\alpha R_\beta = R_{\alpha+\beta}. Multiply the matrices out and read the first column: RαRβ=(cosα−sinαsinαcosα)(cosβ−sinβsinβcosβ)=(cosαcosβ−sinαsinβ−(sinαcosβ+cosαsinβ)sinαcosβ+cosαsinβcosαcosβ−sinαsinβ).\begin{aligned} R_\alpha R_\beta &= \begin{pmatrix} \cos\alpha & -\sin\alpha \\ \sin\alpha & \cos\alpha \end{pmatrix} \begin{pmatrix} \cos\beta & -\sin\beta \\ \sin\beta & \cos\beta \end{pmatrix} \\[4pt] &= \begin{pmatrix} \cos\alpha\cos\beta - \sin\alpha\sin\beta & -(\sin\alpha\cos\beta + \cos\alpha\sin\beta) \\ \sin\alpha\cos\beta + \cos\alpha\sin\beta & \cos\alpha\cos\beta - \sin\alpha\sin\beta \end{pmatrix}. \end{aligned} Comparing with Rα+βR_{\alpha+\beta} entry by entry recovers the angle-addition formulas cos(α+β)=cosαcosβ−sinαsinβ\cos(\alpha+\beta) = \cos\alpha\cos\beta - \sin\alpha\sin\beta and sin(α+β)=sinαcosβ+cosαsinβ\sin(\alpha+\beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta. A geometric fact about turning has become a trigonometric identity, proved by one matrix multiplication.

Theorem 4.17 (Properties of the product)

Whenever the sizes make the products defined:

  1. Associativity: A(BC)=(AB)CA(BC) = (AB)C.
  2. Distributivity: A(B+C)=AB+ACA(B+C) = AB + AC and (A+B)C=AC+BC(A+B)C = AC + BC.
  3. Scalars: c(AB)=(cA)B=A(cB)c(AB) = (cA)B = A(cB) for every scalar cc.
  4. Identity: ImA=A=AInI_m A = A = A I_n for AA of size m×nm \times n, where IkI_k is the k×kk \times k matrix with 11 on the diagonal and 00 elsewhere.
  5. Transpose: (AB)T=BTAT(AB)^{T} = B^{T} A^{T} — the order reverses.

Example 4.18 (The product is not commutative)

Even when AA and BB are square of the same size, so that both ABAB and BABA are defined and of that size, they are usually different. Take A=(0100),B=(0010).A = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, \qquad B = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix} . Then AB=(1000),BA=(0001).AB = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, \qquad BA = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} . Not merely unequal — they have no nonzero entry in common. Geometry makes the failure unsurprising. Let R=R90∘R = R_{90^\circ} be a quarter turn and let F=(100−1)F = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} be the reflection in the xx-axis. Then RF=(0110),FR=(0−1−10)=−RF.RF = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad FR = \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix} = -RF . 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 AB=BAAB = BA is a special property of a particular pair, never a law.

Definition 4.19 (Powers of a square matrix)

Let AA be an n×nn \times n matrix. Its powers are A0=In,Ak=AAk−1(k=1,2,3,…),A^{0} = I_n, \qquad A^{k} = A\,A^{k-1} \quad (k = 1, 2, 3, \dots), so Ak=AA⋯AA^{k} = A A \cdots A with kk factors; by associativity the placement of parentheses does not matter. Powers are defined only for square matrices, since AAAA requires the number of columns of AA to equal its number of rows. In terms of maps, if T(𝐱)=A𝐱T(\mathbf{x}) = A\mathbf{x} then, by the composition theorem, AkA^{k} is the matrix of T∘T∘⋯∘TT \circ T \circ \cdots \circ T (kk times): apply TT repeatedly. Counting factors gives the familiar exponent laws AjAk=Aj+k=AkAj,(Aj)k=Ajk(j,k≥0),A^{j} A^{k} = A^{j+k} = A^{k} A^{j}, \qquad (A^{j})^{k} = A^{jk} \qquad (j, k \ge 0), so powers of the same matrix always commute. The laws that mix two matrices, however, can fail because the product is not commutative: (AB)2=ABAB(AB)^2 = ABAB, which need not equal A2B2=AABBA^2B^2 = AABB, and (A+B)2=A2+AB+BA+B2(A+B)^2 = A^2 + AB + BA + B^2, which equals A2+2AB+B2A^2 + 2AB + B^2 only when AB=BAAB = BA.

Example 4.20 (Powers of a rotation and a nilpotent matrix)

Rotating kk times by θ\theta is rotating by kθk\theta, so by the rotation example Rθk=RkθR_\theta^{\,k} = R_{k\theta}; in particular R90∘4=R360∘=I2R_{90^\circ}^{\,4} = R_{360^\circ} = I_2. At the other extreme, N=(010001000),N2=(001000000),N3=0,N = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix}, \qquad N^{2} = \begin{pmatrix} 0 & 0 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}, \qquad N^{3} = \mathbf{0}, since NN sends 𝐞3↦𝐞2↦𝐞1↦0\mathbf{e}_3 \mapsto \mathbf{e}_2 \mapsto \mathbf{e}_1 \mapsto \mathbf{0}. 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.

Exercise 4.3 auto-check

Let A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}. What is the (1,2)(1,2) entry of A5A^{5}?

Answer:
Example 4.21 (A product of nonzero matrices can be zero)

Let A=(1−11−1),B=(1111),thenAB=(0000),A = \begin{pmatrix} 1 & -1 \\ 1 & -1 \end{pmatrix}, \qquad B = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}, \qquad\text{then}\qquad AB = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}, although neither factor has a single zero entry. (Order matters here too: BA=(2−22−2)≠0BA = \begin{pmatrix} 2 & -2 \\ 2 & -2 \end{pmatrix} \ne \mathbf{0}.) For numbers, ab=0ab = 0 forces a=0a = 0 or b=0b = 0; for matrices that inference is simply false, and the next proposition says exactly what AB=0AB = \mathbf{0} does mean.

Proposition 4.22 (AB=0AB = \mathbf{0} and the equation A𝐱=0A\mathbf{x} = \mathbf{0})

Let AA be m×nm \times n and BB be n×pn \times p with columns 𝐛1,…,𝐛p\mathbf{b}_1, \dots, \mathbf{b}_p. Then AB=0⇔A𝐛j=0for j=1,…,p,AB = \mathbf{0} \qquad\Longleftrightarrow\qquad A\mathbf{b}_j = \mathbf{0} \quad\text{for } j = 1, \dots, p , that is, exactly when every column of BB is a solution of the homogeneous system A𝐱=0A\mathbf{x} = \mathbf{0}. Consequently there exists a nonzero BB with AB=0AB = \mathbf{0} if and only if A𝐱=0A\mathbf{x} = \mathbf{0} has a nonzero solution, which by Lecture 3 happens exactly when the columns of AA are linearly dependent.

Remark 4.23 (When cancellation is allowed)

The failure has a familiar-looking consequence: AB=ACAB = AC does not in general allow us to cancel AA and conclude B=CB = C, since AB=ACAB = AC only says A(B−C)=0A(B - C) = \mathbf{0}, and by the proposition B−CB - C may be a nonzero matrix whose columns all solve A𝐱=0A\mathbf{x} = \mathbf{0}. With A=(1−11−1)A = \begin{pmatrix} 1 & -1 \\ 1 & -1 \end{pmatrix} as above, B=(1111)B = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix} and C=0C = \mathbf{0} satisfy AB=ACAB = AC with B≠CB \ne C.

The proposition also says exactly when cancellation is allowed. For an m×nm \times n matrix AA the following are equivalent:

  1. AB=ACAB = AC implies B=CB = C, for all n×pn \times p matrices BB and CC (any pp);
  2. A𝐱=0A\mathbf{x} = \mathbf{0} has only the trivial solution;
  3. the columns of AA are linearly independent.
Indeed (2) ⇔\Leftrightarrow (3) is Lecture 3, and for (1) ⇔\Leftrightarrow (2): if A𝐱=0A\mathbf{x} = \mathbf{0} forces 𝐱=0\mathbf{x} = \mathbf{0}, then A(B−C)=0A(B-C) = \mathbf{0} makes every column of B−CB - C zero, so B=CB = C; conversely, if some 𝐯≠0\mathbf{v} \ne \mathbf{0} has A𝐯=0A\mathbf{v} = \mathbf{0}, then BB with every column 𝐯\mathbf{v} and C=0C = \mathbf{0} give AB=ACAB = AC with B≠CB \ne C. Note that AA need not be square: independent columns are what cancellation requires, and for square matrices the next section shows this is the same as having an inverse.

Exercise 4.4 auto-check

Let A=(2−103)A = \begin{pmatrix} 2 & -1 \\ 0 & 3 \end{pmatrix} and B=(1450)B = \begin{pmatrix} 1 & 4 \\ 5 & 0 \end{pmatrix}. What is the (1,2)(1,2) entry of ABAB?

Answer:
Exercise 4.5 auto-check

AA is 3×53 \times 5 and BB is 5×25 \times 2. Which statement is true?

Exercise 4.6 auto-check

Let A=(1224)A = \begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix}. Among the vectors (2−1)T\begin{pmatrix} 2 & -1 \end{pmatrix}^{T}, (11)T\begin{pmatrix} 1 & 1 \end{pmatrix}^{T}, (−42)T\begin{pmatrix} -4 & 2 \end{pmatrix}^{T}, how many are columns that could appear in a matrix BB with AB=0AB = \mathbf{0}?

Answer:

4.3  Inverses and elementary matrices

💡 Intuition

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 BB with AB=BA=IAB = BA = I. 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 AA is the same as multiplying AA by a string of them.

Definition 4.24 (Invertible matrix)

A square n×nn \times n matrix AA is invertible (or nonsingular) if there is an n×nn \times n matrix BB with AB=InandBA=In.AB = I_n \qquad\text{and}\qquad BA = I_n . A matrix with no such BB is called singular.

Proposition 4.25 (The inverse is unique)

If BB and CC both satisfy AB=BA=InAB = BA = I_n and AC=CA=InAC = CA = I_n, then B=CB = C. We may therefore speak of the inverse of AA, written A−1A^{-1}.

Theorem 4.26 (Invertible matrices are the bijective maps)

Let AA be n×nn \times n and let T(𝐱)=A𝐱T(\mathbf{x}) = A\mathbf{x} be the associated linear map ℝn→ℝn\mathbb{R}^n \to \mathbb{R}^n. Then AA is invertible if and only if TT is bijective, and in that case A−1A^{-1} is the matrix of the inverse map T−1T^{-1}.

Theorem 4.27 (The inverse, column by column)

Let AA be an invertible n×nn \times n matrix. Then for every 𝐛∈ℝn\mathbf{b} \in \mathbb{R}^n the system A𝐱=𝐛A\mathbf{x} = \mathbf{b} has the unique solution 𝐱=A−1𝐛\mathbf{x} = A^{-1}\mathbf{b}. In particular the jj-th column of A−1A^{-1} is the unique solution of A𝐱=𝐞j.A\mathbf{x} = \mathbf{e}_j .

Remark 4.28 (Computing A−1A^{-1}: solve nn systems at once)

The theorem turns the inverse into nn linear systems A𝐱=𝐞1,…,A𝐱=𝐞nA\mathbf{x} = \mathbf{e}_1, \dots, A\mathbf{x} = \mathbf{e}_n. They share the same coefficient matrix, so the same row operations solve all of them: place all nn right-hand sides side by side and reduce (A∣In)→(In∣A−1).(\,A \mid I_n\,) \ \longrightarrow \ (\,I_n \mid A^{-1}\,) . If the left block cannot be driven to InI_n — some column ends up without a pivot — then AA is not invertible, as the theorem after next explains. Solving a single system A𝐱=𝐛A\mathbf{x} = \mathbf{b} is not a reason to compute A−1A^{-1}: reducing (A∣𝐛)(\,A \mid \mathbf{b}\,) does one system's work instead of nn.

Example 4.29 (Inverting a 3×33 \times 3 matrix)

Let A=(112121211)A = \begin{pmatrix} 1 & 1 & 2 \\ 1 & 2 & 1 \\ 2 & 1 & 1 \end{pmatrix}. Reduce (A∣I3)(\,A \mid I_3\,), clearing the first column, then the second, then the third: →R3+R2(112100121010211001)→R2−R1R3−2R1(11210001−1−1100−1−3−201)→R3+R2(11210001−1−11000−4−311).\begin{aligned} &\phantom{\overset{R_3 + R_2}{\longrightarrow}} \begin{pmatrix} 1 & 1 & 2 & 1 & 0 & 0 \\ 1 & 2 & 1 & 0 & 1 & 0 \\ 2 & 1 & 1 & 0 & 0 & 1 \end{pmatrix} \\[4pt] &\overset{\substack{R_2 - R_1 \\ R_3 - 2R_1}}{\longrightarrow} \begin{pmatrix} 1 & 1 & 2 & 1 & 0 & 0 \\ 0 & 1 & -1 & -1 & 1 & 0 \\ 0 & -1 & -3 & -2 & 0 & 1 \end{pmatrix} \\[4pt] &\overset{R_3 + R_2}{\longrightarrow} \begin{pmatrix} 1 & 1 & 2 & 1 & 0 & 0 \\ 0 & 1 & -1 & -1 & 1 & 0 \\ 0 & 0 & -4 & -3 & 1 & 1 \end{pmatrix}. \end{aligned} Three pivots have appeared, so AA will reduce to I3I_3. The last pivot is −4-4, so scaling it to 11 brings in fractions. Scale the last row, then clear upward: →−14R3(11210001−1−11000134−14−14)→R2+R3R1−2R3(110−121212010−1434−1400134−14−14)→R1−R2(100−14−1434010−1434−1400134−14−14)=(I3∣A−1).\begin{aligned} &\overset{-\frac{1}{4}R_3}{\longrightarrow} \begin{pmatrix} 1 & 1 & 2 & 1 & 0 & 0 \\ 0 & 1 & -1 & -1 & 1 & 0 \\ 0 & 0 & 1 & \tfrac{3}{4} & -\tfrac{1}{4} & -\tfrac{1}{4} \end{pmatrix} \\[4pt] &\overset{\substack{R_2 + R_3 \\ R_1 - 2R_3}}{\longrightarrow} \begin{pmatrix} 1 & 1 & 0 & -\tfrac{1}{2} & \tfrac{1}{2} & \tfrac{1}{2} \\ 0 & 1 & 0 & -\tfrac{1}{4} & \tfrac{3}{4} & -\tfrac{1}{4} \\ 0 & 0 & 1 & \tfrac{3}{4} & -\tfrac{1}{4} & -\tfrac{1}{4} \end{pmatrix} \\[4pt] &\overset{R_1 - R_2}{\longrightarrow} \begin{pmatrix} 1 & 0 & 0 & -\tfrac{1}{4} & -\tfrac{1}{4} & \tfrac{3}{4} \\ 0 & 1 & 0 & -\tfrac{1}{4} & \tfrac{3}{4} & -\tfrac{1}{4} \\ 0 & 0 & 1 & \tfrac{3}{4} & -\tfrac{1}{4} & -\tfrac{1}{4} \end{pmatrix} = (\,I_3 \mid A^{-1}\,). \end{aligned} So A−1=14(−1−13−13−13−1−1),A^{-1} = \frac{1}{4}\begin{pmatrix} -1 & -1 & 3 \\ -1 & 3 & -1 \\ 3 & -1 & -1 \end{pmatrix}, and the check AA−1=I3AA^{-1} = I_3 is worth doing once by hand; the factor 14\tfrac14 can wait until the end, since AA times the integer matrix is 4I34I_3. Read the first column: (−14−1434)T\begin{pmatrix} -\tfrac14 & -\tfrac14 & \tfrac34 \end{pmatrix}^{T} is the solution of A𝐱=𝐞1A\mathbf{x} = \mathbf{e}_1. Although AA has integer entries, its inverse does not: here the pivot −4-4 forced a division by 44.

Remark 4.30 (Solving the matrix equation AX=BAX = B)

The method of computing A−1A^{-1} works for any matrix equation AX=BAX = B, where AA is m×nm \times n and BB is m×pm \times p with columns 𝐛1,…,𝐛p\mathbf{b}_1, \dots, \mathbf{b}_p, and the unknown XX is n×pn \times p. Neither AA nor BB need be square, and AA need not be invertible. Since the jj-th column of AXAX is A𝐱jA\mathbf{x}_j (the definition of the product), the single equation AX=BAX = B is the list of pp systems A𝐱1=𝐛1,…,A𝐱p=𝐛p,A\mathbf{x}_1 = \mathbf{b}_1, \quad \dots, \quad A\mathbf{x}_p = \mathbf{b}_p , all with the same coefficient matrix. So reduce once, (A∣B)→(R∣C)(R the reduced echelon form of A),(\,A \mid B\,) \ \longrightarrow \ (\,R \mid C\,) \qquad (R \text{ the reduced echelon form of } A), and read off each column separately. AX=BAX = B has a solution exactly when every one of the pp systems is consistent, that is, when no zero row of RR is next to a nonzero entry of CC. 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 A𝐱=0A\mathbf{x} = \mathbf{0}; equivalently, if X0X_0 is one solution, all solutions are X0+HX_0 + H with AH=0AH = \mathbf{0} (compare the proposition on AB=0AB = \mathbf{0}). The solution is unique exactly when the columns of AA are independent. When AA is square and invertible the reduction ends in (In∣A−1B)(\,I_n \mid A^{-1}B\,) and X=A−1BX = A^{-1}B; taking B=InB = I_n recovers the inverse algorithm.

Example 4.31 (A matrix equation with a singular coefficient matrix)

Solve AX=BAX = B for A=(121243120),B=(225313),A = \begin{pmatrix} 1 & 2 & 1 \\ 2 & 4 & 3 \\ 1 & 2 & 0 \end{pmatrix}, \qquad B = \begin{pmatrix} 2 & 2 \\ 5 & 3 \\ 1 & 3 \end{pmatrix}, where the unknown XX is 3×23 \times 2. Reduce (A∣B)(\,A \mid B\,), with the bar after column 33: →R3+R2(121222435312013)→R2−2R1R3−R1(121220011−100−1−11)→R3+R2R1−R2(120130011−100000).\begin{aligned} &\phantom{\overset{R_3 + R_2}{\longrightarrow}} \begin{pmatrix} 1 & 2 & 1 & 2 & 2 \\ 2 & 4 & 3 & 5 & 3 \\ 1 & 2 & 0 & 1 & 3 \end{pmatrix} \\[4pt] &\overset{\substack{R_2 - 2R_1 \\ R_3 - R_1}}{\longrightarrow} \begin{pmatrix} 1 & 2 & 1 & 2 & 2 \\ 0 & 0 & 1 & 1 & -1 \\ 0 & 0 & -1 & -1 & 1 \end{pmatrix} \\[4pt] &\overset{\substack{R_3 + R_2 \\ R_1 - R_2}}{\longrightarrow} \begin{pmatrix} 1 & 2 & 0 & 1 & 3 \\ 0 & 0 & 1 & 1 & -1 \\ 0 & 0 & 0 & 0 & 0 \end{pmatrix}. \end{aligned} The left block has only two pivots, so AA is not invertible and there is no A−1BA^{-1}B to compute. But the zero row of the left block is next to zeros on the right, so both systems are consistent. The variable x2x_2 is free in each. Reading column 11 of the right block: x1=1−2sx_1 = 1 - 2s, x2=sx_2 = s, x3=1x_3 = 1; column 22: x1=3−2tx_1 = 3 - 2t, x2=tx_2 = t, x3=−1x_3 = -1. Hence the solutions are X=(1−2s3−2tst1−1)=(13001−1)+(−2s−2tst00),s,t∈ℝ,X = \begin{pmatrix} 1 - 2s & 3 - 2t \\ s & t \\ 1 & -1 \end{pmatrix} = \begin{pmatrix} 1 & 3 \\ 0 & 0 \\ 1 & -1 \end{pmatrix} + \begin{pmatrix} -2s & -2t \\ s & t \\ 0 & 0 \end{pmatrix}, \qquad s, t \in \mathbb{R}, a particular solution plus a matrix whose columns are multiples of the solution (−210)T(\,-2 \;\; 1 \;\; 0\,)^{T} of A𝐱=0A\mathbf{x} = \mathbf{0}, with an independent parameter for each column. Check the particular solution: A(101)T=(251)TA(\,1 \;\; 0 \;\; 1\,)^{T} = (\,2 \;\; 5 \;\; 1\,)^{T} and A(30−1)T=(233)TA(\,3 \;\; 0 \;\; {-1}\,)^{T} = (\,2 \;\; 3 \;\; 3\,)^{T}.

Not every BB works. The same row operations turn a right-hand column (b1b2b3)T(\,b_1 \;\; b_2 \;\; b_3\,)^{T} into one whose last entry is b2+b3−3b1b_2 + b_3 - 3b_1, so a column of BB is allowed exactly when b2+b3=3b1b_2 + b_3 = 3b_1. Both columns above satisfy it; replacing either by 𝐞1\mathbf{e}_1 would make AX=BAX = B have no solution.

Proposition 4.32 (Arithmetic of inverses)

Let AA and BB be invertible n×nn \times n matrices and c≠0c \ne 0 a scalar. Then A−1A^{-1}, ABAB, ATA^{T} and cAcA are invertible, with (A−1)−1=A,(AB)−1=B−1A−1,(AT)−1=(A−1)T,(cA)−1=1cA−1.(A^{-1})^{-1} = A, \qquad (AB)^{-1} = B^{-1}A^{-1}, \qquad (A^{T})^{-1} = (A^{-1})^{T}, \qquad (cA)^{-1} = \tfrac{1}{c} A^{-1} .

Remark 4.33 (Why the order reverses)

(AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1}, not A−1B−1A^{-1}B^{-1}: to undo ``BB first, then AA'' one undoes AA first, then BB. Socks then shoes; shoes off then socks off.

Example 4.34 (The 2×22 \times 2 formula)

For A=(abcd)A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} with ad−bc≠0ad - bc \ne 0, A−1=1ad−bc(d−b−ca),A^{-1} = \frac{1}{ad-bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}, as multiplying out confirms: both products equal (ad−bc)I2(ad-bc)I_2 before the scalar is applied. For example (3457)\begin{pmatrix} 3 & 4 \\ 5 & 7 \end{pmatrix} has ad−bc=1ad - bc = 1 and inverse (7−4−53)\begin{pmatrix} 7 & -4 \\ -5 & 3 \end{pmatrix}. When ad−bc=0ad - bc = 0 the matrix is not invertible: its columns are then dependent, so A𝐱=0A\mathbf{x} = \mathbf{0} has a nonzero solution.

Definition 4.35 (Elementary matrix)

An n×nn \times n matrix EE is elementary if it is obtained from InI_n by a single elementary row operation. There are three kinds, illustrated for n=3n = 3: (100001010)⏟swap R2↔R3,(100050001)⏟R2→5R2,(100010−401)⏟R3→R3−4R1.\underbrace{\begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}}_{\text{swap } R_2 \leftrightarrow R_3}, \qquad \underbrace{\begin{pmatrix} 1 & 0 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 1 \end{pmatrix}}_{R_2 \to 5R_2}, \qquad \underbrace{\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ -4 & 0 & 1 \end{pmatrix}}_{R_3 \to R_3 - 4R_1}.

Lemma 4.36 (Row operations are left multiplications)

Let EE be the elementary matrix obtained by performing a row operation on InI_n. Then for every n×pn \times p matrix AA, the matrix EAEA is the result of performing that same row operation on AA.

Lemma 4.37 (Elementary matrices are invertible)

Every elementary matrix EE is invertible, and E−1E^{-1} is the elementary matrix of the reverse operation — so E−1E^{-1} is itself elementary.

Theorem 4.38 (Invertible ⇔\iff row reduces to InI_n)

For an n×nn \times n matrix AA the following are equivalent:

  1. AA is invertible;
  2. AA can be transformed into InI_n by a sequence of elementary row operations;
  3. an echelon form of AA has nn pivots, one in every row and every column;
  4. A𝐱=0A\mathbf{x} = \mathbf{0} has only the trivial solution;
  5. A𝐱=𝐛A\mathbf{x} = \mathbf{b} has a (unique) solution for every 𝐛∈ℝn\mathbf{b} \in \mathbb{R}^n.

Remark 4.39 (A one-sided inverse is enough)

The proof of (2) ⇒\Rightarrow (1) delivered AB=BA=InAB = BA = I_n from BA=InBA = I_n alone. That is a general fact for square matrices: if BA=InBA = I_n then A𝐱=0A\mathbf{x} = \mathbf{0} forces 𝐱=BA𝐱=0\mathbf{x} = BA\mathbf{x} = \mathbf{0}, so by the theorem AA is invertible, and multiplying BA=InBA = I_n on the right by A−1A^{-1} gives B=A−1B = A^{-1}. For square matrices one side suffices — but the squareness is essential.

Theorem 4.40 (Invertible ⇔\iff a product of elementary matrices)

An n×nn \times n matrix AA is invertible if and only if AA is a product of elementary matrices.

Example 4.41 (Factoring a matrix into elementary matrices)

Reduce A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} to I2I_2 in three operations, recording each as an elementary matrix: R2→R2−3R1:E1=(10−31),E1A=(120−2),R2→−12R2:E2=(100−12),E2E1A=(1201),R1→R1−2R2:E3=(1−201),E3E2E1A=I2.\begin{array}{lll} R_2 \to R_2 - 3R_1: & E_1 = \begin{pmatrix} 1 & 0 \\ -3 & 1 \end{pmatrix}, & E_1 A = \begin{pmatrix} 1 & 2 \\ 0 & -2 \end{pmatrix}, \\[8pt] R_2 \to -\tfrac{1}{2}R_2: & E_2 = \begin{pmatrix} 1 & 0 \\ 0 & -\tfrac{1}{2} \end{pmatrix}, & E_2 E_1 A = \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}, \\[8pt] R_1 \to R_1 - 2R_2: & E_3 = \begin{pmatrix} 1 & -2 \\ 0 & 1 \end{pmatrix}, & E_3 E_2 E_1 A = I_2 . \end{array} Hence A−1=E3E2E1A^{-1} = E_3 E_2 E_1, and inverting each factor, A=E1−1E2−1E3−1=(1031)(100−2)(1201),A = E_1^{-1} E_2^{-1} E_3^{-1} = \begin{pmatrix} 1 & 0 \\ 3 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -2 \end{pmatrix} \begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix}, which multiplies back to (1234)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} — 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.

Exercise 4.7 auto-check

Let A=(2513)A = \begin{pmatrix} 2 & 5 \\ 1 & 3 \end{pmatrix}. What is the (1,1)(1,1) entry of A−1A^{-1}?

Answer:
Exercise 4.8 auto-check

An n×nn \times n matrix AA has an echelon form with a row of zeros. Which statement is false?

Exercise 4.9 auto-check

Let EE be the 3×33 \times 3 elementary matrix for the operation R3→R3+4R1R_3 \to R_3 + 4R_1. What is the (3,1)(3,1) entry of E−1E^{-1}?

Answer:
Remark 4.42 (Looking ahead)

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 ad−bcad - bc of the 2×22 \times 2 formula answered the question with one number, and next week we look for the general such number: the determinant.

Index of statements

  1. Definition 4.1 (Sum and scalar multiple of maps)
  2. Proposition 4.2 (Sums and multiples of linear maps are linear)
  3. Definition 4.3 (Sum and scalar multiple of matrices)
  4. Theorem 4.4 (The dictionary respects sums and multiples)
  5. Remark 4.5 (Why entrywise is the only option)
  6. Example 4.6 (Two projections that add to the identity)
  7. Proposition 4.7 (Arithmetic of matrix addition)
  8. Remark 4.8 (Matrices as vectors)
  9. Definition 4.9 (Composition)
  10. Proposition 4.10 (Composition of linear maps is linear)
  11. Definition 4.11 (Matrix product)
  12. Proposition 4.12 (The entry formula)
  13. Theorem 4.13 (Matrix product = composition)
  14. Remark 4.14 (How to read the definition)
  15. Example 4.15 (Sizes, and a product both ways)
  16. Example 4.16 (Composing rotations)
  17. Theorem 4.17 (Properties of the product)
  18. Example 4.18 (The product is not commutative)
  19. Definition 4.19 (Powers of a square matrix)
  20. Example 4.20 (Powers of a rotation and a nilpotent matrix)
  21. Example 4.21 (A product of nonzero matrices can be zero)
  22. Proposition 4.22 (AB=0AB = \mathbf{0} and the equation A𝐱=0A\mathbf{x} = \mathbf{0})
  23. Remark 4.23 (When cancellation is allowed)
  24. Definition 4.24 (Invertible matrix)
  25. Proposition 4.25 (The inverse is unique)
  26. Theorem 4.26 (Invertible matrices are the bijective maps)
  27. Theorem 4.27 (The inverse, column by column)
  28. Remark 4.28 (Computing A−1A^{-1}: solve nn systems at once)
  29. Example 4.29 (Inverting a 3×33 \times 3 matrix)
  30. Remark 4.30 (Solving the matrix equation AX=BAX = B)
  31. Example 4.31 (A matrix equation with a singular coefficient matrix)
  32. Proposition 4.32 (Arithmetic of inverses)
  33. Remark 4.33 (Why the order reverses)
  34. Example 4.34 (The 2×22 \times 2 formula)
  35. Definition 4.35 (Elementary matrix)
  36. Lemma 4.36 (Row operations are left multiplications)
  37. Lemma 4.37 (Elementary matrices are invertible)
  38. Theorem 4.38 (Invertible ⇔\iff row reduces to InI_n)
  39. Remark 4.39 (A one-sided inverse is enough)
  40. Theorem 4.40 (Invertible ⇔\iff a product of elementary matrices)
  41. Example 4.41 (Factoring a matrix into elementary matrices)
  42. Remark 4.42 (Looking ahead)