Equivalence of statements about transformation matrix and function Let K be a field, n ∈ N, and V a n-dimensional K-vectorspace. Let f : V → V be a
K-linear function. Show the equivalence of the following statements:

*

*There are U, W ⊆ V vector subspaces, such that V = U ⊕ W and  f(U) ⊆ U, f(W) ⊆ W.

*There is a basis B of V, such that the transformation matrix of f in terms of B can be written as
$  M_B^{B}(f) =\begin{pmatrix} A & 0 \\ 0 & B \end{pmatrix} $,

where for some k ∈ N, 1 ≤ k ≤ n:
$A ∈ R^{k×k} 
, B ∈ R^{(n−k)×(n−k)} $and 0 denotes the zero-matrix in $R^{k×(n−k)} $
(upper right) or respectively the zero-matrix in $R^{(n−k)×k}$
(bottom left).
I tried looking at the subspace Ker(f) and Im(f) but sadly to no avail. This is an old exam question, so it technically shouldn't be too difficult to solve given this is "just" linear algebra 1. Any help would be very much appreciated!
 A: We need to additionally presume the subspaces $V$ and $W$ are complementary.
The implication from 1. to 2. then is as follows:
Consider a basis $B_U$ for the subspace $U\subset V$ and a basis $B_W$ for the subset $W\subset V$. Write $r=\dim U$ and $n=\dim V$.
Since the subspaces are complementary, $B:= B_U \cap B_W$ will be a basis for $V$. Moreover, for any $b_i\in B_U$ we have $f(b_i)\in U$ per assumption and hence writing $f(b_i)$ in terms of the basis $B$ is of the form $(x_1,\dots,x_k,0,\dots,0)$, for some $x_1,\dots,x_k\in K$. Similarly for any $b_j\in B_W$ we have $f(b_j)\in W$ which in terms of the basis $B$ is of the form $(0,\dots,0,x_{k+1},\dots,x_n)$ for some $x_{k+1},\dots,x_n\in K$. Since the $i$th column of $M_B^B(f)$ is just the components of the $i$th vector in $B$ with respect to $B$, we find the matrix $M_B^B(f)$ has the required form.
Conversely, the implication from 2. to 1. is as follows:
Set $U := \operatorname{span}(b_1,\dots,b_k)$ and $W := \operatorname{span}(b_{k+1},\dots,b_n)$. From matrix multiplication is is then clear that $f(b_i) = M_B^B(f)b_i \in U$. Since any $u\in U$ is a linear combination of the $b_1,\dots,b_k$, by linearity of $f$ we find that $f(u)$ must again be in $U$. This proofs $f(U)\subset U$. A similar argument proofs $f(W)\subset W$.
A: If 1. is given then we know that we can simply take the Basis $\{u_1, \dots, u_k\}$ of $U$ and the basis $\{w_1, \dots, w_m\}$ of $W$ with $k+m=n$ to get the basis
$$B= \{u_1, \dots, u_k, w_1, \dots, w_m\}$$
of $V$. (It is obvious that this spans $V$ and because we said $U \oplus W=V$ we have a direct sum and can argue with dimensions that it has to be a basis: dim$(V) = \text{dim}(U) + \text{dim}(W)- \text{dim}(U \cap W)$ but for a direct sum $U \cap W = \{0\}$)
In this basis we have $f(u_i) \in U$ for all $i=1, \dots, k$, so the first $k$ columns of $M_B^B(f)$ will only have non-zero entries in the first $k$ rows as $f(u_i)$ is a linear combination of the first $k$ basis vectors. In analogue fashion $f(w_i) \in W$ for $i=1, \dots, m$ and so $f(w_i)$ is a linear combination of the last $m$ basis vectors in $B$, giving $M_B^B(f)$ a $m \times m$ lower right matrix.
Hence we have
$$M_B^B(f) = \begin{pmatrix} A & 0 \\0&B\end{pmatrix}$$
If 2. is given we know that for the basis $B= \{v_1, \dots, v_n\}$ we can choose
$$U= \{v_1, \dots, v_k\}$$
$$W= \{v_{k+1}, \dots, v_n\}$$
where $k$ is the size of $A$. Then we have $U+W=V$ and with the same dimension argument as above also $U \oplus W=V$ and obviously from the matrix $M_B^B(f)$ we see $f(U) \subset U$ and $f(W) \subset W$.
