# Number of $3\times 3$ anticommuting matrices over finite fields $\mathbb{F}_p$ is (or is not?) polynomial in $p$?

There are rare algebraic varieties such that the number of points over finite fields $$\mathbb{F}_p$$ is given by a polynomial in $$p$$. One notable series of examples is the commuting variety: $$[A,B]=0$$ of $$n\times n$$ matrices $$A,B$$ over finite field. The computation was obtained by Feit and Fine in 1960 and many generalizations have been obtained recently. But it seems results in natural generality are not yet achieved (see below).

Question 1: Consider pairs of $$3\times 3$$ anticommuting $$AB+BA = 0$$ over finite fields $$\mathbb{F}_p$$, is true that their number is polynomial in $$p$$, for $$p>2$$ ? May be one needs to exclude some other primes, not only $$p=2$$ or $$p=2$$ is the only exception ?

Question 2: If the number of points is indeed given by a polynomial ($$p>2$$), then it is given by the polynomial found by Roland Bacher and Peter Taylor in MO 404760: $$2p^{10}+7p^9-3p^8-6p^7-4p^6+3p^5+4p^4-2p^3$$ (My direct calculation yields 221157 and 31511625 matrices for $$p=3,5$$ respectively, and colleagues found that it is the only polynomial of degree 10 which satisfies these conditions and has minimal possible coefficients. Heuristic to search for polynomials with the smallest possible coefficients works quite fine in my experience for such questions.)

Question 3: Bonus question. It might be count is polynomial for any $$n$$ and $$n$$x$$n$$ anticommuting $$[A,B]=0$$, and there is nice generating function over $$n$$ for such polynomials - similar to Feit,Fine result for commuting matrices ? (Well, it might be better to leave it for separate question).

======================

PS

For 2x2 case the polynomial seems to be given by $$+p^5+3p^4-2p^3-2p^2+p$$ for $$p>2$$, checked till $$p=19$$.

Anticommuting variety has been studied recently e.g.: Anti-commuting varieties.

======================

Context We might expect similar results not only for pairs, but triples, n-tuples of commuting/anticommuting matrices: MO271752, but commuting/anticommuting is just an example, it should be true for much wider class of algebras - "categorical exponential formula" might be the right context for such questions MO272045, MO275524, however presently known forms seems does not cover even Feit,Fine case. See also very nice results and connections with Hasse-Weil zeta function in Yifeng Huang 2021. The general question about varieties which are polynomial count seems also not so simple as disproof of Kontsevich conjecture indicates. Such varieties thought to be defined over the mysterious "field with one element".

• Numerology note: both of the speculative polynomials have degree $n^2+1$; this somewhat tracks with the Feit-Fine result, though the fact that the leading term is different is curious. Sep 25 '21 at 21:30
• Is $p$ meant to be prime, or a prime power?
– YCor
Sep 25 '21 at 23:31
• I expect it's a polynomial with respect to the odd prime power $p$ and another polynomial with respect to $p$ power of of $2$. The difference should occur when counting pairs $(A,B)$ where $A$ has rank $2$ and no double nor opposite eigenvalues.
– YCor
Sep 26 '21 at 0:50
• Question 2 seems to be a statement, not a question. Sep 26 '21 at 2:00
• @YCor for simplicity let us start with p to be just prime, but if it would be true for primes, I would have almost no doubt it would be true for prime powers. Yours expectations are probably correct. Just couple of remarks: char(F)=2 is very often an exception, but sometimes things depends on $p\%something$, even in the simple example like $\sum x_i^2=0$ math.stackexchange.com/q/4255764/21498 . Also ANTIcommuting variery is known to be more kind of "complicated/ugly" than Comm from algebraic point of view, so if count would not be polynomial it would not be a great surprise. Sep 26 '21 at 8:58

Let's work over a field $$K$$, which when finite is supposed to have $$q$$ elements. I'll assume the characteristic to be $$\neq 2$$, since in characteristic 2 we get the commuting variety which is well-known. Let $$Q=Q(K)$$ be the set of anticommuting pairs $$(A,B)$$.

