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 dim⁡(U+W)=dim⁡U+dim⁡W−dim⁡(U∩W)\dim(U + W) = \dim U + \dim W - \dim(U \cap W).

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 FnF^n, polynomials, functions and matrices.
  • Prove simple consequences of the axioms, such as 0v=00\mathbf{v} = \mathbf{0} and (−1)v=−v(-1)\mathbf{v} = -\mathbf{v}.
  • 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 rank⁡A+dim⁡N(A)=n\operatorname{rank} A + \dim N(A) = n.
  • Work with sums and direct sums, and prove the dimension formula for U+WU + W.

Chapter 1 — Fields and vector spaces

Terminology

  • Field — a set FF 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 0≠10 \neq 1 with a+0=aa + 0 = a and 1a=a1a = a, every aa has a negative −a-a, and every nonzero aa has an inverse a−1a^{-1}. Examples: Q\mathbb{Q}, R\mathbb{R}, C\mathbb{C}, and F2={0,1}\mathbb{F}_2 = \{0, 1\} with arithmetic mod 2. The integers Z\mathbb{Z} are not a field (22 has no integer inverse).
  • Scalars — the elements of the field. In this series FF is R\mathbb{R} or C\mathbb{C} 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 FF is a set VV with an addition V×V→VV \times V \to V and a scalar multiplication F×V→VF \times V \to V such that, for all u,v,w∈V\mathbf{u}, \mathbf{v}, \mathbf{w} \in V and a,b∈Fa, b \in F:

  1. u+v=v+u\mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u} (commutativity).
  2. (u+v)+w=u+(v+w)(\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w}) (associativity).
  3. There is an element 0∈V\mathbf{0} \in V with v+0=v\mathbf{v} + \mathbf{0} = \mathbf{v} for all v\mathbf{v} (additive identity).
  4. For each v\mathbf{v} there is w\mathbf{w} with v+w=0\mathbf{v} + \mathbf{w} = \mathbf{0} (additive inverse).
  5. a(bv)=(ab)va(b\mathbf{v}) = (ab)\mathbf{v}.
  6. 1v=v1\mathbf{v} = \mathbf{v}.
  7. a(u+v)=au+ava(\mathbf{u} + \mathbf{v}) = a\mathbf{u} + a\mathbf{v}.
  8. (a+b)v=av+bv(a + b)\mathbf{v} = a\mathbf{v} + b\mathbf{v}.

The elements of VV are called vectors, whatever they actually are.

First consequences

Proposition. In any vector space: (a) the zero vector is unique; (b) each v\mathbf{v} has exactly one additive inverse, written −v-\mathbf{v}; (c) 0v=00\mathbf{v} = \mathbf{0}; (d) a0=0a\mathbf{0} = \mathbf{0}; (e) (−1)v=−v(-1)\mathbf{v} = -\mathbf{v}.

