Book XXIV contents · ← Chapter 3 · master indexChapter 4 · Book XXI →
Principia Orthogona · Book XXIV · Linear and nonlinear · Chapter 4

Basis and dimension

Why a vector space has a size. A basis is a list that reaches every vector in exactly one way; the exchange lemma says no two bases can differ in length, so the length is a number you may call the dimension.

The object. The plane Fp², and a list of one to three vectors you choose. The points of their span light up. Watch the rank: two independent vectors reach every point, a third adds nothing, and one vector alone never does. The button counts every ordered pair of independent vectors.

teal = in the span · gold ring = a chosen vector · the label is its position in the list
Held textLax, Linear Algebra and Its Applications 2nd ed., Chapter 1: Lemma 1, Lemma 2, Theorem 3 p.5; Theorems 4 and 5 p.6; Exercises 11–12 p.7; Theorem 6 p.8; Corollary 6′ and Exercise 16 p.9; Theorem 7 p.10; Exercises 18–19 p.11 (scan; page checks in the script)
Claim typestandard mathematics, no new results
LeanBasisDimension.lean
compiled by the author: no errors, no warnings, no sorryAx (report)
Every numberch04-verify.py — run first, 0 FAIL
layers

1 · Independence and the exchange lemma

Intuition

In the plane, two vectors can point in different directions; three cannot, whatever you choose. The exchange lemma is that observation made into a theorem about every vector space: a list that reaches everything is never shorter than a list in which nothing is redundant. Its proof swaps the vectors of the second list in for the first, one at a time, and watches the first list run out.

Statement
DefinitionVectors x1, …, xj in V are linearly dependent if k1x1 + … + kjxj = 0 for some scalars not all zero, and linearly independent otherwise. They span V if every vector of V is a combination of them.
Proposition 4 (Lax Exercise 10)If x1, …, xj are linearly independent, none of them is the zero vector.
Lemma 1 (exchange)Suppose x1, …, xn span V and y1, …, yj in V are linearly independent. Then j ≤ n.
Proof

Proposition 4: if xi = 0, then 1·xi plus 0 times each of the others is a combination, not all coefficients zero, equal to 0, so the list is dependent.

Lemma 1. Claim: for each m with m ≤ j and m ≤ n, after renumbering the x’s, the list y1, …, ym, xm+1, …, xn still spans V. For m = 0 this is the hypothesis. Suppose it holds for m and that m + 1 ≤ j and m + 1 ≤ n. Write ym+1 = a1y1 + … + amym + bm+1xm+1 + … + bnxn. If every b were zero, ym+1 would be a combination of y1, …, ym, contradicting independence. So some bi ≠ 0; renumber it as bm+1. Solving for xm+1 expresses it through y1, …, ym+1 and xm+2, …, xn, so the new list spans whatever the old one did, namely V. That proves the claim.

Now suppose j > n. Take m = n: the list y1, …, yn spans V. Then yn+1 is a combination of y1, …, yn, which contradicts independence. So j ≤ n. □

Remarks

Lax Exercise 10, Lemma 1 (p.5). He states it with sets and sketches the replacement; the invariant above, and the case where the x’s run out, are written out here. Lean: indep_ne_zero and lemma1. What the Lean proof is. lemma1 is proved by Mathlib’s counting lemma for spanning finsets (linearIndependent_le_span_finset), not by the replacement argument; it checks that the sentence above is true over every field, not that this proof is right. single_vector_not_span_plane applies it: one vector never spans the rational plane. control_dependent_family is the control: three vectors in a plane exist (the zero family) but are not independent, so independence is doing real work. [OPEN] none of it has been compiled.

The script checks Lemma 1 on every list of length up to n + 1 (up to n for F3³) in F2², F3², F2³ and F3³: the longest independent list is exactly as long as the shortest spanning list, which is n.

2 · Basis and dimension

Intuition

A basis is a spanning list with nothing redundant. Lemma 1 says that any spanning list is at least as long as any independent list, so two bases are each at least as long as the other. The common length is the dimension. In the plate above, any two independent vectors in F3² form a basis, and there are 48 ordered pairs of them.

