Exercise $3$, Section $3.C$ - Linear Algebra Done Right Exercise: Exercise: Suppose $V$ and $W$ are finite-dimensional and $T \in L(V, W)$. Prove
that there exist a basis of $V$ and a basis of $W$ such that with respect to
these bases, all entries of $M(T)$ are $0$ except that the entries in row $j$ ,
column $j$ , equal $1$ for $1 \le j \le \dim \text{range }T$.
Proof: Let dim range $T=m$. By the fundamental theorem of linear maps we have that dim null $T=n-m$ where dim $V=n$. Thus there exist $m$ basis vectors of $V$ that do not get mapped to $0$. Let $v_1,\dots,v_m, \dots,v_n$ be that basis in which those $m$ vector exist and where the remaining $n-m$ vectors get mapped to zero. Using the theorem that if $v_1,\dots,v_n$ spans $V$ then $Tv_1,\dots,Tv_n$ spans range $T$, we see that $Tv_1,\dots,Tv_n$ is a spanning list in range $T$. Using the theorem that a spanning list can be reduced to a basis, we can reduce the list $Tv_1,\dots,Tv_n$ to a basis of range $T$ by removing those vectors that are in the span of the previous ones. In doing so, all the $n-m$ vectors that map to $0$ get removed.
The remaining vectors  $Tv_{1},\dots,Tv_m$ span range $T$. To show that this is a basis of range $T$, it suffices to show that $Tv_j$ is not in the span of the previous vectors.
Suppose there exist scalars $a_{1},\dots,a_{j-1}$ such that $a_{1}Tv_{1}+\dots+a_{j-1}Tv_{j-1}=Tv_j$. Subtracting $Tv_j$ from both sides and using the linearity of $T$ we get $T(a_{1}v_{1}+\dots+a_{j-1}v_{j-1}-v_j)=0$. Because none of the vectors in the list $Tv_{1},\dots,Tv_m$ get mapped to zero, the independence of $v_{1},\dots,v_m$ and the above representation imply that the scalars $a_{1}=\dots=a_m=0$. Thus, the list $Tv_{1},\dots,Tv_m$ is a basis of range $T$.
Extending this basis to a basis of $W$ we see that $Tv_1,\dots,Tv_m$ is part of the basis of $W$. For the basis $v_1,\dots,v_m,\dots,v_n$ of $V$ and the basis $Tv_1,\dots,Tv_m,\dots,w_p$ of $W$ we have that $M(T)$ has a $1$ on row $j$ and column $j$ for $1\le j\le \dim \text{range }T$ as $Tv_j=1Tv_j$. All the other entries equal zero as the rest of the vectors in the basis get mapped to zero.
Is this proof correct?
 A: You've got the right general idea but your proof is overly complicated. Just observe that $Tv_1,\ldots,Tv_m$ are linearly independent since if
$$\alpha_1Tv_1+\cdots+\alpha_m Tv_m=0$$
then
$$T(\alpha_1v_1+\cdots+\alpha_mv_m)=0$$
by linearity of $T$, which implies that $\alpha_1v_1+\cdots+\alpha_mv_m$ is in the kernel of $T$. But this means
$$\alpha_1v_1+\cdots+\alpha_mv_m=\alpha_{m+1}v_{m+1}+\cdots+\alpha_nv_n$$
for some scalars $\alpha_{m+1},\cdots,\alpha_n$. Subtracting and using linear independence of $v_1,\ldots,v_n$ it follows that $\alpha_1=\cdots\alpha_m=0$.
A: Here is rapidly how one can get those bases. Let $n=\dim V$ and $\def\rk{\operatorname{rk}}\def\im{\operatorname{im}}r=\rk T=\dim\im(T)$ (that's your $m$), and $p=\dim W$. Choose a basis of $\ker(T)$ which by rank-nullity has $n-r$ elements so we can label them $v_{r+1},\ldots,v_n$. Complete this (with $r$ initial vectors) to a basis $v_1,\ldots,v_n$ of $V$. The images $T(v_i)$ span $\im(T)$, but the last $n-r$ of them are zero, so $T(v_1),\ldots,T(v_r)$ already span $\im(T)$, and since their number equals the dimension of $\im(T)$, they form a basis of that subspace*. Put $w_i=T(v_i)$ for $i=1,\ldots,r$, and complete to a basis $w_1,\ldots,w_p$ of $W$. Since $T(v_i)=w_i$ for $i\leq r$ and $T(v_i)=0$ otherwise, we get the desired matrix.
*One can alternatively show directly that $T(v_1),\ldots,T(v_r)$  are linearly independent: if some linear combination of these vectors is zero, then by linearity of $T$ the corresponding linear combination of $v_1,\ldots,v_r$ lies in $\ker(T)$, but then it is also a linear combination of the remaining basis vectors $v_{r+1},\ldots,v_n$, which is only possible for the trivial linear combination. Using this argument one can avoid the initial use of rank-nullity (just put $\dim \ker(T)=n-k$ for some $k$, use $k$ instead of $r$, and after the given argument conclude that $k$ was in fact the rank of $T$), which then in fact provides a proof of rank-nullity in passing.
