Scientia sine finibus

Linear Algebra / Unit 4, Vector Spaces / Topic 4.1

Units and Topics

Unit 4. Vector Spaces

4.1 Vector Spaces and Subspaces

This topic states what a vector space is, so that the methods of Units 1 to 3 can be used for objects other than lists of numbers. It also introduces subspaces, which are the lines and planes through the origin and their relatives in more dimensions.

You need Topics 1.1, 1.4, 2.3, and 3.3 for this topic.

1. What a Vector Space Is

In Unit 1, a vector was a list of numbers. Two operations were defined for vectors: addition, and multiplication by a scalar. All of the later results used only these two operations and a short list of rules that they follow. A vector space is any set of objects that has these two operations and follows these rules. The objects are then called vectors, whatever they are.

A set V is a vector space when two conditions hold.

  • The sum of any two members of V is a member of V, and any scalar multiple of a member of V is a member of V. The set is said to be closed under the two operations.
  • The two operations follow the eight rules below, for all members u, v, and w of V and all scalars c and d.
RuleStatement
1u + v = v + u
2(u + v) + w = u + (v + w)
3There is a zero vector 0, and v + 0 = v
4Each v has an opposite −v, and v + (−v) = 0
51v = v
6c(dv) = (cd)v
7c(u + v) = cu + cv
8(c + d)v = cv + dv

You do not need to memorize the eight rules. They state that addition and scalar multiplication behave in the way that you already expect.

2. Examples of Vector Spaces

  • ℝⁿ, the lists of n real numbers, for any n. This is the example from Unit 1.
  • All 2 by 3 matrices. Two matrices of the same size can be added, and a matrix can be multiplied by a number. The zero vector of this space is the 2 by 3 zero matrix.
  • All polynomials of degree 2 or less, such as 3 + 2x + 5x². The sum of two such polynomials is another one, and so is a multiple. The zero vector is the polynomial 0.
  • All functions f(x) that are defined for all real x. The sum of f and g is the function with the values f(x) + g(x), and the multiple cf is the function with the values cf(x).

The last two examples are the reason for the general definition. A function can be treated as a vector. In quantum mechanics, the state of a particle is described by a function, and the methods of linear algebra are applied to these functions. Unit 9 develops this idea.

3. Subspaces

A subspace is a part of a vector space that is a vector space by itself, with the same two operations. The eight rules hold automatically for the members of a part, so only the closure has to be tested. A subset S of a vector space is a subspace when it passes three tests.

  1. The zero vector is in S.
  2. If u and v are in S, then u + v is in S.
  3. If v is in S and c is any scalar, then cv is in S.

Tests 2 and 3 together say that any linear combination of members of S is a member of S.

Sets that are subspaces, and sets that are not

SetSubspaceReason
The line y = 2x in ℝ²YesIt passes the three tests
The line y = 2x + 1 in ℝ²NoIt does not contain the zero vector
The points of ℝ² with x ≥ 0 and y ≥ 0No(1, 1) is in the set, but −1(1, 1) is not
The x-axis together with the y-axisNo(1, 0) and (0, 1) are in the set, but their sum (1, 1) is not
The plane x + y + z = 0 in ℝ³YesIt passes the three tests
The plane x + y + z = 1 in ℝ³NoIt does not contain the zero vector
The symmetric 2 by 2 matricesYesSums and multiples of symmetric matrices are symmetric
The polynomials p of degree 2 or less with p(0) = 1NoThe zero polynomial has p(0) = 0

Try it: test a set

Choose a set of points in the plane. Drag the blue point and the red point. They stay inside the set. The green ring is the sum u + v, and the purple ring is the multiple cu. The set is a subspace only if the two rings can never leave the set.

The subspaces of the plane and of space

The subspaces of ℝ² are the set that contains only the zero vector, each line through the origin, and ℝ² itself. The subspaces of ℝ³ are the set that contains only the zero vector, each line through the origin, each plane through the origin, and ℝ³ itself. There are no others.

4. The Span of a Set of Vectors Is a Subspace

In Topic 1.1, the span of a set of vectors was the set of all of their linear combinations. A span passes the three tests. The combination with all coefficients equal to 0 is the zero vector. The sum of two linear combinations of the same vectors is another linear combination of them, and so is a multiple.

(av + bw) + (cv + dw) = (a + c)v + (b + d)w

The span of a set of vectors is the smallest subspace that contains those vectors.

5. Two Subspaces That Come from a Matrix

The solutions of a homogeneous system

The solutions of Ax = 0 form a subspace. The zero vector is a solution. Suppose that Ax = 0 and Ay = 0.

A(x + y) = Ax + Ay = 0the sum of two solutions is a solutionA(cx) = cAx = 0a multiple of a solution is a solution

This subspace is called the null space of A.

The solutions of Ax = b with b not equal to 0 do not form a subspace, because the zero vector is not a solution. From Topic 2.3, they are a copy of the null space that has been moved away from the origin by one particular solution.

The column space

The product Ax is a linear combination of the columns of A. The set of all such products is the span of the columns. It is called the column space of A.

The system Ax = b has a solution exactly when b is in the column space of A.

