Given k real n x n matrices with a common eigenvector, is there some nontrivial polynomial equation the entries of the matrices satisfy? The following problem has come up in my research and I don't have the tools (i.e., I don't know Algebraic Geometry, especially over $\mathbb{R}$) to solve it.
Consider two subsets $X$ and $Y$ of $M_n(\mathbb{R})^k$ with $k\geq 3$.  The subset $X$ consists of all $k$ tuples of n x n matrices $(A_1,..., A_k)$ such that for any two $A_i$ and $A_j$, there is a vector $v_{ij}$ which is simultaneously an eigenvector for $A_i$ and $A_j$ (but perhaps with different eigenvalues).
The subset $Y$ consists of all those elements of $X$ such that $v_{ij}$ can be chosen independently from $i$ and $j$ - that is, if $(A_1,.., A_k)\in Y$ then all $k$ matrices have a common eigenvector.  (Of course, when $k=1$ or $k=2$, $X = Y$, hence the above restriction on $k$).
Now, I have not been able to prove that $X$ is Zariski closed (though I have not tried that hard - it's not so important for my purposes), but I can prove that it's contained in a proper Zariski closed subset of $M_n(\mathbb{R})^k$ (thought of as $\mathbb{R}^{kn^2}$):  we have $f_{12} = det(A_1A_2 - A_2A_1) = 0$ since $A_1A_2 v_{12} = A_2A_1 v_{12}$.  Or, since we're worker over $\mathbb{R}$, we can put all the $f_{ij}$ into one big polynomial equation $$\sum_{1\leq i < j\leq k} f_{ij}^2 = 0.$$
What I'd like to know is

Is there a Zariski closed subset $F$ with $Y\subseteq F\subsetneq X$?

Said another way

Is there a polynomial which is simultaneously satisfied by all k-tuples of matrices sharing a common eigenvector but for which there are elements in $X$ which do not solve it?

Finally, in case it helps, the case I'm most interested in is $n=3$ and $k = 5$, but I imagine the choice of $n$ won't affect the answer greatly and $k=3$ probably contains all the insight necessary to tackle the larger $k$ values.
Thank you in advance for your help.
 A: Let us consider the problem over $\mathbb{C}$  first (because it is a question about joint spectrum and it is easier to tackle at first over an algebraically closed field). Then both $X$ and $Y$ are subsets of $\mathbb{A}^{k n^2} (\mathbb{C}) = MaxSpec(\mathbb{C}[x_{pqs}]_{p,q=1,\ldots,n,s=1,\ldots,k})$. Now a $k$-tuple of matrices, $(A_1,\ldots,A_k)$, has a joint eigenvector if and only if the long matrix $(\lambda_1 I -A_1 \lambda_2 I - A_2 \ldots \lambda_k I - A_K)$ has rank less then $n$ for some choice $(\lambda_1,\ldots,\lambda_k)$. Now you can consider the maximal minors of the long matrix as polynomials in $(n^2+1) k$ variables. The zeros of the ideal generated by those maximal minors is a Zariski closed subset of $\mathbb{A}^{k (n^2+1)} (\mathbb{C})=MaxSpec(\mathbb{C}[x_{pqs},\lambda_j])$. Let us call this ideal, generated by the maximal minors $\mathfrak{I}$. Then $\mathfrak{J} = \mathfrak{I} \cap \mathbb{C}[x_{pqs}]_{p,q=1,\ldots,n,s=1,\ldots,k}$ is the ideal of $Y$. Therefore $Y$ is closed.
Finding the polynomial you are looking for is a question of elimination using Groebner basis techniques. I'd advise Macaulay2 for this.
