MTH 215 — Intro to Linear Algebra
Section 2.1: Matrix Operations
First, some essential terminology for an $m\times n$ matrix $A$: \[ \mat{ccccc} a_{11} & \dots & a_{1j} & \dots & a_{1n} \\ \vdots & & \vdots & & \vdots \\ a_{i 1} & \dots & a_{ij} & \dots & a_{in} \\ \vdots & & \vdots & & \vdots \\ a_{m 1} & \dots & a_{mj} & \dots & a_{mn} \\ \rix .\]
- $a_{ij}$—the entry in the $i$-th row and $j$-th column of $A$, i.e., position $(i,j)$.
- Main Diagonal—the north-west to south-east diagonal of the matrix: $a_{11}, a_{22}, \dots$.
- $\vec{a}_j$—the $j$-th column of $A$ (a vector in $\R^m $).
- Size—the size of $A$ is $m\times n$.
Two very special matrices are: \[ \text{identity matrix } I_n \; = \; \mat{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & 1 \rix_{n\times n} , \qquad \text{zero matrix } 0 \; = \; \mat{cccc} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & 0 \rix_{m\times n} .\]
- $A$ and $B$ are equal if all corresponding entries are equal:
$a_{ij} = b_{ij}$ for all $1\le i\le m$, $1\le j\le n$. - For any scalar $r$, $rA$ is a scalar multiple of $A$ with each entry multiplied by $r$:
$(rA)_{ij} = r \cdot a_{ij}$ - The sum of $A$ and $B$ is the $m\times n$ matrix $C = A + B$ consisting of the sum of corresponding entries in $A$ and $B$:
$c_{ij} = a_{ij} + b_{ij}$ for all $1\le i\le m$, $1\le j\le n$.
- $A + B = $
- $B + A = $
- $A + C = $
- $B + C = $
- $2 B = $
- $A - 2B = $
- $A + B = B + A$
- $(A+B)+C = A+(B+C)$
- $A + 0 = A$
- $r(A+B) = rA + rB$
- $(r+s)A = rA + sA$
- $r(sA) = (rs)A$
Now, we turn to multiplication. Let $B$ be an $n\times p$ matrix and $\vec{x} \in \R^p$. Suppose we compute $B \vec{x}$ and multiply this output by $A$ (an $m\times n$ matrix), obtaining $A(B \vec{x}) \in \R^m$.
Is there a single matrix which represents this final result? \begin{align*} B \vec{x} & \eq \\[5em] A (B \vec{x}) & \eq \hspace{25em} \\[5em] & \eq \\[5em] & \eq \\[5em] & \eq \end{align*}
Note:
- Matrix multiplication is not done entry-wise!
- The product $AB \, \vec{x}$ represents the composition $\vec{x} \mapsto B \vec{x} \mapsto A(B \vec{x})$.
- Each column of $AB$ is a linear combination of the columns of $A$, using weights from that column of $B$.
It is critically important to pay attention to the sizes!
If $A$ is $m\times n$ and $B$ is $n\times p$, then the $(i,j)$ entry of $AB$ is \[ (AB)_{ij} \eq a_{i 1} b_{1j} + a_{i 2} b_{2j} + \dots + a_{in} b_{nj} .\] \[ \mat{cccc} \\ \\ a_{i 1} & a_{i 2} & \dots & a_{i n} \\ \\ \\ \rix \mat{ccccccc} & & & b_{1 j} & & & \\ & & & b_{2 j} & & & \\ & & & \vdots & & & \\ & & & b_{nj} & & & \rix \eq \mat{ccccccc} \\ \\ & & & (AB)_{ij} & & & \\ \\ \\ \rix \]
Continuing the example from above, \[ AB \;=\; \mat{rr} 2 & 3 \\ 1 & -5 \rix \mat{rrr} 4 & 3 & 6 \\ 1 & -2 & 3 \rix \;=\; \hspace{30em} .\]
- $A(BC) = (AB)C$ associative law of multiplication
- $A(B+C) = AB + AC$ left-distributive law
- $(B+C)A = BA + CA$ right-distributive law
- $r(AB) = (rA)B = A(rB)$ for any scalar $r$
- $I_m A = A = A I_n$ identity for matrix multiplication
- In general, $AB \neq BA$. It is sometimes possible, though.
- If $AB = AC$, then $B$ may or may not equal $C$.
- If $AB = 0$, then $A$ and $B$ are not necessarily $0$.
- If $A = \mat{rr} 5 & 1 \\ 3 & -2 \rix$ and $B = \mat{cc} 2 & 0 \\ 4 & 3 \rix$, then \begin{align*} AB & \eq \mat{rr} 5 & 1 \\ 3 & -2 \rix \mat{cc} 2 & 0 \\ 4 & 3 \rix \eq \hspace{30em} \\[1em] BA & \eq \mat{cc} 2 & 0 \\ 4 & 3 \rix \mat{rr} 5 & 1 \\ 3 & -2 \rix \eq \end{align*}
- If $A = \mat{rr} 2 & -3 \\ -4 & 6 \rix$, $B = \mat{cc} 8 & 4 \\ 5 & 5 \rix$, $C = \mat{rr} 5 & -2 \\ 3 & 1 \rix$, then \[ AB \eq \mat{rr} 1 & -7 \\ -2 & 14 \rix \eq AC, \qquad \text{but } \quad B\neq C .\]
- If $A = \mat{rr} 3 & -6 \\ -1 & 2 \rix$ and $B = \mat{rr} 2 & 4 \\ 1 & 2 \rix$, then $AB = 0$ but $A\neq 0$ and $B\neq 0$.
- $(A^T)^T = A$ (transpose of $A^T$ is $A$)
- $(A+B)^T = A^T + B^T$
- For any scalar $r$, then $(rA)^T = r A^T$
- $(AB)^T = B^T A^T$ (transpose of a product is product of transposes in reverse order)
Note: Property 4 does not say $(AB)^T = A^T B^T$ (this is only sometimes true).
These properties easily generalize to more matrices. For example, \[ (ABC)^T \eq \hspace{10em} \eq \hspace{10em} \eq \]
- If $AB$ and $BA$ are defined, then $A$ and $B$ are square matrices of the same size.
- If $\vec{p}$ solves $A \vec{x} = \vec{b}$ and $\vec{u}$ solves $B \vec{x} = \vec{c}$, then $\vec{p}+\vec{u}$ is a solution for $(A+B) \vec{x} = \vec{b} + \vec{c}$.
- If $A^2 = I_n$, then $A = -I_n$ or $A = I_n$.
- If $A,B$ are $n\times n$ matrices, then $(A^T B + B^T A)^T = A^T B + B^T A$.
Section 2.2: The Inverse of a Matrix
Before discussing inverses of a matrix, recall that the (multiplicative) inverse of any nonzero real number $a$ is $a^{-1} = \frac{1}{a}$, since $a \cdot a^{-1} = 1$. For example, $7 \cdot 7^{-1} = 1 = 7^{-1}\cdot 7$.
For matrices, we would require that both $A \cdot A^{-1}$ and $A ^{-1} \cdot A$ are the multiplicative identity, since multiplication is not commutative! Further, $A$ must be square.
Unlike how every nonzero real number is invertible, not every matrix has an inverse (even if $A \neq 0$). We'll spend time developing theorems for when $A$ is nonsingular.
By this proposition, the notation $A^{-1}$ is well-defined.
| Some Equivalent Terminology | |
|---|---|
| $A$ is invertible | $A$ is not invertible |
| $A$ is nonsingular | $A$ is singular |
| $A$ has an inverse | $A$ does not have an inverse |
Let $A = \mat{cc} a & b \\ c & d \rix$ be a nonsingular matrix. What is $A^{-1}$?
\begin{align*} A\cdot A^{-1} & \eq \mat{cc} a & b \\ c & d \rix \mat{cc} w & x \\ y & z \rix \eq \mat{cc} a w + by & ax+bz \\ cw+dy & cx+dz \rix \eq \mat{cc} 1 & 0 \\ 0 & 1 \rix \end{align*} This yields four equations: \begin{align} aw + by & \eq 1 \label{2.2.1} \\ ax+bz & \eq 0 \label{2.2.2} \\ cw + dy & \eq 0 \label{2.2.3}\\ cx + dz & \eq 1 \label{2.2.4} \end{align}
Multiply \eqref{2.2.1} by $d$ and \eqref{2.2.3} by $b$, and subtract: \[ daw+dby - (bcw+bdy) = d \quad \implies \quad w(ad-bc) = d \quad\implies \quad w = \frac{d}{ad-bc} .\]
Multiply \eqref{2.2.4} by $b$ and \eqref{2.2.2} by $d$, and subtract: \[ bcx+bdz - (dax+dbz) = b \quad \implies \quad x(bc-ad) = b \quad \implies \quad x = \frac{-b}{ad-bc} .\]
Multiply \eqref{2.2.1} by $c$ and \eqref{2.2.3} by $a$, and subtract: \[ caw + cby - (acw+ady) = c \quad \implies \quad y(cb-ad) = c \quad\implies \quad y = \frac{-c}{ad-bc} .\]
Multiply \eqref{2.2.4} by $a$ and \eqref{2.2.2} by $c$, and subtract: \[ acx + adz - (cax+cbz) = a \quad \implies \quad z(ad-bc) = a \quad \implies \quad z = \frac{a}{ad-bc} .\] Therefore, $A^{-1}$ is $\dots$
Suppose $A$ is $n\times n$ and invertible, and $\vec{b} \in \R^n $. What is the solution to $A \vec{x} = \vec{b}$? \[ A \vec{x} = \vec{b} \quad \implies \quad \hspace{25em} \]
- $A^{-1}$ is invertible and $(A^{-1})^{-1} = A$.
- $AB$ is invertible and $(AB)^{-1} = B^{-1} A^{-1}$.
- $A^T$ is invertible and $(A^T)^{-1} = (A^{-1})^T$.
Note that property 3 generalizes to three or more matrices: \[ (ABC)^{-1} \eq C^{-1} B^{-1} A ^{-1} .\]
How do we find the inverse of an $n\times n$ nonsingular matrix $A$? For example, \[ A \eq \mat{rrr} 1 & 2 & 0 \\ 0 & 5 & 0 \\ -1 & -2 & 1 \rix .\] The following row operations will bring $A$ to its $\RREF$: \[ \underbrace{R_3 \leftarrow R_3 + R_1}_{\text{OP } 1} , \qquad \underbrace{R_2 \leftarrow \frac{1}{5}R_2}_{\text{OP } 2} , \qquad \underbrace{R_1 \leftarrow R_1 - 2 R_2}_{\text{OP } 3} .\] In fact, the $\RREF$ of $A$ is simply $I_3$. That is, $A$ is row equivalent to $I_3$. We ought to be able to leverage something out of this fact.
Notice that the action of OP 1 is performed by computing \[ E_1 \cdot A \eq \hspace{10em} \cdot \mat{rrr} 1 & 2 & 0 \\ 0 & 5 & 0 \\ -1 & -2 & 1 \rix \eq \mat{rrr} 1 & 2 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 1 \rix .\] The action of OP 2 is performed by computing \[ E_2 \cdot (E_1 A) \eq \hspace{10em} \mat{rrr} 1 & 2 & 0 \\ 0 & 5 & 0 \\ 0 & 0 & 1 \rix \eq \mat{rrr} 1 & 2 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \rix .\] The action of OP 3 is performed by computing \[ E_3 \cdot (E_2 E_1 A) \eq \hspace{10em} \mat{rrr} 1 & 2 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \rix \eq \mat{rrr} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \rix .\] That is:
Therefore, the same row operations that transform $A$ to $I$ are used to create $A^{-1}$.
The matrices $E_1, E_2, E_3$ we used have a special name.
For example, \[ \mat{cccc} 1 & 0 & 0 & 0 \\ 0 & 6 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \rix \qquad \mat{ccc} 0 & 1 & 0\\ 1 & 0 & 0 \\ 0 & 0 & 1 \rix \qquad \mat{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 5 & 0 & 1 \rix \] are elementary matrices associated with $\dots$
- If a row operation is applied to $A$, the resulting matrix is $E A$ where $E$ is the corresponding elementary matrix.
- Elementary matrices are invertible. Moreover, if $E$ is elementary, then the inverse of $E$ is the elementary matrix corresponding to the single row operation that transforms $E$ back to $I$.
For example: \[ \mat{cccc} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 5 & 0 & 1 \rix \quad \text{has inverse} \quad \hspace{10em} \]
\[ \mat{ccc} 0 & 1 & 0\\ 1 & 0 & 0 \\ 0 & 0 & 1 \rix \quad \text{has inverse} \quad \hspace{9em} \]
Furthermore, if $A$ is invertible, then any sequence of row operations that reduce $A$ to $I_n$ also transform $I_n$ to $A^{-1}$.
We saw this result in action before: \[ A = \mat{rrr} 1 & 2 & 0 \\ 0 & 5 & 0 \\ -1 & -2 & 1 \rix \qquad\quad \begin{aligned} R_3 & \leftarrow R_3 + R_1 \\ R_2 & \leftarrow \frac{1}{5}R_2 \\ R_1 & \leftarrow R_1 - 2 R_2 \end{aligned} \qquad\quad A^{-1} = \mat{rrr} 1 & -2 /5 & 0 \\ 0 & 1 /5 & 0 \\ 1 & 0 & 1 \rix .\] To find $A^{-1}$ (if it exists), we can generate row operations that reduce $A$ to $I_n$. By the theorem, if we keep applying these operations to $I_n$, we will obtain $A^{-1}$.
- Place $A$ and $I_n$ side-by-side in an augmented matrix $\mat{c|c} A & I_n \rix$.
- Perform row operations on this entire matrix, with the goal of reducing $A$ (i.e, the left-half) to $I_n$.
- Afterward, one obtains $\mat{c|c} I_n & A^{-1} \rix$. That is, $A^{-1}$ is the right-half of this matrix.
Continue on your own!
- Solve for $B$ in terms of $A$ and $P$.
\begin{align*} A & \eq P B P^{-1} \\[1em] & \eq \\[1em] & \eq \\[1em] & \eq \\[1em] & \eq \\[1em] & \eq B \end{align*}
- Find an expression for $A^{2026}$ in terms of $B$ and $P$.
\begin{align*} A^2 & \eq \hspace{8em} & \eq \hspace{6em} \\[2em] A^3 & \eq \hspace{8em} & \eq \hspace{6em} \\[2em] A^4 & \eq \hspace{8em} & \eq \hspace{6em} \\[2em] & \quad \;\, \vdots \\ A^{2026} & \eq \end{align*}
Section 2.3: Characterizations of Invertible Matrices
In this short section we give a summary of equivalent conditions to a square matrix $A$ being invertible or not.
- $A$ is an invertible matrix.
- $A$ is row equivalent to the $n\times n$ identity matrix $I_n$.
- $A$ has $n$ pivot positions.
- The equation $A \vec{x} = \vec{0}$ has only the trivial solution.
- The columns of $A$ form a linearly independent set.
- The equation $A \vec{x} = \vec{b}$ has a unique solution for all $\vec{b} \in \R^n $.
- The columns of $A$ span $\R^n $.
- There exists an $n\times n$ matrix $C$ such that $CA = I_n$.
- There exists an $n\times n$ matrix $D$ such that $AD = I_n$.
- $A^T$ is an invertible matrix.
While powerful, the IMT applies to only square matrices! Particularly, do not apply statements (8) and (9) when $A$ is not square.
- The $\RREF$ of $A$ is $\mat{rrr} 1 & 0 & -2 \\ 0 & 1 & 4 \\ 0 & 0 & 3 \rix$. Is $A$ invertible?
- Is $B = \mat{ccc} 2 & 3 & 4 \\ 2 & 3 & 4 \\ 2 & 3 & 4 \rix$ invertible?
- Suppose $C$ is a $5\times 5$ matrix, and there exists $\vec{v} \in \R ^5$ which is not a linear combination of the columns of $C$. How many solutions are there to $C \vec{x} = \vec{0}$?
- Let $A,B$ be $n\times n$ matrices such that $AB \vec{x} = \vec{0}$ has a nontrivial solution. Is $AB$ invertible?
- Let $A$ be a $3\times 3$ matrix whose columns do not span $\R^3$. Can $A$ be invertible?
- Suppose $A$ is $n\times n$ and invertible. Show that the columns of $A^{-1}$ are linearly independent.