Two algorithms for the exchange lemma

In this note, we present two new algorithms for the Steinitz Exchange Lemma. They are grounded on a single application of a procedure (finding either a row echelon form or a basic minor) that has to be applied repeatedly in previously known algorithms. Proving correctness of both the algorithms, we obtain two new, direct proofs of the Exchange Lemma.


Introduction
Let V be a finite dimensional vector space over a field K. Denote by span S the subspace of V generated by a system S of vectors in V . Let A = (a 1 , . . . , a r ) and B = (b 1 , . . . , b s ) be two systems of vectors in V such that A is linearly independent and span A ⊂ span B. The latter condition can be written in terms of matrix multiplication as where superscript T denotes the matrix transpose operation and M is an appropriate matrix in M r,s (K). The Exchange Lemma, attributed by van der Waerden [8, p. 96], to Steinitz [7,p. 133], but already discovered by Grassmann many decades earlier [3, p. 30], says that r ≤ s and that there exists a system C consisting of the vectors A = (a 1 , a 2 , a 3  First, we find C using the algorithm via row echelon forms.
1. Add row 1 to rows 2 and 3 to get Second, we find C using the algorithm via basic minors.
Now we find C using pivoting.
1. Since m 1 1 = −1 = 0, we can exchange vectors a 1 and b 1 , and get 2. Since m 2 2 = −2 = 0, we can exchange vectors a 2 and b 2 , and get 3. Since m 3 5 = 2 = 0, we can exchange vectors a 3 and b 5 , and get Remark 1 The number of arithmetic operations (additions, subtractions, multiplications, and divisions) in the algorithms we consider is as follows (recall that s ≥ r = rank(M)).
(i) Algorithm via row echelon forms, provided M is transformed using Gaussian elimination: r 2 (s − r 3 ) + O(r(s + r)). (ii) Algorithm via basic minors, provided is indicated using the method described in Remark 2 with the intermediate minors found by elementary operations: the same as in (i). (iii) Algorithm via the exchange of vectors: 2r 2 s + O(r(s + r)).

Correctness of the algorithm via row echelon forms
We can assume that the matrix G is in the reduced row echelon form. Indeed, if it is not the case, we transform G further to the reduced row echelon form using Gauss-Jordan elimination. This does not affect R.
M is transformed to G by means of a finite sequence of elementary operations. Apply these operations simultaneously to both sides of (1), namely at the left hand side to the column matrix A T and at the right hand side to the matrix M. We get ⎡ Denote A = (a 1 , . . . , a r ). Since the elementary operations on a system of vectors do not affect either its span or its linear independence, we conclude that and A is linearly independent. In particular, this means that the system A consists of nonzero vectors. Thus, all the rows of the matrix G are nonzero. The number of nonzero rows of any matrix in (the reduced) row echelon form is less than or equal to the number of its columns. The inequality r ≤ s follows.
For i = 1, . . . , r denote by j i the label of the column of G which contains the leading coefficient of the ith row. Let E be the set of these labels, i.e., Since span A ⊂ span B, we have span C ⊂ span B. In order to prove the converse inclusion span B ⊂ span C, it suffices to check that b j ∈ span C for each j ∈ E. By the definition of the reduced row echelon form, the submatrix of G consisting of the columns labeled by j ∈ E is the identity matrix. Thus, by (2), we have for Hence, for each j ∈ E b j ∈ span A + span (b l ) l∈R .
Thus, span B ⊂ span C by (3) and the definition of C.

Basic minors
From now on, we use the following notation. For a matrix A ∈ M k,l (K), we denote by A i (resp. A j ) the ith row (resp. the j th column) of A. If S ⊂ {1, . . . , l} then A S denotes the submatrix of A consisting of the columns A j , where j ∈ S.
Let D = [d ij ] ∈ M k,l (K) and be a nonzero minor of D of order p. We call a basic minor of D if either p = min(k, l) or all of the minors of order p + 1 that contain , i.e., from which is obtained by crossing out a row and column, do vanish. For a proof using the Laplace expansion, see [6, pp. 9-10]. Although in [6] the definition of a basic minor differs from the one we use by demanding the maximality of the order of a nonzero minor, the proof referred to only uses the conditions we impose. The equivalence of these two definitions is irrelevant to our note; actually, it is implied by the equinumerosity of bases.
Remark 2 There is a concise inductive procedure of indicating a basic minor of a matrix, called the bordering minors method. Since this method is presented in very few textbooks available in English (e.g., [4, pp. 70-73]), let us sketch it here. Given a nonzero matrix in M k,l (K), select any nonzero first order minor (1) of it. In the inductive nth step, the input is the nonzero minor (n). If n = min(k, l), then (n) is a basic minor and the procedure terminates. Else, check only those minors of order n + 1 that contain (n), i.e., from which (n) is obtained by crossing out a row and column. If all of these minors are zero, then (n) is a basic minor and the procedure terminates. Else, choose the first encountered nonzero one as (n + 1) and proceed to the next step.

Spanning criterion
Let A = (a 1 , . . . , a r ) and B = (b 1 , . . . , b s ) be two systems of vectors, where r ≤ s. Note well that we do not assume that the system A is linearly independent. Suppose that span A ⊂ span B. This means that there exists a matrix M ∈ M r,s (K) such that The The converse inclusion is clear.

Correctness of the algorithm via basic minors
Let

Remark 4
The part of the above proof concerning the inequality r ≤ s is essentially the same as in [2], pp. 30-31. This inequality is also being deduced, alternatively to our direct argument from Section 3 and to the inductive procedure, from the theorem on the existence of nontrivial solutions to systems of homogeneous linear equations with the number of variables exceeding the number of equations (see, e.g., [1], Chapter 3, Proposition 3.16 and Chapter 1, Corollary 2.17). This theorem is a corollary of the fact that every matrix can be brought to the reduced row echelon form by Gauss-Jordan elimination.

More on the spanning criterion
The condition in Lemma 2 is in general not necessary, even when A is linearly independent. Indeed, we have the following example. However, under the assumption that B is linearly independent, the condition turns out to be necessary.

Proposition 3
= 0 if and only if span C = span B, provided B is linearly independent.
Proof Since we have Lemma 2, we only need to prove that the assumption span C = span B implies = 0. As in the proof of Lemma 2, we assume that E = {1, . . . , r}. Write span B ⊂ span C and span C ⊂ span B as with X ∈ M s,s (K) and where 0 ∈ M s−r,r (K) is the zero matrix and I ∈ M s−r,s−r (K) is the identity matrix. By (5), B T = XY B T . Since B is linearly independent it follows that XY is the identity matrix, so det(XY ) = 1. Thus = det(M E ) = det(Y ) = 0 by (6) and the multiplicativity of determinant.

Remark 5 If B is linearly independent and
= 0, then both A and C are linearly independent. This is clear by the equinumerosity of bases.

Two additional algorithms
Assuming the linear independence of B rather than of A, we have two algorithms, analogue to those in Section 2. Their correctness can be easily established by combining our arguments in Sections 3 and 6 with Remark 5. A = (a 1 , . . . , a r ) and B = (b 1 , . . . , b s ), and a matrix M such that B is linearly independent and A T = MB T .

Algorithm I.
OUTPUT: A system A * which is a basis of span A, and a system C which is the completion of A * by some vectors of B to a basis of span B.
1. Transform M into a matrix G in row echelon form.