In elementary physics, a vector is often described as a directed line segment. While intuitive, this definition is insufficient for higher mathematics. Modern linear algebra treats a Vector Space as an abstract algebraic structure—a “playground” where elements can be added together and scaled by numbers.
1. Defining the Playground
A Vector Space over a field (typically ) is a set equipped with two operations: vector addition () and scalar multiplication (). Instead of memorizing axioms as dry rules, we can view them as the “laws of physics” for our data.
Standard Euclidean Space:
The most common example is , where addition and scaling are performed component-wise. Let’s verify the Commutativity () and Distributivity () properties using NumPy.
Interactive Lab
import numpy as np
# Define two vectors in R3
u = np.array([1, 2, 3])
v = np.array([4, 5, 6])
a = 2.5
# 1. Verify Commutativity
lhs_add = u + v
rhs_add = v + u
print(f"Addition Commutativity: {lhs_add} == {rhs_add}")
# 2. Verify Distributivity
lhs_dist = a * (u + v)
rhs_dist = a * u + a * v
print(f"Distributivity: {lhs_dist} == {rhs_dist}")
# Check if they are numerically equal
print(f"Equal? {np.allclose(lhs_dist, rhs_dist)}")
For any set to be a formal Vector Space, these eight rules must hold for all and scalars :
Commutativity: .
Associativity: .
Additive Identity: There is a such that .
Additive Inverse: For every , there is a such that .
Multiplicative Identity: .
Compatibility: .
Distributivity of Scalar: .
Distributivity of Vector: .
Exercise: The Non-Vector Space
Consider the set of all points in the first quadrant: . Why does this fail to be a vector space?
Interactive Lab
import numpy as np
# A point in the first quadrant
v = np.array([5, 10])
# Scaling by a negative number
scalar = -1
result = scalar * v
print(f"Original vector: {v}")
print(f"Scaled by -1: {result}")
# Is result in the first quadrant?
is_in_q = np.all(result >= 0)
print(f"Is the result still in the first quadrant? {is_in_q}")
python
1import numpy as np
2
3# A point in the first quadrant
4v = np.array([5, 10])
5
6# Scaling by a negative number
7scalar =-1
8result = scalar * v
9
10print(f"Original vector: {v}")
11print(f"Scaled by -1: {result}")
12
13# Is result in the first quadrant?
14is_in_q = np.all(result >=0)
15print(f"Is the result still in the first quadrant? {is_in_q}")
The failure shown above violates Closure under Scalar Multiplication. If we scale a “positive” vector by a negative number, we leave the set. Thus, the first quadrant is not a vector space.
3. Abstract Examples: Polynomials
The beauty of these axioms is that “vectors” don’t have to be arrows. They can be functions or polynomials. The set of polynomials of degree forms a vector space because adding two polynomials yields another polynomial, and the axioms hold.
Knowledge Check
Why is the set of polynomials of *exactly* degree 3 not a vector space?
Answer: It lacks an additive identity (zero polynomial).
If you add x^3 and -x^3, the result is 0, which has degree 0, not degree 3. It fails closure. Also, the zero polynomial (identity) has degree 0, not 3.
Why is the set of polynomials of *exactly* degree 3 not a vector space?
4. Function Spaces
In advanced applications like Fourier analysis, we treat signals (functions) as vectors. If and are continuous functions, then is also continuous.
Interactive Lab
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0, 1, 100)
f = np.sin(2 * np.pi * t)
g = np.cos(4 * np.pi * t)
# Vector addition of 'functions' (sampled)
h = f + g
plt.plot(t, f, '--', label='f(t)')
plt.plot(t, g, '--', label='g(t)')
plt.plot(t, h, 'k', linewidth=2, label='f(t) + g(t)')
plt.legend()
plt.title("Addition in Function Space")
plt.show()