\documentclass[12pt]{article}

\usepackage{systeme}

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}

\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 Friday, Week 3}
\bigskip

\centerline{\bf Bases}
\medskip

\textbf{Definition.} A subset~$B\subset V$ is a {\em basis} if it is linearly
independent and spans~$V$. An {\em ordered basis} is a basis whose elements have
been listed as a sequence:~$B=\langle b_1,b_2,\dots\rangle$.\footnote{Every
  vector space has a basis---we will prove this in the finite-dimensional case.
  An infinite-dimensional vector space may not have a countable basis, i.e., one
  that can be indexed by the natural numbers.  There is a link to a supplemental
article at our course homepage, if you would like to know more.}
\medskip

\textbf{Warning:} Our book defines a {\em basis} to be what we are calling an
{\em ordered basis}.  That's not standard, and there are problems with that idea
when talking about infinite-dimensional vector spaces, which we will not go into
here.  We will, however, use the book's notation of~``$\langle$''
and~``$\rangle$'' to denote an ordered basis. Thus, for us, the word {\em basis}
will mean ``unordered basis'', and we will try to be careful to say ``ordered
basis'' when relevant (but will sometimes forget).  
\medskip

\textbf{Examples.}
\begin{enumerate}
  \item The \emph{standard ordered basis} for~$F^n$ is $\langle e_1,\ldots,e_n\rangle$
    where the $i$-th standard basis vector is~$e_i=(0,\ldots,0,1,0,\ldots,0)$,
    the vector with~$i$-th component~$1$ and all other components~$0$.  For
    instance, the standard ordered basis for~$F^3$ is
    \[
      \langle (1,0,0), (0,1,0), (0,0,1)\rangle.
    \]
    Here is another possible ordered basis for~$F^3$:
    \[
      \langle(1,0,0), (0,1,0),(1,1,1)\rangle.
    \]
    Exercise: check that the above vectors are linearly independent and
    span~$F^3$.
  \item One ordered basis for the vector space $P_3(F)=F[x]_{\leq 3}$ of
    polynomials of degree most three is
    \[
      \langle 1, x, x^{2}, x^{3}\rangle.
    \]
  \item One ordered basis for, $M_{2\times 3}(F)$, the vector space of~$2\times 3$ matrices over a
    field~$F$, is
    \begin{align*}
      M_1 &= 
      \left(\begin{array}{ccc}
	  1 & 0 & 0 \\
	  0 & 0 & 0 
      \end{array}\right),\ 
      M_2 = 
      \left(\begin{array}{ccc}
	  0 & 1 & 0 \\
	  0 & 0 & 0 
      \end{array}\right),\ 
      M_3 = 
      \left(\begin{array}{ccc}
	  0 & 0 & 1 \\
	  0 & 0 & 0 
      \end{array}\right),\\[10pt]
	  M_4 &= 
	  \left(\begin{array}{ccc}
	      0 & 0 & 0 \\
	      1 & 0 & 0 
	  \end{array}\right),\ 
	  M_5 = 
	  \left(\begin{array}{ccc}
	      0 & 0 & 0 \\
	      0 & 1 & 0 
	  \end{array}\right),\ 
	  M_6 = 
	  \left(\begin{array}{ccc}
	      0 & 0 & 0 \\
	      0 & 0 & 1 
	  \end{array}\right).
	\end{align*}	
These matrices span $M_{2\times 3}(F)$:
\[
  \left(\begin{array}{ccc}
      a & b & c \\
      d & e & f
  \end{array}\right)
  =aM_1+bM_2+cM_3+dM_4+eM_5+fM_{6}.
\]
To see they are linearly independent, suppose the above sum is~$0$, i.e., the
zero matrix.  Then we must have~$a=b=c=d=e=f=0$.
\end{enumerate}

Last time, we showed the following proposition:

\textbf{Proposition 1 from previous lecture.} Let~$S\subseteq V$.  Then~$S$ is linearly dependent if and
only if there exists~$v\in S$ such that~$v$ is a linear combination of vectors
in~$S\setminus\left\{ v \right\}$, i.e., if and only
  if~$v\in\Span(S\setminus\left\{ v \right\})$.
