Tutorials › Linear Algebra › Invariance of Dimension

Basis and Dimension · Tutorial 320 of 1000

Invariance of Dimension

Use the Exchange Lemma to prove that the number of vectors in a finite basis does not depend on which basis is chosen.

Intermediate 9 min read

What You'll Learn

  • State the Exchange Lemma in the form needed to compare list lengths
  • Prove that two finite bases of the same vector space have equal lengths
  • Use the result to compare independent and spanning lists with a finite basis
  • Verify finite bases in \(\mathbb{R}^2\), a polynomial space, and a matrix space
  • Recognise why one application of the Exchange Lemma gives only one inequality

Why Basis Length Must Be Well Defined

A vector space can have many different bases. For instance, \(\mathbb{R}^2\) has its standard basis, but it also has bases whose vectors point in other directions. If one basis had two vectors and another had three, the phrase “the number of basis vectors” would depend on the choice of basis. The central result here rules that out: any two finite bases of the same vector space have equal length.

We work over a field \(\mathbb{F}\). A basis of a vector space \(V\) is an ordered list of vectors that is both linearly independent and spanning: it is independent if the only linear combination equal to \(\mathbf{0}\) has all coefficients zero, and it spans \(V\) if every vector in \(V\) is a linear combination of the list. The length of a finite list is its number of entries. The result below says that, although a basis itself is not unique, the length of a finite basis is.

The Exchange Lemma as a Counting Tool

The relevant fact is the Exchange Lemma, established in the earlier material on exchange and replacement. It compares an independent list with a spanning list in the same vector space. The key point for this tutorial is the length inequality it supplies.

Exchange Lemma (length form): Let \(V\) be a vector space over \(\mathbb{F}\). If \(u_1,\dots,u_k\) is a finite linearly independent list in \(V\), and \(v_1,\dots,v_n\) is a finite spanning list for \(V\), then \(k\le n\). The replacement form of the lemma says that the \(u_i\) can be inserted into the spanning list by replacing \(k\) of its entries, while retaining a spanning list.

For the equality-of-length proof, it is the inequality \(k\le n\) that matters. A basis has both properties required by the lemma, so it can be used as the independent list in one application and as the spanning list in another. Both roles are essential: using the lemma only once gives one inequality, not equality.

Worked Example: Two Bases of \(\mathbb{R}^2\)

Consider the standard basis \(\mathcal{E}=(\mathbf{e}_1,\mathbf{e}_2)\), where \(\mathbf{e}_1=(1,0)\) and \(\mathbf{e}_2=(0,1)\), and the list \(\mathcal{B}=((1,1),(1,-1))\). Verify that \(\mathcal{B}\) is also a basis, then compare the lengths.

Take any \((x,y)\in\mathbb{R}^2\). To express it as \(c(1,1)+d(1,-1)\), match coordinates:

$$ c+d=x,\qquad c-d=y. $$

Adding these equations gives \(2c=x+y\), so \(c=(x+y)/2\). Subtracting the second equation from the first gives \(2d=x-y\), so \(d=(x-y)/2\). Thus every \((x,y)\) has a representation in \(\mathcal{B}\). These equations also determine \(c\) and \(d\) uniquely. In particular, if \(c(1,1)+d(1,-1)=(0,0)\), then \(c+d=0\) and \(c-d=0\); adding and subtracting gives \(c=d=0\). The list is independent and spanning, hence a basis.

For a concrete check, take \((3,1)\). The formulas give \(c=(3+1)/2=2\) and \(d=(3-1)/2=1\), and \(2(1,1)+1(1,-1)=(3,1)\). The standard basis also spans, since \((x,y)=x\mathbf{e}_1+y\mathbf{e}_2\), and is independent by comparing its two coordinates. Both bases have length \(2\), as the invariance theorem requires.

Invariance of Finite Basis Length

Theorem (Invariance of basis length): If a vector space \(V\) over \(\mathbb{F}\) has two finite bases \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) and \(\mathcal{C}=(\mathbf{c}_1,\dots,\mathbf{c}_m)\), then \(n=m\).

