Finding a basis for an eigenspace? Where do the additional vectors come from? I want to diagonalize the following matrix:
$$A =\begin{bmatrix}
    1&0&0&0 \\
    0&0&1&0 \\
    0&1&0&0\\
    0&0&0&1
\end{bmatrix}$$
And I get the following characteristic equation: $(\lambda - 1)^3(\lambda +1)$ and therefore $\lambda=1,-1$
Firstly get the basis vectors for $\lambda = 1$
$$(A - \lambda_2 I_4) =  \begin{bmatrix}
    0&0&0&0 \\
    0&-1&1&0 \\
    0&1&-1&0\\
    0&0&0&0
\end{bmatrix} \rightarrow \text{row reduce} \rightarrow \begin{bmatrix}
    0&1&-1&0 \\
    0&0&0&0 \\
    0&0&0&0\\
    0&0&0&0
\end{bmatrix}$$
So I have $x_2 = x_3$ wich yields the vector:
$$v_1 = \begin{bmatrix}
    0 \\
    1 \\
    1\\
    0
\end{bmatrix}$$
However there should be $3$ basis vectors total for $\lambda = 1$ according to the characteristic equation.
The answer key gives vectors: $$\begin{bmatrix}
    1 \\
    0 \\
    0\\
    0
\end{bmatrix} , \begin{bmatrix}
    0 \\
    0 \\
    0\\
    1
\end{bmatrix}$$
to be the other basis vectors for $\lambda = 1$, but where do these vectors come from in regards to my reduced matrix? I understand there ought to be 2 additional vectors to the one that I found but why are they the vectors given?
 A: When you find eigenvectors of a matrix $A$ that corresponds to an eigenvalue $\lambda$
$$Av=\lambda v$$
or equivalently
$$\left(A-\lambda I\right)v=0$$
you need to find the basis of the null space of $A-\lambda I$, i.e.
$${\rm null}\left(A-\lambda I\right)=\left\{v|\left(A-\lambda I\right)v=0\right\}$$
You can easily see that in your case $e_{1}=\begin{pmatrix}1\\0\\0\\0\end{pmatrix}$ and $e_{2}=\begin{pmatrix}0\\0\\0\\1\end{pmatrix}$ indeed satisfy this criterion for the matrix $A-I$
$$\left(A-I\right)e_{1,2}=0$$
so these are also eigenvectors with $\lambda=1$.
A: You’ve found a constraint on $x_2$ and $x_3$, but there are no constraints whatsoever on $x_1$ and $x_4$, so all vectors in this eigenspace are of the form $(a,b,b,c)^T$. Can you see where the other two basis vectors came from now?
A: I guess you're in math251 since i just finished the same question! 
If you examine your matrix, you see that $x_1, x_3$ and $x_4$ are 'free' variables. The number of vectors you're going to end up with are therefore = to the number of free variables. so for $x_1$ you'll have $(1, 0, 0, 0)$, you already found $x_3$ and $x_4$ is $(0, 0, 0, 1)$
