Every way to test a subspace and find its basis
The full checklist for "is this a subspace, and if so, what's a basis and its dimension?"
Start with the subspace test — closure under addition and scalar multiplication, plus containing the zero vector. Once you know you have a subspace, span tells you how to generate it, linear independence tells you when a spanning set has no redundancy, and basis is what happens when both hold at once. Dimension is just the count of vectors in that basis — and it's the same count no matter which basis you pick.
Step 1 — is it a subspace at all?
Term
subspace
The definition — a subset closed under addition and scalar multiplication, containing 0.
Let V be a vector space and let W \subset V be a nonempty subset. Then W is a subspace of V if and only if both of the following hold:
\mathbf{u}, \mathbf{v} \in W \implies \mathbf{u} + \mathbf{v} \in Wc \in \mathbb{R},\ \mathbf{u} \in W \implies c\mathbf{u} \in WThe three-part checklist to verify before anything else.
Show proof
(\implies) If W is a subspace, it is itself a vector space under the addition and scalar multiplication inherited from V, so both closure properties hold automatically — that direction is immediate from the definition of "subspace" and needs no further argument.
(\impliedby) This is the direction that does real work: assume W is nonempty and closed under addition and scalar multiplication, and check that W inherits every vector space axiom from V.
First, \mathbf{0} \in W. Since W is nonempty, pick any \mathbf{u} \in W. Closure under scalar multiplication with c = 0 gives 0 \cdot \mathbf{u} = \mathbf{0} \in W. So W contains the zero vector without that having to be assumed separately — it falls out of nonemptiness plus scalar closure.
Next, every \mathbf{u} \in W has its negative in W: closure under scalar multiplication with c = -1 gives (-1)\mathbf{u} = -\mathbf{u} \in W.
With \mathbf{0} \in W and negatives available inside W, the two closure hypotheses supply exactly the operations W needs: addition of any two elements of W stays in W, and scaling any element of W by any real number stays in W. So W is closed under both vector space operations, and it contains an additive identity and additive inverses drawn from that same closure.
Every remaining axiom — commutativity and associativity of addition, associativity of scalar multiplication, the distributive laws, and the identity 1 \cdot \mathbf{u} = \mathbf{u} — is an equation that holds for all vectors in V, by hypothesis that V is a vector space. Since every element of W is in particular an element of V, each of these equations holds for the elements of W too; W is not required to satisfy some different, weaker set of axioms, only the same ones V already satisfies for every vector it contains. So none of these need separate verification — they are inherited, not re-derived.
Having the two closure properties, an identity element, inverses, and every other axiom inherited for free, W satisfies the full definition of a vector space under the operations of V, restricted to W. That makes W a subspace of V.
Why the test stops at two conditions. A first guess might list three requirements — closure under addition, closure under scalar multiplication, and \mathbf{0} \in W — and that three-condition version is also correct and commonly used. The proof above shows why the third condition is redundant whenever W is already known to be nonempty: scaling any single element of W by 0 produces \mathbf{0}, so nonemptiness plus scalar closure already forces \mathbf{0} \in W. The nonemptiness hypothesis cannot be dropped, though — \varnothing satisfies both closure conditions vacuously (there are no pairs or elements to violate them) but is not a vector space, since it has no zero vector.
Sanity check: take V = \mathbb{R}^2 and W = \{(x, y) : y = x\}, the line through the origin. Adding two points on that line, (a, a) + (b, b) = (a+b, a+b), lands back on the line, and scaling, c(a,a) = (ca, ca), does too — both closure conditions hold, so the test confirms W is a subspace, matching the geometric fact that a line through the origin is a subspace of the plane. Shift the line off the origin to W' = \{(x, y) : y = x + 1\} and closure under scalar multiplication already fails: (0,1) \in W' but 2(0,1) = (0,2) \notin W', correctly flagging that a line missing the origin is not a subspace.
Step 2 — describe what it contains
Term
span
Every linear combination of a given set of vectors.
For any nonempty set of vectors \{\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k\} in a vector space V, \operatorname{span}\{\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k\} is a subspace of V — in fact it is the smallest subspace of V containing every \mathbf{v}_i.
The span of any set of vectors is automatically a subspace.
Show proof
Write W = \operatorname{span}\{\mathbf{v}_1, \dots, \mathbf{v}_k\}, so W is exactly the set of all linear combinations c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_k\mathbf{v}_k with scalars c_1, \dots, c_k. Checking that W is a subspace of V means checking three things: \mathbf{0} \in W, W is closed under addition, and W is closed under scalar multiplication.
Contains the zero vector. Taking every coefficient to be 0 gives the linear combination 0\mathbf{v}_1 + 0\mathbf{v}_2 + \cdots + 0\mathbf{v}_k = \mathbf{0}, so \mathbf{0} \in W. In particular W is nonempty.
Closed under addition. Let \mathbf{u}, \mathbf{w} \in W. Then by definition of W there are scalars a_1, \dots, a_k and b_1, \dots, b_k with \mathbf{u} = a_1\mathbf{v}_1 + \cdots + a_k\mathbf{v}_k, \qquad \mathbf{w} = b_1\mathbf{v}_1 + \cdots + b_k\mathbf{v}_k. Adding these and grouping term by term, \mathbf{u} + \mathbf{w} = (a_1 + b_1)\mathbf{v}_1 + \cdots + (a_k + b_k)\mathbf{v}_k, which is again a linear combination of \mathbf{v}_1, \dots, \mathbf{v}_k — with coefficients a_i + b_i — so \mathbf{u} + \mathbf{w} \in W.
Closed under scalar multiplication. Let \mathbf{u} \in W as above and let t be any scalar. Then t\mathbf{u} = t(a_1\mathbf{v}_1 + \cdots + a_k\mathbf{v}_k) = (ta_1)\mathbf{v}_1 + \cdots + (ta_k)\mathbf{v}_k, again a linear combination of \mathbf{v}_1, \dots, \mathbf{v}_k, so t\mathbf{u} \in W.
All three conditions hold, so W is a subspace of V.
Smallest such subspace. Every \mathbf{v}_i lies in W, since \mathbf{v}_i is the linear combination with coefficient 1 on \mathbf{v}_i and 0 elsewhere. Now suppose U is any subspace of V with \mathbf{v}_1, \dots, \mathbf{v}_k \in U. Because U is closed under scalar multiplication, each c_i\mathbf{v}_i \in U, and because U is closed under addition, the sum c_1\mathbf{v}_1 + \cdots + c_k\mathbf{v}_k \in U for every choice of scalars. That sum is an arbitrary element of W, so W \subseteq U. Hence W sits inside every subspace containing the \mathbf{v}_i's, which is exactly what it means for W to be the smallest one.
No vector in the set is redundant — none is a combination of the others.
Step 3 — pin down a basis and its dimension
Term
basis
A spanning set that is also linearly independent — the minimal complete description.
Theorem
The Basis Theorem
Let V be a vector space with \dim V = n, and let S \subset V be a set of exactly n vectors. Then S is linearly independent if and only if S spans V — and when either holds, S is a basis for V.
Every basis of a given subspace has the same number of vectors.
Show proof
Write S = \{v_1, \dots, v_n\}. Two facts about V are already on hand from the definition of dimension: every linearly independent subset of V can be grown, one vector at a time, into a basis of V; and every basis of V has exactly n vectors, since \dim V = n.
Independent \implies spanning. Suppose S is linearly independent but, toward a contradiction, does not span V. Then some w \in V lies outside \operatorname{span}(S). Adjoining w to S keeps the set independent: if c_1v_1 + \cdots + c_nv_n + c_{n+1}w = 0 with c_{n+1} \ne 0, solving for w would express it as a combination of v_1,\dots,v_n, placing w in \operatorname{span}(S) — which was excluded — so c_{n+1} = 0, and then the independence of S forces every remaining c_i = 0 as well. So S \cup \{w\} is an independent set of n+1 vectors. Extend it to a basis of V exactly as in the growing process above; that basis has at least n+1 vectors, contradicting \dim V = n. No such w exists, so S spans V, and an independent spanning set is by definition a basis.
Spanning \implies independent. Suppose S spans V but, toward a contradiction, is linearly dependent. Dependence means some v_k is a linear combination of the other n-1 vectors in S; deleting v_k leaves a set of n-1 vectors whose span is unchanged, since every occurrence of v_k in a combination can be rewritten using the rest. So V is spanned by only n - 1 vectors. A basis can always be extracted from a spanning set by discarding vectors that are combinations of the others already kept, so V would have a basis of at most n-1 vectors — contradicting \dim V = n. No such dependence exists, so S is independent, and again an independent spanning set is a basis.
Sanity check: in \mathbb{R}^2, where n = 2, the two vectors (1,1) and (1,-1) are independent (neither is a scalar multiple of the other), so the theorem guarantees — without any separate spanning check — that they already span all of \mathbb{R}^2.
Theorem
The Spanning Set Theorem
Let S = \{\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_p\} be a set of vectors in a vector space V, and let H = \operatorname{span}(S).
- If some \mathbf{v}_k \in S is a linear combination of the remaining vectors in S, then the set S' = S \setminus \{\mathbf{v}_k\} formed by removing \mathbf{v}_k still satisfies \operatorname{span}(S') = H.
- If H \neq \{\mathbf{0}\}, some subset of S is a basis for H.
How to trim a spanning set down to a basis by discarding dependent vectors.
Show proof
First claim. Suppose \mathbf{v}_k is a linear combination of the other vectors in S, say \mathbf{v}_k = c_1\mathbf{v}_1 + \cdots + c_{k-1}\mathbf{v}_{k-1} + c_{k+1}\mathbf{v}_{k+1} + \cdots + c_p\mathbf{v}_p. Write S' = S \setminus \{\mathbf{v}_k\}. Since S' \subseteq S, every vector reachable as a combination of S' is automatically reachable as a combination of S, so \operatorname{span}(S') \subseteq H.
For the reverse inclusion, take any \mathbf{y} \in H. Then \mathbf{y} is some combination \mathbf{y} = a_1\mathbf{v}_1 + \cdots + a_k\mathbf{v}_k + \cdots + a_p\mathbf{v}_p. Substitute the expression for \mathbf{v}_k above in place of \mathbf{v}_k and collect terms: each \mathbf{v}_i with i \neq k now carries the combined coefficient a_i + a_k c_i, and \mathbf{v}_k has vanished entirely. So \mathbf{y} is a linear combination of S' alone, giving H \subseteq \operatorname{span}(S'). The two inclusions together give \operatorname{span}(S') = H.
Second claim. If H \neq \{\mathbf{0}\}, then S contains at least one nonzero vector, so among all subsets of S that span H, choose one, call it B, with the fewest vectors possible (such a subset exists because S itself spans H and S is finite, so there are only finitely many subsets to compare). It remains to show B is linearly independent, which makes it a basis for H.
Suppose toward a contradiction that B is linearly dependent. Then some vector in B is a linear combination of the others in B — removing that vector, by the first claim applied to B in place of S, leaves a smaller subset of B (hence of S) that still spans H. This contradicts the minimality of B. So B is linearly independent, and since B already spans H, B is a basis for H.
Sanity check: with S = \{\mathbf{v}_1, \mathbf{v}_2\} where \mathbf{v}_2 = 3\mathbf{v}_1 and \mathbf{v}_1 \neq \mathbf{0}, the second vector is a multiple of the first, so dropping it leaves S' = \{\mathbf{v}_1\} with \operatorname{span}(S') = \operatorname{span}(S) exactly as the theorem predicts — and \{\mathbf{v}_1\} is itself the minimal, linearly independent spanning set, i.e. the basis the second claim guarantees.
Term
dimension
The number of vectors in any basis — well-defined by the basis theorem.