Let \(n = \dim V,\) and recall that if \(\{v_1, \dots, v_n\}\) is any basis for \(V\text{,}\) then \(\Im(T) = \Span(\{T(v_1), \dots, T(v_n)\}).\)
First consider the case that
\(T\) is injective. This means that
\(\ker(T) = \{0\}\text{,}\) so that
\(\nullity(T) = 0\text{.}\) By
Proposition 4.1.3, the set
\(\{T(v_1), \dots, T(v_n)\}\) is linearly independent, and since this set spans
\(\Im(T)\text{,}\) it is a basis for
\(\Im(T)\text{,}\) so its cardinality equals the dimension of the image, i.e.,
\(\rank(T).\) Thus
\(\rank(T)=n\text{,}\) and we see that
\begin{equation*}
n = \dim V = n + 0 = \rank(T) + \nullity(T).
\end{equation*}
Now consider the case where \(\ker(T) \ne \{0\}\text{.}\) Let \(\{u_1, \dots, u_k\}\) be a basis for \(\ker(T)\text{,}\) hence \(\nullity(T) = k.\) Since \(\{u_1, \dots, u_k\}\) is a linearly independent set, by [provisional cross-reference: prop-extend-independent-set-to-basis]
, it can be extended to a basis for \(V\text{:}\)
\begin{equation*}
\{u_1, \dots, u_k, u_{k+1}, \dots, u_n\}
\end{equation*}
To establish the theorem, we need only show that \(\rank(T) =
n-k.\) Since \(\{u_1, \dots, u_k, u_{k+1}, \dots, u_n\}\) is a basis for \(V\text{,}\) \(\Im(T) = \Span(\{T(u_1), \dots,
T(u_n)\})\text{,}\) but we recall that \(u_1, \dots, u_k \in
\ker(T)\text{,}\) so that \(\Im(T) = \Span(\{T(u_{k+1}), \dots,
T(u_n)\})\text{.}\) Thus we know \(\rank T \le n-k.\) To obtain an equality, we need only show that the set \(\{T(u_{k+1}), \dots,
T(u_n)\}\) is linearly independent.
Suppose to the contrary, that the set is linearly independent. Then there exists scalars \(a_i \in F\text{,}\) not all zero, so that
\begin{equation*}
\sum_{i=k+1}^n a_i T(u_i) = 0.
\end{equation*}
By linearity, this says \(T(\sum_{i=k+1}^r a_i u_i) = 0,\) which means \(\sum_{i=k+1}^r a_i u_i \in \ker(T).\) But this in turn says that \(\sum_{i=k+1}^r a_i u_i \in \Span(\{u_1, \dots,
u_k\})\) implying the full set \(\{u_1, \dots, u_n\}\) is linearly dependent, contradicting that it is a basis for \(V.\) This completes the proof.