# Row and column spaces

The **row space and column space** of an *m*-by-*n* matrix are the linear subspaces generated by row vectors and column vectors, respectively, of the matrix. Its dimension is equal to the rank of the matrix and is at most min(*m*, *n*).^{[1]}

The rest of article will consider matrices of real numbers: row and column spaces are subspace of **R**^{n} and **R**^{m} real spaces respectively. But row and column spaces can be constructed from matrices with components in any field and even a ring.

## Overview

Let A be an *m*-by-*n* matrix. Then

- rank(A) = dim(rowsp(A)) = dim(colsp(A)),
- rank(A) = number of pivots in any echelon form of A,
- rank(A) = the maximum number of linearly independent rows or columns of A.

If one considers the matrix as a linear transformation from **R**^{n} to **R**^{m}, then the column space of the matrix equals the image of this linear transformation.

The column space of a matrix A is the set of all linear combinations of the columns in A. If A = [**a**_{1}, ...., **a**_{n}], then colsp(A) = span {**a**_{1}, ...., **a**_{n}}.

The concept of **row space** generalises to matrices to **C**, the field of complex numbers, or to any field.

Intuitively, given a matrix **A**, the action of the matrix **A** on a vector **x** will return a linear combination of the columns of **A** weighted by the coordinates of **x** as coefficients. Another way to look at this is that it will (1) first project **x** into the **row space** of A, (2) perform an invertible transformation, and (3) place the resulting vector **y** in the **column space** of **A**. Thus the result ** y =A x** must reside in the **column space** of A. See the singular value decomposition for more details on this second interpretation.

## Example

Given a matrix J:

the rows are
**r**_{1} = (2,4,1,3,2),
**r**_{2} = (−1,−2,1,0,5),
**r**_{3} = (1,6,2,2,2),
**r**_{4} = (3,6,2,5,1).
Consequently the row space of J is the subspace of **R**^{5} spanned by { **r**_{1}, **r**_{2}, **r**_{3}, **r**_{4} }.
Since these four row vectors are linearly independent, the row space is 4-dimensional. Moreover in this case it can be seen that they are all orthogonal to the vector **n** = (6,−1,4,−4,0), so it can be deduced that the row space consists of all vectors in **R**^{5} that are orthogonal to **n**.