Checking if a vector is in a subspace? I have 
v1= $$
    \begin{pmatrix}
    1 \\
    0 \\
    -1\\
    \end{pmatrix}
$$
v2= 
    \begin{pmatrix}
2 \\
1 \\
3\\
\end{pmatrix}
v3=\begin{pmatrix}
4 \\
2 \\
6\\
\end{pmatrix}
and 
w=\begin{pmatrix}
3 \\
1 \\
2\\
\end{pmatrix}
I need to check whether w is in the subspace spanned by (v1,v2,v3)
I know that w is in the subspace spanned by (v1,v2,v3) if x1v1+x2v2+x3v3=w has a solution .
I write:
x1+2x2+4x3=3
x2+2x3=1
-x1+3x2+6x3=2
I write down the augmented matrix, which is 
A= $$
\begin{pmatrix}
1 & 2 & 4&3 \\
0 & 1 & 2&1 \\
-1 & 3 & 6&2 \\
\end{pmatrix}
$$
And row reduce it to get 
$$
\begin{pmatrix}
1 & 2 & 4&3 \\
0 & 1 & 2&1 \\
0 & 0 & 0&0 \\
\end{pmatrix}
$$
On the answer sheet is states:
since the dimension of the space of the columns of the augmented matrix coincides with the dimension of the space of the matrix coefficients, the system admits a non trivial solution and w exists in (v1,v2,v3)
I am new studying matrices and my dyscalculia certainly does not help. My question is, what is the dimension of the space of the columns of the augmented matrix? What is the dimension of the space of the matrix coefficient? How can i show that they are the same?
Moreover, can you show me an example where the space of the columns of the augmented matrix DOES NOT coincide with the dimension of the space of the matrix coefficients?
I would greatly appreciate an answer that is as clear and simple as possible ... thank you guys ! 
 A: The dimension of the space of columns of a matrix is the maximal number of column vectors that are linearly independent. 
In your example, both dimensions are $2$, as the last two columns can be written as a linear combination of the first two columns.
An example where the dimensions are not equal can be given by 
$$\begin{cases}
x_1=0\\ x_1=1
\end{cases}.$$
The augmented matrix is 
$$\begin{pmatrix}1 & 0 \\ 1 & 1 \end{pmatrix}.$$
The dimension of the space of columns of the coefficient matrix is $1$, while that of the augmented matrix is $2$.
A: I was typing a more elaborate answer; perhaps this still helps.
You set up the matrix form of the linear system and by row reducing this matrix
$$\begin{pmatrix}
1 & 2 & 4&3 \\
0 & 1 & 2&1 \\
-1 & 3 & 6&2 \\
\end{pmatrix}$$
you found:
$$\begin{pmatrix}
1 & 2 & 4&3 \\
0 & 1 & 2&1 \\
0 & 0 & 0&0 \\
\end{pmatrix}$$
Although not necessary, you can further simplify this to the reduced row-echelon form by creating an extra zero above the $(2,2)$-element:
$$\begin{pmatrix}
\color{blue}{1} & 0 & \color{orange}{0}&\color{red}{1} \\
0 & \color{blue}{1} & \color{orange}{2}&\color{red}{1} \\
0 & 0 & 0&0 \\
\end{pmatrix}$$
A bit of terminology and some useful observations:


*

*The elements I highlighted in blue are called pivots and the first two columns are therefore pivot colums. The columns of the original matrix corresponding to the pivot columns (in this example the first two), are linearly independent. The number of pivots thus corresponds to the number of linearly independent columns (of the original matrix!).

*In your example, the first two columns are pivot columns and therefore the first two columns of the original matrix are linearly independent; the other two are not and can be written as linear combinations of the first two.

*An advantage of the reduced row-echelon form is that you can immediately deduce the linear combinations required to form the other columns; highlighted in orange ("the third column is two  times the second column") and red ("the fourth column is the sum of the first and second columns"); verify this for the original matrix!

*Because the last column is not a pivot column, the dimension of the columns of the coefficient matrix (the first three columns) is the same as the dimension of the columns of the augmented matrix (all columns). This is sufficient to conclude that the last column is in the space spanned by the other columns, but by the observations from above we already had the specific linear combination too!



Moreover, can you show me an example where the space of the columns of the augmented matrix DOES NOT coincide with the dimension of the space of the matrix coefficients?

Changing the vector $w$ from $(3,1,2)^T$ to $(3,1,1)^T$ would correspond to the matrix:
$$\begin{pmatrix}
1 & 2 & 4&3 \\
0 & 1 & 2&1 \\
-1 & 3 & 6& 1 \\
\end{pmatrix}$$
with reduced row-echelon form:
$$\begin{pmatrix}
\color{blue}{1} & 0 & 0&0 \\
0 & \color{blue}{1} & 2&0 \\
0 & 0 & 0&\color{red}{1} \\
\end{pmatrix}$$
Notice the extra pivot (highlighted in red), making the last column a pivot column too:


*

*the dimension of the space spanned by the first three columns (corresponding to the coefficient matrix) is 2, but:

*the dimension of the space spanned by all columns (corresponding to the augmented matrix) is now 3; thus different and $w$ is not in the space spanned by the other columns.

