This page can stand on its own, so the first job is to build the mental picture carefully.
Linear Algebra
Vector Spaces
A vector space is a set of objects you can add and scale, where those operations behave consistently.

Concept Structure
Vector Spaces
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learning map
Vector SpacesConceptual Bridge
What should feel connected as you move through this page.
A vector space is a set of objects you can add and scale, where those operations behave consistently.
The next edge should feel earned: use the demo prediction here before following Linear Independence.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
A vector space is what you get when you take the two operations that make geometry and algebra feel "linear" and insist they behave nicely:
- You can add two things of the same kind.
- You can scale a thing up or down by a number.
If those two operations obey a small set of consistency rules (associativity, commutativity, a zero element, etc.), then a huge amount of math becomes possible: projections, least squares, gradients, eigenvectors, Fourier features, embeddings, and more.
The key idea is not "arrows". Arrows in 2D are a great mental model, but the real power is that the objects can be many things: polynomials, functions, images, token embeddings, or model parameter updates. If you can add them and scale them consistently, you can treat them with the same tools.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Definition (Vector space). A vector space over a field (usually or ) is a set with:
- addition:
- scalar multiplication:
The closure encoded in those operation types gives the linear-combination check:
such that for all and :
- There exists with
- For each there exists with
In ML, we often work in , but it's useful to remember that "vector" really means "element of some vector space".
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
# A tiny sanity-check: R^3 with usual + and scalar * behaves like a vector space.
u = np.array([1.0, 2.0, 3.0])
v = np.array([-1.0, 0.5, 4.0])
a, b = 2.0, -0.25
# Distributivity: a(u+v) = au + av
lhs = a * (u + v)
rhs = a * u + a * v
print("distributivity error:", float(np.linalg.norm(lhs - rhs)))
# Compatibility: a(bu) = (ab)u
lhs = a * (b * u)
rhs = (a * b) * u
print("compatibility error:", float(np.linalg.norm(lhs - rhs)))
# Zero + additive inverse
zero = np.zeros_like(u)
print("zero check:", bool(np.allclose(u + zero, u)))
print("inverse check:", bool(np.allclose(u + (-u), zero)))
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Try this:
- Drag u and v around.
- Move sliders a and b to form the linear combination .
- Before revealing the span witness, predict whether the two generators sweep a plane, nearly collapse, or collapse to a line/point.
Notice the two linked ideas: closure keeps inside the same ambient space, while the determinant/area witness tells whether the chosen generators can sweep a 2D patch or have collapsed into fewer directions.
Live Concept Demo
Explore Vector Spaces
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Vector Spaces should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
A vector space is a set of objects you can add and scale, where those operations behave consistently.

Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Vector Spaces should make visible.
Visual Inquiry
Make the image answer a mathematical question
A vector space is a set of objects you can add and scale, where those operations behave consistently.
Which visible object should carry the first intuition?
Pick the cue that should make Vector Spaces easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Grounds vector spaces, bases, coordinates, and the linear algebra vocabulary needed for ML models.
Open sourceClaim Review
A vector space is a set of objects you can add and scale, where those operations behave consistently.
Claims without a substantive review badge still need exact source-support review.
deisenroth-2020-mml
Use equation, code, and demo objects to check whether the source support is operational.
MML defines real-valued vector spaces by addition V x V -> V, scalar multiplication R x V -> V, and the usual group/distributive/scalar axioms. It also treats closure and linear combinations as scaled sums staying in V; the page uses standard field notation F while code/demo instantiate R^d/R^2.
Sources: Mathematics for Machine LearningMML is real-valued; the page's field-general F wording is standard but slightly broader than the source. This review checks algebraic closure/linear combinations only, not affine spaces, modules, norms/topology, completeness, basis/independence, or numerical edge cases.A bounded review summary is present; still check caveats and exact source scope.MML Def. 2.9 defines real vector spaces by +: V x V -> V and scalar multiplication R x V -> V plus Abelian-group, distributive, scalar-associative, and identity axioms; Def. 2.11 defines linear combinations sum_i lambda_i x_i in V. Local math states the field-general form; code checks R^3 operations and the demo forms w=a u+b v in R^2.
Reviewer: codex+oracle; reviewed 2026-05-07Practice Loop
Try the idea before it explains itself
A vector space is a set of objects you can add and scale, where those operations behave consistently.
Before touching the demo, predict one visible change that should happen in Vector Spaces.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Vector Spaces
What is the smallest example that makes Vector Spaces click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:linear-algebra/vector-spaces.
- Source ids to inspect: deisenroth-2020-mml
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Vector Spaces Object key: concept:linear-algebra/vector-spaces Context: Linear Algebra Anchor id: concept/concept-notebook/linear-algebra/vector-spaces Open question: What is the smallest example that makes Vector Spaces click without losing the math? Evidence to inspect: - Source ids to inspect: deisenroth-2020-mml - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action.
concept/concept-notebook/linear-algebra/vector-spaces
concept:linear-algebra/vector-spaces