Linear Algebra

§5 Vector Spaces

1. The Big Idea

Vector spaces are about building objects using addition and scalar multiplication.

The objects might be ordinary vectors, polynomials, matrices, or something more abstract. The same questions keep coming back:

  1. Can these objects build the whole space?
  2. Is any object redundant?
  3. Do we have the perfect set of building blocks?

Here is the vocabulary in plain language:

IdeaPlain meaning
linear combinationa recipe made by scaling and adding vectors
spaneverything those recipes can build
linear independenceno redundancy
basisspans the space and has no redundancy
coordinatesinstructions for building a vector from a chosen basis
dimensionnumber of vectors in a basis

The main theme is simple: a basis is the cleanest possible way to describe a space.


2. Linear Combinations

A vector w\vec{w} is a linear combination of vectors v1,v2,,vr\vec{v}_1,\vec{v}_2,\dots,\vec{v}_r if

w=a1v1+a2v2++arvr\vec{w}=a_1\vec{v}_1+a_2\vec{v}_2+\cdots+a_r\vec{v}_r

where a1,a2,,ara_1,a_2,\dots,a_r are scalars.

The scalars are called coefficients.

Think of a linear combination as a recipe:

  • the vectors are the ingredients
  • the coefficients say how much of each ingredient to use
  • the final result is the vector you build

For example, if

v1=(1,0),v2=(0,1)\vec{v}_1=(1,0),\qquad \vec{v}_2=(0,1)

then

3v1+5v2=(3,5)3\vec{v}_1+5\vec{v}_2=(3,5)

So (3,5)(3,5) is a linear combination of v1\vec{v}_1 and v2\vec{v}_2.


3. Span

The span of a set of vectors is the set of all possible linear combinations of those vectors.

span{v1,v2,,vr}\operatorname{span}\{\vec{v}_1,\vec{v}_2,\dots,\vec{v}_r\}

means all vectors you can build using v1,v2,,vr\vec{v}_1,\vec{v}_2,\dots,\vec{v}_r.

If a set spans a space, then the vectors in the set can build every vector in that space.

Standard Basis of R3\mathbb R^3

Let

e1=(1,0,0),e2=(0,1,0),e3=(0,0,1)e_1=(1,0,0),\qquad e_2=(0,1,0),\qquad e_3=(0,0,1)

These vectors span R3\mathbb R^3, because every vector

(x,y,z)(x,y,z)

can be written as

(x,y,z)=x(1,0,0)+y(0,1,0)+z(0,0,1)(x,y,z)=x(1,0,0)+y(0,1,0)+z(0,0,1)

So e1,e2,e3e_1,e_2,e_3 can build every vector in R3\mathbb R^3.


4. Spanning Polynomial Spaces

Vector spaces do not have to contain arrows. They can contain polynomials too.

For P2P_2, the space of polynomials of degree at most 2, every polynomial looks like

a+bx+cx2a+bx+cx^2

The standard spanning set is

{1,x,x2}\{1,x,x^2\}

because

a+bx+cx2=a(1)+b(x)+c(x2)a+bx+cx^2=a(1)+b(x)+c(x^2)

This is the same idea as vectors in R3\mathbb R^3. The objects look different, but we are still building everything from a few basic pieces.


5. Spanning Matrix Spaces

Matrices can also form vector spaces.

For M2×2M_{2\times 2}, the space of all 2×22\times 2 matrices, every matrix looks like

[abcd]\begin{bmatrix} a&b\\ c&d \end{bmatrix}

The standard spanning set is

{[1000],[0100],[0010],[0001]}\left\{ \begin{bmatrix} 1&0\\ 0&0 \end{bmatrix}, \begin{bmatrix} 0&1\\ 0&0 \end{bmatrix}, \begin{bmatrix} 0&0\\ 1&0 \end{bmatrix}, \begin{bmatrix} 0&0\\ 0&1 \end{bmatrix} \right\}

Each matrix turns on one entry and leaves the others zero.

Any matrix in M2×2M_{2\times 2} can be built as

