\documentclass{article}
\usepackage{enumitem,amsmath,amssymb,amsthm}
\usepackage{graphicx}
\usepackage[left=2.5cm,right=2.5cm, top=2cm, bottom=2cm,nohead,nofoot]{geometry}
\newenvironment{amatrix}[1]{%
  \left(\begin{array}{@{}*{#1}{c}|c@{}}
}{%
  \end{array}\right)
}
\def\trans#1{#1^{T}}
\def\dotprod#1#2{\vec{#1}\cdot\vec{#2}}
\def\vec#1{\mathbf{#1}}
\def\norm#1{\left|\!\left|#1\right|\!\right|}
\def\R{\mathbb{R}}
\def\spn{\operatorname{span}}
\def\rank{\operatorname{rank}}
\def\set#1{\left\{\,#1\,\right\}}
\def\s#1{\left\{#1\right\}}
\def\st{\text{\huge{.}}}
\def\eovec{!!}
\def\colvec#1{\begin{pmatrix}\splitspaceintonewlines(#1\eovec)\end{pmatrix}}
\def\splitspaceintonewlines(#1#2){%
	\ifx#1,\\\else #1\fi%
	\ifx#2\eovec\else \splitspaceintonewlines(#2)\fi%
}
\def\df#1{\textbf{#1}}
\def\theorem{\par\noindent{\bf \underline{Theorem}} }
\def\proof{\par\noindent{\sl Proof.} }
\def\example{\par\noindent{\bf \underline{Example}} }
\def\soln{\par\noindent{\sl Solution.} }
\def\remark{\par\noindent{\bf \underline{Remark}} }
\title{Summary of Day 7}
\author{William Gunther}
\date{May 28, 2014}

\begin{document}
\maketitle

\section{Objectives}
\begin{itemize}
	\item Connect matrix multiplication with systems of equations.
	\item See the `true nature' of matrices as functions.
	\item Define some more matrix operations (e.g. transpose) and explore algebraic properties of matrices.
\end{itemize}
\section{Summary}

\begin{itemize}
\item Matrix multiplication is \emph{not} commutative. In fact, it often doesn't even make sense to switch the order because of the size constraints!
\item We can rephrase linear systems into this language of matrix multiplication. This will allow us when we see the true nature of matrices to prove/use a lot of the theorems we said about systems of equations using a completely different way of thinking about systems than we were capable of. 
\example Consider the system 
\begin{alignat*}{4}
x &-& 2y &+& 3z &=& 0\\
2x&+& y &-& z &=& 4
\end{alignat*}
Recall we can phrase this as an augmented matrix:
\[
\begin{amatrix}{3}
1 & -2 & 3 & 0\\
2 & 1& -1& 4
\end{amatrix}
\]
We could also phrase it in this way:
\[
\begin{pmatrix}
1 & -2 & 3 \\
2 & 1 & -1
\end{pmatrix}
\colvec{x,y,z}
=
\colvec{0,4}
\]
\remark Very important!! Now, notice, asking whether there is a solution to a system can be rephrased as `is there anything that I can multiply this matrix by (on the right) to give me this vector as a solution'
\item Note that the notation we have used for an augmented matrix $(A\mid \vec b)$ will now just be thought to be shorthand for the matrix equation $A\vec x = \vec b$. It is still useful notationally because of Gaussian and Gauss-Jordan elimination.
\item We like to think of matrices as a function; that is, a matrix is a way of transforming one set of information to another. We'll now look at an informal example of how this works, and connect it with matrix multiplication. This is example 3.7 of the book.

\example Ann and Bert are planning to go shopping for fruit for the next week. They each want to buy some apples, oranges, and grapefruit, but in differing amounts. The following two tables give the quantity of each item that each other like to buy, and how much it costs are two of the nearby markets: Sam's and Theo's. 

\hbox to \hsize{
\hfill
\begin{tabular}{r | c c c}
& {\bf Apples} & {\bf Grapefruit} & {\bf Orange} \\\hline
Ann & 6 & 3 & 10\\
Bert & 4 & 8& 5
\end{tabular}
\hfill
\begin{tabular}{r | c c}
& {\bf Sam's} & {\bf Theo's}\\\hline
Apple& \$0.10 & \$0.15\\
Grapefruit& \$0.40 & \$0.30\\
Orange& \$0.10 & \$0.20
\end{tabular}
\hfill
}
We first make a person $\times$ fruit matrix 
\[
\begin{pmatrix}
	6 & 3 & 10\\
	4 & 8& 5
\end{pmatrix}
\]
This is like a function; if you plug in a person it gives you all the fruit that the person wants to buy! Next we make a fruit $\times$ store matrix:
\[
\begin{pmatrix}
	.1 & .15\\
	.4 & .3\\
	.1 & .2
\end{pmatrix}
\]
This is similarly like a function; if you look at a particular fruit, it tells you the price at each of the stores. Now we multiple the type matrices, which gives us a person $\times$ store matrix; this tells us how much the person would spend at each of the store by composing the two function we had. 
\[
\begin{pmatrix}
	6 & 3 & 10\\
	4 & 8& 5
\end{pmatrix}
\begin{pmatrix}
	.1 & .15\\
	.4 & .3\\
	.1 & .2
\end{pmatrix}
=
\begin{pmatrix}
	2.8 & 3.8\\
	4.1 & 4
\end{pmatrix}
\]
So it's in Ann's interest to go to Sam's by a significant amount, but in Bert's to go to Theo's by a relatively small amount.

Exercise: What could you multiply by what to get the total each would spend at each store?
\example Consider $S$ the set of people on Facebook. Consider a $|S|\times |S|$ matrix, $A$,  where the entries are either $0$ or $1$ based on whether two people are friends are not. What does $AA$ signify?
\item Here is another teaser: $A$ is a $m\times n$ matrices. What can you multiply by what to get the $i$th column of the matrix as a column vector? What about the $i$th row as a row vector?

Let $e_j$ be the \df{$j$th standard basis vector} of $R^n$; that is, \[ e_j = [0,0,\ldots,0,1,0\ldots,0,0]\] where the $1$ is in the $j$th row.
\theorem Consider $e_i$ as a row vector. If $A$ is a $m\times n$ matrix.
	\begin{itemize}
	 \item Consider $e_i$ as a row vector in $\R^m$. Then $e_i A = $ $i$th row of $A$.
	 \item Consider $e_j$ as a column vector in $\R^n$. Then $Ae_j =$ $j$th column of $A$.
	\end{itemize}
\proof We'll just prove the first as the second is similar; the size of the resultant matrix is clearly $1\times n$. The $1j$th entry is the vector $e_i$ dotted with the $j$th row of $A$; but, since $e_i$ is $1$ only in the $i$th coordinate and $0$ elsewhere, only the $i$th row of the $j$th column contributes to the sum. Therefore, the $1j$th entry of the resultant matrix is just the $i$th row of the $j$th column of $A$. Therefore, the resultant matrix is just the $i$th row of $A$.\qed
\item The example of Facebook above reveals often it's nice to multiply a matrix by itself; you can only do this with square matrices. This is called a \df{matrix power} and we write it as $A^k$ where $k$ is a nonnegative integer.  
\theorem The following familiar rules occur:
\begin{itemize}
	\item $A^r A^s = A^{r+s}$
	\item $(A^r)^s = A^rs$
\end{itemize}
\item The next operation on matrices seems like an unnatural one, but consider the example above with the person $\times$ fruit matrix it should be natural; the idea that the people were the rows was arbitrary, and in order to multiply the matrices one often needs to switch the order of association. For this we introduce the \df{transpose} of a matrix; The transpose of a matrix is as follow:

If $A$ is $(c_1\,c_2\,\ldots\,c_n)$ where $c_i$ are column vectors then $\trans{A}$ (pronounced $A$ transpose) is defined to be 
\[ \trans{A} = \colvec{r_1,r_2,\vdots,r_n} \] where $r_i$ is the row vector corresponding to $c_i$

We could also defined $\trans{A}$ entrywise: that is, the $ij$th entry of $\trans{A}$ is the $ji$th entry of $A$.
\example 
{
\def\A{\begin{pmatrix} 0 & 1\\ -1& 0 \end{pmatrix} }
\[
\trans{\A} = \begin{pmatrix} 0 & -1 \\ 1 & 0\end{pmatrix}
\]
}
\item A matrix that will prove to be important later is a \df{symmetric matrix}; $A$ is symmetric if $A=\trans{A}$.
\item Now we will explore the algebraic properties of some of these operations
\theorem If $A, B, C$ are all $m\times n$ matrices and $c, d$ are real numbers then:
\begin{enumerate}
	\item $A+B=B+A$
	\item $(A+B)+C = A+(B+C)$
	\item $A+O = A$
	\item $A+(-A) = O$
	\item $c(A+B) = cA + cB$
	\item $(c+d)A = cA + dA$
	\item $c(dA) = (cd)A$
	\item $1A = A$
\end{enumerate}
These properties should look a lot like the properties for vectors; in fact, we can carry over a lot of what we did for vectors for matrices.
\item A \df{linear combination} of matrices $A_1, \ldots, A_k$ is $c_1A_1 + \ldots c_k A_k$ where $c_i$ are scalars and the sizes of the $A_i$ make sense (i.e. they are all the same). The definitions of span, linear dependence, and linear independence also carry over.

Really we're doing nothing new here as the next example should make clear:
\example
Determine if the following matrices are linearly dependent:
{
\def\A{\begin{pmatrix} 0 & 1\\ -1& 0 \end{pmatrix} }
\def\B{\begin{pmatrix} 1 & 0\\ 0 & 1 \end{pmatrix} }
\def\C{\begin{pmatrix} 1 & 1\\ 1 & 0 \end{pmatrix} }
\[ \A \qquad \B \qquad \C \]
\soln We are looking for non-zero solutions to this equation:
\[
c_1 \A + c_2\B + c_3\C = O  
\]
But you can see this is really expressing the following simultaneous system:
\begin{itemize}
	\item $c_2 + c_3 = 0$
	\item $c_1 + c_3 = 0$
	\item $-c_1 + c_3 = 0$
	\item $c_2 = 0$
\end{itemize}
which can be expressed as this matrix:
\[
\begin{pmatrix}
 0 & 1 & 1\\
 1 & 0 & 1\\
-1 & 0 & 1\\
 0 & 1 & 0
\end{pmatrix}
\]
You'll see this has a unique solution of $\vec 0$ if you row reduce.
\item The algebra of matrix multiplication is a little more unorderly. It does have some nice properties though.
\theorem If $A, B, C$ are matrices of appropriate size and $c$ a scalar then:
\begin{enumerate}
	\item $A(BC) = (AB)C$
	\item $A(B+C) = (AB) + (AC)$
	\item $(A+B)C = AC + BC$
	\item $k(AB) = (kA)B = A(kB)$
	\item $I_mA = AI_n = A$ if $A$ is $m\times n$.
\end{enumerate}
\item Many properties that we're used to with real numbers fail in general for matrix multiplication. Particularly, these two very important properties of real number multiplication fail spectacularly:
\begin{itemize}
	\item Commutativity: It is \emph{not} true that $AB = BA$ (even when the sizes make sense).
	\item Invertibility: It is not true that every matrix is invertible (we will talk about this next).
\end{itemize}
\item Transposes also work more or less how you'd expect with perhaps a few surprises.
\theorem If $A,B$ matrices of appropriate size and $c$ a scalar then:
\begin{enumerate}
	\item $\trans{(\trans{A})} = A$
	\item $\trans{(kA)} = k\trans{A}$
	\item $\trans{(A^r)} = \left(\trans{A}\right)^r$
	\item $\trans{(A+B)} = \trans{A} + \trans{B}$
	\item $\trans{(AB)} = \trans{B}\trans{A}$
\end{enumerate}
\proof We will just prove the last property which may be the most surprising. We will do this by calculating the $ij$th entry of each matrix, and show they're the same.

The $ij$th entry of the lhs is the $ji$th entry of $AB$ (by the definition of transpose) which is the $j$th row of $A$ dotted with the $i$th column of $B$.

The $ij$th entry of the rhs is the $i$th row of $\trans B$ dotted with the $j$th column of $\trans A$ which in turn is the $i$th column of $B$ dotted with the $j$th row of $A$ by the definition of transpose. Dotting is commutative, so these two quantities are the same.\qed
}
\end{itemize}
\end{document}
