Every basis for a given vector space has the same number of elements. This number — the dimension — is the single most important invariant of the space. It governs how many vectors can be independent, how large a spanning set must be, how subspaces nest inside one another, and whether two spaces are structurally identical.
Definition
The dimension of a vector space V, written dim(V), is the number of vectors in any basis for V.
This definition relies on a nontrivial fact: all bases for V have the same size. Without this guarantee, "the number of vectors in a basis" would depend on which basis was chosen, and the definition would be meaningless. The basis size theorem, proved in the next section, ensures that the count is intrinsic to the space itself.
By convention, the zero space {0} has dimension 0. Its only "basis" is the empty set, which contains no vectors, is vacuously independent, and spans {0} since the empty linear combination produces 0.
Dimension two, then dimension one
The count of vectors is the same in both pictures; the dimension is not. Above, two independent directions give a two-dimensional span. Below, the second vector repeats the first, the span is a line, and the dimension has dropped to one. Dimension counts directions that survive independence, which is why it cannot be read off the size of a list. Collapse and restore it on the span and independence explorer.
Every result later on this page is a consequence of that one distinction between counting vectors and counting directions.
Dimension Notation
Notation
Dimension Notation
An operator whose value depends on something the notation usually hides — the field you are counting over — plus a symbol for "no finite count" that is a label rather than a number, and the relation that lets one integer stand in for an entire space. All catalogued among the linear algebra symbols.
the dimension of V — over the field F, when it matters
An upright operator taking a space and returning a count, defined as ∣B∣ for any basis, per Definition above. The parentheses are optional — dimV is equally standard — and the subscript names the field of scalars, which most writing omits because it is fixed by context.
CasesOmitting the subscript is safe until two fields are in play, and then it is essential: C has dimension 1 over C and dimension 2 over R, so dimC(C)=1 while dimR(C)=2. The space has not changed — only what counts as a scalar.
Do not confuseA property of the set. Dimension belongs to the space together with its field, not to the underlying collection of vectors; a bare dim carries an unstated field, and two authors can write the same symbol for different numbers without either being wrong.
dim(V)=∞
V is infinite-dimensional
A label, not an arithmetic value: it records that no finite basis exists, which is the distinction Finite vs. Infinite Dimension below draws. The prose form "infinite-dimensional" is the more common spelling precisely because the equation invites reading ∞ as a number.
CasesWhere the size genuinely matters, the count is replaced by a cardinal — the dimension of a space with a countably infinite basis is written ℵ0 rather than ∞, borrowing cardinality notation; function spaces and polynomial spaces of unbounded degree are the usual inhabitants.
Do not confuseArithmetic. dim(V)=∞ cannot be added or subtracted the way finite dimensions can — the subspace and rank–nullity formulas below all carry a silent finiteness assumption, and applying them across an infinite-dimensional space is where they quietly fail.
V≅W
V is isomorphic to W
The wavy equals sign claims structural sameness rather than equality — the spaces may consist of entirely different objects. Dimension and Isomorphism below gives the classification it enables: over one field, V≅W exactly when dim(V)=dim(W), so a single integer determines the space up to ≅.
CasesEvery n-dimensional space over F satisfies V≅Fn, which is what licenses treating abstract spaces as coordinate space once a basis is chosen — the coordinate brackets are that isomorphism written down.
Same glyph elsewhere≅ marks congruence in geometry — same shape and size — and the two uses share only the idea of "the same in the ways that matter here"; a third relative, ≡, means congruence modulo an integer.
If a vector space V has a basis with n elements, then every basis for V has exactly n elements.
The proof rests on two supporting facts. First, in a space spanned by n vectors, any set of more than n vectors is dependent. Second, any spanning set contains at least as many vectors as any independent set.
Suppose B has n elements and C has m elements, and both are bases. Since B spans V and C is independent, we get m≤n. Since C spans V and B is independent, we get n≤m. Together, m=n.
This theorem is what makes dimension well-defined. It converts a property of a particular basis (its size) into a property of the space itself.
Dimensions of Standard Spaces
The dimension of Rn is n. The standard basis {e1,…,en} has n elements, and any other basis for Rn also has exactly n elements.
The matrix space Rm×n has dimension mn. The standard basis consists of the mn matrix units Eij, one for each entry position.
The polynomial space Pn has dimension n+1. The monomial basis {1,x,x2,…,xn} contains n+1 elements. Note the offset: the space of polynomials of degree at most 2 is three-dimensional, not two-dimensional, because the constant term counts as a basis direction.
The space P of all polynomials (no degree bound) is infinite-dimensional. For any proposed finite basis {p1,…,pk}, let N be the maximum degree among them. Then xN+1 cannot be written as a combination of p1,…,pk, so the set does not span P.
The space C[a,b] of continuous functions on [a,b] is also infinite-dimensional, for similar reasons — no finite set of continuous functions can generate all others through linear combinations.
Each entry is a space, its dimension, and the basis that produces the count. The split is the point — the same definition gives a number for the first five and no number at all for the last two.
7spaces
Finite dimensional5
1
Coordinate space
basis {e1,…,en}
dim(Rn)=n
One standard basis vector per coordinate axis. The count is the number of independent directions, which for Rn is exactly the number of components — the case every other entry is measured against.
2
Matrix space
basis {Eij}, one per entry position
dim(Rm×n)=mn
Each matrix unit Eij has a single 1 and zeros elsewhere, so there is one basis element per slot. A 3×3 matrix space has dimension 9, not 3 — the shape does not reduce the count.
3
Polynomials of bounded degree
basis {1,x,x2,…,xn}
dim(Pn)=n+1
The constant term counts as a basis direction, so degree ≤2 gives dimension 3, not 2. This off-by-one is the most common dimension error, and it comes from reading "degree n" as the count rather than the top index.
4
Symmetric matrices
n×n, real, A=AT
dim=2n(n+1)
A subspace of Rn×n: the symmetry condition ties each below-diagonal entry to its mirror, so only the diagonal and one triangle are free. Strictly smaller than n2 for every n>1.
5
The zero space
basis is the empty set
dim({0})=0
Not dimension one. The zero vector is linearly dependent on its own, so it cannot belong to a basis — the empty set spans the zero space vacuously and is independent vacuously.
For any finite set with maximum degree N, the polynomial xN+1 escapes its span — so no finite set can span, and the argument works whatever finite set is proposed.
No finite set of functions generates every continuous function by linear combination. Most of analysis lives here, which is why the finite-dimensional theory has to be stated as such rather than as the general case.
Dimension is a property of the space, not of any basis for it — that is the basis size theorem, and it is what makes the counts below well defined rather than an artefact of the basis chosen. The infinite-dimensional entries are not a failure of the definition; they are what the definition says when no finite set spans.
A vector space is finite-dimensional if it has a finite basis, and infinite-dimensional otherwise.
In finite-dimensional spaces, the theory is clean and complete. Every independent set can be extended to a basis. Every spanning set can be reduced to one. The dimension is a finite integer that governs the entire structure of the space.
In infinite-dimensional spaces, the situation is more delicate. Bases still exist (assuming the axiom of choice), but they are called Hamel bases and are often unwieldy — a Hamel basis for C[0,1] is uncountable and cannot be written down explicitly. In practice, infinite-dimensional spaces are handled with topological tools: Schauder bases (which allow infinite convergent sums), Hilbert space theory, and functional analysis.
On this site, all vector spaces are finite-dimensional unless explicitly stated otherwise. The finite-dimensional theory covers Rn, Pn, Rm×n, and solution spaces of linear ODEs with constant coefficients — the spaces that appear in a standard linear algebra course.
Dimension and Independence
Dimension places hard constraints on how large an independent set can be:
This is the absolute ceiling: independence cannot survive past n vectors, no matter how cleverly they are chosen. In R3, four or more vectors are always dependent. In P2, four or more polynomials are always dependent.
An independent set of exactly n vectors is automatically a basis. Spanning comes for free once the count reaches the dimension. This is one of the most useful shortcuts in practice: to verify that n vectors in an n-dimensional space form a basis, it suffices to check independence alone.
An independent set of fewer than n vectors can always be extended to a basis by adding n−k more vectors, where k is the current count. The extension is not unique — there are many ways to complete the set — but the final count is always n.
Dimension and Spanning
Dimension also constrains spanning sets from the other direction.
In an n-dimensional space, any set of fewer than n vectors cannot span the space. The span has dimension at most k<n, so it is a proper subspace — some vectors in V are unreachable. In R3, two vectors can span at most a plane, never all of R3.
A spanning set of exactly n vectors is automatically a basis. Independence comes for free once the count hits the dimension. This is the mirror image of the independence shortcut: to verify that n vectors span an n-dimensional space, it suffices to check spanning alone, and independence follows.
A spanning set of more than n vectors contains redundancies. At least k−n vectors can be removed without shrinking the span. Removing all redundant vectors produces a basis.
These two shortcuts — "n independent vectors in an n-dimensional space form a basis" and "n spanning vectors in an n-dimensional space form a basis" — are the workhorses of basis verification.
Dimension of Subspaces
If W is a subspace of a finite-dimensional space V, then
The inequality is strict (dim(W)<dim(V)) for every proper subspace — a subspace that is not all of V. The only subspace with dim(W)=dim(V) is W=V itself. This follows because any basis for W is an independent set in V with dim(W) elements, and extending it to a basis for V adds dim(V)−dim(W) vectors. If no vectors need adding, W already has a basis for all of V.
In R3, the possible subspace dimensions are 0 (the zero vector), 1 (a line through the origin), 2 (a plane through the origin), and 3 (R3 itself). There is no subspace of dimension 23 or π — dimension is always a non-negative integer.
For a matrixA, the column space is a subspace of Rm with dimension equal to the rank, and the null space is a subspace of Rn with dimension n−rank(A). Both dimensions are bounded by the dimensions of their ambient spaces.
The Dimension Formula for Subspace Sums
For two subspacesW1 and W2 of a finite-dimensional space V, the dimension of their sum satisfies
This is the linear algebra analogue of the inclusion-exclusion formula for counting elements in the union of two sets. The intersection is subtracted because vectors in W1∩W2 are counted once in dim(W1) and once in dim(W2), but should only contribute once to the dimension of the sum.
A sum is called a direct sum, written W1⊕W2, precisely when the two subspaces meet only at the origin:
Every vector in a direct sum has a unique decomposition as w1+w2 with w1∈W1 and w2∈W2. For direct sums, the dimension formula collapses to plain addition:
For example, in R3, let W1 be the xy-plane (dimension 2) and W2 be the z-axis (dimension 1). Their intersection is {0}, so dim(W1+W2)=2+1−0=3. The sum is all of R3, and the decomposition R3=W1⊕W2 splits every vector into its xy-component and its z-component.
One construction with one condition attached. Whether the intersection is trivial decides the dimension formula, the uniqueness of decompositions, and whether the notation ⊕ is permitted at all.
The correction term is a double count: anything in both subspaces is added twice and must be removed once. Two planes through the origin in R3 have dimensions summing to four in a three-dimensional space — the intersection line is the missing one.
With nothing shared there is nothing to subtract, and each vector splits in exactly one way. This is the structure behind orthogonal complements and behind every basis: V is the direct sum of the lines spanned by its basis vectors.
The direct sum is not a different operation — it is the general sum with W1∩W2={0}, at which point the correction term vanishes and every decomposition becomes unique. The two rows differ in one hypothesis and everything else follows from it.
The uniqueness column is the one that matters, and it is easy to read past. In a general sum a vector can usually be written as w1+w2 in many ways — shift any element of the intersection from one part to the other and the sum is unchanged. A trivial intersection removes that freedom entirely, which is why the direct sum is the condition under which a decomposition can be spoken of as the decomposition.
The column space is a subspace of Rm with dimension rank(A). The null space is a subspace of Rn with dimension n−rank(A). Their dimensions add up to n, the dimension of the domain Rn.
Interpreted through the lens of linear transformations, this says that the n dimensions of the domain split between the image (what the map hits) and the kernel (what the map kills). No dimensions are lost or created — they are redistributed.
The rank-nullity theorem is the fundamental bridge between abstract dimension theory and concrete matrix computation. It connects the number of pivot columns (rank) to the number of free variables (nullity), and it guarantees that every question about the dimension of a null space or column space reduces to row reduction and pivot counting.
Pivot columns above, free-column solutions below
Every column of the matrix is either a pivot column, contributing a dimension to the column space, or a free column, contributing a dimension to the null space. No column can be both and none is left out, which is the whole content of the rank-nullity theorem: the two dimensions are partitioning the same finite supply. See the accounting for all four spaces on the four fundamental subspaces visualizer.
Read this way the theorem is bookkeeping rather than a surprise: the columns were always going to be divided between the two spaces.
Dimension and Isomorphism
Two finite-dimensional vector spaces over the same field are isomorphic — structurally identical as vector spaces — if and only if they have the same dimension.
The forward direction is straightforward: an isomorphism maps a basis to a basis, preserving the count. The reverse direction is the deeper fact: given any two n-dimensional spaces V and W, choosing a basis for each creates coordinate maps V→Rn and W→Rn. Composing one with the inverse of the other gives a direct isomorphism V→W.
This means dimension is the single complete invariant for finite-dimensional vector spaces. It captures everything about the linear-algebraic structure — independence, span, basis size, subspace behavior — in a single integer. Two spaces with the same dimension may contain very different objects (polynomials vs. matrices vs. functions), but from the perspective of linear algebra, they are indistinguishable.
R3, P2, and the solution space of a third-order homogeneous linear ODE are all three-dimensional. They are isomorphic as vector spaces. Every theorem that holds in one holds in all three — that is the payoff of the axiomatic approach.
Summary: Count vs. Dimension
In an n-dimensional space, the relationship between a set's size k and the dimension n controls what the set can be. Sets smaller than n can be independent but never span; sets larger than n can span but are never independent; and at exactly n, the two notions collapse — either independence or spanning alone implies the other, making the set a basis. The table below collects these three regimes side by side, organizing the entire interaction of count and dimension into a single reference card.
k vectors in an n-dimensional space
Can be independent?
Can span?
Can be a basis?
k < n (too few)
possible — the set can always be extended to a basis by adding n − k vectors
impossible — the span is a proper subspace of dimension ≤ k
impossible — cannot span
k = n (the boundary)
iff the set is independent
iff the set spans
independence and spanning collapse — either condition alone implies the other, and the set is a basis
possible if the set contains n independent vectors
impossible — always has redundancy; k − n vectors can be removed
Dimension FAQ
Does C have dimension 1 or 2?
+
Both, depending on the field of scalars, and neither answer is wrong. Over C a single basis vector suffices, so the dimension is 1; over R you need two, giving dimR(C)=2. The space has not changed, only what counts as a scalar. Dimension belongs to a space together with its field.Read more →
Can you do arithmetic with dim(V)=∞?
+
No, and this is where the standard formulas quietly fail. Results like the subspace dimension formula and rank-nullity all carry an unstated finiteness assumption, so subtracting infinities produces nonsense. Where the size genuinely matters, a cardinal replaces the symbol: a countably infinite basis gives dimension ℵ0, not ∞.Read more →
Why can any n-dimensional space be treated as Rn?
+
Because every n-dimensional space over F is isomorphic to Fn, so once a basis is fixed the two are interchangeable for computation. Choosing the basis is what supplies the translation, and coordinate vectors are that isomorphism written down. Without a chosen basis the correspondence exists but has no concrete form.Read more →