[abcd]=a[1000]+b[0100]+c[0010]+d[0001]\begin{bmatrix} a&b\\ c&d \end{bmatrix} = a\begin{bmatrix} 1&0\\ 0&0 \end{bmatrix} + b\begin{bmatrix} 0&1\\ 0&0 \end{bmatrix} + c\begin{bmatrix} 0&0\\ 1&0 \end{bmatrix} + d\begin{bmatrix} 0&0\\ 0&1 \end{bmatrix}

So those four matrices span M2×2M_{2\times 2}.


6. How to Check Linear Combinations and Span

To check whether a vector is in a span, turn the question into a system of equations.

Suppose you want to know whether w\vec{w} is a linear combination of v1,v2,v3\vec{v}_1,\vec{v}_2,\vec{v}_3.

Set up

w=av1+bv2+cv3\vec{w}=a\vec{v}_1+b\vec{v}_2+c\vec{v}_3

Then solve for a,b,ca,b,c.

Result of the systemMeaning
has a solutionw\vec{w} is in the span
has no solutionw\vec{w} is not in the span

Checking Whether Vectors Span Rn\mathbb R^n

If you have nn vectors in Rn\mathbb R^n, place them as columns in a matrix:

A=[v1v2v3]A= \begin{bmatrix} |&|&|\\ \vec{v}_1&\vec{v}_2&\vec{v}_3\\ |&|&| \end{bmatrix}

For three vectors in R3\mathbb R^3:

det(A)0\det(A)\neq 0

means the vectors span R3\mathbb R^3.

If

det(A)=0\det(A)=0

then they do not span all of R3\mathbb R^3.

This determinant shortcut works when the number of vectors matches the dimension, so the matrix is square.


7. Linear Independence

A set of vectors is linearly independent if no vector in the set is redundant.

The formal test is:

a1v1+a2v2++arvr=0a_1\vec{v}_1+a_2\vec{v}_2+\cdots+a_r\vec{v}_r=\vec{0}

If the only solution is

a1=a2==ar=0a_1=a_2=\cdots=a_r=0

then the vectors are linearly independent.

This is called the trivial solution.

If there is a solution where at least one coefficient is not zero, then the vectors are linearly dependent.

Meaning

SituationMeaning
independentno vector can be built from the others
dependentat least one vector is unnecessary because it can be built from the others

So linear independence is really a no-redundancy test.


8. Fast Independence Test with Determinants

For nn vectors in Rn\mathbb R^n, place the vectors as columns in a square matrix AA.

If

det(A)0\det(A)\neq 0

then the vectors are linearly independent.

If

det(A)=0\det(A)=0

then the vectors are linearly dependent.

This is one of the fastest exam methods, but remember the condition: it works directly when you have exactly nn vectors in Rn\mathbb R^n.

For example, three vectors in R3\mathbb R^3 form a 3×33\times 3 matrix, so the determinant test applies.


9. Basis

A basis is a set of vectors that does two things:

  1. It spans the space.
  2. It is linearly independent.

So a basis is the perfect set of building blocks.

It has enough vectors to build the whole space, but no extra unnecessary vectors.

PropertyWhy it matters
spanscan build every object in the space
independenthas no redundant builders

Basis of R3\mathbb R^3

The standard basis is

{(1,0,0),(0,1,0),(0,0,1)}\{(1,0,0),(0,1,0),(0,0,1)\}

Every vector in R3\mathbb R^3 can be built from these vectors, and none of them is redundant.


10. Coordinates Relative to a Basis

Coordinates depend on the basis you choose.

If

S={v1,v2,,vn}S=\{\vec{v}_1,\vec{v}_2,\dots,\vec{v}_n\}

is an ordered basis, and

v=c1v1+c2v2++cnvn\vec{v}=c_1\vec{v}_1+c_2\vec{v}_2+\cdots+c_n\vec{v}_n

then the coordinate vector of v\vec{v} relative to basis SS is

[v]S=[c1c2cn][\vec{v}]_S= \begin{bmatrix} c_1\\ c_2\\ \vdots\\ c_n \end{bmatrix}

These coordinates are not the vector itself. They are the instructions for building the vector from the basis SS.