Statement
DefinitionA finite list that spans V and is linearly independent is a basis of V. V is finite dimensional if it has a basis.
Lemma 2If V is spanned by a finite list x1, …, xn, then V has a basis.
Theorem 3All bases of a finite-dimensional V have the same number of vectors. That number is dim V. (The trivial space {0} has dimension 0.)
Theorem 4Every linearly independent list y1, …, yj in a finite-dimensional V can be completed to a basis of V by adjoining vectors.
Proof

Lemma 2: if the x’s are dependent, some xi is a combination of the others, and dropping it does not change the span. Repeat; the list gets shorter each time, so it stops, at a list that still spans and has no dependence. That is a basis.

Theorem 3: let x1, …, xn and y1, …, ym be two bases. The x’s span and the y’s are independent, so m ≤ n by Lemma 1; the y’s span and the x’s are independent, so n ≤ m. Hence m = n.

Theorem 4: let n = dim V. If the y’s do not span V, some vector x is not a combination of them. Adjoin it. The longer list is still independent: in a relation k1y1 + … + kjyj + cx = 0, c must be 0 (otherwise x would be a combination of the y’s), and then every ki is 0 because the y’s are independent. Repeat. By Lemma 1 an independent list in V has at most n vectors, so this stops after at most n − j steps, at an independent list that spans: a basis. □

Remarks

Lax pp.5–6. Lean: lemma2 and theorem3. theorem3 is Lax’s argument as written: two uses of lemma1, one in each direction. lemma2 builds the basis from Mathlib’s finBasis rather than by dropping vectors. Lean states the bases as families indexed by Fin m and Fin n, where Lax speaks of sets of vectors. Not in Lean: Theorem 4. [OPEN]

The script checks, in all four spaces: no independent list contains a zero vector; every basis has length n; the number of ordered bases is (pn − 1)(pn − p) … (pn − pn−1), which is 6 in F2², 48 in F3², 168 in F2³ and 11,232 in F3³; and that every independent list of length at most n completes to a basis by adjoining vectors (Theorem 4). The counts are consistent with the theorem; they are not a proof of it.

3 · Complements and direct sums

Intuition

Cut a subspace Y out of V. Is there a second subspace Z such that every vector splits as a piece in Y plus a piece in Z, and in only one way? Yes, always, but there is no canonical choice of Z. In Fp², a line Y through the origin has p other lines through the origin, and each is a complement.

Statement
Theorem 5Let V be finite dimensional. (a) Every subspace Y is finite dimensional. (b) Every subspace Y has a complement in V: a subspace Z such that every x in V can be written as x = y + z, y in Y, z in Z, for exactly one pair (y, z). Moreover dim V = dim Y + dim Z.
DefinitionsIf Y and Z are complements, V is their direct sum, written V = Y ⊕ Z. An (n − 1)-dimensional subspace of an n-dimensional space is a hyperplane.
Exercise 12 (Lax)A finite-dimensional V over K of dimension n is isomorphic to Kn; the isomorphism is not unique when n > 1.
Proof

(a) Choose y1 ≠ 0 in Y if Y ≠ {0}, then y2 not in the span of y1, and so on, always adding a vector outside the span so far. Each list stays independent, and by Lemma 1 it cannot exceed n = dim V, so the process stops, at a list that spans Y: a basis of Y.

(b) Complete that basis y1, …, yj to a basis y1, …, yj, zj+1, …, zn of V by Theorem 4, and let Z be the span of the z’s. Every x is a combination of the basis, which splits as a piece in Y plus a piece in Z. Uniqueness: if y + z = y′ + z′, then y − y′ = z′ − z lies in Y and in Z. Writing it in both bases and using that the whole list is independent, every coefficient is zero. So y = y′ and z = z′. The basis of Z has n − j vectors, so dim V = n = j + (n − j) = dim Y + dim Z.