If $$A$$ has eigenvalues $$(x,y,z)$$ (possibly on an extension), the eigenvalues of $$B\mapsto AB+BA$$ are, $$2x,2y,2z$$, and, with multiplicity 2, $$x+y$$, $$x+z$$, $$y+z$$. Write $$W_A$$ as the kernel of this operator, i.e., the set of $$B$$ such that $$(A,B)\in Q$$.

We essentially need to discuss in terms of the conjugacy class of $$A$$, and more precisely in terms of the cardinal of $$W_A$$ and of the conjugacy class of $$A$$.

Write $$Q=Q_1\sqcup Q'\sqcup Q''$$, where $$Q_1$$ is the set of pairs $$(A,0)$$ with $$A$$ invertible; $$Q'$$ is the set of pairs $$(A,B)$$ with $$A$$ invertible, $$B\neq 0$$, $$Q''$$ is the set of pairs $$(A,B)$$ with $$A$$ not invertible. Define $$V'$$ and $$V''$$ as the first projection of $$Q'$$ and $$Q''$$.

Write $$u_q=(q^3-1)(q^3-q)(q^3-q^2)$$ for the cardinal of $$\mathrm{GL}_3(\mathbf{F}_q)$$. Then $$V_1$$ has cardinal $$u_q$$.

From the eigenvalues fact above, the elements of $$V'$$ have eigenvalues $$(x,-x,y)$$ for some nonzero $$x,y$$. Write $$V'=V_2\sqcup V_3\sqcup V_4\sqcup V_5$$ with

• $$V_2$$ (resp. $$V_3$$) the set of $$K$$-diagonalizable (resp. non-$$K$$-diagonalizable) invertible matrices with eigenvalues of the form $$(x,-x,y)$$ with $$y\neq\pm x$$; (note that $$y$$ is the trace).
• $$V_4$$ (resp. $$V_5$$) the set of diagonalizable (resp. non-diagonalizable) invertible matrices with eigenvalues $$(x,x,-x)$$ (note that $$x$$ is the trace)

Write $$V''=V_6\sqcup \dots\sqcup V_{16}$$ with

• $$V_6$$ (resp. $$V_7$$) the set of $$K$$-diagonalizable (resp. non-$$K$$-diagonalizable) matrices with eigenvalues of the form $$(0,x,y)$$, $$x,y$$ nonzero and $$x\neq\pm y$$
• $$V_8$$ (resp. $$V_9$$) the set of diagonalizable (resp. non-diagonalizable) matrices with eigenvalues of the form $$(0,x,x)$$, $$x\neq 0$$ (note that $$x$$ is half the trace)
• $$V_{10}$$ (resp. $$V_{11}$$) the set of $$K$$-diagonalizable (resp. non-$$K$$-diagonalizable) matrices with eigenvalues of the form $$(0,x,-x)$$, $$x$$ nonzero
• $$V_{12}$$ (resp. $$V_{13}$$) the set of diagonalizable (resp. non-diagonalizable) matrices with eigenvalues of the form $$(0,0,x)$$, $$x\neq 0$$
• $$V_{14}$$, $$V_{15}$$, $$V_{16}$$ the set of nilpotent matrices of rank 2, 1, 0 respectively.

For each $$i\in\{2,\dots,16\}$$, all matrices $$A$$ in $$V_i$$ have a centralizer in $$\mathrm{GL}_3(\mathbf{F}_q)$$ of the same size, say $$c_i$$ (and hence a conjugacy class of cardinal $$u_q/c_i$$), and have $$W_A$$ of the same size, say $$q^{d_i}$$ (we will compute them below). Also denote by $$e_i$$ the number of conjugacy classes in $$V_i$$.

Let $$Q_i$$ be the inverse image of $$V_i$$ in $$Q'$$ (for $$2\le i\le 5$$) and in $$Q''$$ for $$i\ge 6$$.

