% This is lecture no. 10 of MH1200/: Linear Algebra I.

\chapter{Basic Theory of Determinants}%
\label{cha:basic_theory_of_determinants}

\section{Basics \& Definitions}%
\label{sec:basics_&_definition}

\subsection{Basics}%
\label{sub:basics}

Determinants of matrices only exist for square matrices.
The determinant of a square matrix $A$ is a single real number $\det A \in \mathbb{R}$ calculated using all the entries of $A$:
\[
	\det : \{\text{Square Matrices}\} \to \mathbb{R}
.\]

\begin{exmp}
	The $1\times 1$ case:
	\[
		\det([c]) = c
	.\]
\end{exmp}

\begin{exmp}
	The $2\times 2$ case:
	\[
		\det\left(
		\begin{bmatrix}
			a & b\\
			c & d\\
		\end{bmatrix}
		\right) = ad-bc
	.\]
\end{exmp}

\begin{exmp}
	The standard alternative notation:
	\[
		\det\left(
		\begin{bmatrix}
			a_{11} & \cdots & a_{1n}\\
			\vdots & \ddots & \vdots\\
			a_{n1} & \cdots & a_{nn}\\
		\end{bmatrix}
		\right) =
		\begin{vmatrix}
			a_{11} & \cdots & a_{1n}\\
			\vdots & \ddots & \vdots\\
			a_{n1} & \cdots & a_{nn}\\
		\end{vmatrix}
	.\]
\end{exmp}

\subsection{Definitions}%
\label{sub:definitions}

There are two definitions that are required for the formal definition of the determinant of a matrix.
First is the definition of a minor matrix:
\begin{definition}
	Minor Matrix.
	Let $A$ be an $n\times n$ matrix.
	Let $i$ and $j$ be integers such that $1\leqslant i \leqslant n$ and $1 \leqslant j \leqslant n$.
	Then the $(i,j)$-minor matrix of $A$ is the $(n-1) \times (n-1)$ matrix denoted by $M_{ij}$ which you get when you forget the  $i$-th row and the $j$-th column.
\end{definition}

\begin{exmp}
	Minor matrices of a matrix. If we have a square matrix $A$ such that:
	\[
	A = 
	\begin{bmatrix}
		1 & 0 & -3 & 5\\
		1 & -4 & 0 & 2\\
		0 & 1 & 1 & 1\\
		2 & 1 & 3 & -10\\
	\end{bmatrix}
	.\]
	Then the $(2,4)$-minor matrix is as follows:
	\begin{align*}
		M_{24} &=
		\begin{bmatrix}
			1 & 0 & -3 & \boxed{5}\\
			\boxed{1} & \boxed{-4} & \boxed{0} & \boxed{2}\\
			0 & 1 & 1 & \boxed{1}\\
			2 & 1 & 3 & \boxed{-10}\\
		\end{bmatrix}\\
			 &=
		\begin{bmatrix}
			1 & 0 & -3\\
			0 & 1 & 1\\
			2 & 1 & 3\\
		\end{bmatrix}
	\end{align*}
	Where the boxed elements are the elements being removed to produce the minor matrix.
\end{exmp}

\bigbreak
\noindent
And second, the definition of the cofactor of an entry in a matrix:
\begin{definition}
	Cofactor of an Entry in a Matrix
	Let $A$ be an $n\times n$ matrix.
	Let $i$ and $j$ be integers such that $1\leqslant i \leqslant n$ and $1 \leqslant j \leqslant n$.
	Then the $(i,j)$-cofactor of $A$ is the number:
	\[
		C_{ij} = (-1)^{i+j} \det M_{ij}
	.\]
\end{definition}

\noindent
With these two definitions we can then approach the formal definition of the determinant of a matrix:
\begin{definition}
	Determinant of a Matrix.
	Let $A$ be an $n\times n$ matrix.
	The determinant of $A$ is given by the following formula:
	\[
		\det A = a_{11}C_{11} + \dotsb + a_{1n}C_{1n}
	.\]
	Where $a_{ij}$ is the $(i,j)$-entry of $A$, and $C_{ij}$ is the $(i,j)$-cofactor of $A$.
\end{definition}

\section{Elementary Properties of Determinants}%
\label{sec:elementary_properties_of_determinants}

\subsection{Property 1}%
\label{sub:property_1}

Let $A$ be an $n\times n$ matrix and assume $A$ has a row of zeroes, or a column of zeroes.
Then:
\[
\det A = 0
.\]
Is true since doing a cofactor expansion along the row or column of zeroes will yield an expression where every term is zero.

\subsection{Property 2}%
\label{sub:property_2}