Proof. The list \(\mathcal{C}\) is linearly independent, and \(\mathcal{B}\) spans \(V\). Apply the Exchange Lemma with \(\mathcal{C}\) as the independent list and \(\mathcal{B}\) as the spanning list. Its length inequality gives \(m\le n\). Now use the other properties of the bases: \(\mathcal{B}\) is linearly independent, and \(\mathcal{C}\) spans \(V\). Apply the Exchange Lemma with \(\mathcal{B}\) as the independent list and \(\mathcal{C}\) as the spanning list. This gives \(n\le m\). Since \(m\le n\) and \(n\le m\), the integers are equal: \(n=m\). The argument also allows a list of length zero, because the Exchange Lemma’s inequalities apply to finite lists including the empty list. \(\square\)

The proof does not compare the entries of the two bases or require one basis to be built from the other. Instead, it uses the two defining properties of each basis in opposite roles. The first application prevents the independent list from being longer than the spanning list; the reversed application prevents the second basis from being longer than the first.

Worked Example: Two Bases of the Polynomial Space \(P_2\)

Let \(P_2\) be the real vector space of polynomials of degree at most \(2\). Compare the monomial basis \((1,x,x^2)\) with the list \(\mathcal{C}=(1,1+x,1+x+x^2)\). Verify the second list directly.

For scalars \(\alpha,\beta,\gamma\), expand a linear combination:

$$ \alpha+\beta(1+x)+\gamma(1+x+x^2) =(\alpha+\beta+\gamma)+(\beta+\gamma)x+\gamma x^2. $$

Given \(p(x)=c+bx+ax^2\), matching coefficients requires \(\gamma=a\), \(\beta=b-a\), and \(\alpha=c-b\). These choices exist for every \(a,b,c\), so \(\mathcal{C}\) spans \(P_2\). They are forced by the coefficient equations, so the representation is unique. If the combination is the zero polynomial, then \(a=b=c=0\), which gives \(\gamma=0\), \(\beta=0\), and \(\alpha=0\). Hence \(\mathcal{C}\) is independent as well.

For example, for \(p(x)=4-x+2x^2\), the coefficients are \(\alpha=4-(-1)=5\), \(\beta=-1-2=-3\), and \(\gamma=2\). Substitution checks the result:

$$ 5-3(1+x)+2(1+x+x^2)=4-x+2x^2. $$

The monomial list is a basis because every polynomial \(c+bx+ax^2\) has those coefficients uniquely. Both displayed bases have three entries. The theorem guarantees this count agrees even though the vectors in the lists are different polynomials.

What the Result Lets Us Compare

The theorem has a useful consequence even when a list is not itself a basis. Once \(V\) has a finite basis of length \(n\), no independent list in \(V\) can have more than \(n\) entries, and no spanning list in \(V\) can have fewer than \(n\). These are two distinct comparisons, each obtained by using the finite basis in the complementary role.

Corollary: Suppose \(V\) has a finite basis of length \(n\). Every finite linearly independent list in \(V\) has length at most \(n\), and every finite spanning list for \(V\) has length at least \(n\).

Proof. Let \(\mathcal{B}\) be a basis of length \(n\). If \(\mathcal{L}\) is a finite independent list of length \(k\), apply the Exchange Lemma to \(\mathcal{L}\) and the spanning list \(\mathcal{B}\). It gives \(k\le n\). If instead \(\mathcal{S}\) is a finite spanning list of length \(s\), apply the lemma to the independent list \(\mathcal{B}\) and the spanning list \(\mathcal{S}\). It gives \(n\le s\). These are the claimed bounds. \(\square\)

Worked Example: Two Bases of a Matrix Space

In the real vector space \(\mathbb{R}^{2\times2}\), let \(\mathcal{E}=(\mathbf{E}_{11},\mathbf{E}_{12},\mathbf{E}_{21},\mathbf{E}_{22})\), where \(\mathbf{E}_{ij}\) has a \(1\) in row \(i\), column \(j\), and zeros elsewhere. Consider also the list \(\mathcal{C}=(\mathbf{D}_1,\mathbf{D}_2,\mathbf{E}_{12},\mathbf{E}_{21})\), where \(\mathbf{D}_1=\begin{bmatrix}1&0\\0&1\end{bmatrix}\) and \(\mathbf{D}_2=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\).

