% $Header$

\documentclass{beamer}

\usepackage[
backend=biber,
style=alphabetic,
sorting=ynt
]{biblatex}

\addbibresource{ref.bib}

\mode<presentation>
{
  \usetheme{Boadilla}
}

\usepackage{multirow}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{physics}
\usepackage[english]{babel}
\usepackage[OT1]{fontenc}
\usepackage{multicol}
\usepackage{cancel}
\usepackage{subcaption}
\usepackage{animate}
\usepackage[dvipsnames]{xcolor}
\usepackage[arrow,curve]{xy}



\newcommand{\vect}{\mathbf{vec}}
\newcommand{\cI}{\mathcal{I}}
\newcommand{\cX}{\mathcal{X}}
\newcommand{\cB}{\mathcal{B}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\opnorm}[1]{\norm{#1}_{\mathrm{op}}}
\newcommand{\inclu}[0] {\ar@{^{(}->}}
\newcommand{\conn}{{\scriptstyle \#}}
\newcommand{\Aut}[1] {\text{Aut}_{#1}}
\newcommand{\Rank}{\text{Rank }}


\newcommand{\Ker}{\text{Ker }}
\newcommand{\Null}[1]{\text{null}({#1})}

\newcommand{\Range}[1]{\text{range}({#1})}
\newcommand{\Span}[1]{\text{span}({#1})}

%\newcommand{\vec}{\text{Vec }}
\newcommand{\Dim}{\text{dim }}
\newcommand{\bcdot}{\boldsymbol{\cdot}}
\newcommand{\spann}{\text{span}}
\newcommand{\im}{\text{Im }}
\newcommand{\gph}{{\rm gph}\,}
\newcommand{\diag}{{\rm diag}}
%\newcommand{\dist}{{\rm dist}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\cA}{\mathcal{A}}
\newcommand{\cU}{\mathcal{U}}
\newcommand{\cS}{\mathcal{S}}
\newcommand{\cR}{\mathcal{R}}
\newcommand{\cN}{\mathcal{N}}
\newcommand{\EE}{\mathbb{E}}
\newcommand{\sign}{\mathrm{sign}}
\newcommand{\lip}{\mathrm{lip}}
\newcommand{\Var}{\mathrm{Var}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\PP}{\mathbb{P}}
\newcommand{\pfail}{p_{\mathrm{fail}}}
%\newcommand{\relint}{\mathrm{ri}}
\newcommand{\supp}{{\mathrm{supp}}} % support
\newcommand{\eqd}{\stackrel{d}{=}}
\renewcommand{\SS}{{\mathbb{S}}}

\newcommand{\Rd}{\mathbb{R}^d}
\newcommand{\cone}[1]{\textrm{cone}({#1})}
\newcommand{\BB}[1]{{\bf {#1}}}
\newcommand{\conv}[1]{\textrm{conv}({#1})}
\newcommand{\ext}[1]{\textrm{ext}({#1})}
\newcommand{\inte}[1]{\textrm{int}({#1})}
\newcommand{\kr}[1]{\textrm{ker}({#1})}
\newcommand{\spn}[1]{\textrm{span}({#1})}
\newcommand{\range}[1]{\text{range}({#1})}
\newcommand{\C}{\mathbb{C}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Lcal}{\mathcal{L}}
\newcommand{\Z}{\mathcal{Z}}
\newcommand{\Bcal}{\mathcal{B}}

\newcommand{\X}{\mathcal{X}}
\newcommand{\Holder}{H\"older }
\newcommand{\inner}[2]{\langle {#1}, {#2} \rangle}
\newcommand{\ti}[1]{\textrm{tight}({#1})}



%%%%%%%%% Convex Analysis %%%%%%%%%
\newcommand{\prox}{\text{prox}}
\newcommand{\proj}{\mathrm{proj}}
\newcommand{\dom}{\text{dom }}
\newcommand{\epi}{\text{epi }}
\newcommand{\hypo}{\text{hypo }}
\newcommand{\interior}{\text{int }}
\newcommand{\bdry}{\text{bdy }}
\newcommand{\relint}{\text{ri }}
\newcommand{\argmin}{\operatornamewithlimits{argmin}}
\newcommand{\mini}{\operatornamewithlimits{minimize}}
\newcommand{\ls}{\operatornamewithlimits{limsup}}
\newcommand{\Diag}{{\rm Diag}}
\newcommand{\argmax}{\operatornamewithlimits{argmax}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\St}{{\mathrm{subject~to}}} % subject to
%%%% Probability %%%%%%%%%%%%%%%%%
\newcommand{\Expect}{\mathbb{E}}
\newcommand{\Prob}[1]{\mathbb{P}\left( #1 \right)}
\newcommand{\Expec}[1]{\mathbb{E}\left( #1 \right)}
\newcommand{\matrx}[1]{\begin{bmatrix} #1 \end{bmatrix}}
%%%%%%%% Theorems %%%%%%%%%%%%%
\newtheorem{thm}{Theorem}[section]

\newtheorem{proposition}[thm]{Proposition}
\newtheorem{lem}[thm]{Lemma}

\newtheorem{cor}[thm]{Corollary}
\newtheorem{remark}[thm]{Remark}


\newtheorem{pa}{Part}
\newtheorem{subclaim}{Subclaim}
\newtheorem{assumption}{Assumption}
\newtheorem{model}{Model}
\renewcommand*{\theassumption}{\Alph{assumption}}

\title[Linear Algebra Review Session Day 2] % (optional, use only with long paper titles)
{Linear Algebra Review Session Day 2}

\author[Aaron Zoll] % (optional, use only with lots of authors)
{ Aaron Zoll}

\institute[Johns Hopkins University] % (optional, but mostly needed)
{
  Department of Applied Math and Statistics\\
  Johns Hopkins University
}

\date[August 21st 2024 ] % (optional)
{ August 21st 2024}

\renewcommand{\arraystretch}{1.5}

% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command:

\beamerdefaultoverlayspecification{<+->}


\begin{document}


\begin{frame}
  \titlepage
\end{frame}

\begin{frame}{Outline}
    \begin{itemize}
        \item Vector Space Maps and Linearity
        \item Null Space and Range
        \item Rank-Nullity Theorem
        \item Matrices
        \item Inverses
        \item Change of Basis/Similarity
        \item Gaussian Elimination/Determinants
        \item Duality (if time)
    \end{itemize}
\end{frame}

\begin{frame}{Maps of Vector Spaces}
\begin{center}
    \textit{"Functions describe the Universe" - some guy}
\end{center}
\begin{definition}
    Given two vectors spaces and a function $f: V \to W$, we call this a \textbf{map} of vector spaces with input $v \in V$ and output $f(v)=:w \in W$
\end{definition}
\begin{itemize}
    \item \makebox[8cm]{$f(x)=x^2$ \hfill}  $f : \R \to \R$
    \item \makebox[8cm]{$f(x,y)=\frac{x+y}{x^2+y^2}$\hfill} $f:\R^2 \to \R$
    \item \makebox[8cm]{$f(x,y,z) = \left(\frac{x}{1-z},\frac{y}{1-z}\right)$\hfill} $f:\R^3 \to \R^2$
    \item \makebox[8cm]{$f(a,b) = a+bi$\hfill} $f : \R \to \C$
    \item \makebox[8cm]{$f(z,w) = (2z+w,-3z+2w,z-4w)$\hfill} $f : \C^2 \to \C^3$
    \item \makebox[8cm]{$f(z) = \frac{1}{2}\|z\|_2^2$\hfill} $f : \F^n \to \F$
    \item \makebox[8cm]{$f(a+bi)=a-bi$\hfill} $f : \C \to \C$ 
\end{itemize}
   
\end{frame}
\begin{frame}{Linear Maps}
    In general, functions are simply too complex for us to work with.
    \begin{definition}
        A map $T:V \to W$ is called \textbf{linear} if for all $v, w \in V$ and $\lambda \in \F$, we have:
        \begin{enumerate}
            \item  Additivity: $$T(u+v)=T(u)+T(v)$$
            \item  Homogeneity: $$T(\lambda v)=\lambda T(v)$$
        \end{enumerate}
    \end{definition}
    \begin{remark}
        Note that these maps "look" like vector spaces. They satisfy the two main requirements. Furthermore, from the requirement of vector spaces being closed under addition and scalar multiplication, these functions are well defined!
    \end{remark}
\end{frame}

\begin{frame}{The Vector Space of Linear Maps}
    \begin{definition}
        The space of linear maps from $V$ to $W$, we define as $$\Lcal(V,W) := \{T: V \to W : \text{T is linear}\}$$
    \end{definition}
    Not hard to check that for $S, T \in \Lcal(V,W)$, we have that $$(S+T)(v) := Sv+Tv \hspace{1cm} (\lambda S)(v) := \lambda(Sv)$$
    are both linear. That is $S+T, \lambda S \in \Lcal(V,W)$
    Therefore, $\Lcal(V,W)$ is itself a vector space!
\end{frame}

\begin{frame}{Examples of Linear Maps}
    \begin{itemize}
        \item The zero functions $O \in \Lcal(V,W)$ where $v \mapsto 0$ $\forall v \in V$
        \begin{itemize}
            \item $O(v+w)=0=0+0=O(v)+O(w)$
            \item $O(\lambda v)=0=\lambda 0=\lambda O(v)$
            \item Only constant linear function (why?)
        \end{itemize}
        \item The identity map $I \in \Lcal(V,V)$ where $v \mapsto v$
        \item $D \in \Lcal(\mathcal{P}(\R),\mathcal{P}(\R))$ sending $f \mapsto f'$
        \item $R \in \Lcal(\F^\infty,\F^\infty)$ sending $(x_1, x_2, ...) \mapsto (0, x_1, x_2, ...)$
        \item $M \in \Lcal(\mathcal{P}(\R),\mathcal{P}(\R))$ sending $f(x) \mapsto x^2f(x)$
        \item Anything with only "linear components" that is:\begin{itemize}
            \item $T(x,y,z)=(2x-y,7x+3z,x+y-z)$\\
            \item $T(x,y)=(3x,2y-x,4y)$\\
            \item $T(x,y,z)=(3x+a,4y+b)$ is linear iff $a=b=0$
            \item $T(x,y)=(2x+a,by^2+7x,c\sin(x)+d\sqrt{y}+kx)$ is linear iff $a=b=c=d=0$. $k$ is free to be anything!
        \end{itemize}
        
    \end{itemize}
\end{frame}

\begin{frame}{"Multiplying" Linear Maps}
\begin{center}
       \begin{xy}
       (0,0)*+{}="";
       (30,0)*+{U}="U"; 
    (60,0)*+{V}="V";
     (90, 0)*+{W}="W";
     {\ar         "U";"V"}?*!/^8pt/{S};
     {\ar    "V";"W"}?*!/^6pt/{T};
     {\ar@{-->}@/^{0.5cm}/ "U";"W"}?*!/_8pt/{ST};
\end{xy}
\end{center}
        
 
    \begin{definition}
        For linear maps $T \in \Lcal(U,V)$ and $S \in \Lcal(V,W)$ we define the \textbf{left multiplication} of T by S as $ST \in \Lcal(U,W)$: $$(ST)(u) := S(T(u))$$
    \end{definition}
\begin{remark}
    This is exactly just functional composition, but the \textbf{linearity} is nice and preserved:
    \scriptsize
    $$ST(u_1+\lambda u_2)=S(T(u_1+\lambda u_2))=\underbrace{S(Tu_1+\lambda Tu_2)}_{\text{linearity of T}}=\underbrace{S(Tu_1)+\lambda S(Tu_2)}_{\text{linearity of S}}=ST(u_1)+\lambda ST(u_2) $$
\end{remark}
\end{frame}

\begin{frame}{Null Space (motivation)}
Suppose we have the following linear system we are aiming to "solve"
$$T(x)=b \hspace{1cm} T \in \Lcal(V,W), \ x \in V, \ b \in W$$
Pictorially this can look like:
\begin{figure}
    \centering
    \includegraphics[width=0.5\linewidth]{linear solve.png}
    \caption{https://mathpqjq.com/solving-a-linear-system-by-graphing/}
    \label{fig:enter-label}
\end{figure}
    
\end{frame}

\begin{frame}{Null Space (motivation)}
\begin{figure}
    \centering
    \includegraphics[width=0.25\linewidth]{linear solve.png}
\end{figure}
    Here we have $$T(x,y)=(3x-2y,2x+y)\text{ and } b=(-7,7)$$ (in the standard basis)
    The solution to this problem is $$(x,y)=(1,5)$$ which is easily verifiable
    We then ask, is this the only solution?
When are there infinite solutions?
\end{frame}

\begin{frame}{Null Space}
    \begin{definition}
        We definite the \textbf{null space} of a linear map $T: V \to W$ as $$\Null{T} := \{v \in V : Tv=0\}$$
    \end{definition}
    \begin{remark}
    Often this is called the \textbf{kernel} as well and is used in many areas of mathematics
        \begin{itemize}
            \item $0 \in \Null{T}$ always 
            \begin{itemize}
                \item $\cancel{T(0)}=T(0+0)=T(0)+\cancel{T(0)}$
            \end{itemize}
            \item Yields all additional solutions! So if $\hat{x}$ solves $T(x)=b$, then $\hat{x}+v$ for any $v \in \Null{T}$ does as well
            \begin{itemize}
                \item $T(x+v)=T(x)+T(v)=T(x)+0=b$
            \end{itemize}
        \end{itemize}
    \end{remark}
\end{frame}

\begin{frame}{Example}
    Suppose $$\varphi(z_1,z_2,z_3) = z_1+2z_2+3z_3, \ \ \ \varphi \in \Lcal(\C^3, \C) $$
    \begin{align*}
        \Null{\varphi} &= \{(z_1,z_2, z_3) \in \C^3 : z_1+2z_2+3z_3=0\}\\
    \Rightarrow &=  \{(z_1,z_2, z_3) \in \C^3 : z_1=-2z_2-3z_3\}\\
      \Rightarrow &=  \{(-2z_2-3z_3,z_2, z_3) \in \C^3\}\\
        \Rightarrow &=  \{z_2(-2, 1, 0)+z_3(-3, 0, 1) : z_2, z_3 \in \C\}\\
        \Rightarrow &= \Span{\{(-2,1,0), (-3,0,1)\}}
    \end{align*}
    In this example, the null span reduces to the span of just two vectors! These are linearly independent, and so the null space is a two dimensional subspace of $V=\C^3$ with the above basis as a valid one.
\end{frame} 
\begin{frame}{Null Space is a Subspace}
    This is always the case:
    \begin{theorem}
        $\Null{T}$ is always a subspace of $V$
    \end{theorem}
    \begin{proof}
        Suppose $v, w \in \Null{T}$ $$T(v+w)=Tv+Tw=0+0=0$$ $$T(\lambda v)=\lambda T(v)=\lambda 0 = 0$$
        Therefore, $v+w, \lambda v \in \Null{T}$ and so it is closed under linearity conditions, so it is a subspace.
    \end{proof}
\end{frame}

\begin{frame}{Injective}
    \begin{definition}
        A map $T: V \to W$ (not necessarily linear) is \textbf{injective} or \textbf{one-to-one} if $$f(x)=f(y) \Longrightarrow x=y$$
        Equivalently, $$x \ne y \Longrightarrow f(x) \ne f(y)$$
    \end{definition}
    This condition in general can be difficult to verify because we would need to check this for all $x, y \in V$. Linear maps are far nicer in that $T \in \Lcal(V,W)$ is injective if and only if $\Null{T}=\{0\}$
    \begin{proof}
    \scriptsize
        ($\Longrightarrow$) If T is injective, then if $Tv=0=T(0)$, then $v=0$, so $\Null{T}=\{0\}$\\
        ($\Longleftarrow$) If $\Null{T}=\{0\}$, then if $Tv=Tw$, by linearity, we have $T(v-w)=0$, and so $v-w \in \Null{T}=\{0\}$\\
        Therefore, $v=w$ and $T$ is injective.
    \end{proof}
\end{frame}

\begin{frame}{Previous Graphical Example}
    Recall when we had $$T(x,y)=(3x-2y,2x+y)$$
    To find $\Null{T}$ we have to simultaneously have \begin{align*}
        3x-2y&=0\\
        2x+y&=0
    \end{align*}
    Adding the first equation to twice the second, we get $$7x=0$$ so $x=0$. And subbing that in we get $y=0$. Therefore, the only vector in the null space is the zero vector, so $T$ is injective, and so the entire set of solutions is $$\hat{x}+\Null{T}=\hat{x}+\{0\}=\{\hat{x}\}$$
    There is only one unique solution!
\end{frame}

\begin{frame}{Range}
    We now have described one fundamental subspace of the input space: $\Null{T} \subseteq V$
    When working with maps $T : V \to W$, all of $V$ is acted on and sent somewhere in $W$.
    \begin{definition}
        We define the \textbf{range} of a map to be the set of all outputs $$\range{T}:=\{Tv : v \in V\}=\{w \in W : w = Tv \text{ for some } v \in V\}$$
    \end{definition}
    \scriptsize
    In the first example, we had $$T(z_1, z_2, z_3) = z_1+2z_2+3z_3$$
    Is it easy to see that $\range{T}=\C$, for if we pick any $z \in \C$, setting $$(z_1, z_2, z_3)=(z, 0, 0)$$ would work.
    Similarly, setting $$(z_1, z_2, z_3)=(0, z/2, 0)$$ or even $$(z_1, z_2, z_3)=(z/6, z/6, z/6)$$ works. Thus $T$ was not injective (but we know that because it had a nontrivial null space!
\end{frame}

\begin{frame}{Example }
    Suppose $T \in \Lcal(\R^2, \R^3)$ is defined by (note the change to the "basis representation") $$T(x,y)=(2x,6y,x+y)=x\begin{bmatrix}2 \\ 0 \\ 1 
    \end{bmatrix}+y\begin{bmatrix}
        0 \\ 5 \\ 1
    \end{bmatrix}$$
    for any $x, y \in \R$.
    Therefore, the range the already in "span form"
    $\range{T}=\Span{\{(2, 0 , 1), (0, 5, 1)\}}$
\end{frame}

\begin{frame}{Example }
    Suppose $T \in \Lcal(\R^3, \R^2)$ is defined by $$T(x,y,z)=(2x+4y-3z,x+2y+z)=x\begin{bmatrix}2 \\ 1 
    \end{bmatrix}+y\begin{bmatrix}
        4 \\ 2
    \end{bmatrix}+\begin{bmatrix}
        -3 \\ 1
    \end{bmatrix}$$
    for any $x, y, z \in \R$.
    Still, the range the already in "span form"
    $$\range{T}=\Span{\{(2,1), (4,2), (-3,1)\}}$$
    but this is no longer a basis because the list is too long. We can remove one to get a basis of the range. \\
    \underline{Which of the following is correct?}
    \begin{enumerate}
        \item $\range{T}=\Span{\{(4,2), (-3,1)\}}$
            \item $\range{T}=\Span{\{(2,1), (-3,1)\}}$
                \item $\range{T}=\Span{\{(2,1), (4,2)\}}$
    \end{enumerate}
\end{frame}

\begin{frame}{Range is a Subspace}
    We saw that the null space describes a subspace of the input. Does the range do the same for the output?
    \begin{theorem}
        For map $T \in \Lcal(V,W)$, $\Range{T}$ is a subspace of $W$
    \end{theorem}
    \begin{proof}
        Suppose $w_1, w_2 \in \Range{T}$. Then there exists $v_1, v_2 \in V$ for which $$w_1=Tv_1 \hspace{1cm} w_2=Tv_2$$
        Therefore, $$w_1+w_2=Tv_1+Tv_2=T(v_1+v_2) \hspace{1cm} \lambda w_1 = \lambda Tv_1=T(\lambda v_1)$$
        Since $V$ is a vector space, both $v_1+v_2$ and $\lambda v_1$ are in $V$, so $w_1+w_2, \lambda w_1 \in \Range{T}$
        
    \end{proof}
\end{frame}

\begin{frame}{Surjective}
    \begin{definition}
        A map $T: V \to W$ (not necessarily linear) is \textbf{surjective} or \textbf{onto} if $$\Range{T}=W$$
        Equivalently, for any $w \in W$ there exists a $v \in V$ with $Tv=w$
    \end{definition}
    \begin{figure}
        \centering
        \includegraphics[width=0.7\linewidth]{kerne and range.png}
        \caption{https://www.geeksforgeeks.org/linear-mapping/}
    \end{figure}
\end{frame}

\begin{frame}{Exact Sequence (quick aside)}
Note: Maps "shrink space".\\
All these tools let us get an understanding of the structure...
    \begin{figure}
        \centering
        \includegraphics[width=0.8\linewidth]{Illustration_of_an_Exact_Sequence_of_Groups.svg.png}
        \caption{Wikipedia}
    \end{figure}
\end{frame}

\begin{frame}{Rank-Nullity Theorem (first "Big" theorem) \\ \scriptsize also known as "The Fundamental Theorem of Linear Maps"}
    Suppose $V$ is finite dimensional and $T \in \Lcal(V,W)$. Then $\Range{T}$ is finite dimensional and $$\boxed{\dim{V}=\underbrace{\dim{\color{red}{\Null{T}}}}_{nullity}+\underbrace{\dim{\color{blue}{\Range{T}}}}_{rank}}$$
    \vspace{-0.6cm}
    \begin{proof}
    \scriptsize
        Let $\color{red}{\{u_1, ..., u_k\}}$ be a basis of $\color{red}{\Null{T}}$ and extend to a basis of all of $V : \{\color{red}{u_1, ..., u_k}, \color{blue}{v_1, ..., v_r}\}$
        Therefore, $\dim{\color{red}{\Null{T}}}=k$ and $\dim{V}=k+r$, so all we need to show is that $\dim{\color{blue}{\Range{T}}}=r$\vspace{0.2cm}
        Suppose $v \in V$, then since the above is a basis, we can write $v=\color{red}{a_1u_1+...+a_ku_k}+\color{blue}{b_1v_1+...+b_rv_r}$ and since all the $\color{red}{u_i}'s$ are in the null space: $T(v)=\color{blue}{b_1Tv_1+...b_rTv_r}$. Since this holds for all $v \in V$, we can represent all the $w \in \color{blue}{\Range{T}}$ as a linear combination of the $\color{blue}{Tv_i's}$. Therefore $\color{blue}{\{Tv_1, ..., Tv_r}\}$ spans the range.\vspace{0.2cm}
        Finally, if $\color{blue}{c_1Tv_1+...+c_rTv_r}=0$, then by linearity $\color{blue}{cv_1+...+cv_r} \in \Null{T}$
        That is, some linear combination of the $\color{blue}{v_i's}$ is a linear combination of the $\color{red}{u_i's}$. But they are linearly \textbf{independent} from each other! The two spans only intersect at the zero vector. So this sum must be $0$ as well, and thus each $c_i$ is 0.\\
        i.e. $\color{blue}\{{Tv_1, ..., Tv_r}\}$ is also linearly independent, and so it forms a basis with dimension $r$
    \end{proof}
\end{frame}
\begin{frame}{Remark on Rank/Nullity}
\scriptsize
    \begin{corollary}
        The rank is bounded above by the dimension of the input and output space:
        $$\dim{\Range{T}} \leq \min\{\dim{V},\dim{W}\}$$
    \end{corollary}
    \begin{corollary}
        If $\dim{V} > \dim{W}$ then no $T \in \Lcal(V,W)$ is \textbf{injective}
        \begin{align*}
            \dim{\Null{T}} &= \dim{V}-\dim{\range{T}}\\
            &\geq \dim{V}-\dim{W} > 0
        \end{align*}
    \end{corollary}
        \begin{corollary}
        If $\dim{V} < \dim{W}$ then no $T \in \Lcal(V,W)$ is \textbf{surjective}
        \begin{align*}
            \dim{\range{T}} &\leq \dim{V}\\
            < \dim{W} 
        \end{align*}
    \end{corollary}
\end{frame}

\begin{frame}{Remark on Solving Linear Systems}
    If we are solving $T(x)=b$ with $T \in \Lcal(\R^n,\R^m)$, that is we are solving \begin{align*}
        T_{1,1}x_1+T_{1,2}x_2 + ... + T_{1,n}x_n &= b_1\\
                T_{2,1}x_1+T_{2,2}x_2 + ... + T_{2,n}x_n &= b_2\\
   & \vdots\\
            T_{m,1}x_1+T_{m,2}x_2 + ... + T_{m,n}x_n &= b_m
    \end{align*} with each $T_{i,j} \in \R$. Then if \begin{itemize}
        \item $n > m$, so we have more variables than equations: more unknowns that constraints, then $T$ is \textbf{not injective} and we have infinite solutions, if ones exist (we call this being consistent)
        \item $n < m$, so we have more equations than variables: more constraints than unknowns, then $T$ is \textbf{not surjective} and we have vectors $b \in \R^m$ without any solutions!
    \end{itemize}
\end{frame} 

\begin{frame}{Matrices (finally)}
\begin{definition}
    A \textbf{matrix} is an array of numbers
\end{definition}
    $$A=\begin{bmatrix}
        A_{1,1} & A_{1,2} & A_{1,3} & \hdots & A_{1,n}\\ 
        A_{2,1} & A_{2,2} & A_{2,3} & \hdots & A_{2,n}\\ 
        A_{3,1} & A_{3,2} & A_{3,3} & \hdots & A_{3,n}\\ 
        \vdots & \vdots & \vdots & \ddots & \vdots \\
        A_{m,1} & A_{m,2}  & A_{m,3} & \hdots & A_{m,n}
    \end{bmatrix}$$
\end{frame}

\begin{frame}{Matrices}
The $\textit{matrix of a (finite dimensional) linear operator}$ $\textbf{with respect to certain bases}$ is an array of numbers.
    \begin{definition}
    \small
        Given a linear map $T: V \to W$ and bases $\Bcal_V = \{v_1, ... v_n\}$ and $\Bcal_W = \{w_1, ..., w_m\}$ then the matrix representation $$\mathcal{M}(T, \Bcal_V, \Bcal_W)=A=\begin{bmatrix}
        A_{1,1} & A_{1,2} & A_{1,3} & \hdots & A_{1,n}\\ 
        A_{2,1} & A_{2,2} & A_{2,3} & \hdots & A_{2,n}\\ 
        A_{3,1} & A_{3,2} & A_{3,3} & \hdots & A_{3,n}\\ 
        \vdots & \vdots & \vdots & \ddots & \vdots \\
        A_{m,1} & A_{m,2}  & A_{m,3} & \hdots & A_{m,n}
    \end{bmatrix}$$
    such that for each $x \in V$, we have $$Tx=y \Longleftrightarrow A[x]_{\Bcal_V}=[y]_{\Bcal_W}$$
    \end{definition}
\end{frame}

\begin{frame}{Matrices}
    Let's decompose what the previous statement means:
    \begin{itemize}
        \item Recall that given a basis of a vector space: $\Bcal_V$, then for any $x \in V$ we can write $x=a_1v_1+...+a_nv_n$ uniquely.
        \item Therefore $Tx=T(a_1v_1+...+a_nv_n)=a_1T(v_1)+...+a_nT(v_n)$
        \item Linearity gives us that we \textit{only} need to know where $v_1, ..., v_n$ is sent.
        \item However, $Tv_i \in W$. So when it is mapped there, it can also be represented uniquely as a sum of finitely many values. 
        \item Thus, $Tv_i = b_1w_1+...b_mw_m$ from the basis vectors in $\Bcal_W$
        \item However, we need this to hold for each basis vector $v_i$, so we need two indices. We arrive at $$Tv_j = A_{1,j}w_1+...+A_{m,j}w_m=\sum_{i=1}^m A_{i,j}w_i$$
        \item In other words, to compute/find a matrix of a linear operator, we input each basis vector, see where it goes, and represent it in the output basis
    \end{itemize}
\end{frame}

\begin{frame}{Example}
\scriptsize
    This is a lot to unpack... let's see an example:
    $$T(x,y)=(2x+3y,-x+y,4x-7y)$$
    If we start with the standard bases $$\Bcal_V = \{e_1, e_2\} \hspace{1cm} \Bcal_W = \{f_1, f_2, f_3\}$$
    Then we get that \begin{align*}
        T(e_1)&=(2,-1,4)=2f_1+(-1)f_2+4f_3\\
        T(e_2)&=(3,1,-7)=3f_1+1f_2+(-7)f_3
    \end{align*}
    If we "pattern match" the corresponding coefficients on the output bases to the "array representation" above we get $$A=\begin{bmatrix}
        2 & 3\\
        -1 & 1\\
        4 & -7
    \end{bmatrix}$$
    which is exactly what we would get it we get wrote $T(x,y)$ is a standard "vector" form
\end{frame}

\begin{frame}{Example}
\scriptsize
    Again consider  $$T(x,y)=(2x+3y,-x+y,4x-7y)$$
    but now let's have the bases be different: $$\Bcal_V'=\left\{\begin{bmatrix}
        1\\2
    \end{bmatrix}, \begin{bmatrix}
        2\\-1
    \end{bmatrix}\right\} \hspace{1cm} \Bcal_W' = \left\{\begin{bmatrix}
        8\\1\\-10
    \end{bmatrix},\begin{bmatrix}
        1/3\\-1\\5\\
    \end{bmatrix},\begin{bmatrix}
        -9\\2\\-7
    \end{bmatrix}\right\}$$
    Doing the same trick we get:
    \begin{align*}
        T(v_1)&=(8,1,-10)=1w_1+0w_2+0w_3\\
        T(v_w)&=(1,-3,15)=0w_1+3w_2+0w_3
    \end{align*}
    So this matrix representation is $$\mathcal{M}(T, \Bcal_V', \Bcal_W') = \begin{bmatrix}
        1 & 0\\
        0 & 3\\ 
        0 & 0
    \end{bmatrix}$$
\end{frame}

\begin{frame}{Example}
\small
Okay, this all seems a little contrived and pointless, when would this be needed? Well consider "non-standard" vector spaces. Nothing too crazy, but let's consider $V=\mathcal{P}_3(\R)$.
Let $D : V \to V$ be differentiation. So $T(p)=p'$
If we just consider the standard basis $\Bcal = \{1, x, x^2, x^3\} $, then \begin{align*}
    D(1)=0&=0v_1+0v_2+0v_3+0v_4\\
    D(x)=1&=1v_1+0v_2+0v_3+0v_4\\
    D(x^2)=2x&=0v_1+2v_2+0v_3+0v_4\\
    D(x^3)=3x^2&=0v_1+0v_2+3v_3+0v_4
\end{align*}
    and so we get a matrix representation for an operation like differentiation. This will be useful in the future:
    $\mathcal{M}(D) = \begin{bmatrix}
        0 & 1 & 0 & 0\\
        0 & 0 & 2 & 0\\
        0 & 0 & 0 & 3\\
        0 & 0 & 0 & 0
    \end{bmatrix}$
\end{frame}

\begin{frame}{Recap}
\small
    In general, recall we have a basis for the input space $$\Bcal_V = \{v_1, ..., v_n\}$$ and a basis for the output space $$\Bcal_W = \{w_1, ..., w_m\}$$
    We know that for each input basis vector, we can map it through $T$, and write it as a linear combination of the output basis vectors: $$Tv_j = A_{1,j}w_1+...+A_{m,j}w_m$$
    This is precisely then the $j^{th}$ column of the matrix:
    \begin{figure}
        \centering
        \includegraphics[width=0.5\linewidth]{matrix.png}
        \caption{\textit{Linear Algebra Done Right}}
    \end{figure}
\end{frame}

\begin{frame}{Recap}
    In other words $$\mathcal{M}(T, \Bcal_V, \Bcal_W) = \begin{bmatrix}
        \biggr| & \biggr| & & \biggr|\\
        [Tv_1]_{\Bcal_W} & [Tv_2]_{\Bcal_W} & ... &         [Tv_n]_{\Bcal_W}\\
        \biggr| & \biggr| & & \biggr|\\
    \end{bmatrix}$$
    $$\mathcal{M}(T, \Bcal_V, \Bcal_W)=\begin{bmatrix}
        A_{1,1} & A_{1,2} & A_{1,3} & \hdots & A_{1,n}\\ 
        A_{2,1} & A_{2,2} & A_{2,3} & \hdots & A_{2,n}\\ 
        A_{3,1} & A_{3,2} & A_{3,3} & \hdots & A_{3,n}\\ 
        \vdots & \vdots & \vdots & \ddots & \vdots \\
        A_{m,1} & A_{m,2}  & A_{m,3} & \hdots & A_{m,n}
    \end{bmatrix}$$
\end{frame}
\begin{frame}{Why do we care?}
    Setting up matrices in this way let's us \begin{enumerate}
        \item Utilize linearity to evaluate a function with much smaller amount of information (just $mn$ numbers). 
        \item Allows freedom of choice of basis which will be extremely useful later (foreshadowing change of basis/spectral decomposition/Schur decomposition/SVD/etc.)
        \item This explains why matrix-vector multiplication works the way it does (and matrix-matrix multiplication too)!
    \end{enumerate}
\end{frame}

\begin{frame}{Matrix Vector Multiplication}
\small
    Suppose $x=c_1v_1+...+c_nv_n$ then $$T(x)=T(\sum_{i=1}^n c_iv_i)=\sum_{i=1}^n c_iTv_i=y \Longrightarrow [y]_{\Bcal_W}=\sum_{i=1}^n \underbrace{c_i [Tv_i]_{\Bcal_W}}_{\text{scaled columns}}$$
    Then since we have a matrix representation $$A= \begin{bmatrix}
       | & | & &|\\
        [Tv_1]_{\Bcal_W} & [Tv_2]_{\Bcal_W} & ... &         [Tv_n]_{\Bcal_W}\\
       | & | & &|\\
    \end{bmatrix}$$
    we have (recall that matrix vector multiplication exactly yields a linear combination of the columns) \vspace{-0.2cm}$$A[x]_{\Bcal_V}= \begin{bmatrix}
       | & | & &|\\
        [Tv_1]_{\Bcal_W} & [Tv_2]_{\Bcal_W} & ... &         [Tv_n]_{\Bcal_W}\\
       | & | & &|\\
    \end{bmatrix}\begin{bmatrix}
        c_1\\c_2\\ \vdots \\ c_n
    \end{bmatrix}=\sum_{i=1}^n c_i[Tv_i]_{\Bcal_W}$$
\end{frame}

\begin{frame}{Matrix Multiplication}
It'll be useful to define the set of matrices from $\F^n \to \F^m$ for given field $\F$
\begin{definition}
    The set of matrices from $\F^n \to \F^m$ (so m by n matrices) will be denoted as $M_{m,n}(\F)$. If $m=n$ we can just use $M_n(\F)$
\end{definition}
    \scriptsize
    Consider the follow matrices $A \in M_{m,n}$ and $C \in M_{n,p}$
    $$A=\begin{bmatrix}
        A_{1,1} & A_{1,2} & A_{1,3} & \hdots & A_{1,n}\\ 
        A_{2,1} & A_{2,2} & A_{2,3} & \hdots & A_{2,n}\\ 
        A_{3,1} & A_{3,2} & A_{3,3} & \hdots & A_{3,n}\\ 
        \vdots & \vdots & \vdots & \ddots & \vdots \\
        A_{m,1} & A_{m,2}  & A_{m,3} & \hdots & A_{m,n}
    \end{bmatrix} \hspace{1cm} C= \begin{bmatrix}
        C_{1,1} & C_{1,2} & C_{1,3} & \hdots & C_{1,n}\\ 
        C_{2,1} & C_{2,2} & C_{2,3} & \hdots & C_{2,n}\\ 
        C_{3,1} & C_{3,2} & C_{3,3} & \hdots & C_{3,n}\\ 
        \vdots & \vdots & \vdots & \ddots & \vdots \\
        C_{m,1} & C_{m,2}  & C_{m,3} & \hdots & C_{m,n}
    \end{bmatrix}$$
    We can view the product of $AC \in M_{m,p}$ in three ways:
\end{frame}

\begin{frame}{Naive Approach}
    If you had the same first experience with matrices I did, you were taught this "row by column" thing:
    \begin{figure}
        \centering
        \includegraphics[width=0.5\linewidth]{matrix mult.png}
        \caption{ThePalindrome.org}
    \end{figure}
    \vspace{-0.3cm}
    It is simple enough to memorize, and is drilled enough to seem natural. In algebraic terms we get an inner product of the $j^{th}$ row of A and the $k^{th}$ column of $C$ $$\boxed{[AC]_{j,k}=\sum_{r=1}^n A_{j,r}C_{r,k}=\inner{a_j}{C_k}} \hspace{0.5cm} 1 \leq j \leq m, \hspace{0.2cm} 1 \leq k \leq p$$
\end{frame}


\begin{frame}{Matrix Multiplication (as composition of linear maps)}
\scriptsize
    Consider $T : U \to V$ and $S : V \to W$ with dimensions $p, n, m$ respectively. Thus, we can have bases $$\Bcal_{U}=\{u_1, ..., u_p\} \hspace{0.5cm} \Bcal_V= \{v_1, ..., v_n\} \hspace{0.5cm} \Bcal_W= \{w_1, ..., w_m\}$$
    We can then define the matrices $$A := \mathcal{M}(S, \Bcal_V, \Bcal_W) \hspace{0.5cm} C:= \mathcal{M}(T, \Bcal_U, \Bcal_V)$$
    We already have seen that $ST : U \to W$ is linear, and so we aim to find the matrix $AC := \mathcal{M}(ST, \Bcal_U, \Bcal_W) \in M_{m,p}$.
    Recall, to find the matrix, we plug in the input basis vectors, and see how they are written in the output. So for any $1 \leq k \leq p$: \begin{align*}
        (ST)u_k &= S\left(\sum_{r=1}^n C_{r,k}v_r\right)\\
        &= \sum_{r=1}^n C_{r,k}(Sv_r)\\
        &= \sum_{r=1}^n C_{r,k}\sum_{j=1}^m A_{j,r}w_j\\
        &= \sum_{j=1}^m \colorbox{cyan}{$\left(\displaystyle\sum_{r=1}^n A_{j,r}C_{r,k}\right)$} w_j
    \end{align*}
\end{frame}

\begin{frame}{Matrix as a list of vectors}
    Finally, we can view the right matrix as a list of $p$ vectors in $\F^n$:
    $$C=\begin{bmatrix}
          | & | & &|\\
       C_1 & C_2 & ... & C_p\\
       | & | & &|\\
    \end{bmatrix}$$
    The matrix $A$ then \textit{acts on each vector} simultaneously and we get $$AC=\begin{bmatrix}
          | & | & &|\\
       AC_1 & AC_2 & ... & AC_p\\
       | & | & &|\\
    \end{bmatrix}$$
    A good exercise would be to verify from the matrix-vector multiplication (a linear combination of the columns) that this is equivalent to the previous.
\end{frame}
\begin{frame}{Inverses}
\scriptsize
    \begin{definition}
        For $T \in \Lcal(V,W)$ is \textbf{invertible} if there exists a $S \in \Lcal(W,V)$ such that $$ST=I_V\in \Lcal(V,V) \hspace{0.5cm} and \hspace{0.5cm} TS=I_W \in \Lcal(W,W)$$
        That is, $ST(v)=v$ and $TS(w)=w$ for all $v \in V$ and $w \in W$
    \end{definition}
    \begin{remark}[uniqueness of inverses]
        If $S_1$ and $S_2$ are inverses of $T$ then $$S_1=S_1I_W=S_1(TS_2)=(S_1T)S_2=I_VS_2=S_2$$
        So $S_1=S_2$
    \end{remark}
    \begin{remark}
    Furthermore $ST=I$ implies that $TS=I$ (in the respective vector spaces). Thus we call $S$ the \textbf{inverse of T} and denote it as $$S=T^{-1}$$
\end{remark}
\end{frame}


\begin{frame}{Conditions for Invertibility}
        \scriptsize

    \begin{theorem}
        $T \in \Lcal(V,W)$ is invertible if and only if $T$ is injective and surjective
    \end{theorem}
    \begin{proof}
        \begin{itemize}
            \item ($\Longrightarrow$) Suppose $T$ is invertible. 
            \begin{itemize}
                    \scriptsize

                \item (Injectivity) Suppose $T(u)=T(v)$. Then since $T^{-1}$ exists, we multiply on the left on both sides to get $u=T^{-1}Tu=T^{-1}Tv=v$. So $u=v$ and $T$ is injective.
                \item (Surjectivity) Now let $w \in W$ be arbitrary and since $T^{-1} \in \Lcal(W,V)$ we have that $T^{-1}w \in V$. So then $T(T^{-1}w)=w$, so there exists something in $V$ that is mapped to any $w \in W$
            \end{itemize}
            \item $(\Longleftarrow)$ Since $T$ is both injective and surjective, each $w \in W$ has a unique $v \in V$ such that $Tv=w$. Defining $S:W \to V$ element wise, so that $Sw=v$, the unique input of $T$
            \begin{itemize}
                    \scriptsize

                \item $TS=I$ by definition
                \item $ST=I$ because $T(ST(v))=(TS)(Tv)=I\circ Tv$, and since $T$ is injective, we get that $(ST)(v)=v$
                \item Finally $T(S(w_1)+\lambda S(w_2))=TS(w_1)+\lambda TS( w_2)=w_1+\lambda w_2$. Since $S$ is defined by $T(S(w))=w$, then $T(S(w_1+\lambda w_2))=w_1+\lambda w_2$. Injectivity of $T$ concludes the linearity condition: $S(w_1+\lambda w_2)=S(w_1)+\lambda S(w_2)$
            \end{itemize}
        \end{itemize}
    \end{proof}
\end{frame}

\begin{frame}{Conditions for Invertibility}
    When the map is \textbf{injective} (one-to-one) and \textbf{surjective} (onto), then we get a nice \textit{equivalence} between the input and output space. We can then actively construct the inverse.
    \begin{figure}
        \centering
        \includegraphics[width=0.7\linewidth]{invertible.jpg}
        \caption{Both injective and surjective}
    \end{figure}
\end{frame}

\begin{frame}{Conditions for Invertibility}
    If we don't have injectivity, then we lose the ability to define a unique output of the inverse map. Recall, \textit{any} function must have a unique output (vertical line test).
    \begin{figure}
        \centering
        \includegraphics[width=0.7\linewidth]{not inj.jpg}
        \caption{Not injective}
    \end{figure}
\end{frame}


\begin{frame}{Conditions for Invertibility}
    If we don't have surjectivity, then we lose the ability to define the map for some of the desired inputs (elements of $W$).\\
    \textit{Note: if the map is injective, then we can always define a map from $T^{-1} : \range{T} \to V$. Hence why we want surjectivity to get a map from all of $W \to V$.}
    \begin{figure}
        \centering
        \includegraphics[width=0.6\linewidth]{not sruj.jpg}
        \caption{Not injective}
    \end{figure}
\end{frame}
\begin{frame}{Conditions for Invertibility}
    Final note of invertibility. In finite dimensions we really only need one of these conditions:
    \begin{remark}
        $$\textit{T invertible} \Longleftrightarrow \textit{T injective} \Longleftrightarrow \textit{T surjective}$$
        with the proof coming directly from the Rank-Nullity Theorem
    \end{remark}
\end{frame}

\begin{frame}{Change of Basis}
\scriptsize
    Recall that \textit{both} vectors and matrices require a \textbf{basis} to represent them. Typically, we just deal with the "standard basis" as this is the easiest to understand and utilize, but there are many reasons to perform a \textbf{change of basis}.
    \scriptsize
    \begin{definition}
        Suppose we have a vector $v \in V$ and a basis $\Bcal=\{v_1, ... v_n\}$. We then can write $v$ in a vector form as $$[v]_\Bcal=\begin{bmatrix}
            a_1 \\ a_2\\ \ddots \\ a_n
        \end{bmatrix}=a_1v_1+...a_nv_n$$
        Given a new basis $\Bcal'=\{v_1',...,v_n'\}$ we can perform a \textbf{change of basis} using the \textbf{change of basis matrix} $$S_{\Bcal \to \Bcal'}\in M_{n}(\F)$$ such that $S_{\Bcal \to \Bcal'}[v_j]_\Bcal=[v_j]_{\Bcal'}$ for each $j$ and therefore $$S_{\Bcal \to \Bcal'}[v]_\Bcal = [v]_{\Bcal'}$$
    \end{definition}
    Essentially, all we are saying is that we can transform $[v]_\Bcal \mapsto [v]_{\Bcal'}$ with a linear transformation simply defined from writing each new vector in the coordinates of the old
\end{frame}

\begin{frame}{Change of Basis}
\scriptsize
\begin{remark}
    Note: Change of Basis is, I think, the \color{red}{hardest concept} \color{black}to fully understand in linear algebra. However, it is essential to understanding all the matrix decompositions. 
\end{remark}
    We start with constructing $S_{\Bcal \to \Bcal'}$ be first constructing its inverse. We will explain in a bit why this exists.\\
    Since $\Bcal$ is our original basis, we can write each new basis vector as a linear combination of them
    \begin{align*}
        v_1' &= A_{1,1}v_1+A_{2,1}v_2...+A_{n,1}v_n\\
        v_2' &= A_{1,2}v_1+A_{2,2}v_2...+A_{n,2}v_n\\
        \vdots\\\
        v_n' &= A_{1,n}v_1+A_{2,n}v_2...+A_{n,n}v_n
    \end{align*}
    Letting $$T=\begin{bmatrix}
        A_{1,1} & A_{1,2} & ... & A_{1,n}\\
        A_{2,1} & A_{2,2} & ... & A_{2,n}\\
        \vdots & \vdots & \ddots & \ddots\\
        A_{n,1} & A_{n,2} & ... & A_{n,n}
    \end{bmatrix}$$
    we can verify that $T[v_j]_\Bcal=T[v_j']_{\Bcal'}=[v_j']_{\Bcal}$ (why?)
\end{frame}

\begin{frame}{Change of Basis}
\small
    Is is typically easiest to think about change of basis when the first basis is just the standard basis. Then the new basis (in vector form, with respect to the standard basis) looks more as expected*, and moreover: $$T_{\Bcal'}:=S_{\Bcal' \mapsto \mathcal{I}}=\begin{bmatrix}
        | & | &  & |\\
        v_1' & v_2' & ... & v_n'\\
        | & | &  & | \\
    \end{bmatrix}$$
    That is, we don't need to worry how to write the new basis vectors in the old basis, and the matrix $T$ just has columns that are precisely the new basis vectors.
    \begin{remark}
        So, plugging in the vector with a one in the $j^{th}$ component and zeros elsewhere extracts the vector $v_j'$. In other words, plugging in $[v_j']_{\Bcal'}$ yields $[v_j']_{\Bcal}$ (recall here $\Bcal$ is the standard basis. \\
        Thus, $T_{\Bcal'}$ is a map from $\Bcal' \mapsto \Bcal$, this is the wrong direct (and very unintuitive in my opinion). 
    \end{remark}
\end{frame}

\begin{frame}{Change of Basis}
\scriptsize
    However, since $T_{\Bcal'}$ has linearly independent columns (as they are just the basis vectors), any $T_{\Bcal'}x$ just looks like a linear combination of those columns. So $T_{\Bcal'}x=0 \Longleftrightarrow x=0$, so $\Null{T_{\Bcal'}}=\{0\}$, this is trivial and $T_{\Bcal'}$ is invertible. Finally we can define \begin{definition}
        The \textbf{change of basis matrix} from the standard basis $\mathcal{I}=\{e_1, ..., e_n\}$ to a new basis $\Bcal'=\{v_1', ..., v_n'\}$ is $$S_{\mathcal{I} \mapsto \Bcal'}=T_{\Bcal'}^{-1}$$ for $T_{\Bcal'}=\begin{bmatrix}
        | & | &  & |\\
        v_1' & v_2' & ... & v_n'\\
        | & | &  & | \\
    \end{bmatrix}$
    \end{definition}
    \begin{remark}
        To construct a change of basis matrix between any two bases, we can simply compose these linear maps (it is an exercise to show that the composition of invertible maps is still invertible):
        $$S_{\mathcal{B} \mapsto \mathcal{B}'} = S_{\mathcal{I} \mapsto \mathcal{B}'}S_{\mathcal{B} \mapsto \mathcal{I}}={S_{\mathcal{B}' \mapsto \mathcal{I}}}^{-1}S_{\mathcal{B} \mapsto \mathcal{I}}={T_{\Bcal'}}^{-1}T_{\Bcal}$$
    \end{remark}
\end{frame}

\begin{frame}{Example}
\tiny
    Consider the vector $$v=(1,2,3,4)$$ and bases $$ \mathcal{I}=\{e_1, e_2, e_3, e_4\} \hspace{0.5cm} \mathcal{B}_1=\left\{\begin{bmatrix}
        1\\-1\\0\\1
    \end{bmatrix}  \begin{bmatrix}
        0\\1\\0\\-1
    \end{bmatrix} \begin{bmatrix}
        1\\0\\1\\0
    \end{bmatrix} \begin{bmatrix}
        0\\1\\0\\1
    \end{bmatrix}\right\}$$ 
    We can easily generate the $T_\Bcal$ by lining up the columns:$$T_\Bcal = \begin{bmatrix}
        1 & 0 & 1 & 0\\
        -1 & 1 & 0 & 1\\
        0 & 0 & 1 & 0\\
        1 &-1 &0 & 1
    \end{bmatrix}$$
    Now we just have to invert this and multiply by $$[v]_\mathcal{I}=\begin{bmatrix}
        1\\2\\3\\4
    \end{bmatrix} \hspace{1cm} {T_\Bcal}^{-1}[v]_\mathcal{I}=\begin{bmatrix}
        1  & 0 & -1 & 0\\
        1 & 0.5 & -1 & -0.5\\
        0 & 0 & 1 & 0 \\
        0 & 0.5 & 0 & 0.5\\
    \end{bmatrix}\begin{bmatrix}
        1\\2\\3\\4
    \end{bmatrix} =\begin{bmatrix}
        -2 \\ -3 \\  \phantom{-}3\\ \phantom{-} 3
    \end{bmatrix}$$
    Note, we can verify that we must multiply by the inverse, ${T_\Bcal}^{-1}$ by checking a basis vector.
\end{frame}

\begin{frame}{Change of Basis (linear maps)}
    Ok well this all seemed like a round about way to do something we already knew... 
    If we want to find a linear combination of some vectors that equal something desired, it is exactly just solving a linear system: $$Ax=b \Longleftrightarrow \begin{bmatrix}
        \text{some column vectors}
    \end{bmatrix}\begin{bmatrix}
        \text{some unknowns}
    \end{bmatrix}=\begin{bmatrix}
        \text{desired vector}
    \end{bmatrix}$$
In this particular case, all we are doing is solving $$T_{\Bcal}x=[v]_\mathcal{I}$$
However, change of basis is especially useful when considering \textbf{linear maps}!
\end{frame}

\begin{frame}{Change of Basis (linear maps)}
\small
    \begin{theorem}
        Given a matrix $A=\mathcal{M}(T, \Bcal)$ representing linear map $T : V \to V$ with basis $\Bcal$. Then the matrix $D=\mathcal{M}(T, \Bcal')$ for a new basis $\Bcal'$ looks like $$D = S_{\Bcal \to \Bcal'}AS_{\Bcal' \to \Bcal}$$
        If $\Bcal=\mathcal{I}$, the standard basis, then $S$ is the matrix whose \textbf{columns are the basis vectors} and $$D=S^{-1}AS \Longleftrightarrow A=SDS^{-1}$$
    \end{theorem}
    \begin{definition}
        If two matrices can be related by an invertible (nonsingular) matrix in the above way, we say two (square) matrices are \textbf{similar}: $$A, B \text{ are similar if and only if }  A=SBS^{-1} \text{ for some invertible matrix S}$$
    \end{definition}

\end{frame}

\begin{frame}{Similarity}
\small
    \begin{remark}
        As we will see, similar matrices share many, \textit{many} properties (trace, determinant, eigenvalues, multiplicity, etc.).\\
        \vspace{0.2cm}
        Moreover, the big result is that all similar matrices \textbf{are the same linear map, just under a different basis}, so of course they should have similar structure!
    \end{remark}
        \begin{remark}
        Furthermore, similarity forms an \textbf{equivalence relation}. That is:
        \begin{enumerate}
            \item $A$ is \textbf{similar} to $A$ for any $A \in M_n$
            \item If $A$ is \textbf{similar} to $B$, then $B$ is \textbf{similar} to $A$
            \item If $A$ is \textbf{similar} to $B$, and $B$ is \textbf{similar} to $C$, then $A$ is \textbf{similar} to $C$
        \end{enumerate}
        Therefore, we can choose one matrix to "represent" the equivalence class of all its similar matrices. In other words, there exists \textbf{just one matrix}, let's call it $J$, that gives all the information about the map.Then any other matrix similar to $J$, will have similar features, just perhaps in a different basis (e.g. different eigenvectors)
    \end{remark}
\end{frame}

\begin{frame}{Gaussian Elimination}
    Note: In many cases, we set up a system that has an invertible matrix, but finding the inverse is difficult, even for a computer!
    \begin{remark}
        When solving $$Ax=b$$ or recall the matrix-matrix multiplication can be viewed as repeated matrix-vector multiplication, so this generalizes, we often do not calculate $$x=A^{-1}b$$ Instead, we utilize something much easier, faster, cheaper, and more importantly, informational. 
    \end{remark}
\end{frame}  
\end{document}
