## Computing the determinant of a matrix over a field

Let $A$ be a square matrix over a field $F$.

1. Compute the determinant of each type of elementary matrix.
2. Prove that $\mathsf{det}(A)$ is nonzero if and only if $A$ is row-equivalent to the identity matrix. Suppose there is a sequence of row operations containing $s$ row interchanges and $t$ row multiplications, using the nonzero constants $u_1, \ldots, u_t$. Prove that $\mathsf{det}(A) = (-1)^s (u_1 \cdots u_t)^{-1}$.

We discussed elementary matrices in this previous exercise.

Note that if $\sigma \in S_n$ is not the identity, then there must exist an element $i$ such that $\sigma(i) > i$. (Otherwise, we can show by induction that $\sigma = 1$.) Now recalling the naive formula for computing $\mathsf{det}(A)$, note that if $A$ is an upper- or lower-triangular matrix, then $\mathsf{det}(A)$ is merely the product of the diagonal entries.

In particular, we have $\mathsf{det}(E_{s,s}(\alpha)) = \alpha$, and $\mathsf{det}(E_{s,t}(\alpha)) = 1$ if $s \neq t$. Note also that the row operation of interchanging two rows is equivalent to three operations which add a multiple of one row to another and one scalar row multiplication by -1. Since determinants are multiplicative, the determinant of the elementary matrix achieving this operation is -1.

Suppose $\mathsf{det}(A) \neq 0$. In this previous exercise, we saw that the columns of $A$ are linearly independent. In particular, all columns in the reduced row echelon form of $A$ are pivotal, and so $A$ is row equivalent to the identity matrix. Conversely, suppose $A$ is row equivalent to the identity matrix. Then the columns of $A$ are linearly independent, and so $\mathsf{det}(A) \neq 0$.

Suppose now that $PA = I$, where $P$ is a product of elementary matrices. Since determinants are multiplicative, it is clear that $\mathsf{det}(A)$ has the given form.