% vim: tw=50
% 04/11/2022 11AM

\begin{corollary*}
    $A_1, \dots, A_k$ are square matrices, then
    \[ \det
    \begin{pmatrix}
        A_1 & * & * & \cdots & * \\
        0 & A_2 & * & \cdots & * \\
        0 & 0 & A_3 & \cdots & * \\
        \vdots & \vdots & \vdots & \ddots & \vdots \\
        0 & 0 & 0 & \cdots & A_k
    \end{pmatrix}
    = (\det A_1) \cdots (\det A_k) \]
\end{corollary*}

\begin{proof}
    By induction on $k$.
\end{proof}

\myskip
In particular, if $A$ is filled with zeros below
the diagonal, then $\det A$ is the product of the
entries on the diagonal. (But this is also quite
easy to show directly from the definition of $\det
A$).

\begin{warning*}
    In general:
    \[ \det
    \begin{pmatrix}
        A & B \\
        C & D
    \end{pmatrix}
    \neq \det A \det D - \det B \det C \]
\end{warning*}

\begin{remark*}
    In $\RR^3$, we have that $(\bf{a} \times
    \bf{b}) \cdot \bf{c}$ is a volume form (and
    represents the volume of a parallelepiped), and in
    fact, $\det(\bf{a}, \bf{b}, \bf{c}) = (\bf{a}
    \times \bf{b}) \cdot \bf{c}$.
\end{remark*}

\subsection{Adjugate matrix}

Observation: We know that swapping two column
vectors flips the sign of the determinant, and we
also know that $\det A = \det A^\top$. So we find
that swapping two rows changes the determinant by
a factor of -1.

\begin{remark*}
    We could prove properties of determinant using
    the decomposition of $A$ into elementary
    matrices.
\end{remark*}

\subsubsection*{Column (line) expansion and
adjugate matrix}

Column expansion is to reduce the computation of
$n \times n$ determinants to $(n - 1) \times (n -
1)$ determinants. Very useful to compute
determinants.

\begin{flashcard}[minor-defn]
\begin{definition*}
    $A \in \mathcal{M}_n(F)$. Pick $i, j \le n$.
    We define:
    \[ A_{\hat{ij}} \in \mathcal{M}_{n - 1}(F) \]
    \cloze{obtained by removing the $i$-th row and the
    $j$-th column from $A$.}
\end{definition*}
\end{flashcard}

\begin{example*}
    \[ A =
    \begin{pmatrix}
        1 & 2 & -7 \\
        2 & 1 & 0 \\
        -3 & 6 & 1
    \end{pmatrix}
    \]
    \[ A_{\hat{32}} =
    \begin{pmatrix}
        1 & -7 \\
        2 & 0
    \end{pmatrix}
    \]
\end{example*}

\begin{lemma*}[Expansion of the determinant]
    Let $A \in \mathcal{M}_n(F)$.
    \begin{enumerate}[(i)]
        \item Expansion with respect to the $j$-th
            column: pick $1 \le j \le n$, then:
            \[ \det A = \sum_{i = 1}^n (-1)^{i +
            j} a_{ij} \det A_{\hat{ij}} \tag{$*$} \]
        \item Expansion with respect to the $i$-th
            row: pick $1 \le i \le n$, then
            \[ \det A = \sum_{j = 1}^n (-1)^{i +
            j} \det A_{\hat{ij}} \]
    \end{enumerate}
    Powerful tool to compute determinants.
\end{lemma*}

\begin{example*}
    \[ A =
    \begin{pmatrix}
        1 & 2 & -1 \\
        3 & -1 & 1 \\
        4 & 2 & -7
    \end{pmatrix}
    \]
    \[ \det A = -(2)
    \begin{vmatrix}
        3 & 1 \\
        4 & -7
    \end{vmatrix}
    + (-1)
    \begin{vmatrix}
        1 & -1 \\
        4 & -7
    \end{vmatrix}
    - 2
    \begin{vmatrix}
        1 & -1 \\
        3 & 1
    \end{vmatrix}
    \]
\end{example*}

