Ran Wei/ Linear Algebra
中文
Linear Algebra · Vectors and linear systems

Module 4Subspaces, bases and dimension

Describe the directions a set can reach and find coordinates that express each vector uniquely.

80 minYou need Modules 1–3

In this module you will

  • Test whether a set is a subspace
  • Distinguish spanning from linear independence
  • Find a basis and use it to change coordinates
1

Closure and span

A subspace of Rn\mathbb R^n contains zero and is closed under addition and scalar multiplication. An equivalent test for a nonempty set is closure under every linear combination of two of its members. This explains why the line y=2xy=2x is a subspace and the parallel line y=2x+1y=2x+1 is not. The latter misses zero.

The span of a list of vectors consists of all their linear combinations. It is a subspace because adding or scaling combinations gives another combination of the same list. In particular, the span is the smallest subspace containing the list.

Try it

Change the generating vectors. Compare the two directions when they are independent with what happens when one is a multiple of the other.

2

Independent directions and coordinates

A list is linearly independent when the zero vector has only one representation as a combination of the list, with all coefficients zero. Otherwise at least one vector is redundant: solve a nonzero relation for any vector with a nonzero coefficient.

A basis is an independent spanning list. Spanning gives coordinates for every vector. Independence makes those coordinates unique, because two different coordinate lists for the same vector would yield a nonzero relation on subtraction. The dimension is the number of vectors in a basis. One way to justify that the count is fixed: a basis of kk vectors identifies the space with Rk,\mathbb R^k\mathclose{\text{,}} where more than kk vectors are dependent by elimination and fewer than kk cannot span because their matrix has fewer than kk pivots.

Example 4.1A basis in a plane✓ Checked

In R3\mathbb R^3 take the plane x+y+z=0.x+y+z=0\mathclose{\text{.}} Put x=s,x=s\mathclose{\text{,}} y=ty=t and then z=−s−t.z=-s-t\mathclose{\text{.}} The vectors (1,0,−1)T(1,0,-1)^\mathsf T and (0,1,−1)T(0,1,-1)^\mathsf T span the plane. Comparing their first two entries proves independence. The dimension is 2.2\mathclose{\text{.}}

3

Change the basis, keep the vector

Put the basis columns into B.B\mathclose{\text{.}} If c\mathbf c is the coordinate vector relative to that ordered basis, then BcB\mathbf c is the vector in ordinary coordinates. To find c,\mathbf c\mathclose{\text{,}} solve Bc=v.B\mathbf c=\mathbf v\mathclose{\text{.}} The same physical displacement can have different coordinates in different bases.

Compute itCoordinates in a nonstandard basis
Python
from sympy import Matrix

B = Matrix([[1, 1], [0, 1]])
v = Matrix([5, 2])
print(list(B.LUsolve(v)))
Output
[3, 2]
4

Exercises

Exercise 4.1★Offset plane

Is x+y+z=1x+y+z=1 a subspace of R3?\mathbb R^3\mathclose{\text{?}}

Show solution✓ Checked

No. Zero fails the equation, since its coordinate sum is 0.0\mathclose{\text{.}}

Exercise 4.2★★Remove a redundant generator

Find a basis for the span of (1,0,1)T,(1,0,1)^\mathsf T\mathclose{\text{,}} (0,1,1)T,(0,1,1)^\mathsf T\mathclose{\text{,}} and (1,1,2)T.(1,1,2)^\mathsf T\mathclose{\text{.}}

Show solution✓ Checked

The third is the sum of the first two, so it adds no direction. The first two are independent because their first two entries form the coordinate vectors of R2.\mathbb R^2\mathclose{\text{.}} Keep those two.

Exercise 4.3★★★Coordinates in two bases

Find the coordinates of (5,2)T(5,2)^\mathsf T relative to the ordered basis (1,0)T,(1,1)T,(1,0)^\mathsf T,(1,1)^\mathsf T\mathclose{\text{,}} then relative to the reversed order.

Show solution✓ Checked

In the first order, the second entry gives coefficient 22 for (1,1)T.(1,1)^\mathsf T\mathclose{\text{.}} The first entry leaves coefficient 33 for (1,0)T.(1,0)^\mathsf T\mathclose{\text{.}} Reversing the order gives coordinates (2,3)T.(2,3)^\mathsf T\mathclose{\text{.}}

5

Check yourself

1
What is the dimension of the span of a single nonzero vector?
2
Which line is a subspace?
3
Why are basis coordinates unique?
Finished this module?