% vim: tw=50
% 31/10/2022 11AM

\begin{corollary*}
    Similar matrices have the same trace
\end{corollary*}

\begin{proof}
    \begin{align*}
        \Trace(P^{-1}AP)
        &= \Trace(APP^{-1}) \\
        &= \Trace(A)
    \end{align*}
\end{proof}

\begin{definition*}
    If $\alpha : V \to V$ linear (endomorphism) we
    can define:
    \[ \Trace \alpha = \Trace([\alpha]_{\mathcal{B}}) \]
    in any basis $\mathcal{B}$ (does not depend on
    the choice $\mathcal{B}$).
\end{definition*}

\begin{flashcard}[trace-of-dual-map]
\begin{lemma*}
    $\alpha : V \to V$, $\alpha^* : V^* \to V^*$
    dual map, then
    \[ \Trace \alpha = \Trace \alpha^* \]
\end{lemma*}

\begin{proof}
    \cloze{
    \begin{align*}
        \Trace \alpha
        &= \Trace([\alpha]_{\mathcal{B}}) \\
        &= \Trace([\alpha]_{\mathcal{B}}^\top) \\
        &= \Trace([\alpha^*]_{\mathcal{B}^*})
        &&\text{(because
        $[\alpha]_{\mathcal{B}}^\top =
        [\alpha^*]_{\mathcal{B}^*}$)} \qedhere
    \end{align*}
    }
\end{proof}
\end{flashcard}

\subsection{Determinants}

\subsubsection*{Permutations and transpositions}

\begin{itemize}
    \item permutation: $S_n = $ group of
        permutations of $\{1, \dots, n\}$
        \[ \sigma : \{1, \dots, n\} \to \{1,
        \dots, n\} \]
        is a bijection. Then $\sigma$ is a
        permutation.
    \item Transposition $k \neq l$, $\tau_{kl} \in
        S_n$ just swaps $k$ and $l$.
    \item Decomposition: any permutation of
        $\sigma$ can be decomposed as a product of
        transpositions
        \[ \sigma = \prod_{i = 1}^{n\sigma}
        \tau_i \]
        $\tau_i$ transposition.
    \item Signature: $\eps : S_n \to \{-1, 1\}$,
        \[ \sigma \mapsto \begin{cases}
            1 & \text{if $n_\sigma$ even} \\
            -1 & \text{if $n_\sigma$ odd}
        \end{cases} \]
        $\eps(\sigma) = $ signature of $\sigma$.
        \emph{and} $\eps$ is a group homomorphism.
\end{itemize}

\begin{definition*}[Determinant]
    $A \in \mathcal{M}_n(F)$ (square matrix),
    \[ A = (a_{ij})_{\substack{1 \le i \le n\\1
    \le j \le n}} \]
    We define the determinant of $A$ as:
    \[ \det A = \sum_{\sigma \in S_n} \eps(\sigma)
    a_{\sigma(1)1} a_{\sigma(2)2} \cdots
a_{\sigma(n) n} \]
\end{definition*}

\begin{example*}
    \[ \det
    \begin{pmatrix}
        a_{11} & a_{12} \\
        a_{21} & a_{22}
    \end{pmatrix}
    a_{11}a_{22} - a_{12}a_{21} \]
\end{example*}

\begin{lemma*}
    If $A = (a_{ij})$ is an upper (lower) triangular
    matrix with 0 on the diagonal:
    \[ a_{ij} = 0 \text{for $i \ge j$ (resp $i \le
    j$)} \]
    then $\det A = 0$.
\end{lemma*}

\begin{proof}
    For $a_{\sigma(1)1} \cdots a_{\sigma(n)n}$ not
    to be zero, I need $\sigma(j) < j$ for all $j
    \in \{1, \dots, n\}$ which is
    \emph{impossible} for $\sigma \in S_n$. So all
    the terms are 0, so $\det A = 0$.
\end{proof}

\myskip
Exercise: Show similarly that if instead we allow
the diagonal elements to be nonzero, then the
determinant is the product of the diagonal
elements.

\begin{lemma*}
    $\det A = \det(A^\top)$
\end{lemma*}

\begin{proof}
    \begin{align*}
        \det A
        &= \sum_{\sigma \in S_n} \eps(\sigma)
        a_{\sigma(1)1} \cdots a_{\sigma(n)n} \\
        &= \sum_{\sigma \in S_n} \eps(\sigma)
        \prod_{i = 1}^n a_{\sigma(i) i} \\
        &= \sum_{\sigma \in S_n} \eps(\sigma)
        \prod_{j = 1}^n a_{j\sigma^{-1}(j)}
    \end{align*}
    Now remember $\eps(\sigma \sigma^{-1}) =
    \eps(\sigma) \eps(\sigma^{-1})$ so since
    $\eps(\sigma) \in \{-1, 1\}$,
    \[ \implies \eps(\sigma^{-1}) = \eps(\sigma) \]
    \begin{align*}
        \det A
        &= \sum_{\sigma \in S_n} \eps(\sigma)
        \prod_{i = 1}^n a_{i \sigma^{-1}(i)} \\
        &= \sum_{\sigma \in S_n} \eps(\sigma^{-1})
        \prod_{i = 1}^n a_{i\sigma^{-1}}(i) \\
        &= \sum_{\sigma \in S_n} \eps(\sigma)
        \prod_{i = 1}^n a_{i\sigma(i)} \\
        &= \det(A^\top)
    \end{align*}
