TITLE: Irreducibility of linear sections of the commuting variety
QUESTION [8 upvotes]: The irreducibility of the commuting variety $\{(A,B) \in \mathcal{M}_{n}(\mathbb{C})^2, \ AB = BA \}$ is well-known (see for instance On Dominance and Varieties of Commuting Matrices by Gerstenhaber). I am interested in the irreducibility of some special linear sections of the commuting varieties. Namely, let $W_1$, $W_2$ be two $k$-dimensional subspaces of $\mathbb{C}^n$ ($n$ and $k$ are fixed). Is the variety:
$$ \{(A,B)\in \mathcal{M}_{n}(\mathbb{C})^2, \ AB = BA, \ W_1 \subset \operatorname{Ker}(A), \ W_2 \subset \operatorname{Ker}(B) \}$$
known to be irreducible? Or perhaps are there examples where it is not?

REPLY [8 votes]: It is already reducible in the toy case $n=2, k=1$ where $W_1, W_2 \subseteq \mathbb{C}^2$ are two distinct lines. Without loss of generality, have them be spanned by the standard basis vectors respectively, so that
$$A = \begin{bmatrix}0 & a_{12} \\ 0 & a_{22} \end{bmatrix}, \quad
B = \begin{bmatrix}b_{11} & 0 \\ b_{21} & 0 \end{bmatrix}.$$
The equation $AB = BA$ now reads
$$\begin{bmatrix}a_{12}b_{21} & 0 \\ a_{22}b_{21} & 0 \end{bmatrix} = \begin{bmatrix}0 & b_{11}a_{12} \\ 0 & b_{21}a_{12} \end{bmatrix}.$$
(As you can see, $AB=BA=0$.) But we have
$$(a_{22}b_{21}, a_{12}b_{21}, a_{12}b_{11}) = (a_{22},a_{12}) \cap (a_{12},b_{21}) \cap (b_{11},b_{21})$$
of ideals in four variables, so there are three irreducible components of dimension $2$ here.
In contrast, in the case $W_1 = W_2$, the equation $AB=BA$ instead has the form of the single equation $ab'=a'b$, which is not only irreducible, but of a different dimension and degree.
So I imagine it's complicated in general, depending on $n,k$ and $\dim(W_1 \cap W_2)$. I wouldn't be surprised if there's a story here similar to Springer fibers, which vary in dimension and reducibility, but in a very nice way.
edit:
Investigations in Macaulay2 for the case $n=4, k=2$ give the following:

If $W_1 + W_2 = \mathbb{C}^4$, then the variety has six irreducible components (two of dimension 9, four of dimension 8).
If $\dim(W_1 \cap W_2) = 1$, then the variety has eight irreducible components (three of dimension 9 and five of dimension 8).
If $W_1 = W_2$, then the variety has two irreducible components, both of dimension 10, but with different degrees of generators.