\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=*}

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

\centerline{\bf Subspaces and spanning sets II}
\medskip

In today's lecture, we start by proving a simple (but useful) results about
spanning sets.  We then present several examples of subspaces and spanning sets.
\medskip

Recall the definitions presented last time:

{\bf Definition.} Let~$S$ be a nonempty subset of~$V$.  Then~$v\in V$ is a
\emph{linear combination} of vectors in~$S$ if there exist
$u_1,\dots,u_n\in S$ and $a_1,\dots,a_n\in F$ (for some~$n$) such that
\[
  v = \sum_{i=1}^{n}a_iu_i=a_1u_1+\dots+a_nu_n.
\]

{\bf Definition.} Let~$S$ be a nonempty subset of~$V$.  The \emph{span}
of~$S$, denoted~$\Span(S)$, is the set of all linear combinations of elements
of~$S$.  By convention~$\Span\emptyset:=\left\{ 0 \right\}$, and we say
that~$0$ is the {\em empty linear combination}.

\textbf{Lemma.} Let~$V$ be a vector space over~$F$, let~$S\subseteq V$, and
let~$v\in V$.  Then
\[
  \Span\left( S\cup\left\{v\right\}\right)=\Span(S)\quad\Leftrightarrow\quad
  v\in\Span(S).
\]
\begin{proof}
  ($\Rightarrow$) If $\Span\left( S\cup\left\{v\right\}\right)=\Span(S)$, then
  since~$v\in\Span\left( S\cup\left\{v\right\}\right)$, it follows that
  $v\in\Span(S)$.

  ($\Leftarrow$) Suppose that~$v\in\Span(S)$.  We wish to show that $\Span\left(
  S\cup\left\{v\right\}\right)=\Span(S)$.  Suppose that $w\in\Span(S\cup
  \{v\})$.  Then we can write
  \[
    w = a_1 s_1+\cdots+a_k s_k + b v
  \]
  for some $s_1,\ldots,s_k\in S$ and some~$a_1,\ldots,a_k,b\in F$.  We are given
  that $v\in\Span(S)$.  Hence, 
  \[
    v = c_1t_1+\cdots+c_{\ell}t_{\ell}
  \]
  for some~$t_1,\ldots,t_{\ell}\in S$ and some $c_1,\ldots,c_{\ell}\in F$.
  Substituting into the previous equation, we see
  \begin{align*}
    w &= a_1 s_1+\cdots+a_k s_k + b(c_1t_1+\cdots+c_{\ell}t_{\ell}) \\
      &= a_1 s_1+\cdots+a_k s_k + bc_1t_1+\cdots+bc_{\ell}t_{\ell}\\
      &\in\Span(S).
  \end{align*}
  We have shown that $\Span\left(
  S\cup\left\{v\right\}\right)\subseteq\Span(S)$. The opposite inclusion also
  holds since one is easily sees that
  \[
    S\subseteq S\cup \{v\}\Rightarrow \Span(S)\subseteq \Span(S\cup \{v\}).
  \]
\end{proof}

We now move on to examples of subspaces and spanning sets.
\medskip

\textbf{Example.} 
Recall from the reading that~$P_k(F)$ is the vector space of
polynomials of degree at most~$k$ with coefficients in~$F$. 
Another, more standard, notation for this vector space is~$F[x]_{\leq k}$. 
We have that
\[
  P_k(F)=F[x]_{\leq2}=\Span\{1,x,\ldots,x^{k}\}.
\]
Now let 
\[
  S=\left\{x^{2}+3x-2,2x^{2}+5x-3\right\}\subset \R[x]_{\leq 2}.
\]
Is~$-x^{2}-4x+4\in\Span(S)$?
\smallskip

\emph{Solution.} We are looking for~$a,b\in\R$ such that
\[
  -x^{2}-4x+4=a(x^{2}+3x-2)+b(2x^{2}+5x-3),
\]
in other words, such that
\[
  -x^{2}-4x+4=(a+2b)x^{2}+(3a+5b)x+(-2a-3b).
\]
So we need to see if the following system of linear equations has a solution:
\begin{align*}
  a+2b&=-1\\
  3a+5b&=-4\\
  -2a-3b&=4.
\end{align*}
Applying Gaussian elimination, we find
\[
  \left(
    \begin{array}{rr|r}
      1&2&-1\\
      3&5&-4\\
      -2&-3&4
    \end{array}
   \right)
  \quad
  \rightsquigarrow
  \quad
  \left(
    \begin{array}{rr|r}
      1&0&0\\
      0&1&0\\
      0&0&1
    \end{array}
   \right).
\]
We see that the system is inconsistent, i.e., it has no solutions.  So
$-x^{2}-4x+4\notin\Span(S)$.
\medskip

\textbf{Definition.} Let~$S$ be any set, and consider the function space~$F^S:=\left\{
f\colon S\to F \right\}$. For each~$s\in S$, define the \emph{characteristic function}~$\chi_s\in F^S$ for~$s$ by
\begin{align*}
  \chi_s\colon S&\to F\\
  t&\mapsto
  \begin{cases}
    1&\text{if~$t=s$}\\
    0&\text{otherwise}.
  \end{cases}
