Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Vector Spaces






The Abstract Structure Behind Linear Algebra

Vectors in the plane can be added and scaled. So can polynomials, matrices, and functions. A vector space is any collection of objects where these two operations make sense and obey a consistent set of rules. By isolating this common structure, results proved once in the abstract apply to every concrete setting — from coordinate geometry to differential equations to signal processing.



What a Vector Space Is

Fact: Written in 1888, taken up in the 1920s
Peano gave the first axiomatic definition of a vector space in 1888 and already noted that the polynomials of degree at most nn form a space of n+1n + 1 dimensions. His book had little influence, and the axioms caught on only after Banach's 1920 dissertation.

Vectors in Rn\mathbb{R}^n can be added and scaled. So can polynomials, matrices, and continuous functions. A vector space is the formal name for any collection of objects where these two operations — addition and scalar multiplication — satisfy ten algebraic axioms: closure, commutativity, associativity, the existence of a zero element, additive inverses, and the expected distributive and identity laws for scalars.

The objects in a vector space are called vectors regardless of whether they look like arrows, columns of numbers, polynomials, or functions. The power of the abstraction is that every theorem proved from the axioms alone applies to every vector space simultaneously. Linear independence, span, basis, dimension, and subspaces are all defined from the axioms, and their properties carry over to any setting where the axioms hold.

Axioms: The Rules Every Vector Space Follows

A vector space VV over the real numbers comes with two operations: adding two vectors and multiplying a vector by a scalar. The ten axioms fix how these operations behave. Two are closure laws: u+v\mathbf{u} + \mathbf{v} and cuc\mathbf{u} must stay inside VV. Four govern addition: it is commutative and associative, there is a zero vector 0\mathbf{0} with v+0=v\mathbf{v} + \mathbf{0} = \mathbf{v}, and every vector has an additive inverse −v-\mathbf{v}. The last four tie scalars to vectors: c(u+v)=cu+cvc(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v}, (c+d)v=cv+dv(c + d)\mathbf{v} = c\mathbf{v} + d\mathbf{v}, c(dv)=(cd)vc(d\mathbf{v}) = (cd)\mathbf{v}, and 1v=v1\mathbf{v} = \mathbf{v}.

Checking a candidate set means testing each rule. Most failures happen at closure or at the zero vector. The set of vectors (x,y)(x, y) with x+y=1x + y = 1 is not a vector space: it does not contain (0,0)(0, 0), and adding (1,0)(1, 0) and (0,1)(0, 1) gives (1,1)(1, 1), which leaves the set.

Subspaces

A subspace is a subset of a vector space that is a vector space in its own right, using the same operations. Commutativity, associativity and the distributive laws are inherited from the larger space, so only three things need checking: the subset contains the zero vector, it is closed under addition, and it is closed under scalar multiplication.

In R3\mathbb{R}^3 the subspaces are exactly four kinds of sets: the origin alone, lines through the origin, planes through the origin, and R3\mathbb{R}^3 itself. A plane that misses the origin, such as z=1z = 1, fails the first test.

THEOREM
The solution set of a homogeneous system Ax=0A\mathbf{x} = \mathbf{0} is always a subspace, while the solution set of Ax=bA\mathbf{x} = \mathbf{b} with b≠0\mathbf{b} \neq \mathbf{0} never is.

Pitfall: Testing scaling only with positive scalars
The quarter-plane of vectors (x,y)(x, y) with x≥0x \geq 0 and y≥0y \geq 0 contains 0\mathbf{0}, is closed under addition, and keeps every positive multiple. But (−1)(1,2)=(−1,−2)(-1)(1, 2) = (-1, -2) leaves it, so it is not a subspace.

Running the test on a candidate set means taking arbitrary members u\mathbf{u} and v\mathbf{v} of the set and an arbitrary real scalar cc, then asking whether u+v\mathbf{u} + \mathbf{v} and cuc\mathbf{u} are still in the set. A single pair of vectors or a single scalar that leads outside is enough to rule the set out. Showing that a set is a subspace takes the general argument, for every choice at once.

Span

The span of a set of vectors is the collection of all their linear combinations c1v1+c2v2+⋯+ckvkc_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_k\mathbf{v}_k.

