## Characterize the units and zero divisors in a multiplicative semigroup of square matrices over a field

Let $F$ be a field, let $n \geq 1$, and let $S = \mathsf{Mat}_n(F)$ denote the multiplicative semigroup of $n \times n$ matrices over $F$. Characterize the units and zero divisors in $S$. Does $S$ have a kernel?

In this previous exercise, we showed that a matrix is invertible if and only if it is row equivalent to the identity matrix. In this previous exercise, we showed that a matrix is row equivalent to the identity if and only if it has nonzero determinant (remember, this is over a field). So a matrix is invertible if and only if it has nonzero determinant.

Now suppose a matrix $A$ has determinant 0. Then as a linear transformation, $A$ is not injective. So there exists a nonzero column matrix $x$ such that $Ax = 0$. Then $A[x|\cdots|x] = 0$, and in particular $A$ is a zero divisor.

That is, every matrix is either a unit or a zero divisor, and to distinguish the two cases, we need only look at the determinant.

Note that $S$ has a zero, namely the zero matrix. Now every ideal in $S$ contains zero, so that the kernel (i.e. the intersection of all two-sided ideals) is nonempty.

Suppose $J \subseteq S$ is an ideal. Note that if $J$ contains a unit $A$, then for all $B \in S$ we have $BA^{-1}A = B \in J$, so that $J = S$. So every nontrivial ideal of $S$ is contained in the set $Z$ of zero divisors.

Let $J \subseteq S$ be an ideal, and suppose there exists a nonzero matrix $A \in J$. Suppose the $(h,k)$ entry of $A$ is nonzero. By left- and right- multiplying by appropriate permutation matrices, we can construct matrices $A_{i,j}$ whose $(i,j)$ entry is nonzero for all $1 \leq i,j \leq n$. By this previous exercise, left- and right-multiplying by appropriate matrices having only one nonzero entry, we see that $J$ contains matrices $B_{i,j}$ having a nonzero entry in $(i,j)$ and 0 elsewhere for any choice of $(i,j)$. Finally, multiplying by an appropriate scalar matrix $\alpha I$, in fact $J$ contains every matrix of the form $E_{h,k}$ having a 1 in entry $(h,k)$ and 0 elsewhere for all $1 \leq h,k \leq n$. In particular, $J$ contains the ideal generated by such matrices.

So the kernel of $S$ is precisely the ideal generated by the matrices $E_{h,k}$. In fact, since each $E_{h,k}$ is row- and column- equivalent to $E_{1,1}$, the kernel of $S$ is the principal ideal generated by the matrix $E_1$ with a 1 in entry $(1,1)$ and 0 elsewhere.

Recall that every square matrix over $F$ is row- and column-equivalent to a diagonal matrix, and that two matrices $A$ and $B$ are row- and column-equivalent precisely when we have $B = PAQ$ for some invertible matrices $P$ and $Q$. In particular, $A \in J(E_1)$ if and only if a diagonal matrix to which $A$ is row- and column equivalent is in $J(E_1)$. Moreover, we can assume that these diagonal matrices have only 1 or 0 on the main diagonal.

We claim that a diagonal matrix which has more than one nonzero entry on the main diagonal is not in $J(E_1)$. To see this, recall that $J(E_1) = E_1 \cup SE_1 \cup E_1S \cup SE_1S$. If $D$ is a diagonal matrix with more than one nonzero entry on the main diagonal, then certainly $D \neq E_1$. As we saw in this previous exercise, every element of $SE_1$ and $E_1S$ has at most one nonzero entry on the main diagonal. So it remains to be seen that $D \notin SE_1S$. Suppose $A = [a_{i,j}]$ and $B = [b_{i,j}]$ and consider $AE_1B = [\sum_{k,\ell} a_{i,k}e_{k,\ell}b_{\ell,j}] = [a_{i,1}b_{1,j}]$. If this matrix is diagonal with nonzero diagonal entry $a_{i,1}b_{1,j}$, then $a_{t,1} = 0$ for all $t \neq 1$, so that we have at most one nonzero diagonal entry.

So $A$ is in the kernel of $S$ if and only if it is row- and column- equivalent to a diagonal matrix with only one nonzero entry.