\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{indentfirst}
\usepackage{amsfonts}
\geometry{legalpaper, portrait, margin=0.5in}
\usepackage{color}   %May be necessary if you want to color links
\usepackage{hyperref}
\hypersetup{
    colorlinks=true, %set true if you want colored links
    linktoc=all,     %set to all if you want both sections and subsections linked
    linkcolor=black,  %choose some color if you want links to stand out
}
\usepackage[siunitx]{circuitikz}
\usetikzlibrary{patterns}
\usetikzlibrary{decorations.markings}
\graphicspath{ {./images/} }
\usepackage{enumitem}
\usepackage{outlines}
\begin{document}
\newcommand*\dif{\mathop{}\!\mathrm{d}}
\renewcommand{\mod}{\,\operatorname{mod}\,}
\setlength{\parindent}{0pt}

\setlist[enumerate]{noitemsep, topsep=0pt, itemindent=\parindent}
\setlist[itemize]{noitemsep, topsep=0pt, itemindent=\parindent}

\newenvironment{subitemize}
{ \begin{itemize}[leftmargin=\parindent] }
{ \end{itemize} }

\newenvironment{subenumerate}
{ \begin{enumerate}[leftmargin=\parindent] }
{ \end{enumerate} }

\newenvironment{nopagebr}
  {\par\nobreak\vfil\penalty0\vfilneg
   \vtop\bgroup}
  {\par\xdef\tpd{\the\prevdepth}\egroup
   \prevdepth=\tpd}

\newcommand{\bbr}{\mathbb{R}}

\pagebreak
\begin{outline}

Generally, we like matrices because they're pretty much the cheapest meaningful general op you can get for $\bbr^n \rightarrow \bbr^m$ transformations. So if we can get away with using them, use them. \\

But how do we know if we can get away with using linear maps?

\section{Linear maps are extrapolation}

Recall that linear maps $T : V \rightarrow W$ are just functions with a restriction of \textbf{linearity}: $T(ax+by) = aT(x) + bT(y)$. This determines what $T$ does to certain inputs ($ax+by$) based on what $T$ does to other inputs ($x,y$). \\

This is essentially an ``extrapolation'' rule: predefine some input-output pairs like $(x,T(x)),(y,T(y))$ and then linearity extrapolates outputs for all input-output pairs of the form $(ax+by,T(ax+by))$. \\

More generally, as a consequence of linearity, if you define $n$ input-output pairs $(b_1,T(b_1)),...,(b_n,T(b_n))$, then you can get an input-output pair $(u,T(u))$ for \textit{every} input $u$ that is a linear combination of the $b_i$s: $u = c_1 b_1 + ... + c_n b_n$. So if $b_1,...,b_n$ form a basis for $V$, then $T(u)$ is defined for every possible input $u \in V$, since every $u \in V$ is a linear combination of a basis for $V$.

\section{When is the ``linearity'' extrapolation ok?}

The deciding factor on whether or not linear maps are acceptable for some task of mapping $V \rightarrow W$ vectors is if $T$'s rule (linearity) extrapolates $T(x)$ for $x \not \in \{b_1,...,b_n\}$ reasonably closely to how we want our $V$ vectors to be mapped to $W$. \\

A useful intuition you can use is thinking of a linear map $T : V \rightarrow W$ as simply \textbf{re-representing} each of its basis vectors $b_1,...,b_n \in V$ as vectors in $W$, with all non-basis vectors continuing to use the same coefficients to combine the basis vectors, regardless of if they're the originals in $V$ or if they're re-represented in $W$. For example, $x = 0.5 b_1 + 0.5 b_2$ is an average of $b_1,b_2$, and after transformation, $T(x)$ is still an average between $T(b_1),T(b_2)$: $T(x) = 0.5 T(b_1) + 0.5 T(b_2)$. \\

XOR, for example, becomes immediately obvious why it fails: if we try a linear model, we have a linear map $T : \bbr^2 \rightarrow \bbr$, our basis is $[1,0],[0,1]$. Our $(b_i,T(b_i))$ pairs are $([1,0],1)$ and $([0,1],1)$. For a non-basis input $[1,1]$, it stays as a mix of $[1,0]$ and $[0,1]$ even in the codomain $\bbr$, yielding $T([1,1]) = T([1,0]) + T([0,1]) = 2$, even though it should be 0.

\end{outline}
\end{document}
