$T$ Invariant subspace Please help me to write a step by step solution to this problem:
Let $T$ be a linear operator defined on a finite dimensional vector space $V$. If $W$ is a $T$ invariant subspace with $V = \mathrm{im}(T) \oplus W$, then show that W must be $N(T)$ (the null space of $T$).
I am getting an intuition but am at a loss as how to write that formally...
 A: Suppose $w\in W$; then $T(w)\in\operatorname{im}(T)$ by definition and $T(w)\in W$ since $W$ is $T$-invariant. Thus $T(w)=0$; therefore $W\subseteq N(T)$.
Can it be $W\subsetneq N(T)$? Use the fact that, by assumption,
$$
\dim V=\dim \operatorname{im}(T)+\dim W
$$
and that, by the rank-nullity theorem,
$$
\dim V=\dim \operatorname{im}(T)+\dim N(T)
$$
A: One way to go about this is by using the following fact:
For a vector space $V$, if $U$ and $W$ are subspaces of $V$, then their sum $U+V$ is a direct sum if and only if $U \cap W=\{0\}$.
Now since $T\in \mathcal{L}(V)$ we have that $\text{im}(T)$ is a subspace of $V$,  and we are given that $W$ is a T-invariant subspace of $V$, so we can make the following conclusion:
$\text{im}(T) \cap W=\{0\}$
Given that $W$ is T-invariant, we have that for any $w\in W$, $T(w)\in W$. But we also know that $T(w)\in \text{im}(T)$. Given that we know their intersection is $\{0\}$ this means that $T(w)=0$, which by definition, means that each $w\in W$ is sent to $0$ by T, and therefore $W\subset N(T)$.
By the rank-nullity theorem we know that $\text{dim}(V)= \text{dim(im}(T))+\text{dim}(N(T))$. Since $V=\text{im}(T) \oplus W$, we also know that $\text{dim}(V)=\text{dim(im}(T)) +\text{dim}(W)$. This tells us that $\text{dim}(W)=\text{dim}(N(T))$.
Since $W\subset N(T)$ and their dimensions are equal, we must have that $W=N(T)$.