Then for $$i\ge 6$$ the cardinal of $$Q_i$$ is $$u_qe_iq^{d_i}/c_i$$, and for $$2\le i\le 5$$ it is $$u_qe_i(q^{d_i}-1)/c_i$$, the difference being only because we excluded $$B=0$$ in those cases. We now compute case by case.

• $$d_2=d_3=2$$, $$d_4=4$$, $$d_5=2$$, $$d_6=d_7=d_8=d_9=1$$, $$d_{10}=d_{11}=3$$, $$d_{12}=4$$, $$d_{13}=2$$, $$d_{14}=3$$, $$d_{15}=5$$, $$d_{16}=9$$.
• $$c_2=c_6=c_{10}=(q-1)^3$$, $$c_3=c_7=c_{11}=(q+1)(q-1)^2$$, $$c_4=c_8=c_{12}=(q-1)(q^2-1)(q^2-q)$$, $$c_5=c_9=c_{13}=q(q-1)^2$$, $$c_{14}=(q-1)q^2$$, $$c_{15}=(q-1)^2q^3$$, $$c_{16}=u_q$$.
• $$e_2=(q-1)(q-3)/2$$ (choose $$y\neq 0$$, then $$x\notin\{0,y,-y\}$$, up to $$x\to -x$$), $$e_3=(q-1)^2/2$$ (choose $$y\neq 0$$ and a non-square $$x^2\neq 0$$), $$e_4=e_5=e_8=e_9=e_{12}=e_{13}=q-1$$, $$e_6=(q-1)(q-3)/2$$ (choose $$y\neq 0$$, then then $$x\notin\{0,y,-y\}$$, up to $$x\leftrightarrow y$$), $$e_7=(q-1)^2/2$$ (choose nonzero $$y$$ and non-square $$x^2$$), $$e_{10}=e_{11}=(q-1)/2$$, $$e_{14}=e_{15}=e_{16}=1$$.

So the desired cardinal is $$|Q_1|+\sum_{i=2}^5|Q_i|+\sum_{i=6}^{16}|Q_i|$$, namely $$|Q(\mathbf{F}_q)|=u_q+u_q\sum_{i=2}^5 e_i(q^{d_i}-1)/c_i+u_q\sum_{i=6}^{16} e_iq^{d_i}/c_i.$$

Computation yields $$|Q(\mathbf{F}_q)|=2q^{10} + 7q^9 - 3q^8 - 6q^7 - 4q^6 + 3q^5 + 4q^4 - 2q^3,$$ which confirms your expectation.

• Wow ! ! ! ! ! ! Let me take some time to digest it. Sep 26 '21 at 11:47
• @AlexanderChervov I'm using that the centralizer of a non-$K$-diagonalizable matrix in $\mathrm{GL}_2$ with distinct eigenvalues has cardinal $q^2-1$ (then the $q-1$ factor comes from the third dimension). Indeed, its centralizer in $\mathrm{Mat}_2$ is then a two-dimensional subalgebra of $\mathrm{Mat}_2$ which is a field, hence of cardinal $q^2$, meeting $\mathrm{GL}_2$ in a subset of cardinal $q^2-1$.
– YCor
Sep 26 '21 at 13:32
• @AlexanderChervov If I view it as the matrix $E_{13}$, the centralizer is the set of upper triangular matrices satisfying $a_{11}=a_{33}$, whence, over $F_q$ the cardinal $(q-1)^2q^3$. One generalization to $n\times n$ would be: the centralizer of $E_{1n}$ is the set of matrices that are upper triangular by blocks $1+(n-2)+1$ satisfying $a_{11}=a_{nn}$.
– YCor
Sep 26 '21 at 13:51
• For $e_7$: I'm counting non-diagonalizable matrices with eigenvalues $(0,x,y)$ with $x,y,x+y,x-y$ nonzero. So, I'm counting characteristic polynomials $t^3+bt^2+ct$ with $b\neq 0$, $d:=b^2-4c$ non-square. So I have $(q-1)$ choices for $b$, $(q-1)/2$ for $d$ (then $c=(b^2-d)/4$), this is $(q-1)^2/2$.
– YCor
Sep 26 '21 at 18:55
• Oh, thanks. Yes it confirms it: to maximize the component dimension $n^2+p$ one needs to choose $p=\lfloor n/2\rfloor$, and then for $n$ even this forces $m=r=0$ (1 solution, hence 1 component of maximal dimension), while for $n$ even this forces $m=0,r=1$, $r=0,m=1$ (2 solutions, hence 2 components of maximal dimension).
– YCor
Sep 26 '21 at 20:35

