In class we've seen that $a$ (the weights) must satisfy $$X^T (y-Xa) =0$$
Here $X$ is a $(n\times d)$ matrix (so we have $n$ samples in $\mathbb R^d$)
let's denote the residuals $r = y-Xa$. In our class notes, it is written that
The normal equations require the residuals to be orthogonal to each of the columns of $X$.
Therefore, the solution of the linear regression is a projection of $y$ onto the subspace spanned by $v_1 , \ldots , v_d$ (the columns of $X$)
Can you please explain this?