THEOREM
The span is always a subspace, and it is the smallest subspace that contains the given vectors.

Span answers a reachability question: which vectors can be built from the ones you have? In R3\mathbb{R}^3, one nonzero vector spans a line, two vectors that are not multiples of each other span a plane, and three vectors span all of R3\mathbb{R}^3 only when none of them lies in the plane of the other two. Testing whether a vector b\mathbf{b} is in the span of the columns of a matrix AA is the same as asking whether Ax=bA\mathbf{x} = \mathbf{b} has a solution.

Linear Independence

A set of vectors is linearly independent when the only way to combine them into the zero vector is with all coefficients zero: c1v1+⋯+ckvk=0c_1\mathbf{v}_1 + \cdots + c_k\mathbf{v}_k = \mathbf{0} forces c1=⋯=ck=0c_1 = \cdots = c_k = 0. If some other combination works, the set is dependent, and at least one vector can be written using the others.

Pitfall: Checking the vectors two at a time
No two of (1,0,1)(1, 0, 1), (0,1,1)(0, 1, 1), (1,1,2)(1, 1, 2) are multiples of each other, so the set looks independent. But (1,1,2)=(1,0,1)+(0,1,1)(1, 1, 2) = (1, 0, 1) + (0, 1, 1), so the set is dependent.

Independence measures redundancy. The vectors (1,0)(1, 0), (0,1)(0, 1) and (1,1)(1, 1) span R2\mathbb{R}^2, but they are dependent, since (1,1)=(1,0)+(0,1)(1, 1) = (1, 0) + (0, 1); dropping any one of them leaves the span unchanged. To test vectors in Rn\mathbb{R}^n, place them as the columns of a matrix and row reduce: they are independent exactly when every column has a pivot.

COROLLARY
More than nn vectors in Rn\mathbb{R}^n are always dependent.

Basis

A basis is a set of vectors that is linearly independent and spans the whole space. Spanning guarantees that every vector can be built; independence guarantees that there is only one way to build it. Together they give each vector a unique list of coefficients, its coordinates relative to that basis.

The standard basis of R3\mathbb{R}^3 is e1=(1,0,0)\mathbf{e}_1 = (1, 0, 0), e2=(0,1,0)\mathbf{e}_2 = (0, 1, 0), e3=(0,0,1)\mathbf{e}_3 = (0, 0, 1), but it is not the only one: (1,1,0)(1, 1, 0), (0,1,1)(0, 1, 1), (1,0,1)(1, 0, 1) is another basis.

THEOREM
Every basis of a given space has the same number of vectors.

A basis can be found from a spanning set by removing dependent vectors, or built from an independent set by adding vectors until the span is complete.
A basis is a spanning set with nothing to spare, so every vector is built from it in exactly one way.

Dimension

The dimension of a vector space is the number of vectors in any of its bases. It is well defined because all bases of the same space have the same size. Rn\mathbb{R}^n has dimension nn, the polynomials of degree at most 22 have dimension 33 (basis 1,x,x21, x, x^2), and the 2×22 \times 2 matrices have dimension 44.

Dimension turns many questions into counting.

THEOREM
In a space of dimension nn, any nn independent vectors automatically span, and any nn spanning vectors are automatically independent, so only one of the two conditions has to be checked.

Pitfall: Counting entries instead of basis vectors
The plane x+y+z=0x + y + z = 0 in R3\mathbb{R}^3 is given dimension 33 because its vectors have three entries. A basis is (−1,1,0)(-1, 1, 0), (−1,0,1)(-1, 0, 1), so the dimension is 22.

A subspace never has a larger dimension than the space that contains it, and it is the whole space when the dimensions match. Some spaces, such as the space of all polynomials, have no finite basis and are called infinite-dimensional.

The Four Fundamental Subspaces

Every m×nm \times n matrix AA comes with four fundamental subspaces. The column space and the left null space live in Rm\mathbb{R}^m; the row space and the null space live in Rn\mathbb{R}^n. The column space holds every output AxA\mathbf{x}, and the null space holds every input that AA sends to zero.

