Continue **reading** Section 3.1 (partitioned matrices) and Section 3.2 for next class,
and Section 3.3 for Wednesday.
Work through recommended homework questions.

**Tutorials:** No quizzes this week, focused on review.
**Midterms** will be handed back.

**Solutions** to the midterm are available from the course home page.

**Office hour:** today, 12:30-1:30, MC103B.

**Help Centers:** Monday-Friday 2:30-6:30 in MC 106.

**Definition:** An $m \times n$ **matrix** $A$ is a rectangular
array of numbers called the **entries**, with $m$ rows and $n$ columns.
$A$ is called **square** if $m = n$.

The entry in the $i$th row and $j$th column of $A$ is usually written $a_{ij}$ or sometimes $A_{ij}$.

If $A$ is square and the __non__diagonal entries are all zero, then
$A$ is called a **diagonal matrix**.
$$
% The Rules create some space below the matrices:
\kern-8ex
\mystack{
\bmat{ccc}
1 & -3/2 & \pi \\
\sqrt{2} & 2.3 & 0
\emat
\Rule{0pt}{0pt}{18pt}
}{\text{not square or diagonal}}
\qquad
\mystack{
\bmat{rr}
1 & 2 \\ 3 & 4
\emat
\Rule{0pt}{0pt}{22pt}
}{\text{square}}
\qquad
\mystack{
\bmat{rr}
1 & 0 \\ 0 & 4
\emat
\Rule{0pt}{0pt}{20pt}
}{\text{diagonal}}
\qquad
\mystack{
\bmat{rr}
1 & 0 \\ 0 & 0
\emat
\Rule{0pt}{0pt}{20pt}
}{\text{diagonal}}
$$

**Definition:** A diagonal matrix with all diagonal entries equal is
called a **scalar matrix**. A scalar matrix with diagonal entries all
equal to $1$ is an **identity matrix**.
$$
% The Rules create some space below the matrices:
\mystack{
I_3 = \bmat{rrr}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\emat
\Rule{0pt}{0pt}{18pt}
}{\text{identity matrix}}
\qquad
\mystack{
\bmat{rrr}
3 & 0 & 0 \\
0 & 3 & 0 \\
0 & 0 & 3
\emat
\Rule{0pt}{0pt}{18pt}
}{\text{scalar}}
\qquad
\mystack{
O = \bmat{rrr}
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0
\emat
\Rule{0pt}{0pt}{18pt}
}{\text{scalar}}
$$
Note: Identity $\implies$ scalar $\implies$ diagonal $\implies$ square.

**Definition:** If $A$ and $B$ are __both__ $m \times n$ matrices,
then their **sum** $A + B$ is the $m \times n$ matrix obtained by adding the
corresponding entries of $A$ and $B$:
$A + B = [a_{ij} + b_{ij}]$.

**Definition:** If $A$ is an $m \times n$ matrix and $c$ is a scalar,
then the **scalar multiple** $cA$ is the $m \times n$ matrix obtained
by multiplying each entry by $c$:
$cA = [c \, a_{ij}]$.

**Theorem 3.2:** Let $A$, $B$ and $C$ be matrices of the same size,
and let $c$ and $d$ be scalars. Then:

(a) $A + B = B + A$ (commutativity) | (b) $(A + B) + C = A + (B + C)$ (associativity) |

(c) $A + O = A$ | (d) $A + (-A) = O$ |

(e) $c(A+B) = cA + cB$ (distributivity) | (f) $(c+d)A = cA + dA$ (distributivity) |

(g) $c(dA) = (cd)A$ | (h) $1A = A$ |

Compare to Theorem 1.1.

This means that __all of the concepts for vectors transfer to matrices__.

E.g., manipulating matrix equations: $$ 2(A+B) - 3(2B - A) = 2A + 2B -6B +3A = 5A - 4B .$$

We define a **linear combination** to be a matrix of the form:
$$ c_1 A_1 + c_2 A_2 + \cdots + c_k A_k .$$

And we can define the **span** of a set of matrices to be
the set of all their linear combinations.

And we can say that the matrices $A_1, A_2, \ldots, A_k$ are
**linearly independent** if
$$ c_1 A_1 + c_2 A_2 + \cdots + c_k A_k = O$$
has only the trivial solution $c_1 = \cdots = c_k = 0$, and
are **linearly dependent** otherwise.

Our techniques for vectors also apply to answer questions such as:

**Example 3.16 (a):** Suppose
$$
\kern-5ex
A_1 = \bmat{rr} 0 & 1 \\ -1 & 0 \emat
\quad
A_2 = \bmat{rr} 1 & 0 \\ 0 & 1 \emat
\quad
A_3 = \bmat{rr} 1 & 1 \\ 1 & 1 \emat
\quad
B = \bmat{rr} 1 & 4 \\ 2 & 1 \emat
$$
Is $B$ a linear combination of $A_1$, $A_2$ and $A_3$?