\smallskip

We use this result to prove the following:
\medskip

\textbf{Proposition 1.} Any finite subset~$S$ of~$V$ has a linearly independent
subset with the same span.  In other words, if~$S$ is a finite set, then there
is a subset of~$S$ that is a basis for~$\Span(S)$.

\begin{proof} If~$S$ is linearly independent, we are done.  If not, then by
  Proposition~1 from the previous lecture, there exists~$v\in S$ such
  that~$v\in\Span(S\setminus \{v\})$.  It follows
  that~$\Span(S)=\Span(S\setminus \{v\})$.  If $S \setminus \{v\}$ is linearly
  independent, we are done.  If not, repeat the above step.  The process will
  end eventually since~$S$ is finite.  We are OK even if the process ends at the
  empty set since the empty set is linearly independent.  (For instance, if
  $S=\left\{0\right\}$, our process would end at~$\emptyset$.)
\end{proof}

In the above, we create a basis for~$\Span(S)$ by discarding elements of~$S$.
Another possibility is to start at the empty set and start adding elements~$S$
that are linearly independent of those we have so far.
This follows from:
\medskip

\textbf{Proposition 2.}  If~$T\subset V$ is linearly independent and~$v\in V\setminus T$,
then~$T\cup\left\{ v \right\}$ is linearly dependent if and only
if~$v\in\Span(T)$.
\smallskip

\begin{proof}
  $(\Rightarrow)$  Suppose that~$v\in V\setminus\left\{v\right\}$ and that~$T\cup\left\{ v \right\}$ is
  linearly dependent.  Then we may write
  \[
    av + a_1u_1+\dots + a_n u_n=0\qquad(\star)
  \]
  for some~$a,a_1,\ldots,a_n\in F$, {\em not all zero}, and distinct~$u_i\in T$.
  We can always assume that~$v$ appears in this expression by taking~$a=0$, if
  necessary.  But, in fact,~$a\neq 0$ since otherwise~$(\star)$ would be a
  linear relation among distinct elements of~$T$.  Since~$T$ is linearly
  independent, this would mean that all the~$a_i=0$, in addition to~$a=0$.
  However, we know that at least one of these scalars in nonzero.
  
  Thus, it must be that~$a\neq0$.  We can then solve for~$v$ in~$(\star)$:
  \[
    v = -\frac{a_i}{a}u_1-\dots-\frac{a_n}{a}u_n\in\Span(T).
  \]
  
  $(\Leftarrow)$ Suppose that~$v\in\Span(T)$. Then
  \[
  v=a_1u_1+\dots+a_nu_n
  \]
  for some~$a_i\in F$ and~$u_i\in T$.  Since~$v\notin T$, it follows that
  \[
    a_1u_1+\dots+a_nu_n+(-1)\cdot v = 0
  \]
  is a nontrivial relation among elements of~$T\cup\left\{ v \right\}$.
  So~$T\cup\left\{ v \right\}$ is linearly dependent.
\end{proof}

\begin{proof}[Alternate proof of Proposition 1]
We are starting with a finite set~$S$ and looking for a subset~$T$ of~$S$ that is
linearly independent and generates~$V=\Span(S)$.  If~$S=\emptyset$ or
$S=\left\{0\right\}$, we take~$T=\emptyset$ and are done.
If not, there exists a nonzero element~$u_1\in S$, and we
set~$T=\left\{u_{1}\right\}$. If~$\Span(T)=\Span(S)$, we are done.  If not, then
there exists~$u_2\in S$ such that~$u_{2}\not\in\Span(T)$. We then append~$u_2$
to $T$.  So now $T=\left\{u_{1},u_{2}\right\}$, and by Proposition~2, the
set~$T$ is linearly independent.  If~$\Span(T)\neq\Span(S)$, repeat to
find~$u_3\in S$ linearly independent of~$u_1$ and~$u_2$. Etc.  Since~$S$ is
finite, the process eventually stops.
\end{proof}

\textbf{Example.}  Let~$V=\left( \Z/3\Z \right)^3$, a vector space over~$\Z/3\Z$.

