Theorem: Dimension Formula
Let $V$ and $W$ be finite-dimensional $K$-vector spaces and $f : V \to W$ be a linear mapping. It holds that
\[
\dim(V) = \dim(\text{Ker}(f)) + \dim(\text{Im}(f)).
\]
Beweis
Let $m = \dim(\text{Ker}(f))$ and $e_1, \ldots, e_m$ be a basis of $\text{Ker}(f)$. We extend this to a basis $e_1, \ldots, e_m, e_{m+1}, \ldots, e_n$ of $V$, where $n = \dim(V) \geq m$. It holds that
\[
\text{Span}(f(e_{m+1}), \ldots, f(e_n)) = \text{Im}(f).
\]
Since $f(e_i) = \ldots = f(e_m) = 0$, it even holds that
\[
\text{Span}(f(e_1), \ldots, f(e_n)) = \text{Im}(f).
\]
Claim: The vectors $f(e_{m+1}), \ldots, f(e_n)$ are linearly independent. To show this, suppose that
\[
\lambda_{m+1} f(e_{m+1}) + \ldots + \lambda_n f(e_n) = 0,
\]
where $\lambda_{m+1}, \ldots, \lambda_n \in K$. Since $f$ is linear, it follows that
\[
f(\lambda_{m+1} e_{m+1} + \ldots + \lambda_n e_n) = 0.
\]
This means that
\[
v = \lambda_{m+1} e_{m+1} + \ldots + \lambda_n e_n \in \text{Ker}(f).
\]
Since $e_1, \ldots, e_m$ is a basis of $\text{Ker}(f)$, there exist $\lambda_1, \ldots, \lambda_m \in K$ such that
\[
-v = \lambda_1 e_1 + \ldots + \lambda_m e_m.
\]
It follows that
\[
\lambda_1 e_1 + \ldots + \lambda_n e_n = 0.
\]
Since the vectors $e_1, \ldots, e_n$ are linearly independent, it holds that
\[
\lambda_1 = \ldots = \lambda_n = 0.
\]
Therefore, the vectors $f(e_{m+1}), \ldots, f(e_n)$ are linearly independent. Since they generate $\text{Im}(f)$, they form a basis of $\text{Im}(f)$. It follows that
\[
\dim(\text{Im}(f)) = n - m,
\]
from which it follows that
\[
\dim(\text{Ker}(f)) + \dim(\text{Im}(f)) = m + (n - m) = n = \dim(V).
\]
$\square$