That is, are there scalars $c_1$, $c_2$ and $c_3$ such that $$ c_1 \bmat{rr} 0 & 1 \\ -1 & 0 \emat + c_2 \bmat{rr} 1 & 0 \\ 0 & 1 \emat + c_3 \bmat{rr} 1 & 1 \\ 1 & 1 \emat = \bmat{rr} 1 & 4 \\ 2 & 1 \emat ? $$ Rewriting the left-hand side gives $$ \bmat{rr} c_2+c_3 & c_1+c_3 \\ -c_1+c_3 & c_2+c_3 \emat = \bmat{rr} 1 & 4 \\ 2 & 1 \emat $$ and this is equivalent to the system $$ \begin{aligned} \phantom{-c_1 + {}} c_2 + c_3 &= 1 \\ \ph c_1 \phantom{{}+c_2} + c_3 &= 4 \\ -c_1 \phantom{{}+c_2} + c_3 &= 2 \\ \phantom{-c_1 + {}} c_2 + c_3 &= 1 \\ \end{aligned} $$ and we can use row reduction to determine that there is a solution, and to find it if desired: $c_1 = 1, c_2 = -2, c_3 = 3$, so $A_1 - 2A_2 + 3A_3 = B$.

This works exactly as if we had written the matrices as column vectors and asked the same question.

See also Examples 3.16(b), 3.17 and 3.18 in text.

We write $A^1 = A$ and $A^0 = I_n$.

We will see in a moment that $(AB)C = A(BC)$, so the expression for $A^k$ is unambiguous. And it follows that $$ A^r A^s = A^{r+s} \qquad\text{and}\qquad (A^r)^s = A^{rs} $$ for all nonnegative integers $r$ and $s$.

For the most part, matrix multiplication behaves like multiplication of real numbers, but there are several differences:

**Example 3.13 on whiteboard:** Powers of
$$
B = \bmat{rr} 0 & -1 \\ 1 & 0 \emat
$$

**Question:**
Is there a nonzero matrix $A$ such that $A^2 = O$?

Yes. For example, take
$$ A = \bmat{rr} 0 & 1 \\ 0 & 0 \emat
\qquad\text{or}\qquad
A = \bmat{rr} 2 & 4 \\ -1 & -2 \emat . $$

**Challenge problems:** Find a $3 \times 3$ matrix $A$ such that $A^2 \neq O$
but $A^3 = O$.

Find a $2 \times 2$ matrix $A$ such that $A \neq I_2$ but $A^3 = I_2$.

**Example on whiteboard:** Tell me the entries of two $2 \times 2$ matrices
$A$ and $B$, and let's compute $AB$ and $BA$.

We can have $A \neq O$ but $A^k = O$ for some $k > 1$.

We can have $B \neq \pm I$, but $B^4 = I$.

We can have $AB \neq BA$.

We can have $B \neq \pm I$, but $B^4 = I$.

We can have $AB \neq BA$.

But most expected properties **do** hold:

**Theorem 3.3:** Let $A$, $B$ and $C$ be matrices of the appropriate sizes,
and let $k$ be a scalar. Then:

(a) $A(BC) = (AB)C$ | (associativity) |

(b) $A(B + C) = AB + AC$ | (left distributivity) |

(c) $(A+B)C = AC + BC$ | (right distributivity) |

(d) $k(AB) = (kA)B = A(kB)$ | (no cool name) |

(e) $I_m A = A = A I_n$ if $A$ is $m \times n$ | (identity) |

The text proves (b) and half of (e). (c) and the other half of (e) are the same, with right and left reversed.

**Proof of (d):**
$$
\kern-7ex
\begin{aligned}
(k(AB))_{ij} &= k (AB)_{ij} = k (\row_i(A) \cdot \col_j(B)) \\
&= (k \, \row_i(A)) \cdot \col_j(B)
= \row_i(kA) \cdot \col_j(B)
= ((kA)B)_{ij}
\end{aligned}
$$
so $k(AB) = (kA)B$. The other part of (d) is similar.

**Proof of (a):**
$$
\kern-7ex
\begin{aligned}
((AB)C)_{ij} &= \sum_k (AB)_{ik} C_{kj} = \sum_k \sum_l A_{il} B_{lk} C_{kj} \\
&= \sum_l \sum_k A_{il} B_{lk} C_{kj} = \sum_l A_{il} (BC)_{lj}
= (A(BC))_{ij}
\end{aligned}
$$
so $A(BC) = (AB)C$.

**On Friday:** more from Sections 3.1 and 3.2: Transpose, symmetric matrices,
partitioned matrices.

.