TITLE: Linear equations given by $Ax = b$ have a solution if and only if $\operatorname{rank}(A|b) = \operatorname{rank}(A)$
QUESTION [7 upvotes]: Theorem:
Given a system of linear equations $Ax = b$ where $A \in M_{m \times n}\left(\mathbb{R}\right)$, $ x \in \mathbb{R}^{n}_\text{col} $, $ b \in \mathbb{R}^{m}_\text{col}$
Deduce that a solution $x$ exists if and only if $\operatorname{rank}\left(A|b\right) = \operatorname{rank}\left(A\right)$ where $A|b$ is the augmented coefficient matrix of this system

I am having trouble proving the above theorem from my Linear Algebra course, I understand that A|b must reduce under elementary row operations to a form which is consistent but I don't understand exactly why the matrix A|b need have the same rank as A for this to happen.
Please correct me if I am mistaken

REPLY [2 votes]: To get started,
If the system contains a row such that  [ 0 0 0 0 | b ] with b=/=0 then the system is inconsistent and has no solution. The rank is the number of pivots matrix X has in echelon form, whereby b is the pivot in this row.
Let M=[A ,B], the augmented matrix, where A is the original matrix. 
The system has a solution if and only if rank(A)=rank(M).
If b is a pivot of M then the solution does not exist. Hence rank(m)>rank(a).