← Back to Linear Algebra

Basis, dimension, and vector spaces

A basis is a minimal set of building blocks for a space. The number of vectors in any basis, the dimension, measures how big the space is.

Vector spaces

A vector space is any set of objects that can be added and scaled while obeying the usual rules: closure, commutativity, associativity, a zero element, additive inverses, and distributive laws. Beyond R^n, examples include polynomials of degree at most n, m x n matrices, continuous functions, and solutions of linear differential equations. Linear algebra's results apply to all of them.

Subspaces

A subspace is a subset of a vector space that is itself a vector space: it contains the zero vector and is closed under addition and scalar multiplication. In R^3, the subspaces are the origin alone, lines through the origin, planes through the origin, and R^3 itself. A plane not through the origin is not a subspace, since it lacks the zero vector.

Basis

A basis of a vector space is a set of vectors that is linearly independent and spans the space. Every vector can then be written in exactly one way as a combination of basis vectors. The standard basis of R^n is e_1, ..., e_n; the polynomials of degree at most 2 have the basis 1, x, x^2. A space has many different bases.

Dimension

All bases of a given space contain the same number of vectors, called its dimension. R^n has dimension n; polynomials of degree at most 2 form a space of dimension 3; 2 x 2 matrices form a space of dimension 4. The zero space has dimension 0, and spaces such as all continuous functions are infinite-dimensional.

Coordinates

Given a basis \(B = \{\mathbf{b}_1, \dots, \mathbf{b}_n\}\), the coordinates of \(\mathbf{x}\) are the unique weights with \(\mathbf{x} = c_1\mathbf{b}_1 + \dots + c_n\mathbf{b}_n\), written \([\mathbf{x}]_B\). Coordinates turn any n-dimensional space into a copy of \(\mathbb{R}^n\): the polynomial \(2 - x + 5x^2\) has coordinates (2, -1, 5) in the basis 1, x, x^2. Changing basis changes coordinates, not the vector itself.

Useful theorems

In an n-dimensional space, any n independent vectors automatically form a basis, as do any n vectors that span; any independent set can be extended to a basis; any spanning set contains a basis; and any set with more than n vectors is dependent. These results save work: to show n vectors form a basis of R^n, checking independence alone is enough.

Why dimension matters

Dimension counts degrees of freedom: the number of independent directions or parameters. A plane through the origin in R^3 has dimension 2 because points on it need two coordinates. In data science, dimensionality reduction seeks lower-dimensional subspaces that capture most of the variation in high-dimensional data.

Worked example

Is \(\{(1, 1, 0), (0, 1, 1), (1, 0, 1)\}\) a basis of \(\mathbb{R}^3\)? Row reducing the matrix with these columns gives pivots in all three columns, since its determinant is \(1(1 - 0) - 0 + 1(1 - 0) = 2 \ne 0\). Three independent vectors in a 3-dimensional space form a basis. The coordinates of (2, 3, 1) solve \(c_1 + c_3 = 2\), \(c_1 + c_2 = 3\), \(c_2 + c_3 = 1\), giving \(c = (2, 1, 0)\).

Key takeaways

Vector spaces are sets closed under addition and scaling with the usual rules: R^n, polynomials, matrices, and functions. Subspaces contain zero and are closed under both operations; in R^3 they are the origin, lines and planes through the origin, and R^3. A basis is an independent spanning set, giving unique coordinates. Every basis of a space has the same size, its dimension: n for R^n, 3 for quadratics, 4 for 2 x 2 matrices. In dimension n, n independent vectors or n spanning vectors form a basis. Dimension counts degrees of freedom.

Flashcard

Vector space

Set closed under addition and scaling with the usual rules

R^n, polynomials.

Check your understanding

What is the dimension of the space of polynomials of degree at most 3?

← Previous lesson Next lesson →