Pitfall: Subtracting the rank from the row count
For A=(102013)A = \begin{pmatrix} 1 & 0 & 2 \\ 0 & 1 & 3 \end{pmatrix}, of rank 22, taking m−r=2−2=0m - r = 2 - 2 = 0 says only 0\mathbf{0} solves Ax=0A\mathbf{x} = \mathbf{0}. Yet (−2,−3,1)(-2, -3, 1) does: the null space has dimension n−r=3−2=1n - r = 3 - 2 = 1.

Their dimensions are fixed by the rank rr. The column space and the row space both have dimension rr, the null space has dimension n−rn - r, and the left null space has dimension m−rm - r. This is the rank–nullity theorem in its full form. The pairs also meet at right angles: the row space is orthogonal to the null space, and the column space is orthogonal to the left null space.
Once the size of a matrix is known, its rank alone fixes the dimensions of all four fundamental subspaces.

Coordinates and Change of Basis

Once a basis B={b1,…,bn}B = \{\mathbf{b}_1, \ldots, \mathbf{b}_n\} is fixed, each vector v\mathbf{v} is described by its coordinate vector [v]B[\mathbf{v}]_B: the coefficients in v=c1b1+⋯+cnbn\mathbf{v} = c_1\mathbf{b}_1 + \cdots + c_n\mathbf{b}_n. The same vector generally has different coordinates in different bases. The vector (3,1)(3, 1) has coordinates (3,1)(3, 1) in the standard basis of R2\mathbb{R}^2, but in the basis (1,1),(1,−1)(1, 1), (1, -1) its coordinates are (2,1)(2, 1), since 2(1,1)+1(1,−1)=(3,1)2(1, 1) + 1(1, -1) = (3, 1).

Moving between two bases takes a single invertible matrix, the change-of-basis matrix. The basis change page shows how to build it and how the matrix of a linear transformation changes when the basis does.

Isomorphism: Why Every Space Looks Like Rⁿ

Choosing a basis turns an abstract vector space into lists of numbers.

THEOREM
The map that sends each vector to its coordinate vector is linear, one-to-one and onto, so it is an isomorphism.

As a result, every real vector space of dimension nn behaves exactly like Rn\mathbb{R}^n.

For example, the polynomial 3−x+2x23 - x + 2x^2 corresponds to the column (3,−1,2)(3, -1, 2) in the basis 1,x,x21, x, x^2. Adding polynomials matches adding these columns, and scaling a polynomial matches scaling its column. Questions about polynomials, matrices or any other finite-dimensional space can therefore be answered with matrix methods in Rn\mathbb{R}^n.

Common Examples of Vector Spaces

Fact: Multiplication as vector addition
With x⊕y=xyx \oplus y = xy as addition and c⊙x=xcc \odot x = x^c as scaling, the positive reals form a vector space whose zero vector is 11 and in which the negative of xx is 1x\frac{1}{x}. The logarithm carries it onto R\mathbb{R}, so its dimension is 11.

The same axioms hold in many settings. Column vectors in Rn\mathbb{R}^n are the model case. The space PnP_n of polynomials of degree at most nn has dimension n+1n + 1. The space of m×nm \times n matrices has dimension mnmn, with a basis made of the matrices that have a single entry 11 and zeros elsewhere. The continuous functions on an interval form an infinite-dimensional space.

Subspaces give many more examples: the solutions of a homogeneous linear system, the symmetric n×nn \times n matrices, the polynomials with p(0)=0p(0) = 0, and the solutions of a homogeneous linear differential equation such as y′′+y=0y'' + y = 0, whose solution space has the basis cos⁡x,sin⁡x\cos x, \sin x.
DownloadPNG2×PDF
Before you read
Where vector spaces show up
Vector spaces are not only arrows: polynomials, matrices and functions form vector spaces too, and many familiar sets sit inside them as subspaces.
  • L0Common vector spaces
    • L1Finite-dimensional
      • L2ℝⁿn-tuples of real numbers
      • L2Pₙpolynomials of degree at most ndim n + 1
      • L2m × n matricesdim mn
    • L1Infinite-dimensional
      • L2Continuous functionson an interval
    • L1Subspace examples
      • L2Solutions of a homogeneous system
      • L2Symmetric n × n matrices
      • L2Polynomials with p(0) = 0
      • L2Solutions of y″ + y = 0basis cos x, sin x
