I have been trying to understand the theory behind the projection of a vector on a orthonormal bases :-
Suppose {$u_1,u_2,u_3,.......u_n$} be an orthonormal basis for a subspace $W$
Then the $\displaystyle proj_{_W} y=(y.u_1)u_1+(y.u_2)u_2+(y.u_3)u_3........(y.u_n)u_n$
But Here is my question :-If $U=[u_1,u_2.....u_n]$.
Then the $\displaystyle proj_{_W} y=U^TUy$
Since {$u_1,u_2,u_3,.......u_n$} is an orthonormal set, U is an orthogonal matrix
So, $U^TU=I\Rightarrow U^TUy=y$.
Where is the change happening?
Recall that in general the projection matrix is given by
$$P=A(A^TA)^{-1}A^T$$
and for U=A orthonormal we have
$$P=UU^T$$
that is precisely
$$\displaystyle proj_{_W} y=(y.u_1)u_1+(y.u_2)u_2+(y.u_3)u_3........(y.u_n)u_n$$