Row space and Column space and product of matrices question The theorems state that the $\operatorname{ColumnSpace}(A \cdot B) \subseteq \operatorname{ColumnSpace}(A)$ and the $\operatorname{RowSpace}(A \cdot B) \subseteq \operatorname{RowSpace}(B)$.
When doing $A \cdot B$, it's the dot product of the rows of $A$ by the columns of $B$. If its the rows of $A$ by the columns of $B$, why is it that $\operatorname{RowSpace}(A \cdot B) \subseteq \operatorname{RowSpace}(B)$ and not $\operatorname{RowSpace}(A)$?
Also, If its the rows of $A$ by the columns of $B$, why is it that $\operatorname{ColumnSpace}(A \cdot B) \subseteq \operatorname{ColumnSpace}(A)$ and not $\operatorname{ColumnSpace}(B)$?

You can view matrix multiplication by a vector on the right as a linear combination of the columns, and on the left - as a linear combination of the rows.
$$
\pmatrix{\vec{a}_1 & \vec{a}_2 & \cdots & \vec{a}_n} \pmatrix{x_1 \\ \vdots \\ x_n}
   = \sum_{k=1}^n x_k \vec{a}_k,
$$
and the other way is just a transpose of this.
So the result of multiplying matrices is either a set of linear combinations of the columns of the left one, or a set of linear combinations of the rows of the right one
