When do two matrices have the same column space?

Let $A, B \in \mathrm{M}_{m,n}(\mathbb{K})$ be two matrices with $m$ rows, $n$ columns and entries in the field $\mathbb{K}$.

The following statements are equivalent:

  1. there exists an invertible matrix $P \in \mathrm{GL}_m(\mathbb{K})$ such that $B = P A$;
  2. there exists a finite sequence of elementary Gauss operations on the rows that transforms $A$ into $B$;
  3. the subspaces of $\mathbb{K}^m$ generated by the rows of $A$ and $B$, respectively, are equal.

The following statements are equivalent:

  1. there exists an invertible matrix $P \in \mathrm{GL}_n(\mathbb{K})$ such that $B = A P$;

  2. there exists a finite sequence of elementary Gauss operations on the columns that transforms $A$ into $B$;

  3. the subspaces of $\mathbb{K}^n$ generated by the columns of $A$ and $B$, respectively, are equal.


When you row-reduce a matrix, the dimension of the column space stays fixed, so if $A,B$ have the same reduced echolon form then the dimensions of the column spaces are equal, but the column spaces might not be equal: $$A=\begin{pmatrix}1&2\\1&2\end{pmatrix}\hspace{10pt}B=\begin{pmatrix}1&2\\2&4\end{pmatrix}$$ The have the same reduced echolon form, but different column-spaces.
In general, the only way to make sure that two matrices have the same column space is to column-reduce them (unless both are of full rank).