Let $A$ be an $n\times n$ matrix.
Then:
\[
\det A^T = \det A
.\]
\begin{proof}
	Determinant of a Transpose.
	Proof will use induction on the dimension $n$ of the $n\times n$ matrix $A$.

	The base case will be $n = 1$.
	This case is trivial because in this case $A^T$ is precisely $A$.
	Therefore the property holds true for $n=1$

	Now for the induction step:
	We are assuming that if $A$ is a square matrix whose order (number of rows or columns) is strictly less than $n$ then:
	\[
	\det A^T = \det A
	.\]
	
	Let $C_{ij}$ denote the $(i,j)$-cofactor of $A$, and let $C'_{ij}$ denote the $(i,j)$-cofactor of $A^T$.
	We therefore know that:
	\[
		C_{ij} = (-1)^{i+j}\det M_{ij}
	.\]
	Where $M_{ij}$ is the $(i,j)$-minor matrix of $A$.
	The key observation is that the $(i,j)$-minor matrix $M_{ij}$ of $A$ is exactly the transpose of the $(j,i)$-minor $M'_{ji}$ of  $A^T$.
	For example, if:
	\[
	A = 
	\begin{bmatrix}
		1 & 2 & 3\\
		4 & 5 & 6\\
		7 & 8 & 9\\
	\end{bmatrix}
	.\]
	Then, the $(1,3)$-minor matrix of $A$ equals:
	\begin{align*}
		M_{13} & =
		\begin{bmatrix}
			\boxed{1} & \boxed{2} & \boxed{3}\\
			4 & 5 & \boxed{6}\\
			7 & 8 & \boxed{9}\\
		\end{bmatrix}
		\\
		       & =
		\begin{bmatrix}
			4 & 5\\
			7 & 8\\
		\end{bmatrix}
	\end{align*}
	Which is exactly the same as the transpose of the $(3,1)$-minor matrix of $A^T$ which equals:
	\begin{align*}
		M'_{31} & =
		\begin{bmatrix}
			\boxed{1} & 4 & 7\\
			\boxed{2} & 5 & 8\\
			\boxed{3} & \boxed{6} & \boxed{9}\\
		\end{bmatrix}\\
			& =
		\begin{bmatrix}
			4 & 7\\
			5 & 8\\
		\end{bmatrix}
	\end{align*}
	Therefore, we can see that:
	\begin{equation}
		\label{obs1}
		M_{ij} = (M'_{ji})^T
	\end{equation}
	Thus:
	\begin{align*}
		C_{ij} & = (-1)^{i+j} \det M_{ij}\\
		\intertext{Using the observation in \cref{obs1}:}
		       & =(-1)^{i+j} \det (M'_{ji})^T \\
		\intertext{Using the inductive assumption:}
		       & =(-1)^{i+j} \det (M'_{ji}) \\
		       & = C'_{ji}
	\end{align*}
	There, we can see that:
	\begin{equation}
		\label{obs2}
		C_{ij} = C'_{ji}
	\end{equation}
	Now, let $a_{ij}$ denote the $(i,j)$-entry of $A$, and $a'_{ij}$ denote the $(i,j)$-entry of $A^T$.
	Thus $a'_{ij} = a_{ji}$ and by the definition of the determinant:
	\begin{align*}
		\det A^T & = a'_{11}C'_{11} + \dotsb + a'_{1n}C'_{1n}\\
		\intertext{Because $a'_{ij} = a_{ji}$:}
		         & = a_{11}C'_{11} + \dotsb + a_{n1}C'_{1n}\\
		 \intertext{Because of the observation in \cref{obs2}:}
		         & = a_{11}C_{11} + \dotsb + a_{n1}C_{n1}\\
		 \intertext{By the definition of the determinant:}
			 & = \det A
	\end{align*}
\end{proof}

\subsection{Property 3}%
\label{sub:property_3}

Consider an $n\times n$ matrix $A$ as a composition of $n$ copies of $1\times n$ matrices:
\[
A =
\begin{bmatrix}
	\leftarrow & R_1 & \rightarrow \\
		   & \vdots & \\
	\leftarrow & R_i & \rightarrow \\
		   & \vdots & \\
	\leftarrow & R_n & \rightarrow \\
\end{bmatrix}
.\]
Now assume that the $i$-th row $R_i$ of $A$ is some linear combination of some other $1\times n$ matrices $S$ and $T$ with coefficients $x_1, x_2 \in \mathbb{R}$ :
\[
R_i = x_1S + x_2T
.\]
Changing the form of $A$ as such:
\[
A =
\begin{bmatrix}
	\leftarrow & R_1 & \rightarrow \\
		   & \vdots & \\
	\leftarrow & x_1S + x_2T & \rightarrow \\
		   & \vdots & \\
	\leftarrow & R_n & \rightarrow \\
\end{bmatrix}
.\]

Then $\det A$ can be expressed as such:
\[
\begin{vmatrix}
	\leftarrow & R_1 & \rightarrow \\
		   & \vdots & \\
	\leftarrow & x_1S + x_2T & \rightarrow \\
		   & \vdots & \\
	\leftarrow & R_n & \rightarrow \\
\end{vmatrix}
=
x_1
\begin{vmatrix}
	\leftarrow & R_1 & \rightarrow \\
		   & \vdots & \\
	\leftarrow & S & \rightarrow \\
		   & \vdots & \\
	\leftarrow & R_n & \rightarrow \\
\end{vmatrix}
+ x_2
\begin{vmatrix}
	\leftarrow & R_1 & \rightarrow \\
		   & \vdots & \\
	\leftarrow & T & \rightarrow \\
		   & \vdots & \\
	\leftarrow & R_n & \rightarrow \\
\end{vmatrix}
.\]
And because the property proved in \cref{sub:property_2}:
\begin{equation*}
	\resizebox{.9\hsize}{!}{
		$
		\begin{vmatrix}
			\uparrow & & \uparrow & & \uparrow \\
			C_1 & \cdots & x_1S + x_2T & \cdots & C_n \\
			\downarrow & & \downarrow & & \downarrow \\
		\end{vmatrix}
		=
		x_1
		\begin{vmatrix}
			\uparrow & & \uparrow & & \uparrow \\
			C_1 & \cdots & S & \cdots & C_n \\
			\downarrow & & \downarrow & & \downarrow \\
		\end{vmatrix}
		+ x_2
		\begin{vmatrix}
			\uparrow & & \uparrow & & \uparrow \\
			C_1 & \cdots & T & \cdots & C_n \\
			\downarrow & & \downarrow & & \downarrow \\
		\end{vmatrix}
		$
	}
\end{equation*}

\begin{proof}
	Determinants are linear functions in rows and columns.

	\noindent
	Let $S = [s_1, \dotsc , s_n]$, $T = [t_1, \dotsc , t_n]$, and $R_i = [r_1, \dotsc , r_n]$.
	Thus because:
	\[
	R_i = c_1S + c_2T
	.\]
	Then:
	\[
	r_j = c_1s_j + c_2t_j
	.\]
	And now by finding the determinant of $A$ by doing a cofactor expansion along row $i$:
	\begin{align*}
		\det A & = r_1C_{i1} + \dotsb + r_nC_{in}\\
		       & = (c_1s_1 + c_2t_1)C_{i1} + \dotsb + (c_1s_n + c_2t_n)C_{in}\\
		       & = c_1(s_1C_{i1} + \dotsb + s_nC_{in}) + c_2(t_1C_{i1} + \dotsb + t_nC_{in})
	\end{align*}
\end{proof}

\subsection{Property 4}%
\label{sub:property_4}

Let $A$ be an $n\times n$ matrix.
If $A$ has a repeated row, or a repeated column, then $\det A = 0$.

\begin{proof}
	Repeated row or column means determinant is zero.
	Proof will use induction.
	The base case of the induction will be the case $n=2$.
	Then the matrix will be of the form:
	\[
	\begin{bmatrix}
		a & b\\
		a & b\\
	\end{bmatrix}
	.\]
	And therefore:
	\[
	\begin{vmatrix}
		a & b\\
		a & b\\
	\end{vmatrix}
	=
	ab - ba
	= 0
	.\]
	And it is therefore true for $n=2$.
	Now for the induction step.
	Let $n$ be an integer such that $n>2$.
	We are assuming that the determinant of an $m\times m$ matrix with a repeated row whose dimension $m$ is strictly less that $n$ is zero.

	\bigbreak
	\noindent
	Let $A$ be an $n\times n$ matrix.
	Assume row $i$ and row $j$ are the same.
	Doing a cofactor expansion of $\det A$ along any choice of row $k$ other than $i$ or $j$ :
	\begin{equation}
		\label{det1}
		\det A = a_{k1}C_{k1} + \dotsb + a_{kn}C_{kn}.
	\end{equation}
	Each cofactor is of the form $(\pm 1)$ multiplied by $\det M_{kl}$, where $M_{kl}$ is the matrix obtained form $A$ by deleting row $k$ and column $l$.
	Because row $k$ was chosen to be different to either of the repeated rows, this matrix still has a repeated row, but is one dimension smaller.
	Because it is smaller we can apply the induction assumption and deduce that:
	\[
		C_{kl} = (-1)^{k+l} \det M_{kl} = 0
	.\]
	And therefore all the cofactor terms in \cref{det1} evaluate to 0, making the determinant 0.
\end{proof}

\subsection{Property 5}%
\label{sub:property_5}

Let $A$ be an $n\times n$ matrix.
Let $A'$ be a matrix obtained from $A$ by swapping two rows, or by swapping two columns.
Then:
\[
\det A' = -\det A
.\]

\begin{proof}
	Effect on determinant of a row swap, or column swap.
	Consider a matrix $A$ as follows and a matrix $A'$ obtained by swapping rows $i$ and $j$:
	\[
	A =
	\begin{bmatrix}
		\leftarrow & R_1 & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_n & \rightarrow\\
	\end{bmatrix}
	\qquad
	A' =
	\begin{bmatrix}
		\leftarrow & R_1 & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_n & \rightarrow\\
	\end{bmatrix}
	.\]
	Replacing both row $i$ and row $j$ by the sum of the two rows produces the following matrix $M$:
	\[
	M =
	\begin{bmatrix}
		\leftarrow & R_1 & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i + R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i + R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_n & \rightarrow\\
	\end{bmatrix}
	.\]
	Using the property shown in \cref{sub:property_2}, we can write the determinant of $M$ as follows:
	\[
	\begin{vmatrix}
		\leftarrow & R_1 & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i + R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i + R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_n & \rightarrow\\
	\end{vmatrix}
	=
	\begin{vmatrix}
		\leftarrow & R_1 & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i + R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_n & \rightarrow\\
	\end{vmatrix}
	+
	\begin{vmatrix}
		\leftarrow & R_1 & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_i + R_j & \rightarrow\\
		& \vdots & \\
		\leftarrow & R_n & \rightarrow\\
	\end{vmatrix}
	.\]
	And by doing further expansion:
	\begin{equation*}
		\resizebox{.9\hsize}{!}{$\begin{vmatrix}
			\leftarrow & R_1 & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i + R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i + R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_n & \rightarrow\\
		\end{vmatrix}
		=
		\begin{vmatrix}
			\leftarrow & R_1 & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_n & \rightarrow\\
		\end{vmatrix}
		+
		\begin{vmatrix}
			\leftarrow & R_1 & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_n & \rightarrow\\
		\end{vmatrix}
		+
		\begin{vmatrix}
			\leftarrow & R_1 & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_n & \rightarrow\\
		\end{vmatrix}
		+
		\begin{vmatrix}
			\leftarrow & R_1 & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_n & \rightarrow\\
		\end{vmatrix}.
		$}
	\end{equation*}
	Then, by using the property proved in \cref{sub:property_4} we can rewrite the equation as follows:
	\[
		0
		=
		0
		+
		\begin{vmatrix}
			\leftarrow & R_1 & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_n & \rightarrow\\
		\end{vmatrix}
		+
		\begin{vmatrix}
			\leftarrow & R_1 & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_j & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_i & \rightarrow\\
				   & \vdots & \\
			\leftarrow & R_n & \rightarrow\\
		\end{vmatrix}
		+
		0
	.\]
	Finally getting:
	\[
	\det A + \det A' = 0
	.\]
	As required.
\end{proof}

\subsection{Property 6}%
\label{sub:property_6}

Let $A$ be a triangular $n\times n$ matrix.
Then $\det A$ is the product of the diagonal entries.

\begin{proof}
	Determinant of a triangular matrix.
	For the base case $n=1$ the fact is obviously true.
	The determinant equals the only entry in the matrix which equals the product of diagonal entries.

	In the induction step, we are assuming that for every upper triangular matrix of dimension strictly less than $n$, the determinant equals the product of the diagonal entries.
	Let $A$ be an upper triangular $n\times n$ matrix:
	\[
	\begin{bmatrix}
		a_{11} & a_{12} & \cdots & a_{1n} \\
		0 & a_{22} & \cdots & a_{2n} \\
		\vdots & \vdots & \ddots & \vdots \\
		0 & 0 & \cdots & a_{nn} \\
	\end{bmatrix}
	.\]
	Then $A$ can be calculated by doing a cofactor expansion down the first column:
	\begin{align*}
		\det A & = a_{11}
		\begin{vmatrix}
			\boxed{a_{11}} & \boxed{a_{12}} & \boxed{\cdots} & \boxed{a_{1n}} \\
			\boxed{0} & a_{22} & \cdots & a_{2n} \\
			\boxed{\vdots} & \vdots & \ddots & \vdots \\
			\boxed{0} & 0 & \cdots & a_{nn} \\
		\end{vmatrix}
		+ 0 + \dotsb + 0\\
		\intertext{And by using the inductive assumption:}
		       & = a_{11} \times \left(a_{22}\times \dotsb \times a_{nn}\right)
	\end{align*}
	Making it true for any triangular matrix.
\end{proof}
