Linear Algebra — 02 · Vector Spaces, Subspaces, Basis and Dimension
Linear Algebra 00 and 01 worked with columns of numbers. This post asks what those columns have in common with polynomials, functions, matrices and the solutions of a differential equation — and answers with one definition: a vector space. From that definition come the ideas that organise the rest of the subject: subspaces, span, linear independence, basis and dimension. The central theorem is that dimension is well defined — every basis of a space has the same size — and it is proved here in full through the Steinitz exchange lemma. The abstract ideas are then brought back to matrices through Strang's four fundamental subspaces, with a complete worked example, a proof that row rank equals column rank, and the rank–nullity theorem in matrix form. The post ends with sums and direct sums of subspaces and the formula .
Series map: 00 Vectors & Linear Systems → 01 Matrix Algebra, Inverses & LU → 02 Vector Spaces, Basis & Dimension (this post) → 03 Linear Maps, Change of Basis & Determinants → 04 Eigenvalues & Diagonalization → 05 Inner Products, Spectral Theorem & SVD.
Learning Outcome
- State the axioms of a vector space over a field, and check them for , polynomials, functions and matrices.
- Prove simple consequences of the axioms, such as and .
- Use the subspace test, and recognise common subspaces and non-subspaces.
- Work with span and linear independence in any vector space, including the linear dependence lemma.
- Prove the Steinitz exchange lemma and deduce that dimension is well defined.
- Extend an independent list to a basis, shrink a spanning list to a basis, and compute coordinates.
- Find bases and dimensions of the four fundamental subspaces of a matrix from its RREF.
- Prove that row rank equals column rank and that .
- Work with sums and direct sums, and prove the dimension formula for .
Chapter 1 — Fields and vector spaces
Terminology
- Field — a set with an addition and a multiplication that satisfy the usual rules of arithmetic: both operations are associative and commutative, multiplication distributes over addition, there are elements with and , every has a negative , and every nonzero has an inverse . Examples: , , , and with arithmetic mod 2. The integers are not a field ( has no integer inverse).
- Scalars — the elements of the field. In this series is or unless stated.
Everything in Linear Algebra 00 and 01 — elimination, pivots, inverses, LU — used only these field rules, so it works word for word over any field.
The definition
A vector space over is a set with an addition and a scalar multiplication such that, for all and :
- (commutativity).
- (associativity).
- There is an element with for all (additive identity).
- For each there is with (additive inverse).
- .
- .
- .
- .
The elements of are called vectors, whatever they actually are.
First consequences
Proposition. In any vector space: (a) the zero vector is unique; (b) each has exactly one additive inverse, written ; (c) ; (d) ; (e) .
Proof. (a) If and are both identities, . (b) If are both inverses of , then . (c) ; add to both sides. (d) The same with . (e) , so is the inverse of , by (b).
Examples
| Space | Vectors | Operations |
|---|---|---|
| columns | entry by entry | |
| polynomials of degree at most | add coefficients; scale coefficients | |
| all polynomials | same | |
| all functions on a set | , | |
| continuous real functions on | pointwise | |
| matrices | entry by entry |
is really the special case with : a column is a function from positions to numbers.
Non-examples. The first quadrant fails axiom 4 — has no inverse inside it. The line has no zero vector. The polynomials of degree exactly 2 are not closed under addition: .
Chapter 2 — Subspaces
Terminology
- Subspace — a subset that is itself a vector space with the same addition and scalar multiplication.
Theorem (subspace test). A subset of a vector space is a subspace if and only if
- ;
- (closed under addition);
- , (closed under scalar multiplication).
Proof. A subspace clearly satisfies 2 and 3, and it contains its own zero vector with ; adding in shows , so 1 holds. Conversely, suppose 1–3 hold. Conditions 2 and 3 make addition and scalar multiplication land in . Axioms 1, 2, 5–8 are identities that hold for all vectors of , so in particular for those of . Axiom 3 holds by condition 1. For axiom 4: if then by condition 3 and part (e) of the proposition.
Trick: conditions 2 and 3 together are the same as "closed under linear combinations": for all and scalars . Check first — it is the fastest way to reject a non-subspace.
Examples and non-examples
- Null space is a subspace of : , and .
- Column space , the span of the columns, is a subspace of .
- is a subspace; is not (no zero polynomial).
- The symmetric matrices form a subspace of .
- The solutions of form a subspace of the twice-differentiable functions .
- The solutions of with are not a subspace (Linear Algebra 00, Chapter 7): is not a solution.
- The union of the -axis and the -axis in is not a subspace: is in neither.
Intersections are subspaces. If and are subspaces, so is : it contains , and a linear combination of vectors in both lies in both. Unions usually are not, as the axes show; Chapter 8 replaces the union by the sum .
Chapter 3 — Span and linear independence in general
The definitions from Linear Algebra 00 carry over unchanged. For a finite list in :
- is the set of all linear combinations . By convention the span of the empty list is .
- The list spans if its span is all of .
- The list is linearly independent if forces ; otherwise it is dependent. The empty list is independent.
Proposition. is the smallest subspace of containing every .
Proof. It contains , and a combination of combinations is a combination, so it is a subspace; it contains each . Any subspace containing all is closed under linear combinations, so it contains the span.
The linear dependence lemma
Lemma. If is linearly dependent, then there is an index such that
- , and
- removing from the list does not change its span.
Proof. Take a relation with not all , and let be the largest index with . Then
which proves 1. (If this says , the span of the empty list.) For 2, in any combination of the full list, replace by the right-hand side above; the result is a combination of the list without .
Independence outside Fⁿ
- In , the list is independent: if is the zero polynomial, all its coefficients are 0.
- In the functions , and are independent: if for all , then gives and gives .
Common pitfall: "" means equality as functions, for every . Finding one where a combination is zero proves nothing; you must show the combination is zero everywhere only when all weights are zero.
Chapter 4 — Basis, the exchange lemma and dimension
Terminology
- Basis of — a list of vectors in that is linearly independent and spans .
- Finite-dimensional — is spanned by some finite list. Otherwise infinite-dimensional.
- Standard basis of — . Of — .
Theorem (unique representation). A list is a basis of if and only if every can be written as in exactly one way.
Proof. Spanning is "at least one way". If a basis gave two ways, subtracting them gives , so every by independence. Conversely, uniqueness for (which is ) is exactly independence.
The Steinitz exchange lemma
Lemma (Steinitz exchange). Let be a vector space. Suppose is linearly independent in and spans . Then . Moreover, after renumbering the 's, the list
also spans .
Proof. We show by induction on that and that, after renumbering, spans . For this is the hypothesis.
Assume it holds for some . Since the list spans , we can write
If every were 0 (in particular, if no 's were left, ), then would be a combination of , contradicting independence of the 's. So some ; hence . Renumber so that and solve for :
So lies in the span of . That span therefore contains the whole old spanning list, so it is . This completes the step. At we get and the stated spanning list.
Small example. In take the independent , and the spanning . Since has a nonzero coefficient on , swap it out: spans. Then ; swap out : spans . (Three vectors that span are automatically a basis — see the theorem at the end of this chapter.)
Dimension is well defined
Theorem. In a finite-dimensional vector space, any two bases have the same length.
Proof. Let and be bases, of lengths and . is independent and spans, so by Steinitz. Swap roles: .
This common length is the dimension .
| Space | Dimension | A basis |
|---|---|---|
| 0 | the empty list | |
| matrices with one entry 1, the rest 0 | ||
| symmetric | 3 | one basis matrix each for the (1,1), (2,2) and paired off-diagonal entries |
| infinite | (no finite list spans) |
Watch out: has dimension over but over (a basis over is ). Dimension depends on the field of scalars.
Growing and shrinking to a basis
Theorem. Let be finite-dimensional with .
- Every spanning list can be shrunk to a basis by removing vectors.
- Every independent list can be extended to a basis by adding vectors.
- Any independent vectors form a basis; any spanning vectors form a basis.
- Every subspace is finite-dimensional with , and only if .
Proof. (1) While the list is dependent, the dependence lemma lets you remove one vector without changing the span. The process stops at an independent spanning list. (2) Apply Steinitz with a basis as the spanning list: the independent list plus the remaining basis vectors spans ; it has length , and by (1) some sublist is a basis, which must have length , so it is the whole list. (3) An independent list of length extends to a basis of length , so nothing is added; a spanning list of length shrinks to a basis of length , so nothing is removed. (4) Any independent list in is independent in , so it has length at most by Steinitz. Keep adding vectors of not yet in the span of an independent list (independence is kept, by Exercise 7); this stops after at most steps with a basis of . If , that basis is independent vectors of , so by (3) it spans , hence .
Chapter 5 — Coordinates
If is a basis of , each has unique weights with . The column is the coordinate vector of relative to .
The map is one-to-one, onto , and respects linear combinations: . So every -dimensional space over behaves exactly like , and computations in it can be done with columns and matrices. Linear Algebra 03 makes this precise (isomorphism) and studies how coordinates change when the basis changes.
Example in . With and : solve , so , , giving , . So , while the standard coordinates are — same vector, different description.
Example in . With , find . Put ; then and . So
(the weights on , and , in that order). Check: .
Chapter 6 — The four fundamental subspaces
Terminology
For an matrix of rank (the number of pivots):
| Subspace | Symbol | Lives in | Definition |
|---|---|---|---|
| Column space | all ; span of the columns | ||
| Null space | all with | ||
| Row space | span of the rows | ||
| Left null space | all with , that is |
Two facts about row operations
Let with invertible (a product of elementary matrices) and the RREF.
Fact 1 — the row space does not change. Every row of is a combination of rows of , and since , every row of is a combination of rows of . So .
Fact 2 — linear relations among columns do not change. , because is invertible. So a combination of columns of is zero exactly when the same combination of columns of is zero, and . (The column spaces of and usually differ.)
Bases from the RREF
- — the pivot columns of (not of ). In the pivot columns are distinct standard basis vectors, so they are independent, and every other column is a combination of them. By Fact 2 the same holds for the corresponding columns of .
- — the nonzero rows of . They span the row space by Fact 1, and they are independent because each has a leading 1 in a column where the other rows have 0.
- — the special solutions (one free variable 1, the others 0), as in Linear Algebra 00.
- — the last rows of : those rows multiply to give the zero rows of .
Worked example
Use the matrix from Linear Algebra 00, Chapter 6:
Pivot columns 1 and 3; free variables .
- Column space (dimension , in ): basis and — columns 1 and 3 of . The other columns satisfy the same relations as in : column 2 column 1, and column 4 column 1 column 3. Check: .
- Row space (dimension , in ): basis and .
- Null space (dimension , in ): basis and .
- Left null space (dimension , in ): the elimination steps , , make row 3 into . So is a basis: .
Orthogonality — a preview
Each row of dotted with a null-space vector gives 0 — that is what says, one row at a time. So every vector of is orthogonal to every vector of . In the example, , , and . In the same way is orthogonal to : and . Over the dimensions add up (, ), which makes each pair orthogonal complements — proved in Linear Algebra 05.
Row rank equals column rank
Theorem. For every matrix, , the number of pivots.
Proof. The pivot columns of are a basis of , and there are of them. The nonzero rows of are a basis of , and there are of them (one per pivot).
This is not obvious: for a matrix it says that the 100 columns span a space of the same dimension as the 3 rows. It also shows , and that .
Rank-one matrices. A matrix has rank 1 exactly when it is a nonzero column times a nonzero row, : every column is a multiple of , every row a multiple of . The outer-product view of Linear Algebra 01 writes any as a sum of such pieces.
Chapter 7 — Rank–nullity (matrix form)
Theorem (rank–nullity). For an matrix ,
Proof. Let be the number of pivots. by Chapter 6. It remains to show that the special solutions are a basis of .
Independent: look only at the free-variable entries. In the -th free variable is 1 and the others are 0. So in the -th free entry is ; if the sum is , every .
Spanning: let with free-variable values . Then is in and has every free variable equal to 0. The RREF expresses each basic variable in terms of the free ones, so all basic variables of are 0 too; thus and .
So , and .
In words: each of the columns either contributes a pivot (a new direction in the column space) or a free variable (a new direction in the null space). For the example, . Applied to (which has columns and the same rank), it gives , here .
The general version — for a linear map , — is proved in Linear Algebra 03.
Consequences
| Condition on the rank | Meaning for |
|---|---|
| (full row rank) | solvable for every ; |
| (full column rank) | at most one solution; |
| exactly one solution; invertible | |
| and | either no solution or infinitely many |
For a square matrix, "rank ", "" and "" join the invertible matrix theorem from Linear Algebra 01.
Trick: rank–nullity is a quick sanity check. A matrix has rank at most 5, so its null space has dimension at least — there are nonzero solutions of before any computation.
Chapter 8 — Sums and direct sums
Terminology
- Sum of subspaces : . It is the smallest subspace containing both (a subspace containing and contains all such sums).
- Direct sum — the sum is direct, written , if every vector of can be written as in only one way.
Proposition. is direct if and only if .
Proof. Suppose the sum is direct and . Then with , , and also ; uniqueness gives . Conversely, if and , then lies in both and , so it is .
Watch out: for three or more subspaces, pairwise zero intersections are not enough. Three distinct lines through the origin in meet pairwise only at , but their sum is not direct (three vectors in are dependent).
The dimension formula
Theorem. If and are finite-dimensional subspaces of , then
Proof. Let be a basis of . Extend it to a basis of and to a basis of (Chapter 4). The combined list clearly spans . For independence, suppose
Then lies in and in , hence in , so for some . The 's and 's together are a basis of , so all (and all ). Now is a relation in a basis of , so all . Hence the combined list is a basis, and
This is the same shape as for finite sets.
Examples
- In , let (the -plane) and (the -plane). Then and , so , but the sum is not direct.
- The plane and the line satisfy (a point with ), so and . For example .
- Every square matrix splits uniquely into symmetric plus skew-symmetric parts, , so over or (any field where ), . For the parts are and .
- For a real matrix, . The intersection is , because a vector in both is orthogonal to itself, and forces ; the dimensions add to . So every splits uniquely as , a row-space part plus a null-space part — the left half of the four-subspace picture. Since , : every in is for a row-space vector , which is the arrow from row space to column space in the figure of Chapter 6.
Practice Exercises
Exercise 1 — A polynomial subspace
Show that is a subspace, and find a basis and its dimension.
Solution
The zero polynomial has , and , so is a subspace. is in iff , i.e. , so . The list , spans and is independent (only the second has a term), so . This matches rank–nullity: is the null space of the map , and .
Exercise 2 — Not a subspace
Is a subspace?
Solution
No. It contains and is closed under scalar multiplication (), but not under addition: has . It is the union of the first and third quadrants.
Exercise 3 — Shrink to a basis
Find a basis for taken from the given vectors, and its dimension.
Solution
Put them as columns and row reduce: . Pivot columns 1 and 3, so and are a basis and the dimension is 2. (All four vectors satisfy , a plane.)
Exercise 4 — Four subspaces of a rank-one matrix
For , give bases and dimensions of all four subspaces.
Solution
, , (). : , dimension 1. : , dimension 1. : , dimension . : solutions of , basis , , dimension . Check orthogonality: .
Exercise 5 — Coordinates
Find the coordinates of relative to .
Solution
, so . Hence , and . Check: .
Exercise 6 — Forced intersection
Let and be 3-dimensional subspaces of . Prove that .
Solution
, so . The dimension formula gives .
Exercise 7 — Proof practice
Prove that if is independent and , then is independent.
Solution
Suppose . If , then is in the span — a contradiction. So , and then all by independence of the . (This is the step used in Chapter 4, part 4.)
Cheat-sheet
| Idea | Key fact |
|---|---|
| Vector space | 8 axioms over a field ; , |
| Subspace test | contains ; closed under and scalars |
| Span | smallest subspace containing the list |
| Dependence lemma | some is in the span of the earlier ones and can be removed |
| Basis | independent + spanning; unique coordinates |
| Steinitz | independent length spanning length |
| Dimension | length of any basis; , |
| In dim | independent or spanning vectors form a basis |
| basis | pivot columns of ; dim |
| basis | nonzero rows of ; dim |
| basis | special solutions; dim |
| basis | last rows of in |
| Rank | row rank = column rank = number of pivots |
| Rank–nullity | |
| Direct sum | unique decomposition |
| Dimension formula |
What's next
Linear Algebra 03 moves from spaces to maps between them. A linear map is determined by what it does to a basis, so after choosing bases it becomes a matrix — and changing the bases changes the matrix to (or for an operator). The post proves the full rank–nullity theorem for linear maps, defines isomorphism (why every -dimensional space "is" ), and then builds the determinant from its defining properties, with its geometric meaning as a signed volume scale factor.
References
- Sheldon Axler, Linear Algebra Done Right, 4th edition, Springer (Undergraduate Texts in Mathematics), 2024 — Chapters 1–2 (vector spaces, subspaces, sums and direct sums, span, independence, bases, dimension, the linear dependence lemma). Open access at linear.axler.net.
- Kenneth Hoffman and Ray Kunze, Linear Algebra, 2nd edition, Prentice-Hall, 1971 — Chapter 2 (vector spaces, bases and dimension, coordinates, row-equivalence).
- Gilbert Strang, Introduction to Linear Algebra, 6th edition, Wellesley-Cambridge Press, 2023 — Chapter 3 (the four fundamental subspaces, rank, dimensions).
- Gilbert Strang, "The Fundamental Theorem of Linear Algebra", The American Mathematical Monthly 100(9), 1993, pp. 848–855 — the source of the four-subspace picture.
- David C. Lay, Steven R. Lay and Judi J. McDonald, Linear Algebra and Its Applications, 6th edition, Pearson, 2021 — Chapter 4 (vector spaces, null and column spaces, bases, coordinate systems, dimension, rank).
- MIT OpenCourseWare, 18.06 Linear Algebra, Spring 2010 (Gilbert Strang) — Lectures 5–10: vector spaces, column and null spaces, solving and , independence, basis and dimension, the four fundamental subspaces.
Note: this post is in progress. Planned additions: quotient spaces and their dimension, a section on infinite-dimensional spaces (why has a countable basis but is harder), and a worked example of the four subspaces over .