For any matrix \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\), a representation using \(\mathcal{C}\) must have the form \(\alpha\mathbf{D}_1+\beta\mathbf{D}_2+\gamma\mathbf{E}_{12}+\delta\mathbf{E}_{21}\). Comparing entries gives \(\alpha+\beta=a\), \(\alpha-\beta=d\), \(\gamma=b\), and \(\delta=c\). Solving yields \(\alpha=(a+d)/2\), \(\beta=(a-d)/2\), \(\gamma=b\), and \(\delta=c\). Thus every matrix has a unique such representation; \(\mathcal{C}\) spans and is independent.

For the matrix \(\begin{bmatrix}3&2\\-1&1\end{bmatrix}\), these formulas give \(\alpha=2\), \(\beta=1\), \(\gamma=2\), and \(\delta=-1\). Direct substitution verifies the coordinates:

$$ 2\begin{bmatrix}1&0\\0&1\end{bmatrix} +\begin{bmatrix}1&0\\0&-1\end{bmatrix} +2\begin{bmatrix}0&1\\0&0\end{bmatrix} -\begin{bmatrix}0&0\\1&0\end{bmatrix} =\begin{bmatrix}3&2\\-1&1\end{bmatrix}. $$

The standard matrix list \(\mathcal{E}\) is a basis because each matrix is the sum of its four entries times the corresponding \(\mathbf{E}_{ij}\), and those coefficients are unique. Both bases have length \(4\), as the theorem says.

Common Pitfall: One Inequality Is Not Equality

A common mistake is to apply the Exchange Lemma in one direction and conclude that two lists have equal length. Its conclusion is an inequality unless the hypotheses are used again with the lists reversed. For a concrete example in \(\mathbb{R}^2\), the list \(((1,0))\) is independent and the list \(((1,0),(0,1))\) spans. The Exchange Lemma gives \(1\le2\), which is correct, but the lists do not have equal length. They are not both bases: the one-vector list does not span \(\mathbb{R}^2\), while the two-vector list is not the independent list in the first application.

The correction is to check both basis conditions before claiming equality. If \(\mathcal{B}\) and \(\mathcal{C}\) are both bases, use independence of \(\mathcal{C}\) and spanning by \(\mathcal{B}\) to get \(m\le n\), then independence of \(\mathcal{B}\) and spanning by \(\mathcal{C}\) to get \(n\le m\). Only the two inequalities together establish equal lengths.

Why the Invariance Result Matters

The theorem makes the size of a finite basis an attribute of the vector space, rather than of a particular choice of vectors. This is the foundation for defining dimension as the common length of finite bases. That definition is meaningful precisely because the theorem proves that different finite bases cannot assign different lengths.

The comparison corollary also provides a quick way to rule out proposed lists. In a space with a basis of length \(n\), a list of \(n+1\) independent vectors cannot exist, and a spanning list with \(n-1\) vectors cannot exist. The statement requires the finite basis of length \(n\); the Exchange Lemma then supplies the relevant inequality. These conclusions concern list lengths, so repeated entries count as separate positions and cannot be ignored without checking independence or spanning.

Check Your Understanding

Use the Exchange Lemma and the basis conditions to justify each conclusion.

  1. If two bases of the same space have lengths \(p\) and \(q\), which two applications give the inequalities needed to prove \(p=q\)?
  2. A vector space has a finite basis of length \(6\). What upper bound does the comparison corollary give for the length of any finite independent list?
  3. In a vector space with a basis of length \(4\), can a spanning list have length \(3\)? State the inequality that decides this.
  4. Why does knowing only \(m\le n\) fail to prove that two finite lists have the same length?
  5. For \(\alpha,\beta,\gamma\in\mathbb{R}\), expand \(\alpha+\beta(1+x)+\gamma(1+x+x^2)\) and recover \(\alpha,\beta,\gamma\) from its polynomial coefficients.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon