Abstract Vector Spaces
A vector doesn't have to be an arrow, or a list of numbers. The whole machinery of linear algebra —
basis, dimension,
independence,
linear maps — never actually cared what the vectors were. It only used two operations:
adding two vectors, and scaling one by a number. So anything
you can add and scale, following the familiar rules, is a vector space — and
everything you know about \mathbb{R}^n instantly applies to it.
That's a startling amount of leverage. Polynomials, functions, matrices, even the solutions of a
differential equation all turn out to be vectors, and linear algebra hands you their structure for
free.
The rules that define a vector space
A set V with an addition and a scalar multiplication is a
vector space (over the real numbers) when those operations obey eight axioms — all
just "the arithmetic behaves sensibly":
- Closure: \mathbf{u} + \mathbf{v} and
c\mathbf{v} are again in V.
- Addition is commutative and associative.
- There is a zero vector \mathbf{0}, and every
\mathbf{v} has a negative
-\mathbf{v}.
- Scalars distribute:
c(\mathbf{u}+\mathbf{v}) = c\mathbf{u}+c\mathbf{v} and
(c+d)\mathbf{v} = c\mathbf{v}+d\mathbf{v}.
- Scalar multiplication is compatible
(c(d\mathbf{v}) = (cd)\mathbf{v}) and
1\mathbf{v} = \mathbf{v}.
Notice what's not here: no mention of coordinates, arrows, lengths or angles. Those are
extra structure some spaces happen to have. The axioms alone are enough to build a basis and a
dimension.
Vectors in disguise
- Polynomials of degree \le n: add them, scale them,
and you stay among such polynomials. This space has dimension n+1, with
basis \{1, x, x^2, \dots, x^n\}.
- Matrices of a fixed size m \times n: a vector space
of dimension mn.
- Functions f:\mathbb{R}\to\mathbb{R}: you can add and
scale them — an infinite-dimensional space.
- Solutions of a linear homogeneous differential equation: add two solutions or
scale one and you get another solution — they form a vector space, which is why such
equations have "general solutions" built from a basis of independent solutions.
A polynomial is really just its list of coefficients — a coordinate vector in the
\{1, x, x^2, \dots\} basis. Adding polynomials is adding those
coefficient vectors. Press Run:
// Represent a polynomial by its coefficient vector: [a0, a1, a2] means a0 + a1·x + a2·x².
type Poly = number[];
function add(p: Poly, q: Poly): Poly {
const n = Math.max(p.length, q.length);
const out: Poly = [];
for (let i = 0; i < n; i++) out.push((p[i] ?? 0) + (q[i] ?? 0));
return out;
}
function scale(c: number, p: Poly): Poly {
return p.map((a) => c * a);
}
const p: Poly = [1, 2, 0]; // 1 + 2x
const q: Poly = [0, 3, 4]; // 3x + 4x²
console.log("p + q =", add(p, q)); // [1, 5, 4] -> 1 + 5x + 4x²
console.log("3p =", scale(3, p)); // [3, 6, 0] -> 3 + 6x
console.log("p + 0 =", add(p, [0, 0, 0])); // unchanged: the zero polynomial
The polynomials behave exactly like coordinate vectors because, as a vector space, that's precisely
what they are.
Here's the pay-off. Differentiation \tfrac{d}{dx} is a
linear map on the space of polynomials:
\tfrac{d}{dx}(f+g) = f' + g' and
\tfrac{d}{dx}(cf) = cf'. So in the basis
\{1, x, x^2, x^3\} it is nothing but a matrix — the one
that sends x^k to kx^{k-1}. Calculus, viewed
through abstract vector spaces, becomes linear algebra: eigenvectors of
\tfrac{d}{dx} are exponentials, and that is the whole reason
e^{x} is special.
-
To qualify as a vector space you must satisfy all the axioms. The usual
failures are a missing zero or missing inverses: the vectors
in \mathbb{R}^2 with only positive entries are not a vector
space — you can't negate them, and there's no zero.
-
A subspace (a subset that is itself a vector space) must contain the zero
vector and be closed under addition and scaling. A line through the origin is a
subspace; a line that misses the origin is not.