Linear Algebra

Vector Spaces

A vector space is a set of objects you can add and scale, where those operations behave consistently.

status: publishedimportance: criticaldifficulty 2/5math: highschoolread: 10mlive demo
Editorial mathematical illustration of basis vectors spanning a translucent vector-space sheet.

Concept Structure

Vector Spaces

01Intuition

Start with the picture, metaphor, or geometric mechanism.

02Math

Make the objects explicit and connect them with notation.

03Code

Mirror the equations with runnable implementation details.

04Interactive Demo

Manipulate the mechanism and watch the idea respond.

0prerequisites
3next concepts
3related links

Learning map

Vector Spaces
BeforeNo hard prerequisiteNow4/4 sections readyTryManipulate one control and predict the visible change.NextLinear Independence

Object flow

4/4 sections readyAsk about thisResearch room
ConceptVector SpacesLinear Algebra
1 source attachedLocal snapshot ready
concept:linear-algebra/vector-spaces

Conceptual Bridge

What should feel connected as you move through this page.

Carry inNo hard prerequisite

This page can stand on its own, so the first job is to build the mental picture carefully.

Work hereVector Spaces

A vector space is a set of objects you can add and scale, where those operations behave consistently.

Carry outLinear Independence

The next edge should feel earned: use the demo prediction here before following Linear Independence.

Test the linkManipulate one control and predict the visible change.Then continue to Linear Independence
01

01

Intuition

Build the mental picture first so the rest of the page has something to attach to.

Section prompt

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:

  1. You can add two things of the same kind.
  2. 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

02

Math

Translate the story into symbols, assumptions, and a derivation you can inspect.

Section prompt

Definition (Vector space). A vector space over a field F\mathbb{F} (usually R\mathbb{R} or C\mathbb{C}) is a set VV with:

  • addition: +:V×VV+: V \times V \to V
  • scalar multiplication: :F×VV\cdot: \mathbb{F} \times V \to V

The closure encoded in those operation types gives the linear-combination check:

au+bvV(u,vV,  a,bF).a u + b v \in V \qquad (u,v \in V,\; a,b \in \mathbb{F}).

such that for all u,v,wVu,v,w \in V and a,bFa,b \in \mathbb{F}:

  1. (u+v)+w=u+(v+w)(u+v)+w = u+(v+w)
  2. u+v=v+uu+v = v+u
  3. There exists 0V0 \in V with v+0=vv+0=v
  4. For each vv there exists v-v with v+(v)=0v+(-v)=0
  5. a(bv)=(ab)va(bv) = (ab)v
  6. 1v=v1\cdot v = v
  7. a(u+v)=au+ava(u+v)=au+av
  8. (a+b)v=av+bv(a+b)v = av+bv

In ML, we often work in Rd\mathbb{R}^d, but it's useful to remember that "vector" really means "element of some vector space".

03

03

Code

Keep the implementation aligned with the notation so the algorithm is legible.

Section prompt
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

04

Interactive Demo

Use direct manipulation to connect the explanation to a moving system.

Section prompt

Try this:

  1. Drag u and v around.
  2. Move sliders a and b to form the linear combination w=au+bvw = a u + b v.
  3. 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 ww 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.

difficulty 2/5highschoolcode-aligned
Demo Prediction Checkpoint

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.

Prediction open01 / Intuition
Editorial mathematical illustration of basis vectors spanning a translucent vector-space sheet.
Prediction lens

Start with the picture, metaphor, or geometric mechanism.

Commit first

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.

4/4 stages readyLive demo connected
Prediction

Which visible object should carry the first intuition?

Commit first

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.

book · 2020Mathematics for Machine LearningDeisenroth, Faisal, and Ong

Grounds vector spaces, bases, coordinates, and the linear algebra vocabulary needed for ML models.

Open source

Claim Review

A vector space is a set of objects you can add and scale, where those operations behave consistently.

Status1 substantive review recorded

Claims without a substantive review badge still need exact source-support review.

Sources1 reference

deisenroth-2020-mml

Witnesses3 local objects

Use equation, code, and demo objects to check whether the source support is operational.

Substantively reviewedA vector space has addition and scalar multiplication obeying the vector-space axioms; closure guarantees that for u,v in V and scalars a,b, the linear combination au+bv is still in V.Claim metadata: source checked

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-07

Practice 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.

Readiness0/3 checks ready
Predict

Before touching the demo, predict one visible change that should happen in Vector Spaces.

Hint 1

Reveal when your model needs a nudge.

Hint 2

Reveal when your model needs a nudge.

Hint 3

Reveal when your model needs a nudge.

Object research drawerClose
ConceptVector SpacesLinear Algebra
Code witness comparisonVector Spaces code witness 1u = np.array([1.0, 2.0, 3.0])Prediction before revealVector Spaces interactive demoManipulate one control and predict the visible change.
Grounded room questionWhat is the smallest example that makes Vector Spaces click without losing the math?Local snapshot ready

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.
Next local actionNo local draft saved yet

Open the draft below to save one note and next action in this browser.

conceptLinear Algebra

Vector Spaces

Anchored question

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
Local action draft

This draft stays locally in this browser for concept:linear-algebra/vector-spaces.

No local draft saved.
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
Grounded AI handoff

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.

Open source object
concept/concept-notebook/linear-algebra/vector-spaces concept:linear-algebra/vector-spaces