Proof. (a) If 0\mathbf{0} and 0′\mathbf{0}' are both identities, 0=0+0′=0′\mathbf{0} = \mathbf{0} + \mathbf{0}' = \mathbf{0}'. (b) If w,w′\mathbf{w}, \mathbf{w}' are both inverses of v\mathbf{v}, then w=w+(v+w′)=(w+v)+w′=w′\mathbf{w} = \mathbf{w} + (\mathbf{v} + \mathbf{w}') = (\mathbf{w} + \mathbf{v}) + \mathbf{w}' = \mathbf{w}'. (c) 0v=(0+0)v=0v+0v0\mathbf{v} = (0 + 0)\mathbf{v} = 0\mathbf{v} + 0\mathbf{v}; add −(0v)-(0\mathbf{v}) to both sides. (d) The same with a0=a(0+0)a\mathbf{0} = a(\mathbf{0} + \mathbf{0}). (e) v+(−1)v=(1+(−1))v=0v=0\mathbf{v} + (-1)\mathbf{v} = (1 + (-1))\mathbf{v} = 0\mathbf{v} = \mathbf{0}, so (−1)v(-1)\mathbf{v} is the inverse of v\mathbf{v}, by (b). ■\blacksquare

Examples

Space Vectors Operations
FnF^n columns (x1,…,xn)(x_1, \dots, x_n) entry by entry
Pn(F)\mathcal{P}_n(F) polynomials of degree at most nn add coefficients; scale coefficients
P(F)\mathcal{P}(F) all polynomials same
FSF^S all functions f:S→Ff : S \to F on a set SS (f+g)(s)=f(s)+g(s)(f + g)(s) = f(s) + g(s), (af)(s)=af(s)(af)(s) = a f(s)
C[a,b]C[a, b] continuous real functions on [a,b][a, b] pointwise
Mm×n(F)M_{m \times n}(F) m×nm \times n matrices entry by entry

FnF^n is really the special case FSF^S with S={1,…,n}S = \{1, \dots, n\}: a column is a function from positions to numbers.

Non-examples. The first quadrant {(x,y):x,y≥0}\{(x, y) : x, y \ge 0\} fails axiom 4 — (1,0)(1, 0) has no inverse inside it. The line {(x,y):y=x+1}\{(x, y) : y = x + 1\} has no zero vector. The polynomials of degree exactly 2 are not closed under addition: (t2+t)+(−t2)=t(t^2 + t) + (-t^2) = t.


Chapter 2 — Subspaces

Terminology

  • Subspace — a subset U⊆VU \subseteq V that is itself a vector space with the same addition and scalar multiplication.

Theorem (subspace test). A subset UU of a vector space VV is a subspace if and only if

  1. 0∈U\mathbf{0} \in U;
  2. u,w∈U⇒u+w∈U\mathbf{u}, \mathbf{w} \in U \Rightarrow \mathbf{u} + \mathbf{w} \in U (closed under addition);
  3. a∈Fa \in F, u∈U⇒au∈U\mathbf{u} \in U \Rightarrow a\mathbf{u} \in U (closed under scalar multiplication).

Proof. A subspace clearly satisfies 2 and 3, and it contains its own zero vector z\mathbf{z} with z+z=z\mathbf{z} + \mathbf{z} = \mathbf{z}; adding −z-\mathbf{z} in VV shows z=0\mathbf{z} = \mathbf{0}, so 1 holds. Conversely, suppose 1–3 hold. Conditions 2 and 3 make addition and scalar multiplication land in UU. Axioms 1, 2, 5–8 are identities that hold for all vectors of VV, so in particular for those of UU. Axiom 3 holds by condition 1. For axiom 4: if u∈U\mathbf{u} \in U then −u=(−1)u∈U-\mathbf{u} = (-1)\mathbf{u} \in U by condition 3 and part (e) of the proposition. ■\blacksquare

Trick: conditions 2 and 3 together are the same as "closed under linear combinations": au+bw∈Ua\mathbf{u} + b\mathbf{w} \in U for all u,w∈U\mathbf{u}, \mathbf{w} \in U and scalars a,ba, b. Check 0\mathbf{0} first — it is the fastest way to reject a non-subspace.

Examples and non-examples

  • Null space N(A)={x∈Fn:Ax=0}N(A) = \{\mathbf{x} \in F^n : A\mathbf{x} = \mathbf{0}\} is a subspace of FnF^n: A0=0A\mathbf{0} = \mathbf{0}, and A(au+bw)=aAu+bAw=0A(a\mathbf{u} + b\mathbf{w}) = aA\mathbf{u} + bA\mathbf{w} = \mathbf{0}.
  • Column space C(A)={Ax:x∈Fn}C(A) = \{A\mathbf{x} : \mathbf{x} \in F^n\}, the span of the columns, is a subspace of FmF^m.
  • {p∈P2(R):p(1)=0}\{p \in \mathcal{P}_2(\mathbb{R}) : p(1) = 0\} is a subspace; {p:p(1)=5}\{p : p(1) = 5\} is not (no zero polynomial).
  • The symmetric n×nn \times n matrices form a subspace of Mn×nM_{n \times n}.
  • The solutions yy of y′′+y=0y'' + y = 0 form a subspace of the twice-differentiable functions R→R\mathbb{R} \to \mathbb{R}.
  • The solutions of Ax=bA\mathbf{x} = \mathbf{b} with b≠0\mathbf{b} \neq \mathbf{0} are not a subspace (Linear Algebra 00, Chapter 7): 0\mathbf{0} is not a solution.
  • The union of the xx-axis and the yy-axis in R2\mathbb{R}^2 is not a subspace: (1,0)+(0,1)=(1,1)(1, 0) + (0, 1) = (1, 1) is in neither.

Intersections are subspaces. If UU and WW are subspaces, so is U∩WU \cap W: it contains 0\mathbf{0}, 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 U+WU + W.


Chapter 3 — Span and linear independence in general

The definitions from Linear Algebra 00 carry over unchanged. For a finite list v1,…,vk\mathbf{v}_1, \dots, \mathbf{v}_k in VV:

  • span⁡(v1,…,vk)\operatorname{span}(\mathbf{v}_1, \dots, \mathbf{v}_k) is the set of all linear combinations a1v1+⋯+akvka_1\mathbf{v}_1 + \dots + a_k\mathbf{v}_k. By convention the span of the empty list is {0}\{\mathbf{0}\}.
  • The list spans VV if its span is all of VV.
  • The list is linearly independent if a1v1+⋯+akvk=0a_1\mathbf{v}_1 + \dots + a_k\mathbf{v}_k = \mathbf{0} forces a1=⋯=ak=0a_1 = \dots = a_k = 0; otherwise it is dependent. The empty list is independent.

Proposition. span⁡(v1,…,vk)\operatorname{span}(\mathbf{v}_1, \dots, \mathbf{v}_k) is the smallest subspace of VV containing every vi\mathbf{v}_i.

Proof. It contains 0\mathbf{0}, and a combination of combinations is a combination, so it is a subspace; it contains each vi\mathbf{v}_i. Any subspace containing all vi\mathbf{v}_i is closed under linear combinations, so it contains the span. ■\blacksquare

The linear dependence lemma

Lemma. If v1,…,vm\mathbf{v}_1, \dots, \mathbf{v}_m is linearly dependent, then there is an index jj such that

  1. vj∈span⁡(v1,…,vj−1)\mathbf{v}_j \in \operatorname{span}(\mathbf{v}_1, \dots, \mathbf{v}_{j-1}), and
  2. removing vj\mathbf{v}_j from the list does not change its span.

Proof. Take a relation a1v1+⋯+amvm=0a_1\mathbf{v}_1 + \dots + a_m\mathbf{v}_m = \mathbf{0} with not all ai=0a_i = 0, and let jj be the largest index with aj≠0a_j \neq 0. Then

vj=−a1ajv1−⋯−aj−1ajvj−1,\mathbf{v}_j = -\frac{a_1}{a_j}\mathbf{v}_1 - \dots - \frac{a_{j-1}}{a_j}\mathbf{v}_{j-1},

which proves 1. (If j=1j = 1 this says v1=0\mathbf{v}_1 = \mathbf{0}, the span of the empty list.) For 2, in any combination of the full list, replace vj\mathbf{v}_j by the right-hand side above; the result is a combination of the list without vj\mathbf{v}_j. ■\blacksquare

Independence outside Fⁿ

  • In P2(R)\mathcal{P}_2(\mathbb{R}), the list 1,t,t21, t, t^2 is independent: if a+bt+ct2a + bt + ct^2 is the zero polynomial, all its coefficients are 0.
  • In the functions R→R\mathbb{R} \to \mathbb{R}, sin⁡\sin and cos⁡\cos are independent: if asin⁡x+bcos⁡x=0a\sin x + b\cos x = 0 for all xx, then x=0x = 0 gives b=0b = 0 and x=π/2x = \pi/2 gives a=0a = 0.

Common pitfall: "asin⁡x+bcos⁡x=0a\sin x + b\cos x = 0" means equality as functions, for every xx. Finding one xx 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 VV — a list of vectors in VV that is linearly independent and spans VV.
  • Finite-dimensional — VV is spanned by some finite list. Otherwise infinite-dimensional.
  • Standard basis of FnF^n — e1,…,en\mathbf{e}_1, \dots, \mathbf{e}_n. Of Pn(F)\mathcal{P}_n(F) — 1,t,…,tn1, t, \dots, t^n.

Theorem (unique representation). A list v1,…,vn\mathbf{v}_1, \dots, \mathbf{v}_n is a basis of VV if and only if every v∈V\mathbf{v} \in V can be written as a1v1+⋯+anvna_1\mathbf{v}_1 + \dots + a_n\mathbf{v}_n in exactly one way.

Proof. Spanning is "at least one way". If a basis gave two ways, subtracting them gives ∑(ai−bi)vi=0\sum (a_i - b_i)\mathbf{v}_i = \mathbf{0}, so every ai=bia_i = b_i by independence. Conversely, uniqueness for v=0\mathbf{v} = \mathbf{0} (which is 0v1+⋯+0vn0\mathbf{v}_1 + \dots + 0\mathbf{v}_n) is exactly independence. ■\blacksquare

The Steinitz exchange lemma

Lemma (Steinitz exchange). Let VV be a vector space. Suppose u1,…,um\mathbf{u}_1, \dots, \mathbf{u}_m is linearly independent in VV and w1,…,wn\mathbf{w}_1, \dots, \mathbf{w}_n spans VV. Then m≤nm \le n. Moreover, after renumbering the w\mathbf{w}'s, the list

u1,…,um,wm+1,…,wn\mathbf{u}_1, \dots, \mathbf{u}_m, \mathbf{w}_{m+1}, \dots, \mathbf{w}_n

also spans VV.

Proof. We show by induction on k=0,1,…,mk = 0, 1, \dots, m that k≤nk \le n and that, after renumbering, u1,…,uk,wk+1,…,wn\mathbf{u}_1, \dots, \mathbf{u}_k, \mathbf{w}_{k+1}, \dots, \mathbf{w}_n spans VV. For k=0k = 0 this is the hypothesis.

Assume it holds for some k<mk < m. Since the list u1,…,uk,wk+1,…,wn\mathbf{u}_1, \dots, \mathbf{u}_k, \mathbf{w}_{k+1}, \dots, \mathbf{w}_n spans VV, we can write

uk+1=a1u1+⋯+akuk+bk+1wk+1+⋯+bnwn.\mathbf{u}_{k+1} = a_1\mathbf{u}_1 + \dots + a_k\mathbf{u}_k + b_{k+1}\mathbf{w}_{k+1} + \dots + b_n\mathbf{w}_n.

If every bjb_j were 0 (in particular, if no w\mathbf{w}'s were left, k=nk = n), then uk+1\mathbf{u}_{k+1} would be a combination of u1,…,uk\mathbf{u}_1, \dots, \mathbf{u}_k, contradicting independence of the u\mathbf{u}'s. So some bj≠0b_j \neq 0; hence k+1≤nk + 1 \le n. Renumber so that bk+1≠0b_{k+1} \neq 0 and solve for wk+1\mathbf{w}_{k+1}:

wk+1=1bk+1(uk+1−∑i=1kaiui−∑j=k+2nbjwj).\mathbf{w}_{k+1} = \frac{1}{b_{k+1}}\Bigl(\mathbf{u}_{k+1} - \sum_{i=1}^{k} a_i\mathbf{u}_i - \sum_{j=k+2}^{n} b_j\mathbf{w}_j\Bigr).

So wk+1\mathbf{w}_{k+1} lies in the span of u1,…,uk+1,wk+2,…,wn\mathbf{u}_1, \dots, \mathbf{u}_{k+1}, \mathbf{w}_{k+2}, \dots, \mathbf{w}_n. That span therefore contains the whole old spanning list, so it is VV. This completes the step. At k=mk = m we get m≤nm \le n and the stated spanning list. ■\blacksquare

Small example. In R3\mathbb{R}^3 take the independent u1=(1,1,0)\mathbf{u}_1 = (1, 1, 0), u2=(0,1,1)\mathbf{u}_2 = (0, 1, 1) and the spanning e1,e2,e3\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3. Since u1=e1+e2\mathbf{u}_1 = \mathbf{e}_1 + \mathbf{e}_2 has a nonzero coefficient on e1\mathbf{e}_1, swap it out: u1,e2,e3\mathbf{u}_1, \mathbf{e}_2, \mathbf{e}_3 spans. Then u2=0 u1+e2+e3\mathbf{u}_2 = 0\,\mathbf{u}_1 + \mathbf{e}_2 + \mathbf{e}_3; swap out e2\mathbf{e}_2: u1,u2,e3\mathbf{u}_1, \mathbf{u}_2, \mathbf{e}_3 spans R3\mathbb{R}^3. (Three vectors that span R3\mathbb{R}^3 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 B1B_1 and B2B_2 be bases, of lengths mm and nn. B1B_1 is independent and B2B_2 spans, so m≤nm \le n by Steinitz. Swap roles: n≤mn \le m. ■\blacksquare

This common length is the dimension dim⁡V\dim V.

Space Dimension A basis
{0}\{\mathbf{0}\} 0 the empty list
FnF^n nn e1,…,en\mathbf{e}_1, \dots, \mathbf{e}_n
Pn(F)\mathcal{P}_n(F) n+1n + 1 1,t,…,tn1, t, \dots, t^n
Mm×n(F)M_{m \times n}(F) mnmn matrices with one entry 1, the rest 0
symmetric 2×22 \times 2 3 one basis matrix each for the (1,1), (2,2) and paired off-diagonal entries
P(F)\mathcal{P}(F) infinite 1,t,t2,…1, t, t^2, \dots (no finite list spans)

Watch out: Cn\mathbb{C}^n has dimension nn over C\mathbb{C} but 2n2n over R\mathbb{R} (a basis over R\mathbb{R} is e1,ie1,…,en,ien\mathbf{e}_1, i\mathbf{e}_1, \dots, \mathbf{e}_n, i\mathbf{e}_n). Dimension depends on the field of scalars.

Growing and shrinking to a basis

Theorem. Let VV be finite-dimensional with dim⁡V=n\dim V = n.

  1. Every spanning list can be shrunk to a basis by removing vectors.
  2. Every independent list can be extended to a basis by adding vectors.
  3. Any nn independent vectors form a basis; any nn spanning vectors form a basis.
  4. Every subspace UU is finite-dimensional with dim⁡U≤n\dim U \le n, and dim⁡U=n\dim U = n only if U=VU = V.

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 n−mn - m basis vectors spans VV; it has length nn, and by (1) some sublist is a basis, which must have length nn, so it is the whole list. (3) An independent list of length nn extends to a basis of length nn, so nothing is added; a spanning list of length nn shrinks to a basis of length nn, so nothing is removed. (4) Any independent list in UU is independent in VV, so it has length at most nn by Steinitz. Keep adding vectors of UU not yet in the span of an independent list (independence is kept, by Exercise 7); this stops after at most nn steps with a basis of UU. If dim⁡U=n\dim U = n, that basis is nn independent vectors of VV, so by (3) it spans VV, hence U=VU = V. ■\blacksquare


Chapter 5 — Coordinates

If B=(v1,…,vn)B = (\mathbf{v}_1, \dots, \mathbf{v}_n) is a basis of VV, each v\mathbf{v} has unique weights with v=a1v1+⋯+anvn\mathbf{v} = a_1\mathbf{v}_1 + \dots + a_n\mathbf{v}_n. The column [v]B=(a1,…,an)∈Fn[\mathbf{v}]_B = (a_1, \dots, a_n) \in F^n is the coordinate vector of v\mathbf{v} relative to BB.

The map v↦[v]B\mathbf{v} \mapsto [\mathbf{v}]_B is one-to-one, onto FnF^n, and respects linear combinations: [au+bw]B=a[u]B+b[w]B[a\mathbf{u} + b\mathbf{w}]_B = a[\mathbf{u}]_B + b[\mathbf{w}]_B. So every nn-dimensional space over FF behaves exactly like FnF^n, 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 R2\mathbb{R}^2. With B=((1,1),(1,−1))B = ((1, 1), (1, -1)) and x=(3,1)\mathbf{x} = (3, 1): solve a(1,1)+b(1,−1)=(3,1)a(1,1) + b(1,-1) = (3, 1), so a+b=3a + b = 3, a−b=1a - b = 1, giving a=2a = 2, b=1b = 1. So [x]B=(2,1)[\mathbf{x}]_B = (2, 1), while the standard coordinates are (3,1)(3, 1) — same vector, different description.

Example in P2(R)\mathcal{P}_2(\mathbb{R}). With B=(1, 1+t, (1+t)2)B = (1,\ 1 + t,\ (1 + t)^2), find [t2]B[t^2]_B. Put s=1+ts = 1 + t; then t=s−1t = s - 1 and t2=s2−2s+1t^2 = s^2 - 2s + 1. So

t2=1⋅(1+t)2−2(1+t)+1⋅1,[t2]B=(1,−2,1)t^2 = 1 \cdot (1 + t)^2 - 2(1 + t) + 1 \cdot 1, \qquad [t^2]_B = (1, -2, 1)

(the weights on 11, 1+t1 + t and (1+t)2(1 + t)^2, in that order). Check: (1+2t+t2)−2−2t+1=t2(1 + 2t + t^2) - 2 - 2t + 1 = t^2.


Chapter 6 — The four fundamental subspaces

Terminology

For an m×nm \times n matrix AA of rank rr (the number of pivots):

Subspace Symbol Lives in Definition
Column space C(A)C(A) FmF^m all AxA\mathbf{x}; span of the columns
Null space N(A)N(A) FnF^n all x\mathbf{x} with Ax=0A\mathbf{x} = \mathbf{0}
Row space C(AT)C(A^T) FnF^n span of the rows
Left null space N(AT)N(A^T) FmF^m all y\mathbf{y} with ATy=0A^T\mathbf{y} = \mathbf{0}, that is yTA=0T\mathbf{y}^TA = \mathbf{0}^T

Two facts about row operations

Let EA=REA = R with EE invertible (a product of elementary matrices) and RR the RREF.

Fact 1 — the row space does not change. Every row of RR is a combination of rows of AA, and since A=E−1RA = E^{-1}R, every row of AA is a combination of rows of RR. So C(AT)=C(RT)C(A^T) = C(R^T).

Fact 2 — linear relations among columns do not change. Ax=0  ⟺  EAx=0  ⟺  Rx=0A\mathbf{x} = \mathbf{0} \iff EA\mathbf{x} = \mathbf{0} \iff R\mathbf{x} = \mathbf{0}, because EE is invertible. So a combination of columns of AA is zero exactly when the same combination of columns of RR is zero, and N(A)=N(R)N(A) = N(R). (The column spaces of AA and RR usually differ.)

Bases from the RREF

  • C(A)C(A) — the pivot columns of AA (not of RR). In RR 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 AA.
  • C(AT)C(A^T) — the nonzero rows of RR. 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.
  • N(A)N(A) — the n−rn - r special solutions (one free variable 1, the others 0), as in Linear Algebra 00.
  • N(AT)N(A^T) — the last m−rm - r rows of EE: those rows multiply AA to give the zero rows of RR.

Worked example

Use the matrix from Linear Algebra 00, Chapter 6:

A=(1222246836810),R=(120−200120000),m=3, n=4, r=2.A = \begin{pmatrix} 1 & 2 & 2 & 2 \\ 2 & 4 & 6 & 8 \\ 3 & 6 & 8 & 10 \end{pmatrix}, \qquad R = \begin{pmatrix} 1 & 2 & 0 & -2 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 0 \end{pmatrix}, \qquad m = 3,\ n = 4,\ r = 2.

Pivot columns 1 and 3; free variables x2,x4x_2, x_4.

  • Column space (dimension r=2r = 2, in R3\mathbb{R}^3): basis (1,2,3)(1, 2, 3) and (2,6,8)(2, 6, 8) — columns 1 and 3 of AA. The other columns satisfy the same relations as in RR: column 2 =2×= 2 \times column 1, and column 4 =−2×= -2 \times column 1 +2×+ 2 \times column 3. Check: −2(1,2,3)+2(2,6,8)=(2,8,10)-2(1,2,3) + 2(2,6,8) = (2, 8, 10).
  • Row space (dimension r=2r = 2, in R4\mathbb{R}^4): basis (1,2,0,−2)(1, 2, 0, -2) and (0,0,1,2)(0, 0, 1, 2).
  • Null space (dimension n−r=2n - r = 2, in R4\mathbb{R}^4): basis s1=(−2,1,0,0)\mathbf{s}_1 = (-2, 1, 0, 0) and s2=(2,0,−2,1)\mathbf{s}_2 = (2, 0, -2, 1).
  • Left null space (dimension m−r=1m - r = 1, in R3\mathbb{R}^3): the elimination steps R2−2R1R_2 - 2R_1, R3−3R1R_3 - 3R_1, R3−R2R_3 - R_2 make row 3 into −(row 1)−(row 2)+(row 3)=0-(\text{row } 1) - (\text{row } 2) + (\text{row } 3) = \mathbf{0}. So y=(−1,−1,1)\mathbf{y} = (-1, -1, 1) is a basis: yTA=0T\mathbf{y}^TA = \mathbf{0}^T.

The four fundamental subspaces of the 3 by 4 example: in R^4 the row space (dimension 2) and the null space (dimension 2) meet at right angles; in R^3 the column space (dimension 2) and the left null space (dimension 1) meet at right angles; A maps the row space onto the column space and the null space to zero

Orthogonality — a preview

Each row of AA dotted with a null-space vector gives 0 — that is what Ax=0A\mathbf{x} = \mathbf{0} says, one row at a time. So every vector of N(A)N(A) is orthogonal to every vector of C(AT)C(A^T). In the example, (1,2,0,−2)⋅(−2,1,0,0)=0(1, 2, 0, -2)\cdot(-2, 1, 0, 0) = 0, (1,2,0,−2)⋅(2,0,−2,1)=0(1, 2, 0, -2)\cdot(2, 0, -2, 1) = 0, (0,0,1,2)⋅(−2,1,0,0)=0(0, 0, 1, 2)\cdot(-2, 1, 0, 0) = 0 and (0,0,1,2)⋅(2,0,−2,1)=0(0, 0, 1, 2)\cdot(2, 0, -2, 1) = 0. In the same way N(AT)N(A^T) is orthogonal to C(A)C(A): (−1,−1,1)⋅(1,2,3)=0(-1, -1, 1)\cdot(1, 2, 3) = 0 and (−1,−1,1)⋅(2,6,8)=0(-1, -1, 1)\cdot(2, 6, 8) = 0. Over R\mathbb{R} the dimensions add up (2+2=42 + 2 = 4, 2+1=32 + 1 = 3), which makes each pair orthogonal complements — proved in Linear Algebra 05.

Row rank equals column rank

Theorem. For every matrix, dim⁡C(A)=dim⁡C(AT)=r\dim C(A) = \dim C(A^T) = r, the number of pivots.

Proof. The pivot columns of AA are a basis of C(A)C(A), and there are rr of them. The nonzero rows of RR are a basis of C(AT)C(A^T), and there are rr of them (one per pivot). ■\blacksquare

This is not obvious: for a 3×1003 \times 100 matrix it says that the 100 columns span a space of the same dimension as the 3 rows. It also shows rank⁡A=rank⁡AT\operatorname{rank} A = \operatorname{rank} A^T, and that r≤min⁡(m,n)r \le \min(m, n).

Rank-one matrices. A matrix has rank 1 exactly when it is a nonzero column times a nonzero row, A=uvTA = \mathbf{u}\mathbf{v}^T: every column is a multiple of u\mathbf{u}, every row a multiple of vT\mathbf{v}^T. The outer-product view of Linear Algebra 01 writes any ABAB as a sum of such pieces.


Chapter 7 — Rank–nullity (matrix form)

Theorem (rank–nullity). For an m×nm \times n matrix AA,

dim⁡C(A)+dim⁡N(A)=n.\dim C(A) + \dim N(A) = n.

Proof. Let rr be the number of pivots. dim⁡C(A)=r\dim C(A) = r by Chapter 6. It remains to show that the n−rn - r special solutions s1,…,sn−r\mathbf{s}_1, \dots, \mathbf{s}_{n-r} are a basis of N(A)N(A).

Independent: look only at the free-variable entries. In sk\mathbf{s}_k the kk-th free variable is 1 and the others are 0. So in ∑cksk\sum c_k\mathbf{s}_k the kk-th free entry is ckc_k; if the sum is 0\mathbf{0}, every ck=0c_k = 0.

Spanning: let x∈N(A)\mathbf{x} \in N(A) with free-variable values f1,…,fn−rf_1, \dots, f_{n-r}. Then z=x−∑fksk\mathbf{z} = \mathbf{x} - \sum f_k\mathbf{s}_k is in N(A)N(A) 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 z\mathbf{z} are 0 too; thus z=0\mathbf{z} = \mathbf{0} and x=∑fksk\mathbf{x} = \sum f_k\mathbf{s}_k.

So dim⁡N(A)=n−r\dim N(A) = n - r, and r+(n−r)=nr + (n - r) = n. ■\blacksquare

In words: each of the nn 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, 2+2=42 + 2 = 4. Applied to ATA^T (which has mm columns and the same rank), it gives dim⁡N(AT)=m−r\dim N(A^T) = m - r, here 3−2=13 - 2 = 1.

The general version — for a linear map T:V→WT : V \to W, dim⁡V=dim⁡im⁡T+dim⁡ker⁡T\dim V = \dim \operatorname{im} T + \dim \ker T — is proved in Linear Algebra 03.

Consequences

Condition on the rank Meaning for Ax=bA\mathbf{x} = \mathbf{b}
r=mr = m (full row rank) solvable for every b\mathbf{b}; C(A)=FmC(A) = F^m
r=nr = n (full column rank) at most one solution; N(A)={0}N(A) = \{\mathbf{0}\}
r=m=nr = m = n exactly one solution; AA invertible
r<mr < m and r<nr < n either no solution or infinitely many

For a square matrix, "rank nn", "N(A)={0}N(A) = \{\mathbf{0}\}" and "C(A)=FnC(A) = F^n" join the invertible matrix theorem from Linear Algebra 01.

Trick: rank–nullity is a quick sanity check. A 5×75 \times 7 matrix has rank at most 5, so its null space has dimension at least 7−5=27 - 5 = 2 — there are nonzero solutions of Ax=0A\mathbf{x} = \mathbf{0} before any computation.


Chapter 8 — Sums and direct sums

Terminology

  • Sum of subspaces U,W⊆VU, W \subseteq V: U+W={u+w:u∈U,w∈W}U + W = \{\mathbf{u} + \mathbf{w} : \mathbf{u} \in U, \mathbf{w} \in W\}. It is the smallest subspace containing both (a subspace containing UU and WW contains all such sums).
  • Direct sum — the sum is direct, written U⊕WU \oplus W, if every vector of U+WU + W can be written as u+w\mathbf{u} + \mathbf{w} in only one way.

Proposition. U+WU + W is direct if and only if U∩W={0}U \cap W = \{\mathbf{0}\}.

Proof. Suppose the sum is direct and v∈U∩W\mathbf{v} \in U \cap W. Then 0=v+(−v)\mathbf{0} = \mathbf{v} + (-\mathbf{v}) with v∈U\mathbf{v} \in U, −v∈W-\mathbf{v} \in W, and also 0=0+0\mathbf{0} = \mathbf{0} + \mathbf{0}; uniqueness gives v=0\mathbf{v} = \mathbf{0}. Conversely, if U∩W={0}U \cap W = \{\mathbf{0}\} and u+w=u′+w′\mathbf{u} + \mathbf{w} = \mathbf{u}' + \mathbf{w}', then u−u′=w′−w\mathbf{u} - \mathbf{u}' = \mathbf{w}' - \mathbf{w} lies in both UU and WW, so it is 0\mathbf{0}. ■\blacksquare

Watch out: for three or more subspaces, pairwise zero intersections are not enough. Three distinct lines through the origin in R2\mathbb{R}^2 meet pairwise only at 0\mathbf{0}, but their sum is not direct (three vectors in R2\mathbb{R}^2 are dependent).

The dimension formula

Theorem. If UU and WW are finite-dimensional subspaces of VV, then

dim⁡(U+W)=dim⁡U+dim⁡W−dim⁡(U∩W).\dim(U + W) = \dim U + \dim W - \dim(U \cap W).

Proof. Let z1,…,zk\mathbf{z}_1, \dots, \mathbf{z}_k be a basis of U∩WU \cap W. Extend it to a basis z1,…,zk,u1,…,up\mathbf{z}_1, \dots, \mathbf{z}_k, \mathbf{u}_1, \dots, \mathbf{u}_p of UU and to a basis z1,…,zk,w1,…,wq\mathbf{z}_1, \dots, \mathbf{z}_k, \mathbf{w}_1, \dots, \mathbf{w}_q of WW (Chapter 4). The combined list z1,…,zk,u1,…,up,w1,…,wq\mathbf{z}_1, \dots, \mathbf{z}_k, \mathbf{u}_1, \dots, \mathbf{u}_p, \mathbf{w}_1, \dots, \mathbf{w}_q clearly spans U+WU + W. For independence, suppose

∑aizi+∑bjuj+∑clwl=0.\sum a_i\mathbf{z}_i + \sum b_j\mathbf{u}_j + \sum c_l\mathbf{w}_l = \mathbf{0}.

Then ∑clwl=−∑aizi−∑bjuj\sum c_l\mathbf{w}_l = -\sum a_i\mathbf{z}_i - \sum b_j\mathbf{u}_j lies in WW and in UU, hence in U∩WU \cap W, so ∑clwl=∑dizi\sum c_l\mathbf{w}_l = \sum d_i\mathbf{z}_i for some did_i. The z\mathbf{z}'s and w\mathbf{w}'s together are a basis of WW, so all cl=0c_l = 0 (and all di=0d_i = 0). Now ∑aizi+∑bjuj=0\sum a_i\mathbf{z}_i + \sum b_j\mathbf{u}_j = \mathbf{0} is a relation in a basis of UU, so all ai,bj=0a_i, b_j = 0. Hence the combined list is a basis, and

dim⁡(U+W)=k+p+q=(k+p)+(k+q)−k.■\dim(U + W) = k + p + q = (k + p) + (k + q) - k. \qquad \blacksquare

This is the same shape as ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣\lvert A \cup B\rvert = \lvert A\rvert + \lvert B\rvert - \lvert A \cap B\rvert for finite sets.

Examples

  • In R3\mathbb{R}^3, let U=span⁡(e1,e2)U = \operatorname{span}(\mathbf{e}_1, \mathbf{e}_2) (the xyxy-plane) and W=span⁡(e2,e3)W = \operatorname{span}(\mathbf{e}_2, \mathbf{e}_3) (the yzyz-plane). Then U∩W=span⁡(e2)U \cap W = \operatorname{span}(\mathbf{e}_2) and dim⁡(U+W)=2+2−1=3\dim(U + W) = 2 + 2 - 1 = 3, so U+W=R3U + W = \mathbb{R}^3, but the sum is not direct.
  • The plane P={x:x1+x2+x3=0}P = \{\mathbf{x} : x_1 + x_2 + x_3 = 0\} and the line L=span⁡(1,1,1)L = \operatorname{span}(1, 1, 1) satisfy P∩L={0}P \cap L = \{\mathbf{0}\} (a point (c,c,c)(c, c, c) with 3c=03c = 0), so dim⁡(P+L)=2+1=3\dim(P + L) = 2 + 1 = 3 and R3=P⊕L\mathbb{R}^3 = P \oplus L. For example (1,2,3)=(−1,0,1)+(2,2,2)(1, 2, 3) = (-1, 0, 1) + (2, 2, 2).
  • Every square matrix splits uniquely into symmetric plus skew-symmetric parts, M=12(M+MT)+12(M−MT)M = \tfrac12(M + M^T) + \tfrac12(M - M^T), so over R\mathbb{R} or C\mathbb{C} (any field where 2≠02 \neq 0), Mn×n=Sym⊕SkewM_{n \times n} = \text{Sym} \oplus \text{Skew}. For M=(1243)M = \begin{pmatrix} 1 & 2 \\ 4 & 3 \end{pmatrix} the parts are (1333)\begin{pmatrix} 1 & 3 \\ 3 & 3 \end{pmatrix} and (0−110)\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}.
  • For a real m×nm \times n matrix, Rn=C(AT)⊕N(A)\mathbb{R}^n = C(A^T) \oplus N(A). The intersection is {0}\{\mathbf{0}\}, because a vector in both is orthogonal to itself, and x⋅x=0\mathbf{x}\cdot\mathbf{x} = 0 forces x=0\mathbf{x} = \mathbf{0}; the dimensions add to r+(n−r)=nr + (n - r) = n. So every x∈Rn\mathbf{x} \in \mathbb{R}^n splits uniquely as x=xr+xn\mathbf{x} = \mathbf{x}_r + \mathbf{x}_n, a row-space part plus a null-space part — the left half of the four-subspace picture. Since Axn=0A\mathbf{x}_n = \mathbf{0}, Ax=AxrA\mathbf{x} = A\mathbf{x}_r: every b\mathbf{b} in C(A)C(A) is AxrA\mathbf{x}_r for a row-space vector xr\mathbf{x}_r, 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 U={p∈P2(R):p(1)=0}U = \{p \in \mathcal{P}_2(\mathbb{R}) : p(1) = 0\} is a subspace, and find a basis and its dimension.

Solution

The zero polynomial has p(1)=0p(1) = 0, and (ap+bq)(1)=ap(1)+bq(1)=0(ap + bq)(1) = ap(1) + bq(1) = 0, so UU is a subspace. p(t)=c0+c1t+c2t2p(t) = c_0 + c_1t + c_2t^2 is in UU iff c0+c1+c2=0c_0 + c_1 + c_2 = 0, i.e. c0=−c1−c2c_0 = -c_1 - c_2, so p=c1(t−1)+c2(t2−1)p = c_1(t - 1) + c_2(t^2 - 1). The list t−1t - 1, t2−1t^2 - 1 spans UU and is independent (only the second has a t2t^2 term), so dim⁡U=2\dim U = 2. This matches rank–nullity: UU is the null space of the map p↦p(1)p \mapsto p(1), and 3−1=23 - 1 = 2.

Exercise 2 — Not a subspace

Is {(x,y)∈R2:xy≥0}\{(x, y) \in \mathbb{R}^2 : xy \ge 0\} a subspace?

Solution

No. It contains 0\mathbf{0} and is closed under scalar multiplication ((cx)(cy)=c2xy≥0(cx)(cy) = c^2xy \ge 0), but not under addition: (1,0)+(0,−1)=(1,−1)(1, 0) + (0, -1) = (1, -1) has xy=−1<0xy = -1 < 0. It is the union of the first and third quadrants.

Exercise 3 — Shrink to a basis

Find a basis for span⁡{(1,2,1),(2,4,2),(1,0,1),(0,1,0)}\operatorname{span}\{(1, 2, 1), (2, 4, 2), (1, 0, 1), (0, 1, 0)\} taken from the given vectors, and its dimension.

Solution

Put them as columns and row reduce: (121024011210)→(1201/2001−1/20000)\begin{pmatrix} 1 & 2 & 1 & 0 \\ 2 & 4 & 0 & 1 \\ 1 & 2 & 1 & 0 \end{pmatrix} \to \begin{pmatrix} 1 & 2 & 0 & 1/2 \\ 0 & 0 & 1 & -1/2 \\ 0 & 0 & 0 & 0 \end{pmatrix}. Pivot columns 1 and 3, so (1,2,1)(1, 2, 1) and (1,0,1)(1, 0, 1) are a basis and the dimension is 2. (All four vectors satisfy x1=x3x_1 = x_3, a plane.)

Exercise 4 — Four subspaces of a rank-one matrix

For B=(122436)B = \begin{pmatrix} 1 & 2 \\ 2 & 4 \\ 3 & 6 \end{pmatrix}, give bases and dimensions of all four subspaces.

Solution

m=3m = 3, n=2n = 2, r=1r = 1 (B=(1,2,3)T(1,2)B = (1, 2, 3)^T(1, 2)). C(B)C(B): (1,2,3)(1, 2, 3), dimension 1. C(BT)C(B^T): (1,2)(1, 2), dimension 1. N(B)N(B): (−2,1)(-2, 1), dimension n−r=1n - r = 1. N(BT)N(B^T): solutions of y1+2y2+3y3=0y_1 + 2y_2 + 3y_3 = 0, basis (−2,1,0)(-2, 1, 0), (−3,0,1)(-3, 0, 1), dimension m−r=2m - r = 2. Check orthogonality: (1,2)⋅(−2,1)=0(1, 2)\cdot(-2, 1) = 0.

Exercise 5 — Coordinates

Find the coordinates of p(t)=2+3t+t2p(t) = 2 + 3t + t^2 relative to B=(1, 1+t, (1+t)2)B = (1,\ 1 + t,\ (1 + t)^2).

Solution

(1+t)2=1+2t+t2(1 + t)^2 = 1 + 2t + t^2, so p−(1+t)2=1+tp - (1 + t)^2 = 1 + t. Hence p=0⋅1+1⋅(1+t)+1⋅(1+t)2p = 0 \cdot 1 + 1 \cdot (1 + t) + 1 \cdot (1 + t)^2, and [p]B=(0,1,1)[p]_B = (0, 1, 1). Check: (1+t)+(1+2t+t2)=2+3t+t2(1 + t) + (1 + 2t + t^2) = 2 + 3t + t^2.

Exercise 6 — Forced intersection

Let UU and WW be 3-dimensional subspaces of R5\mathbb{R}^5. Prove that U∩W≠{0}U \cap W \neq \{\mathbf{0}\}.

Solution

U+W⊆R5U + W \subseteq \mathbb{R}^5, so dim⁡(U+W)≤5\dim(U + W) \le 5. The dimension formula gives dim⁡(U∩W)=3+3−dim⁡(U+W)≥6−5=1\dim(U \cap W) = 3 + 3 - \dim(U + W) \ge 6 - 5 = 1.

Exercise 7 — Proof practice

Prove that if v1,…,vm\mathbf{v}_1, \dots, \mathbf{v}_m is independent and v∉span⁡(v1,…,vm)\mathbf{v} \notin \operatorname{span}(\mathbf{v}_1, \dots, \mathbf{v}_m), then v1,…,vm,v\mathbf{v}_1, \dots, \mathbf{v}_m, \mathbf{v} is independent.

Solution

Suppose a1v1+⋯+amvm+av=0a_1\mathbf{v}_1 + \dots + a_m\mathbf{v}_m + a\mathbf{v} = \mathbf{0}. If a≠0a \neq 0, then v=−1a∑aivi\mathbf{v} = -\frac1a\sum a_i\mathbf{v}_i is in the span — a contradiction. So a=0a = 0, and then all ai=0a_i = 0 by independence of the vi\mathbf{v}_i. (This is the step used in Chapter 4, part 4.)


Cheat-sheet

Idea Key fact
Vector space 8 axioms over a field FF; 0v=00\mathbf{v} = \mathbf{0}, (−1)v=−v(-1)\mathbf{v} = -\mathbf{v}
Subspace test contains 0\mathbf{0}; closed under ++ and scalars
Span smallest subspace containing the list
Dependence lemma some vj\mathbf{v}_j is in the span of the earlier ones and can be removed
Basis independent + spanning; unique coordinates
Steinitz independent length ≤\le spanning length
Dimension length of any basis; dim⁡Pn=n+1\dim \mathcal{P}_n = n + 1, dim⁡Mm×n=mn\dim M_{m \times n} = mn
In dim nn nn independent or nn spanning vectors form a basis
C(A)C(A) basis pivot columns of AA; dim rr
C(AT)C(A^T) basis nonzero rows of RR; dim rr
N(A)N(A) basis special solutions; dim n−rn - r
N(AT)N(A^T) basis last m−rm - r rows of EE in EA=REA = R
Rank row rank = column rank = number of pivots
Rank–nullity r+dim⁡N(A)=nr + \dim N(A) = n
Direct sum U∩W={0}U \cap W = \{\mathbf{0}\}   ⟺  \iff unique decomposition
Dimension formula dim⁡(U+W)=dim⁡U+dim⁡W−dim⁡(U∩W)\dim(U + W) = \dim U + \dim W - \dim(U \cap W)

What's next

Linear Algebra 03 moves from spaces to maps between them. A linear map T:V→WT : V \to W 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 Q−1APQ^{-1}AP (or P−1APP^{-1}AP for an operator). The post proves the full rank–nullity theorem for linear maps, defines isomorphism (why every nn-dimensional space "is" FnF^n), 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 Ax=0A\mathbf{x} = \mathbf{0} and Ax=bA\mathbf{x} = \mathbf{b}, independence, basis and dimension, the four fundamental subspaces.

Note: this post is in progress. Planned additions: quotient spaces V/UV/U and their dimension, a section on infinite-dimensional spaces (why P(F)\mathcal{P}(F) has a countable basis but C[0,1]C[0,1] is harder), and a worked example of the four subspaces over F2\mathbb{F}_2.