# Steinitz exchange lemma

The Steinitz exchange lemma is a basic theorem in linear algebra used, for example, to show that any two bases for a finite-dimensional vector space have the same number of elements. The result is named after the German mathematician Ernst Steinitz. The result is often called the Steinitz–Mac Lane exchange lemma, also recognizing the generalization by Saunders Mac Lane of Steinitz's lemma to matroids.

## Statement

If $\{v_{1},\dots ,v_{m}\}$ is a set of $m$ linearly independent vectors in a vector space $V$ , and $\{w_{1},\dots ,w_{n}\}$ span $V$ , then:

1. $m\leq n$ ;

2. The set $\{v_{1},\dots ,v_{m},w_{m+1},\dots ,w_{n}\}$ spans $V$ , possibly after reordering the $w_{i}$ .

## Proof

Suppose that we have the indicated sets of vectors. We wish to show that for each $k\in \{0,\dots ,m\}$ , we have that $k\leq n$ , and that the set $\{v_{1},\dotsc ,v_{k},w_{k+1},\dotsc ,w_{n}\}$ spans $V$ (where the $w_{j}$ have possibly been reordered, and the reordering depends on $k$ ). We proceed by mathematical induction on $k$ .

For the base case, suppose $k$ is zero. In this case, the claim holds because there are no vectors $v_{i}$ , and the set $\{w_{1},\dotsc ,w_{n}\}$ spans $V$ by hypothesis.

For the inductive step, assume the proposition is true for some $k . Since $v_{k+1}\in V$ , and $\{v_{1},\ldots ,v_{k},w_{k+1},\ldots ,w_{n}\}$ spans $V$ (by the induction hypothesis), there exist coefficients $\mu _{1},\ldots ,\mu _{n}$ such that

$v_{k+1}=\sum _{j=1}^{k}\mu _{j}v_{j}+\sum _{j=k+1}^{n}\mu _{j}w_{j}$ .

At least one of $\{\mu _{k+1},\ldots ,\mu _{n}\}$ must be non-zero, since otherwise this equality would contradict the linear independence of $\{v_{1},\ldots ,v_{k+1}\}$ ; note that this additionally implies that $k+1\leq n$ . By reordering the $\mu _{k+1}w_{k+1},\ldots ,\mu _{n}w_{n}$ , we may assume that $\mu _{k+1}$ is not zero. Therefore, we have

$w_{k+1}={\frac {1}{\mu _{k+1}}}\left(v_{k+1}-\sum _{j=1}^{k}\mu _{j}v_{j}-\sum _{j=k+2}^{n}\mu _{j}w_{j}\right)$ .

In other words, $w_{k+1}$ is in the span of $\{v_{1},\ldots ,v_{k+1},w_{k+2},\ldots ,w_{n}\}$ . The latter span therefore contains each of the vectors $v_{1},\ldots ,v_{k},w_{k+1},w_{k+2},\ldots ,w_{n}$ , and hence must contain the span of these latter vectors as a subset. But since the latter span is $V$ (by the induction hypothesis), this simply means that the span of $\{v_{1},\ldots ,v_{k+1},w_{k+2},\ldots ,w_{n}\}$ contains $V$ as a subset (thus is $V$ ). We have therefore shown that our claim is true of $k+1$ , completing the inductive step.

We have thus shown that for each $k\in \{0,\dots ,m\}$ , we have that $k\leq n$ , and that the set $\{v_{1},\dotsc ,v_{k},w_{k+1},\dotsc ,w_{n}\}$ spans $V$ (where the $w_{j}$ have possibly been reordered, and the reordering depends on $k$ ).

The fact that $m\leq n$ follows from setting $k=m$ in this result.

## Applications

The Steinitz exchange lemma is a basic result in computational mathematics, especially in linear algebra and in combinatorial algorithms.