% This is lecture no. 4 of MH1201/: Linear Algebra II.

\chapter{Bases \& Dimension}%
\label{cha:bases_&_dimension}

\section{Bases}%
\label{sec:bases}

\begin{definition}
	Basis.
	Consider a vector space $\mathsf{\mathsf{V}}$ over a field $F$.
	A set $\beta\subset \mathsf{V}$ is a basis for $\mathsf{V}$, if $\beta$ is both linearly independent and it generates $\mathsf{V}$:
	\[
		\text{span($\beta$)}=\mathsf{V}
	.\]
\end{definition}
\begin{exmp}
	Because span($\varnothing$)=$\{0\}$ and $\varnothing$ is linearly independent, $\varnothing$ is a basis for the zero vector space.
\end{exmp}
\begin{exmp}
	In $F^{n}$ the set $\{e_1,e_2,\dotsc,e_{n}\}$, where $e_1=(1,0,0,\dotsc,0),e_2=(0,1,0,\dotsc,0),\dotsc,e_{n}=(0,0,\dotsc,1)$, is the standard basis for $F^{n}$.
\end{exmp}
\begin{thrm}
	Consider a vector space $\mathsf{V}$ over a field $F$, and the basis for $\mathsf{V}$ represented as $\beta=\{u_1,u_2,\dotsc,u_n\}\subset \mathsf{V}$ then:
	\[
	\forall v\in \mathsf{V} \ \exists ! \lambda_1,\lambda_2,\dotsc,\lambda_n\in F
	\text{ such that }
	v=\lambda_1u_1+\lambda_2u_2+\dotsb+\lambda_nu_n
	.\]
	Where $\exists !$  means ``there uniquely exists''.
\end{thrm}
\begin{proof}
	Suppose $\beta=\{u_1,u_2,\dotsc,u_n\}$ is a basis for $\mathsf{V}$.
	Now let $v\in \mathsf{V}$, since $\beta$ generates $\mathsf{V}$, we have $v\in$ span($\beta$).
	Then there exist $\lambda_1,\lambda_2,\lambda_n\in F$ such that:
	\[
	v=\lambda_1u_1+\lambda_2u_2+\dotsb+\lambda_nu_n
	.\]
	Now assume there is another set of scalars $\mu_1,\mu_2,\dotsc,\mu_n$ such that:
	\[
	v=\mu_1u_1+\mu_2u_2+\dotsb+\mu_nu_n
	.\]
	Taking the difference of these two linear combinations we get:
	\[
		(\lambda_1-\mu_1)u_1+(\lambda_2-\mu_2)u_2+\dotsb+(\lambda_n-\mu_n)u_n=0
	.\]
	However, $\beta$ is linearly independent, and so the coefficients in the equation above are all zero:
	\[
	\therefore \lambda_1=\mu_1, \lambda_2=\mu_2,\dotsc,\lambda_n=\mu_n
	.\]
	Thus $v$ is uniquely expressed as a linear combination of the vectors in $\beta$.
\end{proof}
\begin{thrm}
	Consider a vector space $\mathsf{V}$ over a field $F$, and a finite set $S$ that generates $\mathsf{V}$.
	Then some subset of $S$ is a basis for $\mathsf{V}$, and $\mathsf{V}$ has a finite basis.
\end{thrm}
Based on this theorem, we have a method for reducing a finite spanning set to a finite basis.
Let $\{u_1,u_2,\dotsc,u_n\}$ be a finite spanning set of vectors in $\mathsf{V}$ with $u_1\neq 0$.

\bigbreak
\noindent
\underline{Step 1:} Choose $u_1\neq 0$ and keep it in the `expected' basis.

\bigbreak
\noindent
\underline{Step 2:} Determine whether $u_2$ is a linear combination of the remaining vectors to its left.
\begin{itemize}
	\item If it is, then cross off $u_2$.
	\item If it isn't then keep $u_2$.
\end{itemize}

\bigbreak
\noindent
\underline{Step $k$:} Determine whether $u_k$ is a linear combination of the remaining vectors to its left.
\begin{itemize}
	\item If it is, then cross off $u_k$.
	\item If it isn't then keep $u_k$.
\end{itemize}

\bigbreak
\noindent
\underline{Step $n$:} Determine whether $u_n$ is a linear combination of the remaining vectors to its left.
\begin{itemize}
	\item If it is, then cross off $u_n$, and the remaining vectors to its let form a basis for $\mathsf{V}$.
	\item If it isn't then keep $u_n$, and the remaining vectors to its left together with $u_n$ form a basis for $\mathsf{V}$.
\end{itemize}

\section{Dimension}%
\label{sec:dimension}

\begin{thrm}
	Replacement Theorem.
	Consider a vector space $\mathsf{V}$ over a field $F$, a set $G\subset \mathsf{V}$ that generates $\mathsf{V}$ and contains $n$ vectors, and a linearly independent set $L\subset \mathsf{V}$ that contains $m$ vectors.
	Then:
	\[
	m\leqslant n
	.\]
	and:
	\[
		\exists G^{\prime}\subset G,\ |G^{\prime}|=n-m \text{ such that }L\cup G^{\prime} \text{ generates }\mathsf{V}
	.\]
\end{thrm}
As a result of this theorem, we can say that if $\mathsf{V}$, a vector space, has a finite basis, then every basis for $\mathsf{V}$ contains the same number of vectors.
\begin{proof}
	Suppose $\beta$ is a basis for $\mathsf{V}$ containing $n$ vectors.
	Now, let $\gamma$ be any other basis for $\mathsf{V}$.
	Now assume that $\gamma$ contains more that $n$ vectors (at least $n+1$).
	Then we can select a set $S\subset\gamma$ containing $n+1$ vectors which are all linearly independent.

	\noindent
	Now we have:
	\begin{align*}
		S\text{ is linearly independent, }|S|&=n+1,\\
		\beta\text{ generates }\mathsf{V},\ |\beta|&=n.
	\end{align*}
	And by the first conclusion of the replacement theorem:
	\[
	|S|\leqslant|\beta|\equiv n+1\leqslant n
	.\]
	Which is a contradiction.
	Therefore, $\gamma$ is finite, and the number $m$ of vectors in $\gamma$ satisfies $m\leqslant n$.
	Interchanging the roles of $\beta$ and  $\gamma$, and arguing as above, we obtain $n\leqslant m$, therefore $m=n$.
\end{proof}
\noindent
This fact lends itself to the definition of the dimension of a vector space.
\begin{definition}
	Dimension, finite-dimensional, \& infinite-dimensional.
	When the basis $\beta$ of a vector space $\mathsf{V}$ over a field $F$ has a cardinality of $n$:
	\[
	|\beta|=n
	.\]
	We say that the \textbf{dimension} of $\mathsf{V}$ is $n$:
	\[
		\text{dim($\mathsf{V}$)}=n
	.\]
	If $n$ is finite, we say that $\mathsf{V}$ is \textbf{finite-dimensional}.
	If $n$ is not finite, we say that $\mathsf{V}$ \textbf{infinite-dimensional}.
\end{definition}
\begin{exmp}
	Standard dimensions of vector spaces:
	\begin{enumerate}
		\item $\text{dim($\{0\}$)}=0$.
		\item $\text{dim($F^{n}$)}=n$.
		\item $\text{dim($M_{m\times n}(F)$)}=mn$.
		\item $\text{dim($P_n(F)$)}=n+1$.
	\end{enumerate}
\end{exmp}
\begin{exmp}
	The dimension of  a vector space depends on its field of scalars.
	If $\mathsf{V}=\mathbb{C}$ and $F=\mathbb{C}$ then:
	\[
		\text{dim($\mathbb{C}$(over $\mathbb{C}$))}=1
	.\]
	And an appropriate basis would be $\beta=\{1\}$. 

	\noindent
	If $\mathsf{V}=\mathbb{C}$ and $F=\mathbb{R}$ then:
	\[
		\text{dim($\mathbb{C}$(over $\mathbb{R}$))}=2
	.\]
	And an appropriate basis would be $\beta=\{1,i\}$. 
\end{exmp}

\bigbreak
\noindent
If you have a linearly independent subset $\mathsf{W}\subset \mathsf{V}$ which has a cardinality lower than the dimension of $\mathsf{V}$, you can extend it to create a basis for $\mathsf{V}$ by making a set $\mathsf{W}^{\prime}=\mathsf{W}+\beta$ where $\beta$ is the standard basis for $\mathsf{V}$, and apply the reduction algorithm in \cref{sec:bases}.
