Vector spaces are the abstract framework that unifies all of linear algebra. Functions, polynomials, and solutions to differential equations are all vector spaces.
Key Concepts
Vector Space Axioms
A set V is a vector space over ℝ if it satisfies 8 axioms: closure under addition and scalar multiply, associativity, commutativity, zero vector, additive inverse, distributive laws.
Subspaces
A subset W of V is a subspace if: 1) W contains the zero vector. 2) W is closed under addition. 3) W is closed under scalar multiply. Lines through origin, planes through origin are subspaces.
Linear Independence
Vectors v₁, v₂, ..., vₙ are linearly independent if the only solution to c₁v₁ + c₂v₂ + ... + cₙvₙ = 0 is all cᵢ = 0. Otherwise linearly dependent (one vector is a combo of others).
Basis & Dimension
A basis is a linearly independent set that spans V. All bases have the same number of vectors — this is the dimension of V. ℝⁿ has dimension n. Standard basis: e₁=(1,0,...,0), e₂=(0,1,...,0), etc.
Live Python Practice
import math
def is_independent_2d(v1, v2):
"""Check if 2D vectors are linearly independent"""
# They're dependent iff cross product = 0
cross = v1[0]*v2[1] - v1[1]*v2[0]
return abs(cross) > 1e-10, cross
def is_independent_3d(v1, v2, v3):
"""Check if 3D vectors are linearly independent (det of matrix ≠ 0)"""
det = (v1[0]*(v2[1]*v3[2]-v2[2]*v3[1])
-v1[1]*(v2[0]*v3[2]-v2[2]*v3[0])
+v1[2]*(v2[0]*v3[1]-v2[1]*v3[0]))
return abs(det) > 1e-10, det
print("2D linear independence tests:")
test_2d = [
([1,0],[0,1]), # Standard basis
([1,2],[2,4]), # Dependent (v2 = 2*v1)
([1,1],[1,-1]), # Independent
]
for v1,v2 in test_2d:
ind, cross = is_independent_2d(v1, v2)
print(f" {v1}, {v2}: independent={ind}, det={cross:.3f}")
print("\n3D linear independence tests:")
test_3d = [
([1,0,0],[0,1,0],[0,0,1]), # Standard basis
([1,2,3],[2,4,6],[1,0,1]), # v2 = 2*v1, dependent
([1,0,1],[0,1,1],[1,1,0]), # Independent
]
for v1,v2,v3 in test_3d:
ind, det = is_independent_3d(v1,v2,v3)
print(f" {v1},{v2},{v3}: ind={ind}, det={det:.3f}")
Interactive Lab
v₁:v₂:
Blue dots = span of v₁ and v₂. Independent vectors span ℝ² (fill the plane). Dependent vectors only span a line.