The column space and rank of a matrix have significant applications in data science. First, we introduce the column space.

The column space of a matrix \(A\) in \(M_{m \times n} (\mathbb{R})\) is a subspace of \(\mathbb{R}^m\) spanned (generated) by the columns of the matrix \(A\). In other words, if $$A =\begin{bmatrix} C_1 & \dots & C_n \end{bmatrix},$$ then the column space of \(A\) is the subspace spanned by the column vectors $$\{C_1, \dots, C_n\}.$$

The row space of a matrix \(A\) in \(M_{m \times n} (\mathbb{R})\) is a subspace of \(\mathbb{R}^n\) spanned (generated) by the rows of the matrix \(A\). In other words, if $$A =\begin{bmatrix} R_1 \\ \vdots \\ R_m \end{bmatrix},$$ then the row space of \(A\) is the subspace spanned by the row vectors $$\{R_1, \dots, R_m\}.$$

We denote the column space and the row space of a matrix \(A\) by $$\hbox{Col}(A) \text{ and } \hbox{Row}(A),$$ respectively. Surprisingly, it turns out that the dimension of the column space and the dimension of the row space of a matrix \(A\) are the same. In other words, $$\dim \hbox{Col}(A) = \dim \hbox{Row}(A).$$

#### Dimension of the column space of a matrix

The dimension of the column space of a matrix \(A\) is, by definition, the rank of the matrix \(A\). It is clear that the rank of a matrix \(A\) is the dimension of the row space of the matrix \(A\) also. We denote the rank of a matrix \(A\) is by \(\hbox{rank}(A)\).

Now, let \(A\) be a real \(m \times n\) matrix. Since the number of linearly independent column vectors of the matrix \(A\) is at most \(n\) while all the column vectors lie in \(\mathbb{R}^m\), we can have at most \(\min\{m,n\}\) linearly independent vectors in \(\hbox{Col}(A)\). Therefore, the rank of a real \(m \times n\) matrix is at most \(\min\{m,n\}\). In other words, $$\hbox{rank}(A) \leq \min\{m,n\}.$$

**Remark**. The rank of a matrix has significant applications in data science.

**Exercise**. Let \(A\) be a real matrix and \(A^T\) its transpose. Prove that

- \(\hbox{Col}(A) = \hbox{Row}(A^T)\).
- \(\hbox{Row}(A) = \hbox{Col}(A^T)\).

For the definition of the transpose of a matrix see the post on matrix operations.

#### Column space of a matrix and systems of linear equations

Let \(b \in \mathbb{R}^m\) be a vector in the column space of an \(m \times n\) matrix \(A\). This means that \(b\) is a linear combination of the column vectors \(C_i\)s of the matrix \(A\), i.e., $$b = x_1 C_1 + \dots + x_n C_n.$$ This is equivalent to say that there is a vector solution for the equation \(Ax = b,\) where \(x\) is a column vector and its components are the \(x_i\)s. In other words, the column space of a matrix \(A\) is the set of all vectors \(b\) such that the system of linear equations \(Ax = b\) has a solution.

Another interpretation for the column space of a matrix \(A\) is image of the linear function \(f\) from \(\mathbb{R}^n\) to \(\mathbb{R}^m\), where the matrix of \(f\) is the matrix \(A\).

#### Null space of a matrix

The null space of an \(m \times n\) matrix \(A\), denoted by \(\hbox{Nul}(A)\), is the set of all solutions of the homogeneous system of linear equations \(Ax = \vec{0}\). The null space of a matrix \(A\) is a subspace of \(\mathbb{R}^n\) since $$\hbox{Nul}(A) = \ker(f),$$ where \(f: \mathbb{R}^n \rightarrow \mathbb{R}^m\) is the linear function defined by \(f(x) = Ax\) and the matrix of \(f\) is the matrix \(A\).

#### Nullity of a matrix

Nullity of a matrix \(A\), denoted by \(\hbox{nullity}(A)\), is the dimension of the null space of the matrix \(A\). Now, assume that \(A\) is an \(m \times n\) real matrix. The rank-nullity theorem in linear algebra states that the dimension of the column space of \(A\) plus the dimension of the null space of \(A\) equals to \(n\). In other words, if \(A\) is an \(m \times n\) real matrix, then $$\hbox{rank}(A) + \hbox{nullity}(A) = n.$$