Grounds vector spaces, bases, coordinates, and the linear algebra vocabulary needed for ML models.
Vector Spaces
A vector space is a set of objects you can add and scale, where those operations behave consistently.
Intuition
The idea in plain words, before the symbols.
A vector space is a set whose elements can be added and scaled, with both operations obeying a few algebraic rules. We begin with two arrows in the plane and form their linear combinations. The figure checks whether those combinations fill the plane or collapse onto one line; the code checks several of the rules. You will need arithmetic on coordinates. The two operations are:
- You can add two things of the same kind.
- You can scale a thing up or down by a number.
A first example. Take two arrows in the plane, and . Scaling multiplies both numbers and adding works number by number, so and . Because and point in different directions, every point of the plane is for some numbers and . One number confirms it: , the signed area of the parallelogram with sides and , is not zero.
Now change one thing: take . This is , so every combination is , a multiple of on one line through the origin, and the area is . In the figure, Pair B is this collapsed case.
The rest of this page names the rules that make these calculations work for every kind of vector. Already know them? Go straight to the definition.
If those two operations obey a short list of rules (associativity, commutativity, a zero element and a few more), then one body of mathematics applies to every such space: projections, least squares, gradients, eigenvectors, Fourier features, embeddings, and more.
The idea is not "arrows". Arrows in 2D are a good mental model, but the objects can be many other things: polynomials, functions, images, token embeddings, or model parameter updates. Anything you can add and scale by these rules can be handled with the same tools.
Study prompts for this section: Intuition
Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.
Mathematics
Definitions, assumptions and the derivation.
Definition (Vector space). A vector space over a field (usually or ) is a set with:
- addition:
- scalar multiplication:
such that for all and :
- There exists with
- For each there exists with
Because both operations land back in , every linear combination stays in the space (this is called closure):
The set of all linear combinations of and is their span, . In , two vectors span the whole plane unless one is a scalar multiple of the other; then their span is a line through the origin, or only the origin if both are zero. The determinant is the signed area of the parallelogram with sides and , and it is zero exactly when the span has collapsed to a line or a point.
In ML, we often work in , but it's useful to remember that "vector" really means "element of some vector space".
Study prompts for this section: Mathematics
Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.
Code
The same calculation as runnable code, in the notation of the derivation.
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)))
Study prompts for this section: Code
Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.
Demo
Change an input, predict the result, and see which quantities respond.
Explore Vector Spaces
Observation guide
Optional and ungraded. Opening a guide saves nothing.
Choose what to inspect in Vector Spaces, then open its guide.
Try this:
- Drag u and v around.
- Move sliders a and b to form the linear combination .
- Before revealing the determinant, predict whether and span a plane, nearly collapse onto one line, or collapse to a line or a point.
Notice the two linked ideas: closure keeps inside the same space, while the determinant (the parallelogram's signed area) tells you whether and span the whole plane or have collapsed into fewer directions.
Study prompts for this section: Demo
Each button copies a prompt about this section to your clipboard, for an AI assistant you already use. Nothing is sent by this site.
Concept: Vector Spaces
What is the smallest example of Vector Spaces you can work through by hand, and what does it show?
DetailsLinear Algebra
Reference id
concept:linear-algebra/vector-spacesAfter the first pass
Go deeper
Optional material for a second reading. Sources are always shown; the other panels open from their headings or from these links, and closing one keeps what you wrote or revealed.What to look for in each sectionChoose a section and what you expect to see in it, then read short advice.
Section by section
Choose what to look for in each section
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.
Choose what you expect to see in this section of Vector Spaces.
Questions to ask of the pictureChoose a part of the picture and what you expect, then read short advice.
Looking at the picture
Questions to ask of the picture
A vector space is a set of objects you can add and scale, where those operations behave consistently.
Which part of the picture should you look at first?
Pick the part of the picture you expect to explain Vector Spaces.
Sources
References for this page
A reference shows where an idea comes from; it does not vouch for every step on this page.Springer, open access. Chapter 1 defines a vector space over R or C by the axioms used on this page; Section 2A defines linear combinations and span.
What each claim rests on1 claim, each with its sources, where it appears on this page, and its caveats.
Claims and sources
A vector space is a set of objects you can add and scale, where those operations behave consistently.
The checks were made by this site, not by an independent reviewer.
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 s...
MML works over the real numbers; the page's field F (usually R or C) is the standard, slightly broader setting. The check covers closure under linear combinations, not affine spaces, modules, norms, complete...
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. The page's equations state the general form over a field; the code checks the operations in R^3, and the demo forms w=a u+b v in R^2.
Explain it without the pageWrite your own explanation before asking for feedback. Your draft and any hints stay while this page is open.
Practice · Vector Spaces
Try the idea in your own words
A vector space is a set of objects you can add and scale, where those operations behave consistently.
Concept · Selected for practice
Vector Spaces
What it rests on: Sources: Mathematics for Machine Learning; Linear Algebra Done Right (4th ed.)
Context and links
Linear Algebra
Explain the mechanism
For Vector Spaces: What is the smallest example of Vector Spaces you can work through by hand, and what does it show? Explain your answer, including what changes, why, and which assumption matters.
A rough first thought is enough. Your draft stays when you change tasks.
Your draft stays on this page and is cleared when you leave or reload.
A little help · Explain
Open one hint at a time. These are suggestions, not your answer or a grade.
0 of 3 hints shown for this question.
Clearing your answer keeps this help record. Outside help is your own report; this page cannot check it.
Where am I stuck? (optional)
Take your draft to a feedback conversation
No AI feedback runs here. You can copy a prompt to use elsewhere; nothing is sent automatically. Review the text before sharing, and leave out private information.
Write an attempt before copying a feedback prompt.
A draft, or an AI reply to it, is not a test of what you have learned. To check that, try a different case later without help.
Ask about this pagePick one item on this page and copy a prompt about it into an AI assistant you already use. Notes you write here stay in this browser.
u = np.array([1.0, 2.0, 3.0])Your question
Choose what your question is about
Pick the idea, equation, source, code, claim, misconception or demo state you want to ask about. The prompt you copy includes it, so the answer can stay on that item.Open the draft below to save one note and next action in this browser.
Vector Spaces
What is the smallest example of Vector Spaces you can work through by hand, and what does it show?
Fixed prompts generated from this item. They are not comments from people or independent reviews.
The 2 cited sources must support this exact item, not just the surrounding topic.
Connect the definition to one equation, piece of code or demo before widening the discussion.
Change one input, then check that the same relationship holds in the mathematics, the code and the demo.
You can state the mechanism in your own words
Local action draftNo local draft saved yetOpen when you are ready to write one next action
This draft stays in this browser and is attached to this item only.
- What the 2 cited sources say about this exact item
- The definition, its prerequisites, and a contrasting concept
- The equation or code that makes the concept concrete
- One demo state that shows what stays the same as the inputs change
- You can state the mechanism in your own words
- You can name the prerequisite that would clear up the confusion
- You can predict how the result changes when one input changes
Reference id
concept/concept-notebook/linear-algebra/vector-spaces
concept:linear-algebra/vector-spaces