Prove that the set is a subspace and find dimension an one basis Prove that the set $U=\{X\in \mathcal{M_{2\times 3}}(\mathbb{R})|AX=XB\}$ where $A=        \begin{bmatrix}
        1 & 0\\ 
        1 & -1 \\
        \end{bmatrix},B=        \begin{bmatrix}
        1 & -1 & 0 \\
        0 & 1 & 0 \\
        1 & 0 & -1 \\
        \end{bmatrix}$
is a subspace of $\mathcal{M_{2\times3}}(\mathbb{R})$ and find it's dimension and one basis.
Attempt:
Proof:
$1)$ Existence of null matrix
$X$ can be null matrix such that $AX=XB$
$2)$ Closure under addition
Let $X,Y\in\mathcal{M_{2\times 3}}(\mathbb{R})$
$X+Y=        \begin{bmatrix}
        x_1+y_1 & x_3+y_3 & x_5+y_5 \\
        x_2+y_2 & x_4+y_4 & x_6+y_6 \\
        \end{bmatrix}$
$X+Y$ produces the matrix $2\times 3$ 
$X+Y$ can be null matrix such that $A(X+Y)=(X+Y)B\Rightarrow$ closure under addition.
$3)$ Closure under scalar multiplication
Let $\alpha\in\mathbb{R}\Rightarrow \alpha(X)=\begin{bmatrix}
        \alpha(x_1) & \alpha(x_3) & \alpha(x_5) \\
        \alpha(x_2) & \alpha(x_4) & \alpha(x_6) \\
        \end{bmatrix}$
Again, if $X$ is a null matrix $\Rightarrow A\alpha X=\alpha XB$
Is this the right way to prove that the set $U$ is a subspace of $\mathcal{M_{2\times 3}}(\mathbb{R})$?
In order to find $\dim(U)$, we need to find non-zero matrix $X$ such that $AX=XB$ and then find it's $rref$.
After evaluating $AX$ and $XB$ I am getting the system of $2$ linear equations with $4$ unknowns. Because there is one linearly dependent column vector in $AX$ and $XB$, I assumed that $\dim(U)=2$.
How to find a basis if it is not possible to determine non-zero matrix $X$?
 A: No. You have to check that if $X,Y \in U$ and $\lambda \in \Bbb R$, then $X + \lambda Y \in U$. More explicitly, if $AX = XB$ and $AY = YB$, then $A(X+\lambda Y) = (X+\lambda Y)B$. This can be seen multiplying the second equality by $\lambda$, which gives $A(\lambda Y) = (\lambda Y)B$. Adding the first equality with this one yields what we want. 
Notice that this is true for any $A \in {\rm Mat}(2,\Bbb R)$ and $B \in {\rm Mat}(3,\Bbb R)$.
We only use $A$ and $B$ explictly to find a basis for $U$. If: $$\begin{bmatrix} 1 & 0 \\ 1 & -1\end{bmatrix}\begin{bmatrix} x_{11} & x_{12} & x_{13} \\ x_{21} & x_{22} & x_{23}\end{bmatrix} = \begin{bmatrix} x_{11} & x_{12} & x_{13} \\ x_{21} & x_{22} & x_{23}\end{bmatrix}\begin{bmatrix}  1 & -1 & 0 \\ 0 & 1 & 0 \\  1 & 0 & -1 \end{bmatrix},$$then you multiply everything to get $6$ relations between the $x_{ij}$. Try to express all of the $x_{ij}$ in terms of only a few of them, and write what $\begin{bmatrix} x_{11} & x_{12} & x_{13} \\ x_{21} & x_{22} & x_{23}\end{bmatrix}$ is.
A: Hint:
$$
X=\begin{bmatrix}
a_1&b_1&c_1\\
a_2&b_2&c_2
\end{bmatrix}
$$
we want:
$$
\begin{bmatrix}
1&0\\
1&-1
\end{bmatrix}
\begin{bmatrix}
a_1&b_1&c_1\\
a_2&b_2&c_2
\end{bmatrix}=
\begin{bmatrix}
a_1&b_1&c_1\\
a_2&b_2&c_2
\end{bmatrix}
\begin{bmatrix}
1&-1&0\\
0&1&0\\
1&0&-1
\end{bmatrix}
\Rightarrow
$$
$$
\begin{bmatrix}
a_1&b_1&c_1\\
a_1-a_2&b_1-b_2&c_1-c_2
\end{bmatrix}=
\begin{bmatrix}
a_1+c_1&b_1-a_1&-c_1\\
a_2+c_2&b_2-a_2&-c_2
\end{bmatrix}
$$
equating the corresponding therms we find that $X$ has the form:
$$
X=
\begin{bmatrix}
0&2b-a&0\\
a&b&-2a
\end{bmatrix}
$$ 
Now it is not difficult to show that these matrices form a subspace of dimension $2$.