Takeaway
Same axioms, very different objects
Anything that satisfies the axioms is a vector space, whatever its elements look like.
Common vector spaces and subspaces·/linear-algebra/vector-spacesLearn Math Class

How the Ideas Fit Together

The topics in this section build on each other. The axioms define what a vector space is, and subspaces are the vector spaces that sit inside a larger one. Span describes what a set of vectors can reach, and linear independence describes whether any of them is redundant. A basis is a set that does both jobs at once, and dimension counts its vectors. Coordinates and isomorphism then reduce every finite-dimensional space to Rn\mathbb{R}^n, where matrices do the computing, and the four fundamental subspaces describe what a single matrix does to the spaces it acts on.

Each page in this section treats one step of this chain in full, with definitions and worked examples.
DownloadPNG2×PDF
Before you read
Each idea builds on the one below
The topics of this section form one chain. Read the pyramid from the base up: each level needs the ones beneath it.
builds on the restdependencefoundation
Coordinatesand isomorphism
Dimensionsize of a basis
Basisspans and is independent at once
Span and independencewhat vectors reach, and what is redundant
Subspacesvector spaces inside a larger one
Axiomswhat a vector space is
Takeaway
Where the chain leads
Coordinates and isomorphism reduce every finite-dimensional space to Rn\mathbb{R}^n, where matrices do the computing. At the top, the four fundamental subspaces describe what a single matrix does to the spaces it acts on.
How the vector-space ideas build on each other·/linear-algebra/vector-spacesLearn Math Class

Summary: Catalog of Vector Spaces

This page gave an overview of the vector-space framework — axioms, subspaces, span, independence, basis, dimension and coordinates — and the running theme is that the same abstract structure shows up in many concrete settings. The table below collects the main examples: the typical kind of object, the operations on it, the dimension, the standard basis, and the isomorphism class. The central conclusion of the theory is visible at a glance — any two finite-dimensional real vector spaces with the same dimension are isomorphic, so every finite-dimensional example here is ultimately a copy of some ℝⁿ.
Vector space Typical element Operations Dimension Standard basis Isomorphic to
ℝⁿ (v₁, …, vₙ) entry-by-entry n {e₁, e₂, …, eₙ} itself (canonical model)
𝒫ₙ (polynomials, deg ≤ n) a₀ + a₁x + … + aₙxⁿ ordinary polynomial + and scaling n + 1 monomials {1, x, x², …, xⁿ} ℝⁿ⁺¹
𝒫 (all polynomials) polynomial of any degree ordinary polynomial + and scaling ∞ {1, x, x², …} (infinite) not isomorphic to any ℝⁿ
ℝᵐˣⁿ (real matrices) m × n matrix entry-by-entry mn matrix units {Eᵢⱼ} ℝᵐⁿ
C[a, b] (continuous functions on [a, b]) continuous f: [a, b] → ℝ pointwise (f + g)(x) = f(x) + g(x) ∞ no finite basis not isomorphic to any ℝⁿ
Solutions of y″ + py′ + qy = 0 function y(x) pointwise (sums of solutions are solutions) 2 any two independent solutions y₁, y₂ ℝ²

Common Pitfalls

Four mistakes account for many wrong answers about subspaces, independence and dimension. Each is marked with a box where it happens in the sections above. Here each is worked through in full, with the wrong and the right working side by side.

Testing scaling only with positive scalars

The closure test for scalar multiplication is run with positive scalars only, such as c=2c = 2 or c=12c = \frac{1}{2}. A set that is closed under addition and under positive scaling then passes, even though it fails for negative scalars.

Wrong working: let QQ be the set of vectors (x,y)(x, y) with x≥0x \geq 0 and y≥0y \geq 0. It contains (0,0)(0, 0). If u\mathbf{u} and v\mathbf{v} have nonnegative entries, so does u+v\mathbf{u} + \mathbf{v}. For c=2c = 2, 2(1,2)=(2,4)2(1, 2) = (2, 4) is in QQ. Conclusion: QQ is a subspace.

