Prove that the system $Ax = b, A \in \Bbb R^{m \times n}$ , has a unique solution if and only if rank $A$ = rank$[A \mid b] = n$. So I am trying to prove the above statement and wanted to see if my line of thinking is in fact correct.
So first, because there exists a  unique solution then rank$(A) =$ rank $[A\mid b]$. I then said suppose that rank $(A) \neq n$ and instead that the rank is in fact $k < n$. This means there are $n-k$ linearly dependent columns which means we have infinitely many solutions to $Ax = b$ because we can have $n-k$ arbitrary elements of $x$ because we can 'eliminate' the linearly dependent columns. Is this line of thinking correct?
 A: You can simplify a bit the proof using a more general context:

*

*Over any field $K$, the  linear  system $Ax=b$ has a solution if & only if $\operatorname{rank}(A)=\operatorname{rank}\bigl([A|b] \bigr)$ for the very reason you mentioned – that $b$ is in the span of the column vectors of $A$.

*Using the rank-nullity formula,  you see this common rank is the codimension of the affine subspace of solutions. On another hand, the solution is unique if & only if the codimension is $n$ (which implies $m\ge n$).

A: I think the general idea (for one of the directions) is correct, but it can be worded for explicitly. The following uses reasoning from first principles only.
Forward direction. Suppose that there exists uniquely $x_0$ such that $Ax_0=b.$ If $A$ has rank less than $n$, then there is some $z\neq 0$ such that $Az=0$. But then $x_0+z\neq x_0$ is another solution to $Ax_0=b$. So $A$ has rank $n$. This actually implies $[A|b]$ has rank $n$ as well: rank $[A|b]$ cannot be less than $n$ (because $[A|b]$ contains $A$) and cannot be $n+1$ (because $b$ belongs to the column space of $A$).
Backward direction. If both $A$ and $[A|b]$ have rank $n$, then $b$ must belong to the column space of $A$, so there is $x_0$ such that $Ax_0=b$. Moreover, this $x_0$ must be unique: if there is another $\tilde{x}$ such that $A\tilde{x}=b$, then $A(x-\tilde{x})=0$, contradicting $A$ having full column rank.
