# Finding a matrix corresponding to the projection of Rn to an orthogonal complement of a vector

Let $\mathbf{v}$ be a non-zero (column) vector in $\mathbb{R}^n$.

(a) Find an explicit formula for the matrix $P_\mathbf{v}$ corresponding to the projection of $\mathbb{R}^n$ to the orthogonal complement of the one-dimensional subspace spanned by $\mathbf{v}$.

(b) What are the eigenvalues and eigenvectors of $P_\mathbf{v}$? Compute the dimensions of the associated eigenspaces. Justify your answers.

Wouldn't the matrix be a diagonal matrix such that the eigenvalues are $0$ and $1$ or $-1$? Since it is an orthogonal complement of the subspace spanned by $\mathbf{v}$, wouldn't the matrix also have rows that contain the null space?

-
The orthogonal projection onto the one-dimensional subspace spanned by $v$ is $\frac{1}{\| v \|^2}v v^{\top}$. The orthogonal projection onto the complement of $\mathbb{R}v$ is $Id-\frac{1}{\| v \|^2}v v^{\top}$.
The eigenvectors of $Id-\frac{1}{\| v \|^2}v v^{\top}$ are: the vectors of $\mathbb{R}v$ with eigenvalue $0$, and the vectors of the complement of $\mathbb{R}v$ with eigenvalue $1$.
The dimension of $\mathbb{R}v$ is $1$, as $v \neq 0$. The dimension of the complement is $n-1$.