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](https://doi.org/10.2307/1970336) 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?



Irreducibility of linear sections of the commuting variety
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.