\end{proof}

\myskip
Why this formula for $\det A$?

\begin{flashcard}[volume-form-defn]
\begin{definition*}
    A \emph{volume form} $d$ on $F^n$ is a
    function
    \[ \ub{F^n \times \cdots \times F^n}_{n \text{
    times}} \to F \]
    such that
    \begin{enumerate}[(i)]
        \item \cloze{$d$ is multilinear: for any $1 \le i
            \le n$, for all $v_1, \dots, v_{i -
            1}, v_{i + 1}, \dots, v_n \in F^n$,
            \[ v \mapsto d(v_1, \dots, v_{i - 1},
            v, v_{i + 1}, \dots, v_n) \]
            is linear (i.e. an element of
            $(F^n)^*$) (linear with respect to all
            coordinate)}
        \item \cloze{$d$ alternate: if $v_i = v_j$ for
            some $i \neq j$, then
            \[ d(v_1, \dots, v_n) = 0 \]}
    \end{enumerate}
\end{definition*}
\end{flashcard}

\noindent
We want to show that there is in fact only
\emph{one} (up to a multiplicative constant)
volume form on $F^n \times \cdots \times F^n$
which is given by the determinant:
\[ A = (a_{ij}) = (A^{(1)} \mid \cdots \mid
A^{(n)}) \]
(column vectors)
\[ \det A = \det(A^{(1)}, \dots, A^{(n)}) \]

\begin{lemma*}
    $F^n \times \cdots \times F^n \to F$
    \[ (A^{(1)}, \dots, A^{(n)}) \mapsto \det A \]
    is a volume form.
\end{lemma*}

\begin{proof}
    \begin{enumerate}[(i)]
        \item multilinear $\sigma \in S_n$, then
            $\prod_{i = 1}^n a_{\sigma(i)i}$ is
            multilinear: there is only one term
            from each column appearing in the
            expression. The sum of multilinear
            maps is multilinear, so $\det$ is
            multilinear.
        \item Alternate: Assume $k \neq l$,
            $A^{(k)} = A^{(l)}$. I want to show
            $\det A = 0$. Indeed: let $\tau$ be
            the transposition which swaps $k$ and
            $l$. Then since $A^{(k)} = A^{(l)}$
            then $a_{ij} = a_{i\tau{j}}$ for all
            $i, j$. We can decompose:
            \[ S_n = A_n \sqcup \tau A_n \]
            then
            \begin{align*}
                \det A
                &= \sum_{\sigma \in S_n}
                \eps(\sigma) \prod_{i = 1}^n
                a_{i\sigma(i)} \\
                &= \sum_{\sigma \in A_n} \prod_{i
                = 1}^n a_{i\sigma(i)} +
                \sum_{\sigma \in \tau A_n}
                \eps(\sigma) \prod_{i = 1}^n a_{i
                \tau\sigma(i)} \\
                &= \sum_{\sigma \in A_n} \prod_{i
                = 1}^n a_{i\sigma(i)} -
                \sum_{\sigma \in A_n}
                a_{i\tau\sigma(i)} \\
                &= \sum_{\sigma \in A_n} \prod_{i
                = 1}^n a_{i\sigma(i)} -
                \sum_{\sigma \in A_n} \prod_{i =
                1}^n a_{i\sigma(i)} \\
                &= 0
            \end{align*}
    \end{enumerate}
\end{proof}

\begin{lemma*}
    Let $d$ be a volume form. Then swapping two
    entries changes the sign.
\end{lemma*}

\begin{proof}
    Equivalent definition of ``alternate''.
    \begin{align*}
        0
        &= d(v_1, \dots, v_i + v_j, \dots, v_i + v_j,
        \dots, v_n) \\
        &= d(v_1, \dots, v_i, \dots, v_i, \dots,
        v_n) + d(v_1, \dots, v_i, \dots, v_j,
        \dots, v_n) \\
        &~~~ + d(v_1, \dots v_j, \dots, v_i,
        \dots, v_n) + d(v_1, \dots, v_j, \dots,
        v_j, \dots, v_n) \\
        &= 0 + d(v_1, \dots, v_i, \dots, v_j,
        \dots, v_n) + d(v_1, \dots, v_j, \dots,
        v_i, \dots, v_n)
    \end{align*}
\end{proof}
