# $\dim (f^{-1}(K \cap \operatorname{im} f))= \dim (\ker f)+ \dim(K \cap \operatorname{im} f)$ [duplicate]

I've a problem with this:
Let $f:V \to W$ be a linear function between two vector spaces, let $K$ be a subspace of $W,$ then $\dim (f^{-1}(K \cap \operatorname{im} f))= \dim (\ker f)+ \dim(K \cap \operatorname{im} f)$ How can I prove that? I can't understand this completely, it is similar to the rank-nullity theorem, is there any link between them? Thanks a lot in advice

Let $U= f^{-1}(\operatorname{im}f)-\ker{f}$. Then $$f^{-1}(K\cap\operatorname{im}f)=(U\cap K)\oplus \ker{f}$$ Since $f$ maps $x\in U\cap K$ injectively to $K\cap\operatorname{im}{f}$ $$\dim{(U\cap K)}=\dim{(K\cap\operatorname{im}{f})}$$ So we have $$\dim{f^{-1}(K\cap\operatorname{im}f)}=\dim{(U\cap K)}+\dim{\ker{f}}=\dim{(K\cap\operatorname{im}{f})}+\dim{\ker{f}}$$
Observe $\ker f\subset f^{-1}(K\cap\operatorname{Im}f)$, and apply the rank-nullity theorem to the restriction of $f$ to $f^{-1}(K\cap\operatorname{Im}f)$.