How many elements are in~$V$?  A point in~$V$ has the form~$(x_1,x_2,x_3)$, and
there are~$3$ choices for each~$x_i$.  Hence, the number of elements in~$V$
is~$|V|=3^3=27$.

As an exercise, check that the following is a subspace of~$V$:
\[
  W =\left\{ (x_1,x_2,x_3)\in V:x_1+x_2+x_3=0 \right\}.
\]
How many elements are in~$W$?  We have,
\[
  W=\left\{ (-x_2-x_3,x_2,x_3): x_2,x_3\in\Z/3\Z\right\}.
\]
As we let~$x_2$ and~$x_3$ vary, we get~$9$ elements:
\[
  \{(0,0,0),(2,1,0),(1,2,0),(2,0,1),(1,1,1),(0,2,1),(1,0,2),(0,1,2),(2,2,2)\}.
\]
Let's try to find a linearly independent
generating set for~$W$.  Start with~$v_1:=(2,1,0)$. The span of~$\{v_1\}$ has three elements:
\begin{align*}
  0\cdot(2,1,0)&=(0,0,0)\\
  1\cdot(2,1,0)&=(2,1,0)\\
  2\cdot(2,1,0)&=(1,2,0).
\end{align*}
Next, note that~$v_2=(2,0,1)$ is not in~$\Span(\{v_1\})$.  By Proposition~2, we
see that~$S:=\left\{ v_1,v_2 \right\}$ is linearly independent.  We
claim~$\Span(S)=W$. First, since~$v_1,v_2\in W$, we see~$\Span(S)\subseteq W$.
Next, by Theorem~1, every element of~$\Span(S)$ has a unique expression of the
form
\[
  a_1v_1+a_2v_2
\]
where~$a_1,a_2\in\Z/3\Z$.  Hence,~$|\Span(S)|=3^2=9$.  Since~$\Span(S)\subseteq
W$ and~$|\Span(S)|=|W|=9$, it follows that~$\Span(S)=W$.
\bigskip

\textbf{Proposition 3.} If~$B$ is a basis for~$V$, then every element of~$V$ can be
expressed uniquely as a linear combination of elements of~$B$.
\smallskip

\begin{proof}
  Since~$B$ is linearly independent, we've already seen that every
  element in $\Span(B)$ can be written uniquely as a linear combination of
  elements of~$B$. Since~$B$ is a basis, $\Span(B)=V$.
\end{proof}

\textbf{Definition.} Let~$B=\langle v_1,\dots,v_n\rangle$ be an ordered basis
for~$V$.  Given~$v\in V$, there are unique~$a_1,\dots,a_n\in F$ such that
\[
  v=a_1v_1+\dots+a_nv_n.
\]
The \emph{coordinates of~$v$ with respect to the basis~$B$} are the components of
the vector~$(a_1,\dots,a_n)\in F^n$.  We write
\[
  [v]_B = (a_1,\ldots,a_n).
\]

\Needspace{3\baselineskip}
\textbf{Examples.}  

\begin{enumerate}
  \item Let~$v=(x,y,z)\in F^3$.  The coordinates of~$v$ with respect
to the standard ordered basis $B=\langle e_{1},e_{2},e_{3}\rangle$ are~$(x,y,z)$
since
\[
  (x,y,z) = x(1,0,0)+y(0,1,0)+z(0,0,1)=xe_{1}+ye_{2}+ze_{3}.
\]
Now consider~$B'=\langle (1,0,0),(1,1,0),(1,1,1)\rangle$.  Then the coordinates
of~$v$ with respect to~$B'$ are $(x-y,y-z,z)$ since
\[
  (x,y,z) = (x-y)(1,0,0)+(y-z)(1,1,0)+z(1,1,1).
\]
\item Recall the ordered basis~$\langle M_1,\ldots,M_6\rangle$ for~$M_{2\times
  3}(F)$ defined earlier.  Then the coordinates of the matrix
  \[
    \left(\begin{array}{ccc}
   a & b & c \\
  d &e & f\\
    \end{array}\right)
  \]
  are $(a,b,c,d,e,f)\in F^6$.
  \end{enumerate}

\end{document}
