Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Dimension of Vector Space






The Number That Classifies a Vector Space

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 VV, written dim⁡(V)\dim(V), is the number of vectors in any basis for VV.

Dimension Definition
dim⁡(V)=∣B∣for any basis B of V\dim(V) = |\mathcal{B}| \quad \text{for any basis } \mathcal{B} \text{ of } V
Learn more about this formula: Dimension Definition →


This definition relies on a nontrivial fact: all bases for VV 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}\{\mathbf{0}\} has dimension 00. Its only "basis" is the empty set, which contains no vectors, is vacuously independent, and spans {0}\{\mathbf{0}\} since the empty linear combination produces 0\mathbf{0}.
φabspan = ℝ²φabspan = line
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.
B\mathcal{B} and the basis letters come from basis notation; ∣B∣|\mathcal{B}| counting bars from cardinality notation; Col⁡\operatorname{Col}, Nul⁡\operatorname{Nul} and the rank–nullity dictionary from fundamental-space notation and image and kernel notation; F\mathbb{F} from span notation.
dim⁡(V)\dim(V), dim⁡F(V)\dim_{\mathbb{F}}(V)
the dimension of V — over the field F, when it matters
An upright operator taking a space and returning a count, defined as ∣B∣|\mathcal{B}| for any basis, per Definition above. The parentheses are optional — dim⁡V\dim V 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\mathbb{C} has dimension 11 over C\mathbb{C} and dimension 22 over R\mathbb{R}, so dim⁡C(C)=1\dim_{\mathbb{C}}(\mathbb{C}) = 1 while dim⁡R(C)=2\dim_{\mathbb{R}}(\mathbb{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⁡\dim carries an unstated field, and two authors can write the same symbol for different numbers without either being wrong.
dim⁡(V)=∞\dim(V) = \infty
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 ∞\infty 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\aleph_0 rather than ∞\infty, borrowing cardinality notation; function spaces and polynomial spaces of unbounded degree are the usual inhabitants.
Do not confuseArithmetic. dim⁡(V)=∞\dim(V) = \infty 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≅WV \cong 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≅WV \cong W exactly when dim⁡(V)=dim⁡(W)\dim(V) = \dim(W), so a single integer determines the space up to ≅\cong.
CasesEvery nn-dimensional space over F\mathbb{F} satisfies V≅FnV \cong \mathbb{F}^{n}, 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≅\cong 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, ≡\equiv, means congruence modulo an integer.

The Basis Size Theorem

THEOREMBasis Size Theorem
If a vector space VV has a basis with nn elements, then every basis for VV has exactly nn elements.

The proof rests on two supporting facts. First, in a space spanned by nn vectors, any set of more than nn vectors is dependent. Second, any spanning set contains at least as many vectors as any independent set.

Suppose B\mathcal{B} has nn elements and C\mathcal{C} has mm elements, and both are bases. Since B\mathcal{B} spans VV and C\mathcal{C} is independent, we get m≤nm \leq n. Since C\mathcal{C} spans VV and B\mathcal{B} is independent, we get n≤mn \leq m. Together, m=nm = 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\mathbb{R}^n is nn. The standard basis {e1,…,en}\{\mathbf{e}_1, \dots, \mathbf{e}_n\} has nn elements, and any other basis for Rn\mathbb{R}^n also has exactly nn elements.

The matrix space Rm×n\mathbb{R}^{m \times n} has dimension mnmn. The standard basis consists of the mnmn matrix units EijE_{ij}, one for each entry position.

The polynomial space Pn\mathcal{P}_n has dimension n+1n + 1. The monomial basis {1,x,x2,…,xn}\{1, x, x^2, \dots, x^n\} contains n+1n + 1 elements. Note the offset: the space of polynomials of degree at most 22 is three-dimensional, not two-dimensional, because the constant term counts as a basis direction.

The space P\mathcal{P} of all polynomials (no degree bound) is infinite-dimensional. For any proposed finite basis {p1,…,pk}\{p_1, \dots, p_k\}, let NN be the maximum degree among them. Then xN+1x^{N+1} cannot be written as a combination of p1,…,pkp_1, \dots, p_k, so the set does not span P\mathcal{P}.

The space C[a,b]C[a, b] of continuous functions on [a,b][a, b] is also infinite-dimensional, for similar reasons — no finite set of continuous functions can generate all others through linear combinations.
Vector spaces · dimension

Dimensions of the standard spaces

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}\{\mathbf{e}_1, \ldots, \mathbf{e}_n\}
dim⁡(Rn)=n\dim(\mathbb{R}^n) = n
One standard basis vector per coordinate axis. The count is the number of independent directions, which for Rn\mathbb{R}^n is exactly the number of components — the case every other entry is measured against.
2
Matrix space
basis {Eij}\{E_{ij}\}, one per entry position
dim⁡(Rm×n)=mn\dim(\mathbb{R}^{m \times n}) = mn
Each matrix unit EijE_{ij} has a single 11 and zeros elsewhere, so there is one basis element per slot. A 3×33 \times 3 matrix space has dimension 99, not 33 — the shape does not reduce the count.
3
Polynomials of bounded degree
basis {1,x,x2,…,xn}\{1, x, x^2, \ldots, x^n\}
dim⁡(Pn)=n+1\dim(\mathcal{P}_n) = n + 1
The constant term counts as a basis direction, so degree ≤2\leq 2 gives dimension 33, not 22. This off-by-one is the most common dimension error, and it comes from reading "degree nn" as the count rather than the top index.
4
Symmetric matrices
n×nn \times n, real, A=ATA = A^{\mathsf{T}}
dim⁡=n(n+1)2\dim = \dfrac{n(n+1)}{2}
A subspace of Rn×n\mathbb{R}^{n \times n}: the symmetry condition ties each below-diagonal entry to its mirror, so only the diagonal and one triangle are free. Strictly smaller than n2n^2 for every n>1n > 1.
5
The zero space
basis is the empty set
dim⁡({0})=0\dim(\{\mathbf{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.
Infinite dimensional2
6
no finite basis exists
dim⁡(P)=∞\dim(\mathcal{P}) = \infty
For any finite set with maximum degree NN, the polynomial xN+1x^{N+1} escapes its span — so no finite set can span, and the argument works whatever finite set is proposed.
7
dim⁡(C[a,b])=∞\dim(C[a,b]) = \infty
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.
Dimensions of the standard spaces·/linear-algebra/vector-spaces/dimensionLearn Math Class

Finite vs. Infinite Dimension

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.

Fact: Sequences need uncountably many directions
A real sequence has one entry for each of 1,2,3,…1, 2, 3, \ldots, yet the space of all real sequences has no countable basis. The sequences (1,t,t2,…)(1, t, t^2, \ldots), one for each real tt, are independent by the Vandermonde determinant, and no independent set is larger than a basis.

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]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\mathbb{R}^n, Pn\mathcal{P}_n, Rm×n\mathbb{R}^{m \times 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:

Max Independent Set Size
∣S∣>dim⁡V⇒S is dependent|S| > \dim V \Rightarrow S \text{ is dependent}
Learn more about this formula: Max Independent Set Size →


This is the absolute ceiling: independence cannot survive past nn vectors, no matter how cleverly they are chosen. In R3\mathbb{R}^3, four or more vectors are always dependent. In P2\mathcal{P}_2, four or more polynomials are always dependent.

An independent set of exactly nn 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 nn vectors in an nn-dimensional space form a basis, it suffices to check independence alone.

Pitfall: Counting without checking independence
Calling (1,2,3)(1, 2, 3), (2,4,6)(2, 4, 6), (0,0,1)(0, 0, 1) a basis of R3\mathbb{R}^3 because there are three of them overlooks (2,4,6)=2(1,2,3)(2, 4, 6) = 2(1, 2, 3). Their matrix has only 22 pivots, so they span a plane and are not a basis.

In a typical exercise the vectors are written as the columns of a matrix, and the question is whether they form a basis. The count is compared with the dimension first. When the two agree, one further test settles the question, for example row reducing that matrix and counting its pivots: in R3\mathbb{R}^3, three vectors whose matrix has three pivots, or equivalently a nonzero determinant, are a basis.

An independent set of fewer than nn vectors can always be extended to a basis by adding n−kn - k more vectors, where kk is the current count. The extension is not unique — there are many ways to complete the set — but the final count is always nn.

Dimension and Spanning

Dimension also constrains spanning sets from the other direction.

THEOREM
In an nn-dimensional space, any set of fewer than nn vectors cannot span the space.

The span has dimension at most k<nk < n, so it is a proper subspace — some vectors in VV are unreachable. In R3\mathbb{R}^3, two vectors can span at most a plane, never all of R3\mathbb{R}^3.

A spanning set of exactly nn 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 nn vectors span an nn-dimensional space, it suffices to check spanning alone, and independence follows.

A spanning set of more than nn vectors contains redundancies. At least k−nk - n vectors can be removed without shrinking the span. Removing all redundant vectors produces a basis.

These two shortcuts — "nn independent vectors in an nn-dimensional space form a basis" and "nn spanning vectors in an nn-dimensional space form a basis" — are the workhorses of basis verification.
DownloadPNG2×PDF
Before you read
Dimension fixes the counts
In an nn-dimensional space, dimension caps independent sets from above and spanning sets from below. A basis sits exactly at nn.
most vectorssize of the setfewest vectors
Spanning setat least nn vectors; extras are redundant
Basisexactly n=dim⁡Vn = \dim V vectors
Independent setat most nn vectors; can be extended
Takeaway
The two shortcuts
nn independent vectors in an nn-dimensional space form a basis, and so do nn spanning vectors: once the count reaches the dimension, the other property comes for free.
Independent, basis, spanning: sizes fixed by dimension·/linear-algebra/vector-spaces/dimensionLearn Math Class

Dimension of Subspaces

If WW is a subspace of a finite-dimensional space VV, then

Subspace Dimension Inequality
W⊆V⇒dim⁡(W)≤dim⁡(V),with equality  ⟺  W=VW \subseteq V \Rightarrow \dim(W) \leq \dim(V), \quad \text{with equality} \iff W = V
Learn more about this formula: Subspace Dimension Inequality →


The inequality is strict (dim⁡(W)<dim⁡(V)\dim(W) < \dim(V)) for every proper subspace — a subspace that is not all of VV. The only subspace with dim⁡(W)=dim⁡(V)\dim(W) = \dim(V) is W=VW = V itself. This follows because any basis for WW is an independent set in VV with dim⁡(W)\dim(W) elements, and extending it to a basis for VV adds dim⁡(V)−dim⁡(W)\dim(V) - \dim(W) vectors. If no vectors need adding, WW already has a basis for all of VV.

Pitfall: Counting components instead of directions
Calling the plane x+y+z=0x + y + z = 0 three-dimensional because its vectors have three entries gives dim⁡=3\dim = 3. It has the basis (−1,1,0)(-1, 1, 0), (−1,0,1)(-1, 0, 1), so its dimension is 22.

In R3\mathbb{R}^3, the possible subspace dimensions are 00 (the zero vector), 11 (a line through the origin), 22 (a plane through the origin), and 33 (R3\mathbb{R}^3 itself). There is no subspace of dimension 32\frac{3}{2} or π\pi — dimension is always a non-negative integer.

For a matrix AA, the column space is a subspace of Rm\mathbb{R}^m with dimension equal to the rank, and the null space is a subspace of Rn\mathbb{R}^n with dimension n−rank(A)n - \text{rank}(A). Both dimensions are bounded by the dimensions of their ambient spaces.
DownloadPNG2×PDF
Before you read
Subspaces of R3\mathbb{R}^3 by dimension
If WW is a subspace of VV, then dim⁡(W)≤dim⁡(V)\dim(W) \leq \dim(V), with equality only when W=VW = V. In R3\mathbb{R}^3 that leaves exactly four possible dimensions.
smallestdimensionlargest
The zero vectordim⁡=0\dim = 0
Line through the origindim⁡=1\dim = 1
Plane through the origindim⁡=2\dim = 2
R3\mathbb{R}^3 itselfdim⁡=3\dim = 3
Takeaway
Always a whole number
There is no subspace of dimension 32\frac{3}{2} or π\pi: dimension is always a non-negative integer. See subspaces for these four kinds.
Subspaces of R³ by dimension·/linear-algebra/vector-spaces/dimensionLearn Math Class
A subspace can only be smaller by whole dimensions, and one with the full dimension is the whole space.

The Dimension Formula for Subspace Sums

For two subspaces W1W_1 and W2W_2 of a finite-dimensional space VV, the dimension of their sum satisfies

Dimension Sum Formula
dim⁡(W1+W2)=dim⁡(W1)+dim⁡(W2)−dim⁡(W1∩W2)\dim(W_1 + W_2) = \dim(W_1) + \dim(W_2) - \dim(W_1 \cap W_2)
Learn more about this formula: Dimension Sum Formula →


Pitfall: Leaving out the intersection
Adding the dimensions of the xyxy-plane and the yzyz-plane gives 2+2=42 + 2 = 4, more than dim⁡(R3)=3\dim(\mathbb{R}^3) = 3. The planes share the yy-axis, so dim⁡(W1+W2)=2+2−1=3\dim(W_1 + W_2) = 2 + 2 - 1 = 3.

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∩W2W_1 \cap W_2 are counted once in dim⁡(W1)\dim(W_1) and once in dim⁡(W2)\dim(W_2), but should only contribute once to the dimension of the sum.

A sum is called a direct sum, written W1⊕W2W_1 \oplus W_2, precisely when the two subspaces meet only at the origin:

Direct Sum Criterion
V=W1⊕W2  ⟺  V=W1+W2 and W1∩W2={0}V = W_1 \oplus W_2 \iff V = W_1 + W_2 \text{ and } W_1 \cap W_2 = \{\mathbf{0}\}
Learn more about this formula: Direct Sum Criterion →


THEOREM
Every vector in a direct sum has a unique decomposition as w1+w2\mathbf{w}_1 + \mathbf{w}_2 with w1∈W1\mathbf{w}_1 \in W_1 and w2∈W2\mathbf{w}_2 \in W_2.

For direct sums, the dimension formula collapses to plain addition:

Direct Sum Dimension
V=W1⊕W2⇒dim⁡(V)=dim⁡(W1)+dim⁡(W2)V = W_1 \oplus W_2 \Rightarrow \dim(V) = \dim(W_1) + \dim(W_2)
Learn more about this formula: Direct Sum Dimension →


Fact: Three lines in a plane break the count
Three different lines through the origin of R2\mathbb{R}^2 meet pairwise only at 0\mathbf{0}, so the set pattern predicts 1+1+1−0−0−0+0=31 + 1 + 1 - 0 - 0 - 0 + 0 = 3. Their sum is the plane, of dimension 22: any two of the lines already span it, third line included.

For example, in R3\mathbb{R}^3, let W1W_1 be the xyxy-plane (dimension 22) and W2W_2 be the zz-axis (dimension 11). Their intersection is {0}\{\mathbf{0}\}, so dim⁡(W1+W2)=2+1−0=3\dim(W_1 + W_2) = 2 + 1 - 0 = 3. The sum is all of R3\mathbb{R}^3, and the decomposition R3=W1⊕W2\mathbb{R}^3 = W_1 \oplus W_2 splits every vector into its xyxy-component and its zz-component.

For finite sets, inclusion-exclusion continues to three sets: add the three sizes, subtract the three pairwise overlaps, then add back the part shared by all three. The same pattern can be tried on three subspaces, with dimensions in place of sizes and intersections in place of overlaps. The simplest test case is three different lines through the origin in R2\mathbb{R}^2.
Vector spaces · subspace sums

Sum and direct sum

One construction with one condition attached. Whether the intersection is trivial decides the dimension formula, the uniqueness of decompositions, and whether the notation ⊕\oplus is permitted at all.

2cases
The general case1
Sum§ 8W1+W2={w1+w2}W_1 + W_2 = \{\mathbf{w}_1 + \mathbf{w}_2\}
dimensiondim⁡W1+dim⁡W2−dim⁡(W1∩W2)\dim W_1 + \dim W_2 - \dim(W_1 \cap W_2)
intersectionmay be nontrivial
decompositionexists, but not unique
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\mathbb{R}^3 have dimensions summing to four in a three-dimensional space — the intersection line is the missing one.
When the intersection is trivial1
Direct sum§ 8W1∩W2={0}W_1 \cap W_2 = \{\mathbf{0}\}
dimensiondim⁡W1+dim⁡W2\dim W_1 + \dim W_2
intersectiontrivial — the origin only
decompositionexists and is unique
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: VV 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}W_1 \cap W_2 = \{\mathbf{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.
Sum and direct sum·/linear-algebra/vector-spaces/dimensionLearn Math Class
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\mathbf{w}_1 + \mathbf{w}_2 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 Rank-Nullity Theorem as a Dimension Statement

For an m×nm \times n matrix AA, the rank-nullity theorem states

Rank-Nullity Theorem (Matrix Form)
dim⁡(Col A)+dim⁡(Null A)=n\dim(\text{Col}\,A) + \dim(\text{Null}\,A) = n
Learn more about this formula: Rank-Nullity Theorem (Matrix Form) →


The column space is a subspace of Rm\mathbb{R}^m with dimension rank(A)\text{rank}(A). The null space is a subspace of Rn\mathbb{R}^n with dimension n−rank(A)n - \text{rank}(A). Their dimensions add up to nn, the dimension of the domain Rn\mathbb{R}^n.

Interpreted through the lens of linear transformations, this says that the nn 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.

Pitfall: Subtracting the rank from the row count
For a 3×53 \times 5 matrix of rank 22, taking 3−23 - 2 gives nullity 11. The null space lies in R5\mathbb{R}^5, so the nullity is 5−2=35 - 2 = 3.

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.
A3×3121243364→basis of C(A)3×2112334R3×3120001000→A3×3121243364basis of N(A)3×12−10=03×1000
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

THEOREM
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 nn-dimensional spaces VV and WW, choosing a basis for each creates coordinate maps V→RnV \to \mathbb{R}^n and W→RnW \to \mathbb{R}^n. Composing one with the inverse of the other gives a direct isomorphism V→WV \to 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\mathbb{R}^3, P2\mathcal{P}_2, 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.

Over one field, the dimension alone decides whether two finite-dimensional spaces are the same space with renamed vectors.

Summary: Count vs. Dimension

In an nn-dimensional space, the relationship between a set's size kk and the dimension nn controls what the set can be. Sets smaller than nn can be independent but never span; sets larger than nn can span but are never independent; and at exactly nn, 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
k > n (too many) impossible — the set is automatically dependent possible if the set contains n independent vectors impossible — always has redundancy; k − n vectors can be removed

Common Pitfalls

Five mistakes account for many wrong dimension counts. Four are marked with a box where they happen in the sections above, and the first, the offset for polynomial spaces, is pointed out in the section on standard spaces. Here each is worked through in full, with the wrong and the right working side by side.

Taking the degree as the dimension

The dimension of Pn\mathcal{P}_n is read off its subscript, so the polynomials of degree at most 22 are said to form a two-dimensional space. The constant term is left out of the count.

Wrong working: every polynomial of degree at most 22 is built from xx and x2x^2, so dim⁡(P2)=2\dim(\mathcal{P}_2) = 2.

Right working: a general element is a0+a1x+a2x2a_0 + a_1 x + a_2 x^2, with three free coefficients. The basis is {1,x,x2}\{1, x, x^2\}, which has three elements, so dim⁡(P2)=3\dim(\mathcal{P}_2) = 3. In general dim⁡(Pn)=n+1\dim(\mathcal{P}_n) = n + 1.

Why it happens: the degree nn names the highest power, the last index in the list x0,x1,…,xnx^0, x^1, \dots, x^n, and that list has n+1n + 1 entries.

How to check: test a constant. The polynomial p(x)=5p(x) = 5 belongs to P2\mathcal{P}_2, but no combination ax+bx2a x + b x^2 equals it, because every such combination is 00 at x=0x = 0. A set that misses a constant cannot be a basis.

Counting without checking independence

A set of exactly nn vectors in an nn-dimensional space is declared a basis because the count matches the dimension. The shortcut needs independence, or spanning, as well; the count alone settles nothing.

Wrong working: (1,2,3)(1, 2, 3), (2,4,6)(2, 4, 6) and (0,0,1)(0, 0, 1) are three vectors in R3\mathbb{R}^3, and dim⁡(R3)=3\dim(\mathbb{R}^3) = 3, so they form a basis.

Right working: put the vectors in the columns of a matrix and row reduce.
(120240361)→(120001000)\begin{pmatrix} 1 & 2 & 0 \\ 2 & 4 & 0 \\ 3 & 6 & 1 \end{pmatrix} \to \begin{pmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix}

There are only 22 pivots. The set is dependent, since (2,4,6)=2(1,2,3)(2, 4, 6) = 2(1, 2, 3), and its span is the plane of all vectors (a,2a,3a+c)(a, 2a, 3a + c). The vector (1,0,0)(1, 0, 0) is not in it, so the set does not span R3\mathbb{R}^3 and is not a basis.

Why it happens: the shortcut "nn independent vectors in an nn-dimensional space form a basis" is remembered as "nn vectors form a basis", and the condition drops out.

How to check: for nn vectors in Rn\mathbb{R}^n, compute the determinant of their matrix. Here the first two columns are proportional, so the determinant is 00 and the vectors are not a basis.

Counting components instead of directions

The dimension of a subspace of R3\mathbb{R}^3 is taken to be 33 because its vectors have three entries. The number of entries describes the space the vectors live in; the dimension of the subspace counts the independent directions inside it.

Wrong working: W={(x,y,z):x+y+z=0}W = \{(x, y, z) : x + y + z = 0\} consists of vectors with three components, so dim⁡(W)=3\dim(W) = 3.

Right working: solve the equation for xx, so x=−y−zx = -y - z with yy and zz free.
(x,y,z)=y(−1,1,0)+z(−1,0,1)(x, y, z) = y(-1, 1, 0) + z(-1, 0, 1)

The two vectors are independent and span WW, so dim⁡(W)=2\dim(W) = 2: WW is a plane through the origin.

Why it happens: for Rn\mathbb{R}^n itself the number of components and the dimension agree, and the coincidence is carried over to every subspace.

How to check: use the subspace inequality. If dim⁡(W)=3\dim(W) = 3, then WW would be all of R3\mathbb{R}^3. But (1,0,0)(1, 0, 0) is not in WW, because 1+0+0≠01 + 0 + 0 \neq 0, so dim⁡(W)<3\dim(W) < 3.

Leaving out the intersection

The dimension of a sum of subspaces is found by adding the two dimensions, and the correction term dim⁡(W1∩W2)\dim(W_1 \cap W_2) is dropped. Plain addition is correct only for a direct sum.

Wrong working: in R3\mathbb{R}^3, let W1W_1 be the xyxy-plane, spanned by e1\mathbf{e}_1 and e2\mathbf{e}_2, and W2W_2 the yzyz-plane, spanned by e2\mathbf{e}_2 and e3\mathbf{e}_3. Then dim⁡(W1+W2)=2+2=4\dim(W_1 + W_2) = 2 + 2 = 4.

Right working: the two planes meet in the yy-axis, spanned by e2\mathbf{e}_2, so dim⁡(W1∩W2)=1\dim(W_1 \cap W_2) = 1.
dim⁡(W1+W2)=2+2−1=3\dim(W_1 + W_2) = 2 + 2 - 1 = 3

The sum is all of R3\mathbb{R}^3.

Why it happens: in the direct-sum example of the xyxy-plane and the zz-axis the dimensions really do add, and the same step is repeated for subspaces that overlap.

How to check: the dimension of a sum can never exceed the dimension of the whole space. A result of 44 inside R3\mathbb{R}^3 is impossible, so something was counted twice. Listing the spanning vectors shows what: e1,e2,e2,e3\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_2, \mathbf{e}_3 contains e2\mathbf{e}_2 twice.

Subtracting the rank from the row count

The nullity is computed as m−rank(A)m - \text{rank}(A), the number of rows minus the rank. The null space lives in the domain Rn\mathbb{R}^n, so the rank is subtracted from the number of columns.

Wrong working: take
A=(102010131011511)A = \begin{pmatrix} 1 & 0 & 2 & 0 & 1 \\ 0 & 1 & 3 & 1 & 0 \\ 1 & 1 & 5 & 1 & 1 \end{pmatrix}

The third row is the sum of the first two, so rank(A)=2\text{rank}(A) = 2, and dim⁡(Null A)=3−2=1\dim(\text{Null}\,A) = 3 - 2 = 1.

Right working: AA is 3×53 \times 5, so n=5n = 5 and dim⁡(Null A)=5−2=3\dim(\text{Null}\,A) = 5 - 2 = 3. The pivots are in columns 11 and 22, the variables x3,x4,x5x_3, x_4, x_5 are free, and the three null-space vectors (−2,−3,1,0,0)(-2, -3, 1, 0, 0), (0,−1,0,1,0)(0, -1, 0, 1, 0) and (−1,0,0,0,1)(-1, 0, 0, 0, 1) form a basis.

Why it happens: mm comes first in "m×nm \times n", and the rank is often read from the nonzero rows of the echelon form, so the row count looks like the natural number to subtract from.

How to check: count free variables. Every column without a pivot gives one free variable, so the nullity is the number of columns minus the number of pivots, here 5−2=35 - 2 = 3. The number m−r=1m - r = 1 is the dimension of a different space, the null space of ATA^T.

Dimension FAQ

Does C\mathbb{C} have dimension 11 or 22?

+
Both, depending on the field of scalars, and neither answer is wrong. Over C\mathbb{C} a single basis vector suffices, so the dimension is 11; over R\mathbb{R} you need two, giving dim⁡R(C)=2\dim_{\mathbb{R}}(\mathbb{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)=∞\dim(V) = \infty?

+
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\aleph_0, not ∞\infty.Read more →

Why can any nn-dimensional space be treated as Rn\mathbb{R}^n?

+
Because every nn-dimensional space over F\mathbb{F} is isomorphic to Fn\mathbb{F}^n, 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 →