Let $\mathbf{w}_1, \ldots, \mathbf{w}_n$ be an arbitrary basis of the subspace $W \subset \mathbb{R}^m$. Let $A=\left(\mathbf{w}_1, \ldots, \mathbf{w}_n\right)$ be the $m \times n$ matrix whose columns are the basis vectors, so that $W=\operatorname{img} A$ and $\operatorname{rank} A=n$. (a) Prove that the corresponding projection matrix $P=A\left(A^T A\right)^{-1} A^T$ is idempotent: $P^2=P$. (b) Prove that $P$ is symmetric. (c) Prove that $\operatorname{img} P=W$. (d) (e) Prove that the orthogonal projection of $\mathbf{v} \in \mathbb{R}^n$ onto $\mathbf{w} \in W$ is obtained by multiplying by the projection matrix: $\mathbf{w}=P \mathbf{v}$. (f) Show that if $A$ is nonsingular, then $P=\mathrm{I}$. How do you interpret this in light of part $(e)$ ? $(g)$ Explain why Exercise 4.4 .9 is a special case of this result. (h) Show that if $A=Q R$ is the factorization of $A$ given in Exercise 4.3 .32 , then $P=Q Q^T$. Why is $P \neq \mathrm{I}$ ?