Proof: dimension of the vector space of solutions to the system Bx=0 I've run into a matrix dimension proof I'm having some trouble with:
Let $A,B$ be $n\times n$ matrices, and let $P(A),P(B),P(AB)$ be the vector spaces of solutions to the systems $A\underline{x}=\underline{0},B\underline{x}=\underline{0},AB\underline{x}=\underline{0}$ respectively.
Prove that if $rank(B)\leq rank(AB)$ then $P(AB)=P(B)$ .
So what I did was this: it's known that $dimP(A)=n-rank(A)$, which also means that $rank(A)=n-dimP(A)$. So:
$$
n-dimP(B)\leq n-dimP(AB)\\
-dimP(B)\leq -dimP(A)\\
dimP(B)\geq dimP(AB)\\
\Rightarrow P(AB)\subseteq P(B)
$$
My reasoning for the last line is that if $P(B)$ and $P(AB)$ are both subspaces of the same vector space and the dimension of $P(B)$ is greater than or equal to that of $P(A)$, then the latter must be contained in or equal to the former.
Here's where I got stuck. In order to prove that $P(B)=P(AB)$ I'll have to prove the opposite direction, that is, that $P(B)\subseteq P(AB)$, which will, coupled with my first argument, prove that the two spaces are equal.
I can't seem to get my head around that part and if anyone could help I'd appreciate it very much.
Also if my logic has been flawed thus far please let me know. Thanks!
 A: Since the rank of a product is less than or equal to the rank of each factor, the hypothesis $\operatorname{rank}(B)\le\operatorname{rank}(AB)$ implies $\operatorname{rank}(B)=\operatorname{rank}(AB)$.
As a consequence, 
$$
\dim P(B)=n-\operatorname{rank}(B)=n-\operatorname{rank}(AB)=\dim P(AB)
$$
It is clear that $P(B)\subseteq P(AB)$ (if $x\in P(B)$, then $Bx=0$, so also $ABx=0$); equality of dimensions yields $P(B)=P(AB)$.

Note that your argument is flawed: just proving that $\dim U_1\le\dim U_2$ doesn't imply $U_1\subseteq U_2$, for generic subspaces.
A: Hint: The easiest approach is to go to the definition of subset, i.e., show that every element of $P(B)$ is also an element of $P(AB)$. Now, if $x\in P(B)$, then $Bx=0$, so ...
A: It's easy to see if you interpret the matrices in terms of linear maps. 
Let $u\colon K^n\to K^n$ the linear map associated to $A$,  $v\colon K^n\to K^n$ the linear map associated to $B$. Then $u\circ v$ corresponds to $AB$.
Now, it is always true that $\;\DeclareMathOperator\rk{rank}\rk(AB)\le\rk B$, so the hypothesis reallys means  $\rk AB=\rk B$, in other words $\rk(u\circ v)=\rk v$. In turn, this means the restriction of $u$ to $\operatorname{Im}v$ is injective, so $\ker u\circ v=\ker v$, which is exactly $P(AB)=P(B)$.
