\documentclass[11pt]{article}

\usepackage{systeme}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
%\usepackage{palatino}
\usepackage{setdeck}

\usepackage{xcolor}

%\usepackage[textheight=8.5in, margin=1.6in]{geometry}
\usepackage[total={6in,8in}]{geometry}

\usepackage{tikz}
%\usepackage{pgfplots}
%\tikzstyle{ball} = [circle,shading=ball, ball color=black,
%    minimum size=1mm,inner sep=1.3pt]
%\usetikzlibrary{arrows.meta}
%\tikzset{>={Latex[length=2mm,width=1.5mm]}}

%\usepackage{graphicx}

\usepackage{needspace}  % <-- to prevent bad pagebreak over environment titles
% Use:  \Needspace{3\baselineskip} before opening an environment

\usepackage{enumitem}
\setlist[enumerate]{leftmargin=*,label=(\alph*)}

%\usepackage[colorlinks=true,citecolor=black,linkcolor=black,urlcolor=blue]{hyperref}

\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\sn}{\mathfrak{S}}
\newcommand{\ve}{\varepsilon}
\newcommand{\ips}[2]{\langle{#1}, {#2}\rangle}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Span}{\mathrm{Span}}
\DeclareMathOperator{\rk}{\mathrm{rank}}
\DeclareMathOperator{\trace}{\mathrm{tr}}
\DeclareMathOperator{\im}{\mathrm{im}}
\DeclareMathOperator{\Sym}{\mathrm{Sym}}
\DeclareMathOperator{\Hom}{\mathrm{Hom}}
\DeclareMathOperator{\diag}{\mathrm{diag}}
\DeclareMathOperator{\glb}{\mathrm{glb}}
\DeclareMathOperator{\lub}{\mathrm{lub}}

\parskip = 0.05in
\parindent = 0.0in

%\pagestyle{empty}

\begin{document}
\centerline{Math 201 lecture for Wednesday, Week 4}
\bigskip

\centerline{\bf Dimension II}
\medskip

Last time, we showed that if $V$ is finite-dimensional, then all of its bases
have the same number of elements.  Then, by definition, the number of elements in any
basis for~$V$ is the \emph{dimension} of~$V$.
\medskip

\textbf{Examples.}  
\begin{itemize}[label=--]
  \item $\dim F^n=n$ (for instance, $\{e_{1},\ldots,e_{n}\}$
    is a basis).
  \item $\dim\mathcal{P}_{d}(F)=\dim F[x]_{\leq d}=d+1$ (for instance,
    $\{1,x,\ldots,x^{d}\}$ is a basis).
  \item $\dim \{(x,y,z)\in F^{3}:x+y+z=0\}=2$ (for instance,
    $\{(1,0,-1),(0,1,-1)\}$ is a basis).
  \item $\dim_{\R}\C=2$ (for instance,~$\{1,i\}$ is a basis).
  \item $\dim_{\C}\C=1$ (for instance,~$\{1\}$ is a basis).
  \item $\dim \{\vec{0}\}=0$ (the basis is~$\emptyset$, which has~$0$ elements).
\end{itemize}

\textbf{Corollary.} Let~$V$ be a vector space of dimension~$n$. Then
\begin{enumerate}
  \item\label{cor:04wed1} If $S\subseteq V$ is linearly independent, then~$S$ has at most~$n$
    elements.
  \item\label{cor:04wed2} If~$S\subseteq V$ is linearly independent, then~$S$ can be completed to
    a basis for~$V$, i.e., there exists a basis containing~$S$ as a subset.
  \item\label{cor:04wed3} If~$S$ has $n$ elements, then~$S$ is linearly independent if and only if
    it spans~$V$.
  \item If~$S$ spans~$V$, then~$S$ has at least~$n$ elements.
  \item A basis is a minimal spanning set for~$V$.  (Here, ``minimal'' can mean the set
    has no strict subsets that also span~$V$, or it can mean minimal in number of
    elements.)
  \item A basis is a maximal linearly independent subset of~$V$.  (Here,
    ``maximal'' can mean there is no strict superset that is also linearly
    independent, or it can mean maximal in number.)
\end{enumerate}

\textbf{Example.}  Before proving the Corollary, here is an example of its use.
Prove that~$\{(5,3),(1,4)\}$ is a basis for~$\R^2$.  Since~$\dim\R=2$, we just
need to check that these two vectors are linearly independent (by
part~\ref{cor:04wed3}). Since neither is a scalar multiple of the other, we are
done.
\medskip

\begin{proof}
  \begin{enumerate}
    \item Here we repeat the key idea of the proof from last time showing that
      all bases have the same number of elements.
      If~$S=\emptyset$, we are done.  Otherwise, say
      $S=\{s_{1},\ldots,s_{k}\}$ for some~$k\geq1$.  We know that~$V$ has some basis
      $C=\{v_{1},\ldots,v_{n}\}$.  Since~$V=\Span(C)$, we can write
      \[
        s_1=a_1v_1+\cdots+a_{n}v_{n}.
      \]
      Since~$S$ is linearly independent, $s_{1}\neq\vec{0}$, and hence,
      some~$a_{i}\neq0$.  Without loss of generality, say~$a_{1}\neq 0$.  By
      the exchange lemma, we can swap~$s_{1}$ for~$v_{1}$ in~$C$ to get a new
      basis~$C'=\{s_{1},v_{2},v_{3},\ldots,v_{n}\}$.

      If~$k \geq2$, since~$C'$ is a basis, we can write
      \[
        s_{2} = b_{1}s_{1}+b_{2}v_{2}+\cdots+b_{n}v_{n}.
      \]
      Since~$s_{1}$ and~$s_{2}$ are linearly
      independent, at least one of~$b_{2},\ldots,b_{n}$ is nonzero.  For
      convenience, say~$b_{2}\neq 0$.  By the exchange lemma, the
      set~$C''=\{s_{1},s_{2},v_{3},\ldots,v_{n}\}$ is a basis.
      We can repeat this process until all elements of~$S$ have been swapped
      into~$C$, thus showing that~$k\leq n$, as required.
    \item If~$V=\Span(S)$, we are done.  If not, take~$v\in V\setminus\Span(S)$.
      By an earlier result, $S\cup \{v\}$ is linearly independent.  We can
      repeat this process, but once we reach~$n$ elements, the process stops by
      part~\ref{cor:04wed1}.
    \item ($\Rightarrow$) Suppose that~$S$ is linearly independent.  By
      part~\ref{cor:04wed2}, we can complete~$S$ to a basis~$B$.  Since~$\dim
      V=n$, we know that~$|B|=n$.  So we have~$S\subseteq B$ and~$|S|=|B|=n$.
      It follows that~$S=B$ is a basis, and hence, it spans~$V$.

      ($\Leftarrow$) Suppose~$V=\Span(S)$. We saw in an earlier lecture that there is a linearly subset of~$S'$
      of~$S$ with the same span as~$S$.  Since~$S'$ is linearly independent
      and~$V=\Span(S)=\Span(S')$, it follows that~$S'$ is a basis, and
      hence~$|S'|=\dim V=n$.  Since~$S'\subseteq S$ and~$n=|S'|=|S|$, it follows
      that~$S'=S$, and therefore, $S$ is linearly independent.
    \item If~$S$ is infinite, there is nothing to prove.  Otherwise, by removing
      elements from~$S$ we can find
      a linearly independent subset~$S'\subseteq S$ with the same span.
      Then~$S'$ is a basis for~$V$ and hence has $n$ elements.  Since~$S'\subseteq S$, we
      have~$n=|S'|\leq|S|$.
    \item HW.
    \item HW.
 \end{enumerate}
 \medskip

\textbf{Example.} Prove that
$\left\{(3,1,2),(1,0,-1),(-1,2,4),(1,3,0)\right\}\subset\R^{3}$
is linearly dependent.
\smallskip

\emph{Solution.} Since $\dim\R^{3}=3$, a linearly independent set has at
most~$3$ elements.
\end{proof}


\textbf{Extra time activity.}  Let~$F=\Z/3\Z$, and
consider the following twelve points in~$F^4$:
\[
\begin{array}{ccc}
  (1, 1, 2, 1)&(1, 1, 2, 0)&(2, 1, 2, 1)\\[10pt]
  (1, 1, 0, 1) &(2, 0, 1, 0) &(1, 0, 1, 1)\\[10pt]
  (2, 1, 1, 0)&(1, 2, 0, 0)&(1, 2, 2, 1)\\[10pt]
  (1, 2, 0, 1) &(2, 0, 1, 1)&(0, 0, 2, 2)
\end{array}
\]
Goal: find subsets of size three of this array that sum to~$(0,0,0,0)$.
\bigskip

\noindent All solutions:
\begin{itemize}
  \item $(1, 1, 2, 1), (1, 0, 1, 1), (1, 2, 0, 1)$
 \item $(1, 1, 0, 1), (1, 0, 1, 1), (1, 2, 2, 1)$
 \item $(2, 1, 1, 0), (1, 2, 0, 1), (0, 0, 2, 2)$
\end{itemize}

\noindent Observations: 
\begin{itemize}
  \item Three vectors sum to zero if and only if in each component, the entries
    are either all the same or all different.  For example, in the solution $(2,
    0, 0, 1), (2, 0, 1, 2), (2, 0, 2, 0)$, the entries in the first component
    are all~$2$, the entries in the second component are all~$0$, the entries in
    the third and fourth components are~$0,1,2$---all different.
  \item If~$u,v,w$ is a solution so that~$u+v+w=0$, consider the value of
    \[
      u+t(v-u)
    \]
    as~$t$ varies among the element of~$F$.  When~$t=0$, we get~$u$.
    When~$t=1$, we get~$v$, and when~$t=2$, we get
    \[
      u+2(v-u)= -u+2v = -u-v =w,
    \]
    recalling that~$2=-1$ in~$F=\Z/3\Z$.  We may think of~$t(v-u)$ as
    determining a line through the origin as~$t$ varies.  So then~$u+t(v-u)$ is
    that line translated by the vector~$u$.  So finding these triples of points
    whose sum is zero is the same as finding lines in~$F^{4}$ containing the
    three points.
\end{itemize}
\newpage

Relation to the game Set (number-1, shading, color, shape):
\bigskip

\begin{center}
  \begin{tikzpicture}
    \node[label={below:$(1,1,2,1)$}] at (0,0) {\smallsetcard{2}{2}{3}{2}{0.3}};
    \node[label={below:$(1,1,2,0)$}] at (2,0) {\smallsetcard{2}{2}{3}{1}{0.3}};
    \node[label={below:$(2,1,2,1)$}] at (4,0) {\smallsetcard{3}{2}{3}{2}{0.3}};

    \node[label={below:$(1,1,0,1)$}] at (0,-3) {\smallsetcard{2}{2}{1}{2}{0.3}};
    \node[label={below:$(2,0,1,0)$}] at (2,-3) {\smallsetcard{3}{1}{2}{1}{0.3}};
    \node[label={below:$(1,0,1,1)$}] at (4,-3) {\smallsetcard{2}{1}{2}{2}{0.3}};

    \node[label={below:$(2,1,1,0)$}] at (0,-6) {\smallsetcard{3}{2}{2}{1}{0.3}};
    \node[label={below:$(1,2,0,0)$}] at (2,-6) {\smallsetcard{2}{3}{1}{2}{0.3}};
    \node[label={below:$(1,2,2,1)$}] at (4,-6) {\smallsetcard{2}{3}{3}{2}{0.3}};

    \node[label={below:$(1,2,0,1)$}] at (0,-9) {\smallsetcard{2}{3}{1}{2}{0.3}};
    \node[label={below:$(2,0,1,1)$}] at (2,-9) {\smallsetcard{3}{1}{2}{2}{0.3}};
    \node[label={below:$(0,0,2,2)$}] at (4,-9) {\smallsetcard{1}{1}{3}{3}{0.3}};
  \end{tikzpicture}
\end{center}
\end{document}