Right working: closure under scalar multiplication must hold for every real cc. With c=−1c = -1,
(−1)(1,2)=(−1,−2)(-1)(1, 2) = (-1, -2)

which has negative entries and is not in QQ. So QQ is not a subspace.

Why it happens: the scalings that come to mind first are stretching and shrinking, both with positive numbers. Negative scalars, which point a vector the other way, are the ones that break sets like QQ.

How to check: always try c=−1c = -1. A subspace contains −u-\mathbf{u} for every u\mathbf{u} in it, so if the negative of some member is missing, the set is not a subspace.

Checking the vectors two at a time

Independence of three or more vectors is tested by comparing them in pairs. Since no vector is a multiple of another, the set is called independent.

Wrong working: none of (1,0,1)(1, 0, 1), (0,1,1)(0, 1, 1), (1,1,2)(1, 1, 2) is a multiple of another, so the three vectors are declared independent.

Right working: place them as the columns of a matrix and row reduce.
(101011112)→(101011000)\begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 2 \end{pmatrix} \to \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{pmatrix}

The third column has no pivot, so the vectors are dependent. Indeed (1,1,2)=(1,0,1)+(0,1,1)(1, 1, 2) = (1, 0, 1) + (0, 1, 1).

Why it happens: for two vectors, being multiples of each other is exactly what dependence means, and the pair test is carried over to larger sets. With three or more vectors, one of them can be a combination of several others without being a multiple of any single one.

How to check: row reduce and count pivots; the vectors are independent only if every column has one. For nn vectors in Rn\mathbb{R}^n, the determinant of the matrix they form must be nonzero; here it is 00.

Counting entries instead of basis vectors

The dimension of a subspace of Rn\mathbb{R}^n is read off from the number of entries in its vectors, which always gives nn.

Wrong working: every vector in the plane WW given by x+y+z=0x + y + z = 0 has three entries, so dim⁡W=3\dim W = 3.

Right working: solve for one variable, x=−y−zx = -y - z. Every vector in WW is then
(−y−z,y,z)=y(−1,1,0)+z(−1,0,1)(-y - z, y, z) = y(-1, 1, 0) + z(-1, 0, 1)

The vectors (−1,1,0)(-1, 1, 0) and (−1,0,1)(-1, 0, 1) span WW and are not multiples of each other, so they form a basis and dim⁡W=2\dim W = 2.

Why it happens: the vectors of WW have three entries because WW sits inside R3\mathbb{R}^3. The number of entries describes the surrounding space, not the subspace.

How to check: a subspace with the same dimension as the space around it is the whole space. If dim⁡W\dim W were 33, WW would be all of R3\mathbb{R}^3, but (1,0,0)(1, 0, 0) is not in WW, since 1+0+0≠01 + 0 + 0 \neq 0.

Subtracting the rank from the row count

The dimension of the null space of an m×nm \times n matrix is computed as m−rm - r, from the number of rows, instead of n−rn - r, from the number of columns.

Wrong working: A=(102013)A = \begin{pmatrix} 1 & 0 & 2 \\ 0 & 1 & 3 \end{pmatrix} is 2×32 \times 3 with rank 22, so the null space would have dimension 2−2=02 - 2 = 0, and only x=0\mathbf{x} = \mathbf{0} would solve Ax=0A\mathbf{x} = \mathbf{0}.

Right working: the null space lives in Rn\mathbb{R}^n, the space of inputs, so its dimension is n−r=3−2=1n - r = 3 - 2 = 1. Setting the free variable x3=tx_3 = t gives x1=−2tx_1 = -2t and x2=−3tx_2 = -3t, so the null space is the line spanned by (−2,−3,1)(-2, -3, 1). The count m−r=0m - r = 0 belongs to the left null space.

Why it happens: row reduction works on rows, so their number is the first one at hand. But each column stands for a variable, and the null space has one dimension for each free variable, that is, for each column without a pivot.

How to check: count the columns without a pivot in the echelon form. Here column 33 has none, so the null space has dimension 11. The rank and the null-space dimension must add up to nn, the number of columns.