Exercise 12: a basis e1, …, en of V gives the map that sends k1e1 + … + knen to (k1, …, kn). It is linear, and it is bijective because each vector has exactly one such expression. Different bases give different maps, and for n > 1 there are several bases. □

Remarks

Lax pp.6–7. Lean: theorem5a, theorem5b and exercise12. theorem5b states Lax’s sentence (existence and uniqueness of the splitting, plus the dimension formula); the complement is obtained from Mathlib’s exists_isCompl, and the uniqueness is derived from it in the file. exercise12 proves that an isomorphism exists; the non-uniqueness half is not in Lean. [OPEN]

The script lists every subspace of F2², F3², F2³ and F3³ (5, 6, 16 and 28 of them) and checks that each has complements, that each complement adds dimensions, and that a j-dimensional subspace of an n-dimensional space has exactly pj(n−j) of them, so never just one when 0 < j < n. It counts isomorphisms Fpn → Fpn as (pn − 1) … (pn − pn−1) (6, 48, 168, 11,232). Over F3 even n = 1 has two isomorphisms (multiplication by 1 and by 2), so “not unique” is only a statement about n > 1 for F2.

Not done here. Lax’s Exercise 11 (dimension of a direct sum of m subspaces) is left as an exercise.

4 · The quotient, and counting dimension with it

Intuition

Chapter 3 formed V/Y by forgetting what Y contributes. Theorem 6 says what is left: whatever dimension Y has, the rest is the quotient. The proof shows which vectors carry it: complete a basis of Y by new vectors xk, and the classes of the xk alone are a basis of V/Y.

Statement
Theorem 6If Y is a subspace of a finite-dimensional V, then dim Y + dim(V/Y) = dim V.
Corollary 6′A subspace Y of a finite-dimensional V with dim Y = dim V is all of V.
Proof

Let y1, …, yj be a basis of Y, j = dim Y, completed by xj+1, …, xn to a basis of V, n = dim V (Theorem 4). Claim: the classes {xj+1}, …, {xn} are a basis of V/Y.

They span: every x is a combination ∑aiyi + ∑bkxk, and the y’s lie in Y, so {x} = ∑bk{xk}. They are independent: if ∑ck{xk} = {0}, then ∑ckxk lies in Y, so equals ∑diyi for some di; moving it across gives a relation among basis vectors of V, so all ck and di are zero. So dim(V/Y) = n − j, and dim Y + dim(V/Y) = j + (n − j) = n.

Corollary 6′: if dim Y = dim V then dim(V/Y) = 0, so V/Y has the empty list as a basis and its only element is the class of 0. Every x then satisfies {x} = {0}, which means x − 0 lies in Y. So Y = V. □

Remarks

Lax pp.8–10 (Theorem 6, Corollary 6′; Exercise 17 is the proof of the corollary). Lean: theorem6, corollary6. Both are calls to Mathlib’s theorems about finrank of a quotient and of a subspace of full dimension, stated in Lax’s words; the basis argument above is not re-done in Lean. [OPEN]

The script checks, for every subspace of all four spaces, that the number of classes is pn−j, that the classes of the added vectors span V/Y and are independent (the claim in the proof, tested on one completion per subspace), and that a subspace of dimension n is everything. Lax Exercise 16 (polynomials of degree below n vanishing at j points) is in the exercises; the script checks it over F3 with n = 3 and every choice of j distinct points in F3.

5 · Sums of subspaces

Intuition

Two planes through the origin in 3-space meet in a line, and together they fill the space: 2 + 2 − 1 = 3. Theorem 7 is that count in every dimension. The overlap is counted twice by the dimensions, so it is subtracted once. The proof reduces the general case to a sum that has no overlap, by collapsing the overlap W to a point.

Statement
Theorem 7Let V be finite dimensional, U and U′ two subspaces with U + U′ = V, and W = U ∩ U′. Then dim V = dim U + dim U′ − dim W.
Definition, Exercises 18 and 19 (Lax)The Cartesian sum V1 ⊕ V2 is the set of pairs (x1, x2), with addition and scaling componentwise. Its dimension is dim V1 + dim V2, and for a subspace Y of V, Y ⊕ (V/Y) is isomorphic to V.
Proof

