# Find a basis and dimension of $W_1\cap W_2$ if the span is given

Find a basis and dimension of $W_1\cap W_2$ where $W_1$ is a subspace generated by vectors $\left\{ \begin{bmatrix} 1 & 1 \\ 0 & 0 \\ \end{bmatrix},\begin{bmatrix} 3 & 1 \\ -1 & 0 \\ \end{bmatrix}\right\}$ and $W_2$ is generated by $\left\{ \begin{bmatrix} 1 & 1 \\ 1 & 0 \\ \end{bmatrix},\begin{bmatrix} 2 & -1 \\ 1 & -1 \\ \end{bmatrix}\right\}$.

I don't understand why the rank of a matrix $\begin{bmatrix} 1 & 1 & 3 & 1\\ 0 & 0 & -1 & 0\\ \end{bmatrix}$ is $2$, and $rref$ is $\begin{bmatrix} 1 & 0 & 1 & 1\\ 0 & 0 & 1 & 0\\ \end{bmatrix}$. From there, we have that a basis for $W_1$ is $\{\begin{bmatrix} 1 & 0 & 1 & 1\\ \end{bmatrix},\begin{bmatrix} 0 & 0 & 1 & 0\\ \end{bmatrix}\}$ and $\dim(W_1)=2$.

For a matrix $\begin{bmatrix} 1 & 1 & 2 & -1\\ 1 & 0 & 1 & -1\\ \end{bmatrix}$ $rref$ is $\begin{bmatrix} 1 & 0 & 1 & 1\\ 0 & 1 & 1 & -2\\ \end{bmatrix}$. A basis for $W_2$ is $\{\begin{bmatrix} 1 & 0 & 1 & 1\\ \end{bmatrix},\begin{bmatrix} 0 & 1 & 1 & -2\\ \end{bmatrix}\}$ and $\dim(W_2)=2$.

What is the method for finding a basis of $W_1\cap W_2$ and $\dim(W_1\cap W_2)$?

To find the matrices in $W_1\cap W_2$, you need to solve the equation \begin{align} a\begin{bmatrix} 1 & 1\\0 & 0\end{bmatrix}+b\begin{bmatrix}3 & 1\\-1 & 0\end{bmatrix} &=c\begin{bmatrix}1 & 1\\1 & 0\end{bmatrix}+d\begin{bmatrix}2 & -1 \\1 & -1\end{bmatrix}\\ \begin{bmatrix}a+3b & a+b\\-b & 0\end{bmatrix} & =\begin{bmatrix}c+2d & c-d\\c+d & -d\end{bmatrix} \end{align}
Immediately we see that $d=0$. Hence, $$\begin{bmatrix}a+3b & a+b\\-b & 0\end{bmatrix}=\begin{bmatrix}c & c\\c & 0\end{bmatrix}.$$
So, $b=-c$,and we get $$\begin{bmatrix}a+3b & a+b\\-b & 0\end{bmatrix}=\begin{bmatrix}-b & -b\\-b & 0\end{bmatrix}$$ which implies $$\begin{bmatrix}a+4b & a+2b\\0 & 0\end{bmatrix}=\begin{bmatrix}0 & 0\\0 & 0\end{bmatrix}$$
It's pretty easy to see from here that $a=b=c=d=0$.