Let $S \subseteq \mathbb R^n \setminus \{\vec 0\}$. We form a subspace of $\mathbb R^{n \times n}$ as follows: $M \in E_S$ if every vector of $S$ is an eigenvector of $M$.
For example, $E_\emptyset =\mathbb R^{n \times n}$ and $E_{\mathbb R^n \setminus \{\vec 0\}} = \operatorname {span} (I_{n \times n})$ (indeed, $I_{n \times n} \in E_S$ for any valid $S$).
Quick proof that this is a vector space. For all $\vec x \in S$ and $A,B \in E_S$
- $0_{n \times n} \vec x = 0 \vec x$
- $(kA) \vec x = k(A \vec x) = k (\lambda \vec x) = (k \lambda) \vec x$
- $(A+B) \vec x = A \vec x + B \vec x = \lambda_1 \vec x + \lambda_2 \vec x = (\lambda_1 + \lambda_2) \vec x$
So $E_S$ is a subspace of $\mathbb R^{n \times n}$. My question is, what is the dimension of $E_S$ in terms of $S$?
Extract a maximal set $V$ of linear independent vector from $S$. Every vector $w\in S$ can be written as a linear combination of the vectors $v_i$ in $V$ in only one way.
Given $v_1,v_2\in V$, define the equivalence relation $v_1\sim v_2$ if and only if there exists $w\in S$ such that, writing $w = a_1v_1 + a_2v_2 + \dots$, then $a_1\ne 0 \ne a_2$. This will divide $V$ in $k$ groups of equivalent $v_i$.
If $m = |V|$, then the wanted dimension will be $k + n(n-m)$.