Show that there exist ordered bases $\beta$ and $\gamma$ for V and W, such that T is a diagonal matrix Let $V$ and $W$ be vector spaces such that $\operatorname{dim}(V) = \operatorname{dim}(W)$ and let $T: V \to W$ be linear.
Show that there exist ordered bases $\beta$ and $\gamma$ for $V$ and $W$, such that $[T]^{\gamma}_{\beta}$ is a diagonal matrix.
My thought: I don't understand how the equality of dimension helps, when the $R(T)$ can be just a subspace of $W$, such that $\operatorname{dim}(R(T)) < \operatorname{dim}(W)$. And so I could not be able to find a diagonal matrix. If that is the case, $T$ will also not be one to one, such that $T(v_i)$ for vectors in $v$ might not be linearly independent such that the matrix is unlikely to be diagonal. I am not sure though. 
 A: Choose a basis $\{w_1, \ldots, w_m\}$ for $\ker(T)$ and extend it to a basis $\mathcal{B} = \{w_1, \ldots, w_m, v_{m+1}, \ldots v_n\}$ of $V$.  We claim that $\{T(v_{m+1}), \ldots, T(v_n)\}$ is linearly independent.  Suppose
$$
a_{m+1} T(v_{m+1}) + \cdots + a_n T(v_n) = 0
$$
for some scalars $a_{m+1}, \ldots, a_n$.  Then
$$
0 = a_{m+1} T(v_{m+1}) + \cdots + a_n T(v_n) = T(a_{m+1} v_{m+1} + \cdots + a_n v_n)
$$
so $\sum_{i=m+1}^n a_i v_i \in \ker(T)$.  Then
\begin{align*}
\sum_{i=m+1}^n a_i v_i = \sum_{j=1}^m a_j w_j \Rightarrow 0 = \sum_{j=1}^m a_j w_j - \sum_{i=m+1}^n a_i v_i
\end{align*}
for some scalars $a_1, \ldots a_m$.  But $\mathcal{B}$ is linearly independent, so $0 = a_1 = \cdots = a_n$.  Thus $\{T(v_{m+1}), \ldots, T(v_n)\}$ is linearly independent, and hence it can be extended to a basis $\mathcal{C} := \{x_1, \ldots, x_m, T(v_{m+1}), \ldots, T(v_n)\}$. So we obtain
\begin{align*}
[T]_\mathcal{B}^\mathcal{C} =
\left(\begin{array}{ccc|ccc}
0 & & & & &\\
 & \ddots & & & &\\
 & &0 & & & \\
\hline
 & & & 1 & & \\
 & & & & \ddots & \\
 & & & & & 1
\end{array}\right).
\end{align*}
as the matrix representation of $T$ with respect to the ordered bases $\mathcal{B}$ and $\mathcal{C}$.
A: Let $T\colon V \to W$ be linear.
Consider $\text{Ker}T = \{ v \in V \ | \ T(v) = 0\}$, a subspace of $V$.
Let $\{e_1, \ldots e_k\}$ be a basis of $\text{Ker}T$.
Complete it to a basis $\{e_1, \ldots, e_m\}$ of $V$.
Then $(f_1, \ldots , f_{m-k})=(T(e_{k+1}), \ldots, T(e_m))$ are a basis of $\text{Im}T$.
Complete this to a basis $\{f_1, \ldots, f_n\}$ of $W$.
In the bases $\{e_{k+1}, \ldots, e_m, e_1, \ldots, e_{k}\}$ and $\{f_1, \ldots, f_n\}$ the matrix of $T$ is diagonal with the first $m-k$ diagonal elements $1$ and the rest of them  $0$