For example, the columns of the matrix below are (1, 2) and (2, 4), which are on one line. The column space is the line through (1, 2). The system Ax = b has a solution for b = (3, 6), and it has no solution for b = (3, 5).

A = 1224

Topic 4.4 studies these two subspaces, and two more, in detail.

Common Mistakes

  • Calling a line or a plane that misses the origin a subspace. A subspace always contains the zero vector.
  • Testing only the zero vector. The quarter of the plane contains the zero vector, but it fails the third test.
  • Testing addition but not scalar multiplication, or the reverse. Both tests are needed.
  • Checking the tests with one pair of vectors only. A test must hold for all members of the set. One failure is enough to show that a set is not a subspace.
  • Thinking that a vector must be a list of numbers or an arrow. Matrices, polynomials, and functions are vectors in their own vector spaces.

Summary

TermMeaning
Vector spaceA set with addition and scalar multiplication that is closed under both and follows the eight rules
ClosedThe result of the operation is still in the set
SubspaceA subset that contains the zero vector and is closed under both operations
SpanAll linear combinations of a set of vectors, which is always a subspace
Null space of AThe solutions of Ax = 0
Column space of AThe span of the columns of A, which is the set of all products Ax

Practice

Work each problem on paper first. Then open the answer to check your work.

1. Is the set of vectors (x, y) with y = 3x a subspace of ℝ²?

Yes. The zero vector satisfies 0 = 3(0).

If y₁ = 3x₁ and y₂ = 3x₂, then y₁ + y₂ = 3(x₁ + x₂), and cy₁ = 3(cx₁).

2. Is the set of vectors (x, y) with xy = 0 a subspace of ℝ²?

No. This set is the two axes together.

The vectors (1, 0) and (0, 1) are in the set, but their sum (1, 1) has xy = 1.

3. Is the set of vectors (x, y, z) with x + 2y − z = 0 a subspace of ℝ³?

Yes. It is the set of solutions of a homogeneous system with one equation, so it is the null space of the matrix 12−1. It is a plane through the origin.

4. Is the set of 2 by 2 matrices with determinant 0 a subspace of the space of all 2 by 2 matrices?

No. The matrices 1000 and 0001 both have the determinant 0, but their sum is the identity matrix, which has the determinant 1.

5. Is the set of polynomials p of degree 2 or less with p(1) = 0 a subspace?

Yes. The zero polynomial has the value 0 at x = 1.

If p(1) = 0 and q(1) = 0, then (p + q)(1) = 0 and (cp)(1) = 0.

6. For A = 1326, is b = (2, 4) in the column space? Is b = (2, 5)?

The columns are (1, 2) and (3, 6), which are both multiples of (1, 2). The column space is the line through (1, 2).

(2, 4) = 2(1, 2) is in the column space. (2, 5) is not a multiple of (1, 2), so it is not in the column space.

Python Practice

Step 1. Test whether a vector is in a set

The plane x + y + z = 0 in ℝ³ is a subspace. A vector is in this plane when the sum of its components is 0. The instruction np.sum adds all of the components of a vector.

Python

The result is 0, so the vector (1, 2, −3) is in the plane.

Step 2. Test the closure

The code below takes two vectors in the plane and tests their sum and one multiple. The + sign adds two vectors, and the * sign multiplies a vector by a number.

Python

Both results are 0, so the sum and the multiple are in the plane.

In the next box, change v to a different vector in the plane x + y + z = 0. Do not use the zero vector or a multiple of u.

Python

Step 3. A set that is not a subspace

The plane x + y + z = 1 is not a subspace. The code below takes two vectors in that plane and tests their sum.

Python

The components of u add to 1, and the components of v add to 1, so both vectors are in the plane. The components of their sum add to 2, so the sum is not in the plane.

Step 4. Vectors in a null space

The null space of a matrix A is the set of solutions of Ax = 0. The @ sign multiplies a matrix by a vector. The matrix below has one row, so its null space is the plane x + 2y − z = 0 from Practice Problem 3. A matrix with one row is still typed with two pairs of square brackets.

Python

Each result is [0]. The vectors x and y are in the null space, and so is the linear combination 3x − 5y.

In the next box, replace the zeros so that w is a vector in this null space. Do not use the zero vector, (1, 0, 1), or (0, 1, 2).

Python

Step 5. Test whether a vector is in a column space

From Topic 2.3, the system Ax = b has a solution when the matrix of coefficients and the augmented matrix have the same rank. So b is in the column space of A exactly when adding b to A as one more column does not increase the rank. The instruction np.column_stack joins a matrix and a vector into one matrix. Its inputs go inside a second pair of parentheses.

Python

The ranks are 1 and 2. The rank increased, so (2, 5) is not in the column space of A. This agrees with Practice Problem 6.

Now change b to a vector that is in the column space. Do not use the zero vector.

Python

Quiz

This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.

Choose how your answers are checked

1. Which of these sets is a subspace of ℝ²?

2. Why is the line y = x + 2 not a subspace of ℝ²?

3. Which of these sets is a subspace of ℝ³?

4. Which vector is in the column space of 1236?

5. The vector (4, y) is in the null space of 1236. Find y.

Next: Topic 4.2, Linear Independence