Skip to content

14. Vector Span

Updated
17 Sept 2026
3 min read
7 sections
Page 16 of 17
Master Linear Algebra with Python

Vector Span

Span is almost the same concept as a subspace — but the two terms carry slightly different emphasis. A subspace is the region of space itself; the span of a set of vectors is how you generate that region through linear combinations.

A subspace is a region of space you can reach by any linear combination of a given set of vectors. Those vectors are said to span that subspace.

1. Formal Definition

Given a set of nn vectors {v1,v2,…,vn}\{ \mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_n \}, their span is the set of all possible linear combinations:

span{v1,…,vn}={α1v1+α2v2+⋯+αnvn  |  αi∈R}\text{span}\{\mathbf{v}_1, \dots, \mathbf{v}_n\} = \left\{ \alpha_1\mathbf{v}_1 + \alpha_2\mathbf{v}_2 + \cdots + \alpha_n\mathbf{v}_n \;\middle|\; \alpha_i \in \mathbb{R} \right\}

Because the scalars αi\alpha_i can be arbitrarily large or small, the span always stretches to infinity — just like a subspace.


2. Is a Vector in the Span?

A key question in linear algebra: "Is vector v\mathbf{v} inside the span of set SS?"

  • Yes — if v\mathbf{v} can be expressed as a linear combination of the vectors in SS.
  • No — if no combination of scalars can produce v\mathbf{v} from SS.

Example

Let the spanning set be: S={s1,s2}={[110],  [170]}S = \left\{ \mathbf{s}_1, \mathbf{s}_2 \right\} = \left\{ \begin{bmatrix}1\\1\\0\end{bmatrix},\; \begin{bmatrix}1\\7\\0\end{bmatrix} \right\}

Test two candidate vectors: v=[120],w=[321]\mathbf{v} = \begin{bmatrix}1\\2\\0\end{bmatrix}, \qquad \mathbf{w} = \begin{bmatrix}3\\2\\1\end{bmatrix}

v∈span(S)\mathbf{v} \in \text{span}(S)? — Yes, using weights α1=56\alpha_1 = \tfrac{5}{6} and α2=16\alpha_2 = \tfrac{1}{6}: 56[110]+16[170]=[120]=v✓\frac{5}{6}\begin{bmatrix}1\\1\\0\end{bmatrix} + \frac{1}{6}\begin{bmatrix}1\\7\\0\end{bmatrix} = \begin{bmatrix}1\\2\\0\end{bmatrix} = \mathbf{v} \checkmark

w∈span(S)\mathbf{w} \in \text{span}(S)? — No. Both spanning vectors have a zero third element. No weighted combination of zeros can produce $1$: α1⋅0+α2⋅0=0≠1  ⟹  w∉span(S)\alpha_1 \cdot 0 + \alpha_2 \cdot 0 = 0 \neq 1 \implies \mathbf{w} \notin \text{span}(S)

Finding the correct weights is generally not trivial — it requires matrix computations (solving linear systems). Focus on the concept for now: can the target vector be reached?

3. Geometric Interpretation

One vector → Line

A single non-zero vector spans an infinitely long line through the origin — a 1D subspace.

Two independent vectors → Plane

Two vectors pointing in different directions span an infinite flat plane — a 2D subspace. The 3D plot below illustrates this:

  • 🔴 Red — the two spanning vectors s1,s2\mathbf{s}_1, \mathbf{s}_2 (define the plane)
  • 🟢 Green — vector v\mathbf{v} lies on the plane (in the span)
  • 🔵 Blue — vector w\mathbf{w} pokes out of the plane (not in the span)

Two independent vectors in R2\mathbb{R}^2 → All of R2\mathbb{R}^2

In 2D space, two independent vectors span the entire plane — every point in R2\mathbb{R}^2 can be reached by some linear combination. The question is only what the weights are.


4. Adding a Redundant Vector Does Not Extend the Span

If you add a third vector already inside the span of the first two, the span does not grow:

span{v1,v2,v3}=span{v1,v2}when v3∈span{v1,v2}\text{span}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\} = \text{span}\{\mathbf{v}_1, \mathbf{v}_2\} \quad \text{when } \mathbf{v}_3 \in \text{span}\{\mathbf{v}_1, \mathbf{v}_2\}

Once you span all of R2\mathbb{R}^2, no additional vector can increase it — it is already fully covered.


5. Multiple Sets Can Span the Same Space

Different sets of vectors can span the same subspace. What changes is the coordinate description — i.e., the weights needed to reach any given point.

Example: Same point, two coordinate systems

Using spanning set S1={v1,v2}S_1 = \{\mathbf{v}_1, \mathbf{v}_2\}: p=−1⋅v1+0⋅v2\mathbf{p} = -1 \cdot \mathbf{v}_1 + 0 \cdot \mathbf{v}_2

Using a different spanning set S2={u1,u2}S_2 = \{\mathbf{u}_1, \mathbf{u}_2\}: p=32⋅u1+12⋅u2\mathbf{p} = \frac{3}{2} \cdot \mathbf{u}_1 + \frac{1}{2} \cdot \mathbf{u}_2

Same point — but very different coordinates. Some spanning sets are more convenient than others for certain problems. This idea is central to basis, explored in the next lesson.


Key Takeaways

  • Span: All possible linear combinations α1v1+⋯+αnvn\alpha_1\mathbf{v}_1 + \cdots + \alpha_n\mathbf{v}_n of a given set of vectors.
  • Membership: v∈span(S)\mathbf{v} \in \text{span}(S) iff v\mathbf{v} can be written as a linear combination of the vectors in SS.
  • Geometry: 1 independent vector → line; 2 → plane; nn independent vectors in Rn\mathbb{R}^n → all of Rn\mathbb{R}^n.
  • Redundancy: Adding a dependent vector leaves the span unchanged.
  • Multiple spanning sets: Many sets span the same subspace; they differ only in how they coordinatize it.

6. Python: Visualising a Spanning Plane in 3D

python
# set S
S1 = np.array([1, 1, 0])
S2 = np.array([1, 7, 0])

# vectors v and w
v = np.array([1, 2, 0])
w = np.array([3, 2, 1])

# draw vectors
fig = plt.figure()
# ax = fig.add_subplot(projection='3d')
ax = plt.axes(projection = '3d')
ax.plot([0, S1[0]],[0, S1[1]],[.1, S1[2]+.1],'r',linewidth=3)
ax.plot([0, S2[0]],[0, S2[1]],[.1, S2[2]+.1],'r',linewidth=3)

ax.plot([0, v[0]],[0, v[1]],[.1, v[2]+.1],'g',linewidth=3)
ax.plot([0, w[0]],[0, w[1]],[0, w[2]],'b')

# now draw plane
xx, yy = np.meshgrid(range(-15,16), range(-15,16))
cp = np.cross(S1,S2)
z1 = (-cp[0]*xx - cp[1]*yy)*1./cp[2]
ax.plot_surface(xx,yy,z1)

plt.show()
Out · plot
Output 1