I came across this question on Quora:
How many $3\times 3$ matrices over the finite field $\{0,1,2\}$ satisfy the condition $A^{-1}=(A^T)^2$?
Thanks to NumPy, with sheer brute-force, I found that there are $33$ such matrices. (You may go through the code and the output.)
I believe that there is a more elegant/algebraic approach to this problem because of the following observations I made:
$A^{-1}=(A^T)^2\implies \det A= 1$ so there can be at most $\dfrac{(3^3-1)(3^3-3)(3^3-3^2)}{3-1}=5616\tag*{}$ such matrices. (Order of special linear group.)
All of them are symmetric i.e., $A^T=A$. (I don't know how to prove this but it's supported by observation.)
All of them satisfy $A^3=I$. (As a consequence of 2)
All of them have zero trace i.e., sum of the diagonal elements is $0$. (I don't know how to prove this either.)
There is only one such matrix which has $(1,1,1)$ on the diagonal. It is the identity matrix.
There are four matrices each which have $(2,2,2)$ or $(0,0,0)$ on their diagonal.
For each permutation $\sigma$ of $0$, $1$, $2$, there are four matrices such that $\text{diag}(A)=\sigma$.
This accounts for the $1+4+4+3!\cdot 4=33$ such matrices.
I would want to know why $(2)$ and $(4)$ are true.
Here's a short summary:
For a matrix $A$ over the field of three elements, it looks like: $$A^{-1}=(A^T)^2 \iff \begin{array}\ A^T=A\\ \text{det }A=1\\ A^3=I \end{array}\implies \text{tr}(A)=0$$
However, I don't have a proof, it's just observations.
Update:
After a long discussion in comments, it is clear to me why $(2)$ and $(4)$ are true.
Why (2) is true? You can rewrite the given condition as $A^T=(A^TA)^{-1}$; now take transpose on both sides to get $A=(AA^T)^{-1}$ and now, use these facts:
- The product of a matrix and its transpose is always symmetric.
- The inverse (if exists) of a symmetric matrix is symmetric.
Why (4) is true? $1$ is the eigen value of $A^3$ with algebraic multiplicity of $3$... This means that eigenvalues of $A$ are of the form cube-root of unity. There is only one cube root of unity in this field. It is $1$ iteself. So the eigenvalues of $A$ are $1,1,1$. Thus, $\text{tr}(A)=1+1+1=0$.
Account for 33 solutions: I think I have also got an idea for a more elegant approach which accounts for the $33$ solutions. I don't know if there is any fallacy in my logic, it is not at all rigorous :(
The properties $A^3=I$ and $A^T=A$ are preserved under conjugation by a non-singular diagonal matrix in this field. What I mean is that:
Let $D$ be a non-singular diagonal matrix (there are $2^3$ choices because $0$ can't be diagonal entry). If $A$ is a solution, $DAD^{-1}$ is also a solution.
Reason: $\mathbb Z_3^*$ is a cyclic group of order two and the group of diagonal matrices is isomorphic to $\mathbb Z_3^*\times \mathbb Z_3^*\times \mathbb Z_3^*$ which is Boolean group. Hence, $D^2=I$. This implies that $D^{-1}=D=D^{T}$. Thus, the conjugate $DAD^{-1}=DAD^T=(DAD^{-1})^T$ is symmetric. Also, notice that $(DAD^{-1})^3=DA^3D^{-1}=I$.
Another point to note is that Conjugation by a diagonal matrix preserves the diagonal… I mean that $\text{diag}(DAD^{-1})=\text{diag}(A)$.
Reason: When you left multiply $A$ by a diagonal matrix $D$, each row $i$ is scaled by $D_{ii}$. Following that right multiplication by $D^{-1}$, scales each column $i$ by $1/D_{ii}$. As a result, the diagonal elements remain unscaled and intact.
Given a solution $A$ with $\text{diag}(A)=(1,2,0)$, how many $D$-conjugates of $A$ exist?
$D$ and $-D$ yield the same conjugate because $DAD^{-1}=(-D)A(-D)^{-1}$… We have $8/2=4$ unique diagonal matrices upto sign, each of which yield a unique $D$-conjugate of $A$. These conjugates have the same diagonal as $A$ and also satisfy our condition.
Likewise, for every solution $A$ with $\text{diag}(A)=(2,2,2)$ or $(2,1,0)$, etc. (we make sure the trace is zero), we have $4$ solutions each by conjugating $A$ with diagonal matrices.
$A=I$ is an exception because $DID^{-1}=I$ so we don’t get any new solution.
Leaving $(1,1,1)$ aside, there are $8$ other arrangements for the diagonal entries which make the trace zero: $(0,0,0)$, $(2,2,2)$ or some permutation of $(1,2,0)$. For each of these types of arrangements along the diagonal, it is observed that there is at least one solution, which can be $D$-conjugated to generate new solutions.
\begin{array}{|c|c|}\hline \text{diag}(A) & \text{No. of $D$-conjugates}\\ \hline (1,1,1)&1\\ \hline(0,0,0)&4\\ \hline (2,2,2)&4\\ \hline (1,2,0)&4\\ \hline (1,0,2)&4\\ \hline (0,1,2)&4\\ \hline (0,2,1)&4\\ \hline (2,1,0)&4\\ \hline (2,0,1)&4\\ \hline \end{array}
That makes the count $8\times 4+1=33$.
Firstly, from $A^{-1}=(A^T)^2$, we obtain $AA^TA^T=I$. Taking transpose on both sides, we also get $AAA^T=I$. Therefore $A=A^T$. Secondly, as pointed out by Jyrki Lahtonen in a comment, the polynomial $x^3-1=(x-1)^3$ annihilates $A$. It follows that $B=A-I$ is symmetric and nilpotent.
Obviously, $B=0$ (i.e., $A=I$) gives a solution.
If $\operatorname{rank}(B)=1$, then $B=suu^T$ for some $s=\pm1$ and $u\ne0$, because $B$ is symmetric. Since $B$ is nilpotent, we must have $u^Tu=0$. However, in $GF(3)^3$, all nonzero vectors $u$ such that $u^Tu=0$ are entrywise nonzero. Hence we may assume that $u=(1,\pm1,\pm1)^T$. There are $2$ choices of the sign $s$ and $4$ choices of $u$, which amount to $8$ solutions in total.
If $\operatorname{rank}(B)=2$, the Jordan form of $B$ is a nilpotent Jordan block of size $3$. Therefore there exist two vectors $v\ne0$ and $w$ such that $Bv=0$ and $B^2w=v$. It follows that $v^Tv=(B^2w)^T(B^2w)=w^TB^4w=0$. Hence $v$ is entrywise nonzero, i.e., its elements are $\pm1$. Let $D=\operatorname{diag}(v)$ and $C=D^{-1}BD=DBD$. Then $C$ is symmetric, traceless and all row/column sums of $C$ are zero. Therefore $C$ is in the form of $$ \pmatrix{a&c&b\\ c&b&a\\ b&a&c} $$ with $a+b+c=0$. Since $C$ is a symmetric rank-two matrix, at least one of the two-rowed principal minors of $C$ is nonzero. As $(x)(x)-(-2x)^2\equiv0\equiv(x)(-2x)-(x)^2$ in $GF(3)$, $a,b$ and $c$ must be distinct, i.e., $\{a,b,c\}=\{0,1,2\}$. In this case, one may verify that all elements of $C^2$ are equal to $2$ and hence $C^3=0$. Therefore $B=DCD^{-1}=DCD$ is indeed nilpotent and it takes the form of $$ B=DP\pmatrix{0&2&1\\ 2&1&0\\ 1&0&2}P^TD =P\pmatrix{0&s_2&s_1\\ s_2&1&0\\ s_1&0&-1}P^T $$ for some permutation matrix $P$ and for some $s_1,s_2\in\{1,-1\}$. Hence there are $6\times2^2=24$ solutions in this case.
To sum up, there are $1+8+24=33$ solutions in total. They are given by $$ A=I,\quad A=I+s\pmatrix{1\\ s_1\\ s_2}\pmatrix{1&s_1&s_2} \quad\text{or}\quad A=I+P\pmatrix{0&s_2&s_1\\ s_2&1&0\\ s_1&0&-1}P^T $$ where $s,s_1,s_2\in\{1,-1\}$ and $P$ is a permutation matrix.