Theorem 7. If W = {0}, this is Theorem 5. In general, W lies in U and in U′. Let U0 be the set of classes {u} in V/W with u in U, and U′0 likewise. The map u → {u} from U to V/W is linear with kernel U ∩ W = W, so U0 is isomorphic to U/W and dim U0 = dim U − dim W by Theorem 6. Similarly dim U′0 = dim U′ − dim W.

U0 and U′0 meet only in {0}: if {u} = {u′} with u in U, u′ in U′, then u = u′ + w with w in W, and W lies in U′, so u lies in U′, hence in U ∩ U′ = W, so {u} = {0}. And U0 + U′0 is all of V/W, since V = U + U′. By the case W = {0}, dim(V/W) = dim U0 + dim U′0. By Theorem 6, dim(V/W) = dim V − dim W. So dim V − dim W = (dim U − dim W) + (dim U′ − dim W), which is the formula. □

Exercise 18: the pairs (bi, 0) and (0, ck), for bases of V1 and V2, form a basis of the Cartesian sum. Exercise 19: choose a complement Z of Y (Theorem 5). Each class of V/Y meets Z in exactly one point, because x and x′ in the same class and both in Z give x − x′ in Y ∩ Z = {0}; and every class meets Z, since x = y + z puts z in the class of x. Send (y, class) to y + (that point of Z). This is linear and bijective, so Y ⊕ V/Y ≅ V. The isomorphism depends on the choice of Z. □

Remarks

Lax pp.10–11. Lean: theorem7, exercise18, exercise19; each is a short call to Mathlib’s finrank theorems for sums, products and quotients. theorem7 is stated additively (dim V + dim W = dim U + dim U′) to avoid subtraction in the natural numbers. [OPEN]

The script checks Theorem 7 on every pair of subspaces with U + U′ = V in the four spaces (15, 23, 129 and 445 pairs), and the identity without that hypothesis (dim(U + U′) + dim(U ∩ U′) = dim U + dim U′) on every pair. It also checks each step of the proof: |U0| = |U|/|W|, U0 ∩ U′0 = {0}, U0 + U′0 = V/W. For Exercise 19 it builds the explicit map above for every subspace of all four spaces and confirms it is a bijection that respects addition. Exercise 18 is checked only by counting elements (pn1+n2).

6 · Which fields

Remarks

Lax works over the reals or complex numbers. Nothing above uses that: only that K is a field, so every statement and proof holds over Fp, which is where the plate and the script live, and the Lean file is over an arbitrary field. The field axiom is used where the proof of Lemma 1 divides by the nonzero coefficient b to solve for xm+1. Over a ring that is not a field that step is unavailable, and I have not checked here what happens to the lemma there.

7 · Exercises

  1. In F3², list the ordered bases whose first vector is (1, 0). Why are there six?
  2. Use Theorem 6 to prove Corollary 6′ (Lax Exercise 17) without the argument given above.
  3. (Lax Exercise 16.) X is the space of polynomials of degree below n; Y is the set of those that vanish at distinct points t1, …, tj, j < n. Show that Y is a subspace and find dim Y and dim X/Y. Check n = 3, j = 2 over F3: how many elements does Y have, and how many classes does X/Y have?
  4. List all complements of span((1, 0)) in F3². There should be p = 3. For each, write (2, 2) as y + z.
  5. In F2³ let U be a plane and U′ a line not in it. Check Theorem 7 and say what W is. Then take U′ a line inside U: which hypothesis of Theorem 7 fails, and what does the identity dim(U + U′) + dim W = dim U + dim U′ say?
  6. Show that every list of n + 1 vectors in an n-dimensional space is dependent.
  7. (Lax Exercise 11.) If V is finite dimensional and the direct sum of Y1, …, Ym, show dim V = ∑ dim Yi.
  8. In Exercise 19’s isomorphism Y ⊕ V/Y → V, what choice did you make? Is there a way to define a map Y ⊕ V/Y → V without making it?