Vector Spaces

What is a Vector Space?

A vector space (also called a linear space) is a collection of objects called vectors, along with two operations:

  1. Vector addition: You can add two vectors to get another vector.
  2. Scalar multiplication: You can multiply a vector by a number (a scalar) to get another vector.

The scalars usually come from the real numbers \mathbb{R}, but they can also come from the complex numbers \mathbb{C} or other fields.


Example

The set \mathbb{R}^2 (the plane) is a vector space. Vectors are pairs of real numbers:

\mathbf{v} = \begin{bmatrix} x \\ y \end{bmatrix}, \quad x,y \in \mathbb{R}

  • Addition: \begin{bmatrix} x_1 \\ y_1 \end{bmatrix} + \begin{bmatrix} x_2 \\ y_2 \end{bmatrix} = \begin{bmatrix} x_1 + x_2 \\ y_1 + y_2 \end{bmatrix}

  • Scalar multiplication: c \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} c x \\ c y \end{bmatrix}


Axioms of a Vector Space

For a set V to be a vector space (over scalars in a field F), it must satisfy:

  1. Closure under addition and scalar multiplication
  2. Commutativity: \mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u}
  3. Associativity: (\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w})
  4. Additive identity: There exists a vector \mathbf{0} such that \mathbf{v} + \mathbf{0} = \mathbf{v}
  5. Additive inverse: For every \mathbf{v} there exists -\mathbf{v} with \mathbf{v} + (-\mathbf{v}) = \mathbf{0}
  6. Distributivity: a(\mathbf{u} + \mathbf{v}) = a\mathbf{u} + a\mathbf{v} and (a+b)\mathbf{v} = a\mathbf{v} + b\mathbf{v}
  7. Scalar multiplication identity: 1\mathbf{v} = \mathbf{v}

Example with Python

import numpy as np

# define two vectors
u = np.array([2, 1])
v = np.array([1, 3])

# addition
u_plus_v = u + v

# scalar multiplication
scalar_mult = 3 * u

u_plus_v, scalar_mult
(array([3, 4]), array([6, 3]))