\end{align*}
\medskip

\textbf{Example.} Let~$S=\left\{ 1,2,3 \right\}$, and consider the
function~$f\colon S\to\R$ given by~$f(1)=-1$,~$f(2)=\pi$, and~$f(3)=16$.
Then we can write~$f$ as a linear combination of characteristic functions:
\[
  f=-\chi_1+\pi\chi_2+16\chi_3.
\]
For instance,
\begin{align*}
  f(2)&= (-\chi_1+\pi\chi_2+16\chi_3)(2)\\
      &= -\chi_1(2)+\pi\chi_2(2)+16\chi_3(2)\\
      &= -0+\pi\cdot 1+16\cdot 0 = \pi.
\end{align*}

In this way, if~$S$ is finite, then~$\left\{ \chi_s:s\in S \right\}$
generates~$F^S$.  On the other hand, if~$S$ is infinite, things are more
complicated.  For instance, consider the case where~$S=\N=\{0,1,2,\dots\}$.
Then~$\R^{\N}$ is the vector space of infinite real sequences.  For instance,
the sequence $1,1/2,1/4,/8,\dots$ is the function $f\in\R^{\N}$ given
by~$f(i):=1/2^i$.  If we try to write~$f$ as a linear combination of
characteristic functions, we would have
\[
  f = \chi_0+\frac{1}{2}\chi_1+\frac{1}{4}\chi_2+\frac{1}{8}\chi_3+\cdots,
\]
an infinite sum.  However, by definition, the span of a set is the
collection of all {\em finite} linear combinations of elements in the set.
Infinite linear combinations like those above involve questions of
convergence, and we are not concerned with those issues at the moment.
\medskip

\textbf{Definition.} A linear equation of the form $a_1x_1+\cdots+a_nx_n=0$
where~$a_i\in F$ is called \emph{homogeneous}.
\medskip

\textbf{Proposition.} The solution set to a system of homogeneous linear
equations in $n$ unknowns and with coefficients in~$F$ is a subspace of~$F^{n}$.
\begin{proof}
  First note that the zero vector satisfies any homogeneous linear equation.  So
  the solution set is nonempty.  Next, let $u=(u_1,\ldots,u_n)$ and
  $v=(v_1,\ldots,v_n)$ be solutions to a system of homogeneous linear equations,
  and let $a_1x_1+\cdots+a_nx_{n}=0$ be any equation in the system.  Thus,
\begin{align*}
  a_1u_1+\cdots+a_nu_n&=0\\
  a_1v_1+\cdots+a_nv_n&=0.
\end{align*}
Now let~$\lambda\in F$ and consider 
\[
  u+\lambda v = (u_1+\lambda v_{1},\ldots,u_{n}+\lambda v_{n}).
\]
The following calculation shows that~$u+\lambda v$ is also a solution to the
equation
\begin{align*}
  a_1(u_1+\lambda v_{1})+\cdots+a_n(u_{n}+\lambda v_{n})&=
a_1u_1+\cdots+a_nu_n + \lambda(a_1v_1+\cdots+a_nv_n)\\
&=0+\lambda\cdot 0=0.
\end{align*}
\end{proof}
\medskip

\textbf{Terminology.}  Since the solution set to a system of homogeneous linear
equations is a subspace, we usually refer to the solution set as the
\emph{solution space} for the system.
\medskip

\textbf{Example.} Writing a solution to a system of homogeneous linear equations
in vector form yields a set of generators for the solution space.  For example,
consider the system
\[
  \sysdelim..
  \systeme[xyzw]{x+z+w=0,2x+y-w=0,3x+y+z=0.}
\]
We solve the system by performing Gaussian elimination (intermediary steps
omitted):
\[
  \left(\begin{array}{rrrr|r}
      1 & 0 & 1 & 1&0 \\
      2& 1 & 0 & -1&0 \\
      3&  1 & 1 & 0&0
  \end{array}\right)
  \quad
  \rightsquigarrow
  \quad
  \left(\begin{array}{rrrr|r}
  1& 0 & 1 & 1 & 0 \\
  0 & 1 & -2 & -3 & 0 \\
  0 & 0 & 0 & 0 & 0
  \end{array}\right).
\]
Converting back into equations and solving for the leading (pivot) variables
gives
\begin{align*}
  x &=-z-w\\
  y &= 2z+3w.
\end{align*}
So the set of solutions (in parametric form) is
\[
  \left\{(-z-w,2z+3w,z,w):z,w\in\R\right\},
\]
or, written in vector form,
\[
  \left\{
    z\left(\begin{array}{rrrr} -1\\ 2\\1 \\0 \end{array}\right)
  +
    w\left(\begin{array}{rrrr} -1\\ 3\\0 \\1 \end{array}\right):
    z,w\in\R
  \right\}
  =
  \Span \left\{\left(\begin{array}{rrrr} -1\\ 2\\1 \\0 \end{array}\right),
	   \left(\begin{array}{rrrr} -1\\ 3\\0 \\1 \end{array}\right)\right\}.
\]
The solution space is generated by two vectors.
\end{document}