The order of the basis matters. If you swap the order of the basis vectors, the coordinate vector changes too.


11. Basis for Subspaces

A subspace is a smaller vector space sitting inside a larger vector space.

To find a basis for a subspace, look for the free parameters. Each free parameter usually gives one basis vector.

Example: Trace-Zero 2×22\times 2 Matrices

Let

M={AM2×2:tr(A)=0}M=\left\{ A\in M_{2\times 2}:\operatorname{tr}(A)=0 \right\}

This means MM is the set of all 2×22\times 2 matrices whose trace is zero.

A general matrix in M2×2M_{2\times 2} looks like

A=[abcd]A= \begin{bmatrix} a&b\\ c&d \end{bmatrix}

The trace condition is

a+d=0a+d=0

so

d=ad=-a

Thus every matrix in this subspace looks like

A=[abca]A= \begin{bmatrix} a&b\\ c&-a \end{bmatrix}

Now break it apart by parameters:

A=a[1001]+b[0100]+c[0010]A = a \begin{bmatrix} 1&0\\ 0&-1 \end{bmatrix} + b \begin{bmatrix} 0&1\\ 0&0 \end{bmatrix} + c \begin{bmatrix} 0&0\\ 1&0 \end{bmatrix}

So a basis is

{[1001],[0100],[0010]}\left\{ \begin{bmatrix} 1&0\\ 0&-1 \end{bmatrix}, \begin{bmatrix} 0&1\\ 0&0 \end{bmatrix}, \begin{bmatrix} 0&0\\ 1&0 \end{bmatrix} \right\}

There are three free parameters: aa, bb, and cc. That is why the basis has three matrices and the subspace has dimension 3.


12. Problem-Solving Routine

For vector space problems, use this routine:

  1. Identify the space. Are you working in Rn\mathbb R^n, a polynomial space, a matrix space, or a subspace?
  2. To test a linear combination, set up coefficients. Write the target as a combination of the given vectors and solve.
  3. To test span, ask whether every object can be built. For nn vectors in Rn\mathbb R^n, use a determinant if possible.
  4. To test independence, set the combination equal to zero. Only the trivial solution means independent.
  5. To find a basis, keep enough vectors to span but remove redundancy. A basis must do both jobs.
  6. For subspaces, look for free parameters. Break the general object into parameter times basic objects.
  7. Dimension equals the number of basis vectors. Count the final basis elements.

13. Key Takeaways

  • A linear combination is a recipe made from scalar multiples and addition.
  • The span is everything those recipes can build.
  • A vector is in a span if the matching coefficient system has a solution.
  • Linear independence means no redundancy.
  • A basis is both spanning and linearly independent.
  • Coordinates relative to a basis are instructions for building a vector from that basis.
  • Dimension is the number of vectors in a basis.
  • For subspaces, free parameters often reveal the basis.

Mini-Self-Check

  1. What does it mean for w\vec{w} to be in span{v1,v2}\operatorname{span}\{\vec{v}_1,\vec{v}_2\}?

It means w\vec{w} can be written as a linear combination of v1\vec{v}_1 and v2\vec{v}_2:

w=av1+bv2\vec{w}=a\vec{v}_1+b\vec{v}_2

for some scalars aa and bb.

Click to reveal
  1. What is the difference between a spanning set and a basis?

A spanning set can build the whole space, but it might have redundant vectors. A basis spans the space and is linearly independent, so it has no redundancy.

Click to reveal
  1. If three vectors in R3\mathbb R^3 are placed as columns of AA and det(A)=0\det(A)=0, what does that mean?

The vectors are linearly dependent and do not span all of R3\mathbb R^3.

Click to reveal
  1. Why does order matter in a basis?

Because coordinates are listed according to the order of the basis vectors. Changing the order changes the meaning of each coordinate entry.

Click to reveal
  1. Why is the trace-zero 2×22\times 2 matrix subspace dimension 3?

The trace condition forces d=ad=-a, leaving three free parameters: aa, bb, and cc. Therefore the basis has three matrices, so the dimension is 3.

Click to reveal
Back to Linear Algebra