Linear Algebra · Undergraduate

Basis, Dimension and the Rank Theorem

Quick answer

A basis of a subspace is a linearly independent set that spans it, and every vector in the subspace has exactly one set of coordinates relative to it. All bases of a subspace have the same number of vectors, and that number is its dimension. For a matrix, the dimension of the column space is the rank, the number of pivot columns, and the dimension of the null space is the number of free variables. Since every column is one or the other, rank plus nullity equals the number of columns.

What you'll learn

  • Decide whether a set is a basis
  • Find the coordinates of a vector relative to a basis
  • Find the dimension of a subspace
  • Use the rank theorem to relate rank and nullity

Enough vectors, and no more

A basis of a subspace HH is a set of vectors in HH that is

  1. linearly independent, and
  2. spans HH.

Spanning means every vector in HH can be built. Independence means none of the building blocks is wasted. The standard vectors e1,…,en\mathbf{e}_1, \ldots, \mathbf{e}_n form a basis of ℝⁿ, but they are far from the only one: (1,1)(1, 1) and (1,−1)(1, -1) form a basis of ℝ² as well.

Relative to a basis, each vector has coordinates: the coefficients that build it. They are unique. If two combinations of the basis gave the same vector, subtracting them would give a combination equal to 0\mathbf{0} with a nonzero coefficient, which independence rules out.

Why every basis has the same size

The key fact is a counting argument. Suppose HH is spanned by kk vectors, and take any k+1k + 1 vectors in HH. Each is a combination of the kk spanning vectors, so a dependence among them comes down to a homogeneous system with kk equations and k+1k + 1 unknowns. More unknowns than equations forces a free variable, hence a nonzero solution, hence dependence. In a subspace spanned by kk vectors, any k+1k + 1 vectors are dependent. So a basis can never have more vectors than another basis, and by symmetry the two sizes match.

That common size is the dimension of HH, written dim⁡H\dim H. A line through the origin has dimension 11, a plane through the origin 22, ℝⁿ has dimension nn, and {0}\{\mathbf{0}\} has dimension 00.

Rank and the rank theorem

For a matrix AA, the previous lesson found bases for both of its subspaces. The basis for Col A\text{Col}\,A has one vector per pivot column, and the basis for Nul A\text{Nul}\,A has one vector per free variable. So

rank A=dim⁡Col A=number of pivot columnsdim⁡Nul A=number of free variables\text{rank}\,A = \dim\text{Col}\,A = \text{number of pivot columns} \qquad \dim\text{Nul}\,A = \text{number of free variables}

Every column of AA is either a pivot column or a free-variable column, never both. Counting columns gives the rank theorem:

For an m×nm \times n matrix AA,  rank A+dim⁡Nul A=n\ \text{rank}\,A + \dim\text{Nul}\,A = n.

The rank also cannot exceed the number of rows, since each pivot needs its own row, so rank A≤min⁡(m,n)\text{rank}\,A \le \min(m, n).

Worked examples

Common mistakes

Practice problems

  1. Is {(1,2), (2,4)}\{(1, 2),\ (2, 4)\} a basis of ℝ²?

    Answer

    No

    Full solution

    (2,4)=2(1,2)(2, 4) = 2(1, 2), so the set is dependent and spans only a line.

  2. Is {(1,0,0), (0,1,0)}\{(1, 0, 0),\ (0, 1, 0)\} a basis of ℝ³?

    Answer

    No

    Full solution

    It is independent but spans only the xyxy-plane. A basis of ℝ³ needs three vectors.

  3. Find the coordinates of (4,6)(4, 6) relative to {(1,1), (1,−1)}\{(1, 1),\ (1, -1)\}.

    Answer

    (5,−1)(5, -1)

    Full solution

    c1+c2=4c_1 + c_2 = 4 and c1−c2=6c_1 - c_2 = 6 give c1=5c_1 = 5 and c2=−1c_2 = -1. Check: 5(1,1)−(1,−1)=(4,6)5(1, 1) - (1, -1) = (4, 6).

  4. Find dim⁡Span{(1,2,3), (2,4,6), (0,1,1)}\dim\text{Span}\{(1, 2, 3),\ (2, 4, 6),\ (0, 1, 1)\}.

    Answer

    22

    Full solution

    The second vector is twice the first, and the third is not a multiple of the first. Row reducing the three columns gives two pivots.

  5. A 4×64 \times 6 matrix has rank 44. Find dim⁡Nul A\dim\text{Nul}\,A, and describe Col A\text{Col}\,A.

    Answer

    dim⁡Nul A=2\dim\text{Nul}\,A = 2; Col A=\text{Col}\,A = ℝ⁴

    Full solution

    The rank theorem gives 6−4=26 - 4 = 2. A 44-dimensional subspace of ℝ⁴ is all of ℝ⁴.

  6. A 6×46 \times 4 matrix has a null space of dimension 11. What is its rank?

    Answer

    33

    Full solution

    rank=4−1\text{rank} = 4 - 1, counting the four columns.

  7. An n×nn \times n matrix has det⁡A≠0\det A \ne 0. What are its rank and nullity?

    Answer

    Rank nn, nullity 00

    Full solution

    A nonzero determinant means AA is invertible, so it has nn pivots and only the trivial solution to Ax=0A\mathbf{x} = \mathbf{0}.

  8. Find the rank and nullity of [121324371224]\begin{bmatrix} 1 & 2 & 1 & 3\\ 2 & 4 & 3 & 7\\ 1 & 2 & 2 & 4 \end{bmatrix}.

    Answer

    Rank 22, nullity 22

    Full solution

    Row reduction gives [120200110000]\begin{bmatrix} 1 & 2 & 0 & 2\\ 0 & 0 & 1 & 1\\ 0 & 0 & 0 & 0 \end{bmatrix}: pivots in columns 11 and 33, free variables x2x_2 and x4x_4.

  9. Can three vectors span ℝ⁴?

    Answer

    No

    Full solution

    Their span has dimension at most 33, and ℝ⁴ has dimension 44. The matrix with them as columns has at most three pivots, leaving a row without one.

  10. A student says the column space of a 3×53 \times 5 matrix has dimension 55, since the matrix has five columns. What went wrong?

    Hint

    Where does the column space live?

    Answer

    The dimension is the rank, the number of pivot columns, which is at most 33.

    Full solution

    The column space is a subspace of ℝ³, so its dimension cannot exceed 33. Five columns in ℝ³ are always dependent, and only the pivot columns count toward the dimension.

Frequently asked questions

What is a basis?

A set of vectors that is linearly independent and spans the subspace: enough vectors to reach every vector in it, and no redundant ones.

What is the dimension of a subspace?

The number of vectors in any basis for it. Every basis of the same subspace has the same size.

What is the rank of a matrix?

The dimension of its column space, which equals the number of pivot columns.

What is the rank theorem?

For an m × n matrix, rank A + dim Nul A = n. Every column either holds a pivot or belongs to a free variable.

When do n vectors form a basis of ℝⁿ?

Exactly when they are independent, which for n vectors in ℝⁿ is the same as spanning ℝⁿ. Checking either condition is enough.

What to learn next