<s>[INST] Show that the diagonal elements of $V$ coincide Let $V$ be an $n\times n$ diagonal positive definite matrix, and suppose that
$$[I_n-XX']VX=0$$
for all $X\in\mathbb R^{n \times k}$ satisfying $X'X=I_k$, where $k<n$ is fixed.
Can I show that the diagonal elements of $V$ are all equal in this case?
 [/INST] As you said you're interested in the case $k <n$, here it is. Denote $V=\mathrm{Diag}(a_1,a_2,\cdots,a_n)$ and $(e_1,\cdots,e_n)$ be the canonical basis of $\mathbb{R}^n$. Take $X \in \mathcal{M}_{n,k}(\mathbb{R})$ the matrix whose columns are $(e_1+e_2,e_3,e_4,\cdots,e_{k+1})$ It is possible as $k+1\leq n$. This is
$$X = \begin{pmatrix}1&0&0&\cdots & 0\\
1&0&0&\cdots & 0\\
0&1&0&\cdots & 0\\
0&0&1&\cdots & 0\\
\vdots & \vdots &\vdots &\ddots &\vdots \\
0&0&0&\cdots & 1\\
0&0&0&\cdots & 0\\
\vdots & \vdots &\vdots &\ddots &\vdots\\
0&0&0&\cdots & 0\\
\end{pmatrix}$$
Take $X' \in \mathcal{M}_{k,n}(\mathbb{R})$ the matrix whose rows are $(\dfrac{1}{2}(e_1+e_2),e_3,e_4,\cdots,e_{k+1})$. AS the coefficient of $X'X$ are the inner products of the rows of $X'$ with the columns of $X$, we get $XX' = I_k$.
We then have
$$XX'= \begin{pmatrix}\frac{1}{2}&\frac{1}{2}&0&\cdots & 0&0&\cdots & 0\\
\frac{1}{2}&\frac{1}{2}&0&\cdots & 0&0&\cdots & 0\\
0&0&1&\cdots & 0&0&\cdots & 0\\
\vdots & \vdots &\vdots &\ddots &\vdots&0&\cdots & 0 \\
0&0&0&\cdots & 1&0&\cdots & 0\\
0&0&0&\cdots & 0&0&\cdots & 0\\
\vdots & \vdots &\vdots &\ddots &\vdots&0&\cdots & 0\\
0&0&0&\cdots & 0&0&\cdots & 0\\
\end{pmatrix}.$$
$$I_n -XX' = \begin{pmatrix}\frac{1}{2}&-\frac{1}{2}&0&\cdots & 0&0&\cdots & 0\\
-\frac{1}{2}&\frac{1}{2}&0&\cdots & 0&0&\cdots & 0\\
0&0&0&\cdots & 0&0&\cdots & 0\\
\vdots & \vdots &\vdots &\ddots &\vdots&0&\cdots & 0 \\
0&0&0&\cdots & 0&0&\cdots & 0\\
0&0&0&\cdots & 0&1&\cdots & 0\\
\vdots & \vdots &\vdots &\ddots &\vdots&0&\vdots & 0\\
0&0&0&\cdots & 0&0&\cdots & 1\\
\end{pmatrix}.$$
Let's look at the first column of $(I_n -XX')VX$, which is the column given by $(I_n -XX')V(e_1+e_2)$.We have
$$\begin{array}{rll}
(I_n -XX')V(e_1+e_2) &=& (I_n -XX')(a_1.e_1+a_2.e_2) \\
&=&a_1.(I_n -XX')e_1+a_2.(I_n -XX')e_2)
&=& a_1.\begin{pmatrix}{\frac{1}{2} \\ -\frac{1}{2} \\0\\ \vdots \\ 0}\end{pmatrix} + b_1.\begin{pmatrix}{-\frac{1}{2} \\ \frac{1}{2} \\0\\ \vdots \\ 0}\end{pmatrix} \\
&=& \begin{pmatrix}{\frac{1}{2}a_1-\frac{1}{2}a_2 \\ -\frac{1}{2}a_1+\frac{1}{2}a_2  \\0 \\ \vdots \\ 0}\end{pmatrix}.
\end{array}$$
By assumption, this must be $0$, so $a_1=a_2$.
$\rhd$ We can now do the exact same proof to prove $a_p=a_q$, by taking $X \in \mathcal{M}_{n,k}(\mathbb{R})$ the matrix whose columns are $(e_p+e_q,e_1,e_2,\cdots,e_{\text{something}})$ where $e_p$ and $e_q$ do not appear among the vectors $e_1,e_2,\cdots,e_{\text{something}}$ ; and similarly for $X'$.
</s>