Let $T:X\to Y$ be an $\mathbb{R}$-linear map of $\mathbb{R}$-vector spaces $X$ and $Y$ of finite dimension. Let $W\subseteq Y$ be an $\mathbb{R}$-vector subspace such that $\text{Im} \ T$ and $W$ together span $Y$. Let $Z=T^{-1}(W)$. Show that $\text{dim} \ X+\text{dim} \ W=\text{dim} \ Y+\text{dim} \ Z$.
My approach : Clearly $\text{dim} \ X=\text{rank}\ T+\text{nullity}\ T$. Again since $\text{Im} \ T$ and $W$ together span $Y$, we have $\text{rank}\ T+\text{dim}\ W=\text{dim}\ Y$. Adding these two relations we have $\text{dim} \ X+\text{dim} \ W=\text{nullity}\ T+\text{dim}\ Y$. But I have problem to show that $\text{nullity}\ T=\text{dim}\ Z$. Can anyone help me regarding this issue? Thanks in advance.