If $\mathbf{X}_{n \times K}= \begin{bmatrix} \mathbf{x}'_1 \\ \cdots \\ \mathbf{x}'_n \end{bmatrix}$, then can we say that $\mathbf{X}(\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\mathbf{x}_k=\mathbf{x}_k$?
I was trying to show that $(\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'\mathbf{x}_k=e_k$, where $e_k$ is a vector with 1 in the k-th entry, and the remaining entries zero. I haven't been successful so far...