\begin{proof}
    Expansion with respect to the $j$-th column
    (row expansion formula follows by taking
    transpose). Pick $1 \le j \le n$.
    \begin{itemize}
        \item $A = (A^{(1)} \mid A^{(2)} \mid
            \cdots \mid A^{(j)} \mid \cdots
            \mid A^{(n)})$
            \[ A^{(j)} = \sum_{i = 1}^n a_{ij}
            e_i, \quad A = (a_{ij})_{1 \le i , j
            \le n} \]
        \item \begin{align*}
            \det A
            &= \det \left( A^{(1)}, \dots, \sum_{i
            = 1}^n a_{ij} e_i, \dots, A^{(n)}
            \right) \\
            &= \sum_{i = 1}^n a_{ij} \det
            (A^{(1)}, \dots, e_i, \dots, A^{(n)})
            \\
            \det (A^{(1)} \mid \cdots \mid e_i
            \mid \cdots \mid A^{(n)})
            &= (-1)^{j - 1} \det (e_i \mid
            A^{(1)} \mid A^{(j - 1)} \mid A^{(j +
            1)} \mid \cdots \mid A^{(n)}) \\
            &= (-1)^{i - 1}(-1)^{j - 1} \det
            (A_{\hat{ij}}) \\
            &= (-1)^{i + j} \det(A_{\hat{ij}})
        \end{align*}
        so
        \begin{align*}
            \det A
            &= \sum_{i = 1}^n a_{ij} \det(A^{(1)},
            \dots, a^{(j - 1)}, e_i, \dots,
            A^{(n)}) \\
            &= \sum_{i = 1}^n a_{ij} (-1)^{i + j}
            \det A_{\hat{ij}} \qedhere
        \end{align*}
    \end{itemize}
\end{proof}

\begin{flashcard}[adjugate-defn]
\begin{definition*}[Adjugate matrix]
    Let $A \in \mathcal{M}_n(F)$. The adjugate
    matrix $\adj(A)$ is the $n \times n$ matrix
    with $(i, j)$ entry given by
    \[ \cloze{(-1)^{i + j} \det(A_{\hat{ji}})} \]
\end{definition*}
\end{flashcard}

\begin{theorem*}
    Let $A \in \mathcal{M}_n(F)$, then
    \[ \adj(A) A = (\det A) I_n \]
\end{theorem*}

\noindent
In particular, when $A$ is invertible,
\[ A^{-1} = \frac{1}{\det A} \adj(A) \]

\begin{proof}
    We just proved: ($*$)
    \begin{itemize}
        \item \begin{align*}
            \det A
            &= \sum_{i = 1}^n (-1)^{i + j} (\det
            A_{\hat{ij}}) a_{ij} \\
            &= \sum_{i = 1}^n (\adj(A))_{ji}
            a_{ij} \\
            &= (\adj(A)A)_{jj}
        \end{align*}
        \item For $j \neq k$ we have
            \begin{align*}
                0
                &= \det (A^{(1)}, \dots, A^{(k)},
                \dots, A^{(k)}, \dots, A^{(n)}) \\
                &= \det \left( a^{(1)}, \dots,
                \sum_{i = 1}^n a_{ik} e_i, \dots,
                A^{(k)}, \dots, A^{(n)} \right) \\
                &= \sum_{i = 1}^n a_{ik} \det
                (A^{(1)}, \dots, e_i, \dots,
                A^{(n)}) \\
                &= \sum_{i = 1}^n (\adj(A))_{ji}
                a_{ik} \\
                &= (\adj(A)A)_{jk} \\
                &= 0
            \end{align*}
            for $j \neq k$.
    \end{itemize}
    So done.
\end{proof}

\subsubsection*{Cramer rule}

\begin{proposition*}
    Let $A \in \mathcal{M}_n(F)$ be invertible.
    Let $b \in F^n$. Then the unique solution to
    $Ax = b$ is given by:
    \[ x_o = \frac{1}{\det A}\det(A_{\hat{i}} b) \]
    $1 \le i \le n$ where $A_{\hat{i}} b$ is
    obtained by replacing the $i$-th column of $A$
    by $b$.
\end{proposition*}

\noindent
Algorithmically, this avoids computing $A^{-1}$.


TODO: CHECK WHETHER NEEDS EDITING.
