Problem: Let $T:\mathbb{R} ^3 \to \mathbb{R} ^3$ be a linear transformation such that
\[
T\left( \begin{bmatrix}
1 \\
1 \\
1 \\
\end{bmatrix} \right) = \begin{bmatrix}
1 \\
-1 \\
1 \\
\end{bmatrix}, \quad
T^2\left( \begin{bmatrix}
1 \\
1 \\
1 \\
\end{bmatrix} \right) = \begin{bmatrix}
1 \\
1 \\
1 \\
\end{bmatrix}, \text{ and } \quad
T^2\left( \begin{bmatrix}
1 \\
1 \\
2 \\
\end{bmatrix} \right) = \begin{bmatrix}
1 \\
1 \\
1 \\
\end{bmatrix}.
\]
Then the rank of $T$ is ______________.
Solution: Let us denote
\[
\mathbf{v} _1 =
\begin{bmatrix}
1 \\
1 \\
1 \\
\end{bmatrix},
\mathbf{v} _2 =
\begin{bmatrix}
1 \\
-1 \\
1 \\
\end{bmatrix}, \text{ and }
\mathbf{v} _3 =
\begin{bmatrix}
1 \\
1 \\
2 \\
\end{bmatrix}.
\]
Then we have
\begin{align*}
T(\mathbf{v} _1) = \mathbf{v} _2 & \implies T(\mathbf{Tv} _1) = T(\mathbf{v} _2) \\
& \implies T(\mathbf{v} _2) = T^2(\mathbf{v} _1) = \mathbf{v} _1.
\end{align*}
Thus, $\mathbf{v} _1, \mathbf{v} _2$ are in the image of $T$. As they are linearly independent, $\operatorname{rank}(T) \geq 2$. Now note that
\begin{align*}
T^2(\mathbf{v} _3) - T^2(\mathbf{v} _1) = 0 & \implies T^2(\mathbf{v} _3 - \mathbf{v} _1) = 0 \\
& \implies T^2(e_3) = 0,
\end{align*}
where $e_3 = \begin{bmatrix}
0 \\
0 \\
1 \\
\end{bmatrix}$. Thus, $0$ is an eigenvalue of $T^2$, which implies $0$ is an eigenvalue of $T$ and hence $\operatorname{rank}(T)\leq 2 $. Therefore, we proved that $\operatorname{rank}(T) = 2$.