I think one can run a similar argument as YCor's to show the number of anticommuting pairs of $$n\times n$$ matrices over $$\mathbb F_q$$ is polynomial in $$q$$ for $$q$$ odd, for any $$n$$. This argument is not as detailed as I would like, but I believe they can all be filled in.

To do this, note that $$AB + BA =0$$ is a system of linear equations in $$B$$. So we're looking for $$\sum_a q^{ \dim \{ B \mid AB+BA= 0\}}$$.

Now the operator $$B \mapsto AB + BA$$ can be written as the operator from a vector space $$V \otimes V^{\vee}$$ to itself given by $$A \otimes I + I \otimes A^T$$. Expressed this way, it's clear that its kernel is invariant under conjugating $$A$$ and $$A^T$$ separately. Noting that $$A^T$$ is conjugate to $$A$$, we may assume that $$A$$ and $$A^T$$ are both in Jordan normal form, and it's the same Jordan normal form. (Here we use that the dimension of the kernel may be calculated over a larger field.)

The kernel now may be derived from a standard computation of the kernel of $$A_1 \otimes I + I \otimes A_2$$, which may be done one Jordan block at a time. It is the sum over ordered pairs of a Jordan block of $$A$$ of size $$n_1$$ and eigenvalue $$\lambda_1$$ and a Jordan block fo $$A$$ of size $$n_2$$ and eigenvalue $$\lambda_2$$ of $$\begin{cases} n_1 +n_2 -1 & \lambda_2 =-\lambda_1 \\ 0 & \textrm{otherwise}\end{cases}$$

This depends only on the following features of $$A$$: The number of distinct prime factors of its characteristic polynomial, the degree of each prime factor, for each prime factor, the number of associated Jordan canonical form / rational canonical form blocks of each size, which prime factors are related to which other prime factors by the relation $$f(x) = \pm f(-x)$$, and which prime factors satisfy $$f(x) = f(-x)$$. Indeed, given such data, we know how many eigenvalues it has, for each eigenvalue, the sizes of its Jordan blocks, and for each eigenvalue, which other eigenvalue, if any, is its negative, and this can be used to calculate $$\sum_{\lambda_1,\lambda_2, n_1,n_2}\begin{cases} n_1 +n_2 -1 & \lambda_2 =-\lambda_1 \\ 0 & \textrm{otherwise}\end{cases}$$.

So it suffices to show the number of matrices consistent with one fixed list of the number of prime factors, the number of Jordan blocks of each size for each prime factor, etc. is a polynomial in $$q$$. This data determines for similar reasons the size of the centralizer of $$A$$, which is a polynomial in $$q$$ dividing the order of $$GL_n(\mathbb F_q)$$, and thus the size of the conjugacy class, so it suffices to show the number of conjugacy classes consistent with this data is polynomial in $$q$$.

