Let $n$ be a positive integer, and let $M_n$ be the set of all $( n \times n)$ matrices with coefficients in an algebraically closed field $K$. Identify $M_n$ with the affine space $\mathbb{A}^{n^2}$.
If we denote by $SL_n$ the set of $(n \times n)$ matrices with determinant $1$, then this is a closed subvariety of $M_n$.
Let $SL_n^{k}$ be the set of matrices $A$ in $SL_n$ such that $A$ has an eigenvalue of multiplicity at least $k$ for an integer $1 \leq k \leq n$. Then $SL_n^k$ is an algebraic subset of $SL_n$ .
Problem: Describe the associated ideal of $SL_n^k$ for $2 \leq n \leq 4$. Are these $SL_n^{k}$ varieties? What are their dimension?
Attempt:
I was trying to understand these ideals for the simplest case $n = 2$. Then I have $SL_2^1$ and $SL_2^2$. A matrix $A \in SL_2^1$ is a $(2 \times 2)$ matrix with determinant $1$, and such that its characteristic polynomial $P_A(x) = \det(A - x I) \in K[x]$ splits in two linear factors over $K$ (since the eigenvalues must be of multiplicity $1$).
The associated ideal of $SL_2^1$ would be $$ I (SL_2^1) = \left\{ f \in K[x_1, x_2, x_3, x_4] \mid f(A) = 0, \ \forall A \in SL_2^1 \right\}$$ where a 'point' $A \in SL_2^1$ is considered as a matrix.
How do I work this out further?
As explained in my other answer on this topic, the ideal of $SL^k_n$ is generated by $$Res_\lambda(\chi(\lambda),\chi(\lambda)^{(a)})$$ for $0 < a < k$ where $\chi(\lambda)$ is the characteristic polynomial in the variable $\lambda$. Let's work through an example or two to see how it works:
Case 0: $SL_2^1$. This is the whole of $SL_2$, since every matrix has an eigenvalue of multiplicity at least one. So the ideal is just the zero ideal. This generalizes to $SL_n^1$ for any $n$.
Case 1: $SL_2^2$. Here, the characteristic polynomial is given by $\lambda^2-(a_{11}+a_{22})\lambda + (a_{11}a_{22} - a_{12}a_{21})$. The derivative of this is $2\lambda-(a_{11}+a_{22})$, and the resultant of these two polynomials is $-a_{11}^2+2a_{11}a_{22}-4a_{12}a_{21}-a_{22}^2$. Remembering that we're in $SL_2$ where $a_{11}a_{22} - a_{12}a_{21}=1$, we can write the resultant as $$-a_{11}^2-2a_{11}a_{22}+4a_{11}a_{22}-4a_{12}a_{21}-a_{22}^2 =-a_{11}^2-2a_{11}a_{22}+4-a_{22}^2= -(a_{11}+a_{22})^2+4$$
so we know that the ideal cut out by this resultant is exactly those matrices of trace $\pm 2$, which in $SL_2$ are exactly those matrices which have both eigenvalues $1$ or both eigenvalues $-1$, which are the matrices in $SL_2$ with repeated eigenvalues.
We can see that this matches up exactly with what we'd expect to see from writing the characteristic polynomial as $\lambda^2-(x_1+x_2)\lambda+x_1x_2$ where the $x_i$ are the eigenvalues. If $x_1=x_2$ and $x_1x_2=1$, then $x_1=x_2=\pm 1$.
For larger $n$, these resultants will get really messy really fast. For instance, when expanded out, the resultant of the characteristic polynomial with it's derivative for any matrix in $SL_3$ has more than a hundred terms. It's best to use computer algebra systems for this if you're interested in actually doing these computations.