Good evening, I have a hard time with the following problem, I found how to start, but don't see how to continue: Imagine we have a $D$x$N$ matrix $X$ such that all rows are normalized (zero mean and variance one), except for the last row, that has variance 2. Suppose that we also have a second matrix, say $\tilde{X}$, which is defined as a $(D+1)$x$N$ matrix with the same rows as X, except row $D$ is now normalized, and row $D + 1$ is a copy of row $D$.
So to summarize, $X$ is almost normalized, only last row has variance 2 and $\tilde{X}$ is perfectly normalized, but has two equal rows. Now I have to show that $X^\top X = \tilde{X}^\top\tilde{X}$.
I started by writting $\tilde{X}$ as $KX$ where K is a $(D+1)$x$D$ matrix with the first $D$ rows forming an identity matrix, and the last row being $\frac{1}{\sqrt{2}} * \textbf{e}_n$ where $\textbf{e}_n$ is the unit vector with a 1 in position n and zeros everywhere else, so that we have a normalized row in $\tilde{X}$. After that, I still cannot show the result...
Any help would be greatly appreciated
Suppose that $X$ is a matrix with rows $r_1,r_2,\dots,r_D$ (each of size $1 \times N$). We have $$ X^\top X = \sum_{i=1}^D r_i^\top r_i = r_D^\top r_D + \sum_{i=1}^{D-1}r_i^\top r_i. $$ Now, the modified matrix $\tilde X$ has the same rows except that the final row $r_D$ is replaced with the normalized $\tilde r_D = r_D/\sqrt{2}$ and a row $\tilde r_{D+1} = \tilde r_D$ is added. We then find that $$ \begin{align} {\tilde X}^\top \tilde X &= \tilde r_{D+1}^\top \tilde r_{D+1} + \tilde r_D^\top \tilde r_D + \sum_{i=1}^{D-1}r_i^\top r_i \\ & = [r_D/\sqrt{2}]^\top [r_D/\sqrt{2}] + [r_D/\sqrt{2}]^\top [r_D/\sqrt{2}] + \sum_{i=1}^{D-1}r_i^\top r_i \\ & = \frac 12 r_D^\top r_D + \frac 12 r_D^\top r_D + \sum_{i=1}^{D-1}r_ir_i^\top \\ & = r_D^\top r_D + \sum_{i=1}^{D-1} r_i^\top r_i = X^\top X. \end{align} $$
Alternatively, note that we can write $\tilde X = RX$, where $$ R = \pmatrix{ I_{(D-1) \times (D - 1)} & 0_{(D - 1) \times 1}\\ 0_{1 \times (D-1)} & 1/\sqrt{2}\\ 0_{1 \times (D-1)} & 1/\sqrt{2}}. $$ Verify that $R^\top R = I$, so that $$ [\tilde X]^\top [\tilde X] = [RX]^\top [RX] = X^\top R^\top R X = X^\top I X = X^\top X. $$