(Why does the size of the centralizer divide the size of $$GL_n$$? Because the centralizer looks like an extension of a unipotent group by a product of things of the form $$GL_a(\mathbb F_{q^b})$$ where the sum of $$ab$$ is $$n$$. The order of $$GL_a(\mathbb F_{q^b})$$ divides the order of $$GL_{ab}(\mathbb F_{q})$$ by matching up the factors, and then the product of these divides $$GL_n$$ by the usual flag variety calculation. The unipotent part gives a power of $$q$$, but if the power of $$q$$ doesn't match up as abstract polynomials, it also won't match up for integers, because the other factors never accidentally give us powers of $$q$$, so that's ok also.)

Choosing the prime factors one at a time, we see that it suffices that the number of primes of degree $$d$$ over $$\mathbb F_q$$ is polynomial in $$q$$, as is the number of primes satisfying $$f(x) =\pm f(-x)$$ and $$f(x) \neq \pm f(-x)$$, because then the number of choices for each prime is given by a polynomial minus a constant representing forbidden values. The polynomiality of the primes is standard, so it suffices to show polynomiality of primes satisfying $$f(x) = \pm f(-x)$$.

In degree $$1$$ there is one such prime, in every other odd degree there are none, and in even degree $$2n$$, every such prime arises as $$g(x^2)$$ for $$g$$ prime of degree $$n$$. However, not all $$g(x^2)$$ are irreducible - they can also be $$h(x) h(-x)$$ for $$h$$ of degree $$n$$ irreducible not equal to $$\pm h(-x)$$. However, because the number of such $$h$$ is polynomial by induction on $$n$$, we only need to subtract a polynomial term from the number of irreducible $$g$$ of degree $$n$$ to get the answer, giving a polynomial, as desired.

• Wow ! ! ! ! ! ! Let me take some time to digest it. Sep 26 '21 at 13:25
• I was indeed trying to figure out the general picture, indeed expecting something less explicit, but I didn't go up to this so far. Two question: (a) how do you know the order of the centralizer divides the order of $\mathrm{GL}_n(F_q)$ (as polynomial over $q$)? (b) when you say "the polynomiality of the primes", do you mean the number of primes of given degree (and additional condition, in the next §) being polynomial with respect to $q$?
– YCor
Sep 26 '21 at 13:40
• @YCor The centralizer looks like an extension of a unipotent group by a product of things of the form $GL_a (\mathbb F_{q^b})$ where the sum of $ab$ is $n$. The order of $GL_a (\mathbb F_{q^b})$ divides the order of $GL_{ab}(\mathbb F_q)$ by matching up the factors, and then the product of these divides $GL_n$ by the usual flag variety calculation. The unipotent part gives a power of $q$, but if the power of $q$ doesn't match up as abstract polynomials, it also won't match up for integers, because the other factors never accidentally give us powers of $q$, so that's ok also. Sep 26 '21 at 14:12
• @YCor I mean the polynomiality of the number of primes of a given degree, which I think is reasonably called standard. With the extra condition it's nonstandard but that is handled in the next paragraph. Sep 26 '21 at 14:13
• OK thanks (I guess your answer to (a) should be incorporated in your answer as it's really part of the argument — (b) was just a terminology question)
– YCor
Sep 26 '21 at 14:19

Here is an explicit formula. Let $$C_n(q)$$ be the number of pairs of anticommuting matrices over $$F_q$$ of size $$n$$. Let $$\phi(q,T)=\sum_{n=0}^\infty \frac{T^n}{\prod_{i=1}^n(1-q^{-i})}.$$ Then $$\sum_{n=0}^\infty \frac{C_n(q) T^n}{q^{n^2}\prod_{i=1}^n(1-q^{-i})} = \prod_{n=1}^\infty \frac{\phi(q,T^n)}{(1-q T^{2n})(1-T^{2n-1})}.$$ The calculation is a bit tedious. Some of the ideas:

We have $$|GL_n(F_q)|=q^{n^2}\prod_{i=1}^n(1-q^{-i})$$, so when we divide $$C_n(q)$$ by this number we are counting pairs $$A,B$$ up to conjugation with weight $$\frac{1}{|\text{automorphisms(A,B)}|}$$.

The generating function splits as a product of the corresponding functions for $$3$$ cases:

1. $$A$$ invertible, $$B$$ invertible. Here the computation is reduced to the number of conjugacy classes $$C$$ in $$GL_n$$ satisfying $$-C=C$$. The answer is $$\prod_{n=1}^\infty \frac{1-T^{2n}}{1-q T^{2n}}.$$

2. $$A$$ invertible, $$B$$ nilpotent. It is clear that $$-B$$ is conjugate to $$B$$, so the corresponding generating function counts nilpotent conjugacy classes $$\prod_{n=1}^\infty \frac{1}{1-T^{n}}.$$

3. $$A$$ nilpotent, $$B$$ arbitrary. Here we compute the dimension of the kernel of the operator $$B\to BA+AB$$, obtain $$\sum_{i} \lambda_i^2$$ where $$\lambda$$ is the conjugate partition to the partition giving the sizes of Jordan blocks of $$A$$. The result is $$\prod_{n=1}^\infty \phi(q,T^n).$$

Finally, we multiply all the generating functions together. and obtain the claimed result.

By the way, using the fact that the number of nilpotent matrices is $$q^{n^2-n}$$ one can check that the counting function for pairs nilpotent, nilpotent is given by $$F_3(q,q^{-1} T),$$ where $$F_3$$ is the function for the case 3. So we obtain $$F_3(q,T)=F_3(q,q^{-1} T) \prod_{n=1}^\infty \frac{1}{1-T^{n}},$$ from which it is possible to deduce our formula for $$F_3$$ using $$\phi(q,T)=\phi(q,q^{-1} T) \frac{1}{1-T}.$$ But the formula for $$F_3$$ can be also obtained by a direct computation.

• For case 3 - when A is nilpotent , B - arbitrary - due to mathoverflow.net/q/405126/10446 it is the same as A commute with B and that case seems to be analyzed by O. Schiffmann math.stackexchange.com/a/1371336/21498 , is that correct ? Oct 9 '21 at 22:18
• You are right, indeed case 3 is equivalent to the commuting matrices by Darij Grinberg's comment there and the commuting matrices case is explained by Schiffmann. My favorite reference on the commuting case is this one arxiv.org/abs/math/0612664 Oct 10 '21 at 6:24
• The same goes for case 2. It remains to understand case 1. There one can say that conjugacy classes in $GL_n(F_q)$ satisfying $C=-C$ are in bijection with conjugacy classes in $GL_{n/2}(F_q)$, and again use formula for commuting matrices (invertible case) Oct 10 '21 at 6:33
• What is refrence for 2 ? I thought in Shifman only case when B - arbitrary matrix was considered. Oct 10 '21 at 15:43
• right, it is not given there. In the reference by Villegas arxiv.org/abs/math/0612664 it is explained that if $\Lambda^{n,n}=Exp[F]$ then if you want to replace "nilpotent" condition on one of the matrices by "invertible" you simply multiply $F$ by $q-1$, and if you want to replace "nilpotent" by "all" you multiply $F$ by $q$. By the way, to find $F$ it is easiest to compute the "nilpotent,invertible" case (the partition function) and then deduce the other cases using this rule. Oct 11 '21 at 9:58

If you were counting matrices $$A$$, $$B$$ in $$GL_n$$ with $$AB=-BA$$, this could be attacked using the methods from

Hausel, Tamás; Rodriguez-Villegas, Fernando, Mixed Hodge polynomials of character varieties. With an appendix by Nicholas M. Katz. (arXiv version), Invent. Math. 174, No. 3, 555-624 (2008). ZBL1213.14020 .

First of all, taking determinants of both sides, notice that $$n$$ must be even. We can rewrite the relation as $$ABA^{-1} B^{-1} = - \mathrm{Id}_n$$. Hausel and Rodriguez-Villegas spend most of the paper studying the count of solutions to $$ABA^{-1}B^{-1} = \zeta \mathrm{Id}_n$$, for $$\zeta$$ a primitive $$n$$-th root of unity but, as they note in Section 3.8, their methods can also be adapted to non-primitive $$n$$-th roots of unity, such as $$-1$$.