Skip to content

Cheatsheet: Abstract vector spaces

A vector is anything you can add and scale coherently (the first lesson’s math view). Arrows and lists are two examples; functions and polynomials are two more.

(f + g)(x) = f(x) + g(x) (add pointwise)
(c · f)(x) = c · f(x) (scale pointwise)

Both stay inside the set of functions (closure), so functions form a vector space.

Basis for polynomials of degree 3 or less: {1, x, x^2, x^3}, dimension 4.

2x^2 + 5x + 7 <-> [7, 5, 2, 0]

Adding polynomials = adding coordinate vectors: (3x^2 + 1) + (x + 2) -> [1,0,3,0] + [2,1,0,0] = [3,1,3,0] -> 3x^2 + x + 3.

Apply d/dx to each basis polynomial; the images are the columns:

d/dx: 1->0, x->1, x^2->2x, x^3->3x^2
D = [ 0 1 0 0 ]
[ 0 0 2 0 ]
[ 0 0 0 3 ]
[ 0 0 0 0 ]

Differentiate 2x^2 + 5x + 7 (coords [7,5,2,0]):

7·[0,0,0,0] + 5·[1,0,0,0] + 2·[0,2,0,0] = [5, 4, 0, 0] = 4x + 5

Calculus by matrix multiplication.

Any set whose addition and scaling obey the standard axioms (commutativity, distributivity, a zero, etc.). The takeaway, not the list: satisfy them and every tool from the whole track applies (spans, bases, dimension, transformations, determinant, eigenvectors, change of basis).

ML lives in abstract vector spaces, not 2D arrows.

  • Embeddings (word, sentence, image): high-dim vectors; rank by cosine similarity, compress by PCA.
  • Layers: linear transformation (a matrix) + nonlinearity, in a space too big to draw.
  • Function spaces: signals, kernels, neural tangent kernels treat functions as vectors.
  • You can now read “latent space,” “embedding space,” “function space” as vector spaces in this sense.
  • A vector must be an arrow or list. No, that was the teaching model; the definition is add-and-scale.
  • Coordinates are absolute. No, they depend on the chosen basis here too.
  • Abstraction means new rules. No, same addition, scaling, matrices, eigenvectors.
  • The axioms are the thing to learn. No, the consequence is: the whole track applies.

A vector is anything you can add and scale, so functions and polynomials are vectors, the derivative is a matrix, and every tool from this track works on any space that follows the two rules.