# How to find bases for a subspace defined by an equation

How would you find the bases for

$W_1 = \{(a_1,a_2,a_3,a_4,a_5) \in F^5: a_1 - a_3 - a_4 = 0 \}$ and $W_2 = \{ (a_1,a_2,a_3,a_4,a_5) \in F^5: a_2 = a_3 = a_4$ and $a_1+a_5 = 0 \}$ ?

Would the basis for $W_1$ be $\{ (1 \,0 \, 1 \, 0 \, 0), (1 \, 0 \, 0 \, 1 \, 0) \}$ and $dim(W_1) = 2$?

Since there is one linear restriction on the elements of $W_1$, it follows that $\dim W_1=4$. One basis would be $$\left\{\left(\begin{array}{r}1\\0\\0\\1\\0\end{array}\right),\left(\begin{array}{r}0\\1\\0\\0\\0\end{array}\right),\left(\begin{array}{r}0\\0\\1\\-1\\0\end{array}\right),\left(\begin{array}{r}0\\0\\0\\0\\1\end{array}\right)\right\}.$$
As for $W_2$, there are three linear restrictions, so that $\dim W_2=2$ and a basis would be $$\left\{\left(\begin{array}{r}1\\0\\0\\0\\-1\end{array}\right),\left(\begin{array}{r}0\\1\\1\\1\\0\end{array}\right)\right\}.$$