44 min read

> Learning paths. Math majors — read everything, especially the careful statement of linearity and the Math-Major Sidebar on what "linear" really demands. CS / Data Science — focus on the Geometric Intuition callouts, the numpy snippets, and the...

Learning Objectives

  • Explain in plain language what linear algebra studies and why it appears across machine learning, graphics, quantum mechanics, data science, signals, and economics.
  • State the two rules of linearity (preservation of vector addition and scalar multiplication) and use them to classify a process as linear or nonlinear.
  • Describe the central viewpoint of this book: a matrix is a function that transforms space (rotate, scale, shear, project).
  • Read a 2D transformation figure produced by the recurring visualizer and predict what a simple 2×2 matrix does to the unit square.
  • Identify the linear-algebra content inside a described real system (e.g., a recommender, a rendered game frame, a qubit).
  • Set up the from-scratch toolkit/ package and run visualize_2d on the identity, a scaling, a rotation, and a shear.

What Is Linear Algebra? The Mathematics Hiding Inside Everything

Learning paths. Math majors — read everything, especially the careful statement of linearity and the Math-Major Sidebar on what "linear" really demands. CS / Data Science — focus on the Geometric Intuition callouts, the numpy snippets, and the tour of applications; the sidebars are optional. Physics / Engineering — focus on the geometry of transformations and the quantum/signals applications, and keep the picture of the moving unit square in your head. In this opening chapter everyone reads the same thing: it assumes no prior linear algebra at all.

1.1 What is linear algebra, and why is it hiding inside everything?

Open your phone. The moment you unlock it with your face, a small program multiplies a grid of pixel-brightness numbers by another grid of numbers, again and again, until a single number comes out that means yes, this is you. That repeated multiplication of grids is linear algebra. When you ask a chatbot a question, the words you typed are turned into long lists of numbers, and those lists are pushed through dozens of grids of numbers in sequence; the answer that comes back is the result. That, too, is linear algebra. When Google ranks the web, when Netflix guesses what you'll watch next, when a hospital reconstructs a cross-section of your body from an MRI scanner, when a video game spins a spaceship smoothly across your screen, when a physicist describes an electron that is somehow in two states at once — every one of these is linear algebra, wearing a different costume each time.

This is the strange and wonderful fact at the center of this book. Linear algebra is the most widely used branch of mathematics in the modern world, and most people have no idea it exists. It is not glamorous the way calculus is glamorous — there is no dramatic story about Newton and falling apples. It does not have the forbidding mystique of number theory. It is the quiet infrastructure underneath the technology you touch every day, the plumbing behind the walls. And yet it is usually taught as a dry sequence of procedures — "row reduce this matrix," "compute that determinant," "find the eigenvalues" — with almost no explanation of why. Students grind through the mechanics and leave without ever seeing the single beautiful idea that ties it all together.

We are going to do the opposite. From the first page, the why comes first, and the why is a picture. Here is the one sentence that this entire book unfolds:

The Key Insight — Linear algebra is the study of linear transformations: ways of moving and reshaping space that keep grid lines straight, evenly spaced, and anchored at the origin. A matrix is just the bookkeeping we use to write one of these transformations down.

Hold that sentence loosely for now; you are not expected to fully understand it yet. By the end of this chapter you will understand it well enough to see why it matters, and by the end of the book it will feel obvious. The goal of Chapter 1 is not to teach you to compute anything — there is not a single row reduction in these pages — but to install the right mental model, so that everything that follows lands in the right place.

So: what is linear algebra? The shortest honest answer is the mathematics of vectors and the transformations between them. A vector, for now, is just an arrow — a quantity with a direction and a length, like a velocity or a displacement (we make this precise in Chapter 2). A transformation is a rule that takes every arrow in space and moves it somewhere. Linear algebra studies the special, beautifully well-behaved transformations — the linear ones — and the spaces they act on. That's it. Everything else, the determinants and the eigenvalues and the four subspaces, is machinery built to understand those two things deeply.

And why is linear algebra important? Because an astonishing range of real problems, when you strip away the surface details, turn out to be questions about linear transformations and vectors. A recommendation engine asks: which direction in "taste space" does this user point? An image is a vector; compressing it asks what is the simplest combination of patterns that approximates this picture? A quantum computer asks: what does this gate, a transformation, do to the state of a qubit? Once you can see the linear algebra hiding inside a problem, you inherit a toolbox — the same toolbox — for solving all of them. That is the promise of this subject, and it is not an exaggeration. Learn it once; use it everywhere.

Let's begin where this book always begins: with a picture.

1.2 What does it mean to say a transformation is "linear"?

Picture an infinite sheet of graph paper — the flat plane, with its grid of perfectly square cells stretching out forever in every direction. We are going to grab this sheet and reshape it. We can stretch it, squash it, rotate it, skew it sideways. We are not allowed to crumple it, tear it, or bend it into a curve. The transformations linear algebra cares about are exactly the ones you can do to the graph paper while keeping every grid line straight, keeping the lines evenly spaced, and keeping the origin (the center point, where the axes cross) pinned in place.

Geometric Intuition — A transformation is linear if, after you apply it, the grid lines are still straight lines, still parallel to each other in each family, and still evenly spaced — and the origin hasn't moved. Stretching, rotating, and skewing all pass this test. Bending the paper into a wave, or sliding the whole sheet over without rotating (so the origin moves), both fail it.

That visual test is the soul of linearity, but to compute with it we need the precise version. A transformation $T$ — a function that takes a vector $\mathbf{v}$ and returns a transformed vector $T(\mathbf{v})$ — is linear when it obeys exactly two rules. Throughout this book, vectors are written in bold lowercase ($\mathbf{u}$, $\mathbf{v}$) and scalars (plain numbers) in italics ($c$):

Rule 1 — it preserves vector addition. For any two vectors $\mathbf{u}$ and $\mathbf{v}$, $$T(\mathbf{u} + \mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v}).$$ In words: transforming the sum is the same as summing the transformed pieces. It does not matter whether you add first and then transform, or transform first and then add — you land in the same place.

Rule 2 — it preserves scalar multiplication. For any vector $\mathbf{v}$ and any number $c$, $$T(c\,\mathbf{v}) = c\,T(\mathbf{v}).$$ In words: if you scale a vector and then transform it, that's the same as transforming it first and then scaling the result by the same amount. Doubling the input doubles the output; tripling triples it.

These two rules are often bundled into one statement, and that bundled form has a name worth knowing.

The Key Insight — Linearity is superposition: the response to a combination of inputs is the same combination of the individual responses. Formally, for any scalars $c$ and $d$, $$T(c\,\mathbf{u} + d\,\mathbf{v}) = c\,T(\mathbf{u}) + d\,T(\mathbf{v}).$$ The whole is exactly the sum of the scaled parts. Break the input apart, transform each piece, scale each result, add them up — you get the right answer.

The word superposition will come back throughout your scientific life. Engineers say a circuit "obeys superposition." Physicists say quantum states "superpose." Signal processors decompose a sound into pure tones, process each, and add them back. Every one of those statements is a claim that some transformation is linear. The reason linear systems are so beloved across science and engineering is precisely this: you can take them apart, deal with the simple pieces, and reassemble the answer. Nonlinear systems offer no such mercy.

Let's make superposition concrete with the smallest possible example. Suppose a transformation $T$ acts on 2D arrows, and we have already discovered what it does to two particular arrows: it sends $\mathbf{u}$ to $T(\mathbf{u})$ and $\mathbf{v}$ to $T(\mathbf{v})$. Then superposition tells us, for free, what $T$ does to any arrow we can build from $\mathbf{u}$ and $\mathbf{v}$ by scaling and adding — to $2\mathbf{u}$, to $\mathbf{u} + \mathbf{v}$, to $3\mathbf{u} - 5\mathbf{v}$, to all of them. Knowing the transformation on a few building-block arrows tells us the transformation everywhere. Hold onto that sentence: it is the seed of the single most important idea in this entire book, and it blossoms in Chapter 7.

Check Your Understanding — A transformation $T$ satisfies $T(\mathbf{u}) = (3, 1)$ and $T(\mathbf{v}) = (0, 2)$. If $T$ is linear, what is $T(2\mathbf{u} + \mathbf{v})$?

Answer

By superposition, $T(2\mathbf{u} + \mathbf{v}) = 2\,T(\mathbf{u}) + T(\mathbf{v}) = 2(3,1) + (0,2) = (6,2) + (0,2) = (6,4)$. You never needed to know what $\mathbf{u}$ and $\mathbf{v}$ actually are — knowing the transformation on the building blocks was enough. That is the power of linearity.

One small but important consequence falls out of Rule 2 immediately. Set the scalar $c = 0$. Then $T(0 \cdot \mathbf{v}) = 0 \cdot T(\mathbf{v})$, which says $T(\mathbf{0}) = \mathbf{0}$: a linear transformation must send the zero vector (the origin) to itself. This is the algebraic echo of "the origin stays pinned." It also gives us a fast way to disqualify a candidate transformation: if it moves the origin, it cannot be linear, full stop.

Common Pitfall — "Linear means a straight line, like $y = mx + b$." Not in this book. The familiar high-school line $y = mx + b$ is not a linear transformation unless $b = 0$, because the $+b$ shifts the origin: at $x = 0$ you get $y = b$, not $y = 0$. A function like $y = mx + b$ with $b \neq 0$ is called affine — linear-plus-a-shift. The distinction feels pedantic now, but it matters enormously: pure rotations and scalings are linear, while "rotate, then slide three units to the right" is affine. We'll see in Chapter 12 the clever trick (homogeneous coordinates) that lets us fold the shift back into a matrix for computer graphics.

Math-Major Sidebar (optional) — Stated abstractly, a linear map is a function $T : V \to W$ between two vector spaces over a common field (Chapter 5 defines vector spaces; for now read $V, W$ as $\mathbb{R}^n$ and $\mathbb{R}^m$) satisfying additivity, $T(\mathbf{u}+\mathbf{v}) = T(\mathbf{u}) + T(\mathbf{v})$, and homogeneity, $T(c\mathbf{v}) = c\,T(\mathbf{v})$. Over the real numbers, additivity alone does not force homogeneity — there exist pathological additive maps that are not homogeneous (built using a Hamel basis and the axiom of choice). This is why the definition demands both conditions explicitly rather than deriving one from the other. You will never meet such a pathology in applied work, but a careful definition closes the door on it. We return to abstract linear maps in Chapter 35.

1.3 Why is "scaling a recipe" linear but "compound interest" is not?

Linearity is easiest to feel through contrast. Let's hold linear and nonlinear processes side by side, in settings that have nothing to do with arrows or graph paper, so you can hear the rhythm of the idea in everyday life.

Linear: scaling a recipe. A cookie recipe calls for 2 cups of flour and 1 cup of sugar to make 24 cookies. Want 48 cookies? Double everything: 4 cups flour, 2 cups sugar. Want 72? Triple it. Want to combine a double batch of cookies and a single batch of brownies? The total flour is the sum of the two flour amounts. Scaling the output scales each input by the same factor, and combining two orders adds their ingredient lists. Both rules of linearity hold. Recipe-scaling is a linear process, which is exactly why nobody finds it hard — you can reason about the parts independently and add them up.

Nonlinear: compound interest. Put \$100 in an account earning 10% per year, compounded annually. After one year you have \$110. Double the time to two years — do you get double the interest? No: you get \$121, because in the second year you earn interest on the interest. The growth is multiplicative, not additive; doubling the input (time) more than doubles the relevant output (total interest earned). Compound interest is nonlinear. This is also why it is so powerful for long-term saving and so dangerous as debt — the nonlinearity compounds in your favor or against you, and you cannot reason about it by simply scaling.

Nonlinear: squaring. Consider the humble operation $f(x) = x^2$. Is $f(2 + 3)$ equal to $f(2) + f(3)$? Let's check: $f(5) = 25$, but $f(2) + f(3) = 4 + 9 = 13$. Not equal. Squaring violates Rule 1 spectacularly. Any time you see a square, a product of two varying quantities, a logarithm, a sine, or an exponential, your linearity alarm should ring — those are the classic nonlinear operations.

There is a clean way to test any process. Ask the two questions: (1) If I add two inputs and run them through, do I get the same answer as running them separately and adding the outputs? (2) If I double an input, does the output double? If both answers are yes, the process is linear. If either is no, it's nonlinear.

Let's run that test on a transformation of arrows, to connect it back to the geometry. Consider the "slide everything one unit right and one unit up" rule, $f(\mathbf{x}) = \mathbf{x} + (1, 1)$ — a pure translation, with no rotating or stretching. It feels like it should be linear; it's about as simple a motion as there is. But watch it fail Rule 1. Take $\mathbf{u} = (1, 2)$ and $\mathbf{v} = (3, 1)$. Adding first: $\mathbf{u} + \mathbf{v} = (4, 3)$, so $f(\mathbf{u} + \mathbf{v}) = (5, 4)$. Transforming first and then adding: $f(\mathbf{u}) = (2, 3)$ and $f(\mathbf{v}) = (4, 2)$, so $f(\mathbf{u}) + f(\mathbf{v}) = (6, 5)$. The two answers, $(5, 4)$ and $(6, 5)$, disagree. Translation is not linear — it's affine, exactly the case the earlier pitfall warned about. The tell is that $f(\mathbf{0}) = (1, 1) \neq \mathbf{0}$: it moves the origin, so it cannot be linear. (Geometrically: sliding the sheet of graph paper sideways moves the center point, which our visual test forbids.) This is not a quirk — it is precisely why computer graphics needs the homogeneous-coordinate trick of Chapter 12, which smuggles translations back into the matrix framework by adding a dimension.

Real-World ApplicationAudio mixing (signals). When a sound engineer combines a vocal track and a guitar track on a mixing board, the resulting waveform is literally the sum of the two waveforms, sample by sample, each scaled by its fader level. Sound, at ordinary volumes in air, superposes — two voices in a room produce a combined pressure wave that is the sum of the individual waves. This linearity is what makes audio engineering tractable: you can record, process, and balance each instrument independently and trust that they add up. It is also why the Fourier transform (Chapter 22), which decomposes any signal into a sum of pure sine waves, is one of the crown jewels of applied linear algebra. (Push the volume high enough that the air itself distorts, and the linearity breaks — that's the gritty "overdrive" sound, and it is genuinely a nonlinear effect.)

A warning before we move on, because this trips up nearly everyone at first: most of the world is nonlinear. Planetary orbits, turbulent fluids, neural firing, economic markets, the weather — none of these is linear. So why spend a whole subject on linear things? Two reasons. First, the linear problems are the ones we can actually solve completely and reliably; nonlinear problems are usually attacked by approximating them with linear ones (that's what calculus does — a derivative is the best linear approximation to a function near a point). Second, a shocking number of important problems are exactly linear, or close enough that the linear model is the right tool. Linear algebra is both the foundation we build everything else on and a powerful direct tool in its own right.

1.4 What does it mean to say "a matrix is a function that transforms space"?

Here is the single most important idea in this book, and we are going to introduce it as a picture before a single number.

Imagine the flat plane again, with its grid. Pick out two special little arrows at the origin: one pointing one unit to the right, which we'll call $\mathbf{e}_1$, and one pointing one unit up, which we'll call $\mathbf{e}_2$. These two arrows are the standard basis vectors — the fundamental "east" and "north" of our space. Every other arrow in the plane can be built from these two by scaling and adding. The arrow pointing to the location $(3, 2)$, for instance, is just $3\mathbf{e}_1 + 2\mathbf{e}_2$: go three units east, two units north.

Now suppose I apply some linear transformation to the whole plane. Because of superposition, I don't need to track what happens to every one of the infinitely many arrows. I only need to know where the transformation sends $\mathbf{e}_1$ and $\mathbf{e}_2$. Once I know the new "east" and the new "north" — call them $\mathbf{e}_1'$ and $\mathbf{e}_2'$ — superposition reconstructs everything: the arrow that was at $3\mathbf{e}_1 + 2\mathbf{e}_2$ lands at $3\mathbf{e}_1' + 2\mathbf{e}_2'$. The whole transformation is captured by just two arrows: where east goes and where north goes.

Geometric Intuition — A linear transformation of the plane is completely determined by what it does to the two basis arrows. Tell me where east and north land, and I can tell you where every point lands. The transformation is fully described by two arrows' worth of information — and a matrix is exactly the device for recording those two arrows.

That is what a matrix is. A matrix is a small table whose columns are the landing spots of the basis vectors. For a 2D transformation we get a $2 \times 2$ table. By convention we write matrices as italic capital letters — $A$, $B$, $P$ — and we stack the new east-arrow in the first column and the new north-arrow in the second: $$A = \begin{bmatrix} \uparrow & \uparrow \\ \mathbf{e}_1' & \mathbf{e}_2' \\ \downarrow & \downarrow \end{bmatrix} = \begin{bmatrix} a & b \\ c & d \end{bmatrix}.$$ The first column $(a, c)$ is where east goes; the second column $(b, d)$ is where north goes. To find where any arrow $\mathbf{v} = (x, y)$ lands, you take $x$ copies of the first column plus $y$ copies of the second: $$A\mathbf{v} = x \begin{bmatrix} a \\ c \end{bmatrix} + y \begin{bmatrix} b \\ d \end{bmatrix}.$$ That weighted sum of columns is matrix-times-vector. We will not dwell on the arithmetic here — Chapter 7 develops it carefully — but notice what just happened: we did not define matrix multiplication as some arbitrary rule to memorize. We derived it from superposition. Multiplying a matrix by a vector means "rebuild the transformed arrow from the transformed building blocks." It could not be anything else.

Common Pitfall — Beginners often see a matrix as "just a grid of numbers" and matrix-times-vector as "a rule where you multiply across rows and down columns and add." That rule is correct, but if it is all you see, you have missed the point entirely. The numbers in a matrix are the coordinates of where the basis vectors go; the multiplication rule is the machinery of superposition. Memorizing the rule without the picture is like memorizing sheet music without ever hearing the song. Keep the moving grid in your head.

Let's make this concrete. Take the matrix $$A = \begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix}.$$ Its first column says east lands at $(2, 1)$; its second column says north lands at $(1, 3)$. Where does the arrow $(2, 3)$ go? Two copies of the first column plus three copies of the second: $$A\begin{bmatrix} 2 \\ 3 \end{bmatrix} = 2\begin{bmatrix} 2 \\ 1 \end{bmatrix} + 3\begin{bmatrix} 1 \\ 3 \end{bmatrix} = \begin{bmatrix} 4 \\ 2 \end{bmatrix} + \begin{bmatrix} 3 \\ 9 \end{bmatrix} = \begin{bmatrix} 7 \\ 11 \end{bmatrix}.$$ The arrow at $(2,3)$ lands at $(7, 11)$. Let's confirm with numpy. A quick note that will matter every time code appears in this book: mathematics indexes from 1 (the first component of $\mathbf{v}$ is $v_1$), but numpy indexes from 0 (the first component is v[0]). Keep that one-step shift in mind.

# Matrix-times-vector as a weighted sum of the matrix's columns.
import numpy as np
A = np.array([[2, 1],
              [1, 3]])
v = np.array([2, 3])
print(A @ v)                      # the @ operator means matrix multiply
# [ 7 11]
print(2 * A[:, 0] + 3 * A[:, 1])  # 2*(first column) + 3*(second column)
# [ 7 11]

The two print statements agree: applying the matrix and rebuilding from the columns give the same answer, $(7, 11)$. (A[:, 0] is numpy for "the whole first column" — every row, column index 0.) This is superposition, executed by a machine. The matrix did not do anything mysterious; it scaled its columns by the components of the input and added them.

Why two columns of numbers can describe an infinite transformation

It is worth pausing on how remarkable this is, because it is the conceptual heart of the chapter. A transformation of the plane has to specify where every one of infinitely many points goes. You might expect that to require an infinite amount of information. It does not. For a linear transformation, four numbers — two columns — pin it down completely, and superposition does the rest. Let's watch that happen, slowly, with a worked example you can follow on paper.

Suppose someone hands you a mystery linear transformation $T$ and tells you only two facts: it sends east to $(2,1)$ and north to $(1,3)$. That is the matrix $A = \begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix}$ from a moment ago. Now I ask you a question they never told you the answer to: where does the arrow pointing to $(1, 1)$ — the corner of the unit square — go? You can deduce it. The arrow to $(1,1)$ is "one east plus one north," that is $\mathbf{e}_1 + \mathbf{e}_2$. By Rule 1 (additivity), $T$ of a sum is the sum of $T$'s, so $$T(\mathbf{e}_1 + \mathbf{e}_2) = T(\mathbf{e}_1) + T(\mathbf{e}_2) = (2, 1) + (1, 3) = (3, 4).$$ The corner of the square lands at $(3, 4)$ — and you figured that out from the two columns alone. Ask about $(4, 0)$? That's "four easts," so by Rule 2 (homogeneity) it lands at $4 \cdot (2,1) = (8, 4)$. Ask about $(2, 3)$? We already did it above: $(7, 11)$. Every question about $T$ has an answer, and the answer is always scale the two columns by the two components and add. The two columns are not a partial description of the transformation; they are the whole transformation, compressed.

# Two columns determine the whole map: rebuild T on several inputs.
import numpy as np
A = np.array([[2, 1],
              [1, 3]])
for v in ([1, 1], [4, 0], [2, 3]):
    v = np.array(v)
    print(v, "->", A @ v)
# [1 1] -> [3 4]
# [4 0] -> [8 4]
# [2 3] -> [ 7 11]

This is exactly why the visualizer in the next section only needs to track a single square. Watch where the corners of the unit square go — equivalently, where east and north go — and you have watched where everything goes. The blue square in those figures is a stand-in for the whole infinite plane.

Geometric Intuition — The unit square is the plane's "DNA sample." Because the transformation is linear, whatever it does to that one little square, it does (scaled and tiled) to every square in the plane. If the unit square doubles in area, so does every region. If the unit square shears 30°, so does the entire grid. This is why one small picture can faithfully represent a transformation of all of infinite space — and it is the reason the visualizer works.

1.5 What do the basic transformations actually look like? (Introducing the visualizer)

We have claimed that matrices rotate, scale, shear, and project space. Now we are going to see it. This is the moment we introduce the single most important tool in this book — a small piece of Python, called the 2D transformation visualizer, that draws what any $2 \times 2$ matrix does to space. It will return in nearly every chapter from here on, always looking the same, so that all forty-odd figures in the book speak one visual language. Here it is, exactly as it lives in toolkit/visualizer.py:

# toolkit/visualizer.py — the recurring 2D transformation visualizer.
# Shows what a 2x2 matrix A does to the unit square and the basis vectors.
import numpy as np
import matplotlib.pyplot as plt

def visualize_2d(A, title="", ax=None):
    """Plot the action of 2x2 matrix A on the unit square and i-hat, j-hat."""
    A = np.asarray(A, dtype=float)
    square = np.array([[0, 1, 1, 0, 0],
                       [0, 0, 1, 1, 0]])          # unit-square corners (closed)
    out = A @ square                               # transformed square
    e1, e2 = A @ np.array([1, 0]), A @ np.array([0, 1])   # images of basis vectors
    if ax is None:
        _, ax = plt.subplots(figsize=(5, 5))
    ax.plot(square[0], square[1], "b--", lw=1, label="input (unit square)")
    ax.fill(out[0], out[1], alpha=0.25, color="C1")
    ax.plot(out[0], out[1], "C1-", lw=2, label="A · (unit square)")
    ax.arrow(0, 0, *e1, color="C3", width=0.02, length_includes_head=True)  # A e1
    ax.arrow(0, 0, *e2, color="C2", width=0.02, length_includes_head=True)  # A e2
    ax.axhline(0, color="gray", lw=0.5); ax.axvline(0, color="gray", lw=0.5)
    ax.set_aspect("equal"); ax.grid(True, alpha=0.3)
    ax.set_title(title or f"det = {np.linalg.det(A):.2f}")
    ax.legend(loc="best", fontsize=8)
    return ax

# Example: a horizontal shear
# visualize_2d([[1, 1], [0, 1]], title="Shear")
# plt.show()

You don't need to understand every line yet. Here is the idea. We start with the unit square — the square with corners at $(0,0)$, $(1,0)$, $(1,1)$, and $(0,1)$ — drawn as a blue dashed outline. This square is built from our two basis arrows: its bottom edge is $\mathbf{e}_1$ (east), its left edge is $\mathbf{e}_2$ (north). Then we apply the matrix $A$ to all four corners and draw the result as a solid orange shape. Two arrows show where east (red) and north (green) land. By watching how the blue square morphs into the orange shape, you can read off everything the matrix does. Let's run it on five fundamental transformations.

The identity: do nothing

The simplest matrix of all is the identity matrix, written $I$: $$I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}.$$ Its first column is $(1, 0)$ — east stays east. Its second column is $(0, 1)$ — north stays north. Nothing moves. The orange shape lands exactly on top of the blue square.

import matplotlib.pyplot as plt
from toolkit.visualizer import visualize_2d
visualize_2d([[1, 0], [0, 1]], title="Identity")
plt.show()

Figure 1.1 — The identity transformation. The orange unit square sits exactly on top of the blue dashed input square; the red arrow (image of east) points to $(1,0)$ and the green arrow (image of north) points to $(0,1)$, unchanged. Alt-text: a single unit square with the transformed square indistinguishable from the input, illustrating that the identity matrix leaves every point fixed.

The identity is to matrices what 1 is to multiplication or 0 is to addition: the transformation that changes nothing. Boring on its own, but it is the reference point against which every other transformation is measured, and it will matter enormously when we ask, in Chapter 9, how to undo a transformation.

Scaling: stretch and squash

Now change the diagonal entries: $$A = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}.$$ The first column is $(2, 0)$: east, doubled in length. The second column is $(0, 3)$: north, tripled. The square stretches into a rectangle — twice as wide, three times as tall.

import matplotlib.pyplot as plt
from toolkit.visualizer import visualize_2d
visualize_2d([[2, 0], [0, 3]], title="Scaling")
plt.show()

Figure 1.2 — A scaling transformation. The unit square stretches into a 2-by-3 rectangle; the red arrow reaches $(2,0)$ and the green arrow reaches $(0,3)$. The figure's title reports the determinant as 6.00. Alt-text: a tall wide rectangle replacing the unit square, showing horizontal stretch by 2 and vertical stretch by 3.

Notice the title says det = 6.00. The original square had area 1; the stretched rectangle has area $2 \times 3 = 6$. That number — the determinant — is measuring exactly how much the transformation scales areas. We are seeing it informally here; Chapter 11 makes it a centerpiece. For now, just register the pattern: the determinant is the area-scaling factor of the transformation. A determinant of 6 means areas grow sixfold; a determinant of 1 means areas are preserved; a determinant of 0 means area is crushed to nothing (we'll meet that case shortly).

Rotation: spin the plane

Here is where it gets satisfying. Consider $$A = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}.$$ First column $(0, 1)$: east gets sent straight up. Second column $(-1, 0)$: north gets sent to point west. The entire plane has spun a quarter turn counterclockwise — a 90° rotation.

import matplotlib.pyplot as plt
from toolkit.visualizer import visualize_2d
visualize_2d([[0, -1], [1, 0]], title="Rotation 90°")
plt.show()

Figure 1.3 — A 90° rotation. The unit square pivots a quarter-turn counterclockwise about the origin; the red arrow (image of east) now points up to $(0,1)$ and the green arrow (image of north) points left to $(-1,0)$. The determinant is 1.00 — rotations preserve area. Alt-text: the unit square rotated 90 degrees counterclockwise around the origin, same size, new orientation.

Rotations are special and beautiful, and they recur throughout the book. The determinant is exactly 1 because spinning the plane doesn't change any areas — it just reorients them. The general rotation by an angle $\theta$ has the matrix $$R_\theta = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix},$$ which you can verify sends east to $(\cos\theta, \sin\theta)$, exactly the point on the unit circle at angle $\theta$. Plug in $\theta = 90°$ ($\cos 90° = 0$, $\sin 90° = 1$) and you recover the matrix above. We will study rotations carefully in Chapter 21, where they turn out to be the gateway to orthogonal matrices and, eventually, to the unitary gates that drive quantum computers.

Shear: slide the layers

A shear is the transformation that turns a square into a slanted parallelogram, the way a stack of paper slides when you push the top sideways: $$A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}.$$ First column $(1, 0)$: east is untouched. Second column $(1, 1)$: north gets pushed one unit to the right while keeping its height. The bottom edge stays put; the top edge slides over.

import matplotlib.pyplot as plt
from toolkit.visualizer import visualize_2d
visualize_2d([[1, 1], [0, 1]], title="Shear")
plt.show()

Figure 1.4 — A horizontal shear. The unit square slants into a parallelogram; the red arrow (image of east) stays at $(1,0)$ while the green arrow (image of north) tilts to $(1,1)$. The determinant is 1.00 — the parallelogram has the same area as the square (same base, same height). Alt-text: a leaning parallelogram with a horizontal bottom edge, illustrating a horizontal shear of the unit square.

The determinant of a shear is 1, which is the algebra confirming a fact you may remember from geometry: a parallelogram has the same area as the rectangle with the same base and height. Shears look modest, but they are workhorses — they appear in image-processing (italicizing text is a shear), in the inner machinery of Gaussian elimination (Chapter 4 — every elimination step is secretly a shear), and in physics.

Projection: flatten onto a line

Our last fundamental transformation throws information away. Consider $$A = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}.$$ First column $(1, 0)$: east is preserved. Second column $(0, 0)$: north is sent to the origin — flattened to zero. Every point gets squashed straight down onto the horizontal axis. This is an orthogonal projection onto the $x$-axis: it is what a shadow does, casting every point onto a line.

import matplotlib.pyplot as plt
from toolkit.visualizer import visualize_2d
visualize_2d([[1, 0], [0, 0]], title="Projection onto x-axis")
plt.show()

Figure 1.5 — A projection onto the horizontal axis. The unit square collapses onto the segment from $(0,0)$ to $(1,0)$; the red arrow (image of east) stays at $(1,0)$ while the green arrow (image of north) shrinks to the origin. The determinant is 0.00 — the square has been crushed to a line, which has zero area. Alt-text: the unit square flattened down to a horizontal line segment on the x-axis, showing a projection.

Here at last is a determinant of zero. The transformation has collapsed a 2D square into a 1D segment; area has been annihilated. A determinant of zero is the signature of a transformation that loses dimensions — it cannot be undone, because once two different points have been squashed onto the same spot, no rule can pull them back apart. This "crushing to a lower dimension" is the geometric meaning of a singular (non-invertible) matrix, and it will be central to Chapter 9 and the whole theory of when systems of equations can be solved. Projection itself is the secret engine behind least-squares fitting and linear regression (Chapter 17 and Chapter 19) — it is how we find the "closest" answer when an exact one doesn't exist.

Check Your Understanding — Without running any code, predict what the matrix $\begin{bmatrix} -1 & 0 \\ 0 & 1 \end{bmatrix}$ does to the unit square. Where do east and north land, and what do you expect the determinant to be?

Answer

The first column $(-1, 0)$ sends east to point west (one unit in the negative-$x$ direction); the second column $(0, 1)$ leaves north alone. This is a reflection across the vertical ($y$) axis — the plane flips left-to-right, like a mirror. The determinant is $(-1)(1) - (0)(0) = -1$. A negative determinant signals that the transformation flips orientation (a left hand becomes a right hand); its absolute value, 1 here, says areas are preserved. We will give the sign of the determinant its full meaning in Chapter 11.

Five matrices, five behaviors: do nothing, stretch, rotate, slide, flatten. Every $2 \times 2$ matrix you will ever meet is some combination of these basic moves, and one of the deepest theorems in the book — the singular value decomposition of Chapter 30 — says that any matrix whatsoever is exactly a rotation (or reflection), a scaling along axes, and another rotation (or reflection) — the outer factors are orthogonal, so each can be a rotation possibly combined with a reflection. The whole zoo reduces to spin–stretch–spin. But that is far ahead; for now, just enjoy that you can already read a matrix as a motion.

1.6 Where does linear algebra actually show up? A tour across fields

You now have the core idea — matrices are functions that transform space, and the well-behaved ones are linear — so let's take the promised tour. The point of this section is to convince you, concretely, that linear algebra is not a niche topic but the connective tissue of modern quantitative work. We will visit six fields. Notice as we go that the same objects (vectors, matrices, transformations) keep reappearing in different clothes.

Machine learning and AI: deep nets are stacks of matrix multiplications

Start with the technology of the moment. A neural network — the thing behind image recognition, language models, recommendation, self-driving perception — is, at its computational heart, a tower of matrix multiplications interleaved with simple nonlinear "squashing" functions. Each layer takes an input vector, multiplies it by a matrix of learned weights (a linear transformation of the data into a new space), adds a bias, and then applies a nonlinearity. Stack dozens or hundreds of such layers and you get a system that can, after training, transform a vector of raw pixel values into a vector of class probabilities.

Strip out the nonlinearities and a neural network is pure linear algebra — a chain of matrices applied one after another. The nonlinearities are essential (without them the whole stack would collapse into a single matrix, since a composition of linear maps is just another linear map — a fact you'll prove in Chapter 8), but the heavy lifting, the part that consumes essentially all the computation when you train GPT-scale models on thousands of GPUs, is matrix multiplication. When people say modern AI runs on linear algebra, this is the literal truth. To see how the layers, weights, and transformations fit together end to end, the dedicated treatment in how neural networks work builds the picture from the ground up; this book gives you the mathematical machinery underneath it, and we return to neural-network layers and embeddings directly in Chapter 33.

Real-World ApplicationRecommendation systems (data science). When Netflix or Spotify guesses what you'll like, it often represents every user and every item as a vector in a shared "taste space" of a few hundred dimensions. Your predicted rating for a movie is essentially the dot product of your vector with the movie's vector — a single linear-algebra operation. Building that space from millions of sparse, incomplete ratings is a matrix factorization problem, a close cousin of the SVD we reach in Chapter 30. We'll trace this story in detail in this chapter's first case study.

Computer graphics: every frame is a pile of matrix multiplications

Every 3D video game and animated film is built on linear algebra, and it is the transformation viewpoint in its purest form. A character model is a cloud of thousands of points (vertices) in 3D space, each a vector. To move the character, rotate it to face a new direction, scale it, and then project the 3D world onto your flat 2D screen, the graphics engine multiplies every one of those vectors by a sequence of matrices — a model matrix, a view matrix, a projection matrix — typically hundreds of times per second. The smooth spin of a spaceship or the turn of a camera is a rotation matrix, exactly like the one in Figure 1.3, applied to millions of points each frame. Your graphics card (GPU) is, fundamentally, a machine built to do enormous numbers of these matrix–vector multiplications in parallel — the same hardware that, not coincidentally, turned out to be perfect for the neural networks above. Chapter 12 is devoted to the graphics pipeline, and our second case study renders a single game frame by hand.

Quantum mechanics: states are vectors, measurements are matrices

Now the most surprising field of all, and the one where linear algebra is not merely a useful tool but the actual language of the physical theory. In quantum mechanics, the state of a system — an electron's spin, a photon's polarization, the configuration of a quantum computer's memory — is described by a vector. The simplest case is the qubit, the quantum bit, whose state is a vector in a two-dimensional space (the two coordinates being, loosely, the amplitudes for "0" and "1"). Every operation a quantum computer performs — every logic gate — is a matrix that transforms this state vector, and crucially these gates are rotations (Chapter 21's orthogonal/unitary matrices). Measuring the system involves yet more linear algebra: the possible outcomes are the eigenvalues of a special matrix, and the probabilities come from projecting the state vector (Chapter 27).

The connection runs deep. The superposition principle you learned in Section 1.2 — "the whole is the sum of scaled parts" — is literally the quantum superposition that lets a qubit be in a blend of 0 and 1 at once. The mathematics is identical because the physics is linear: quantum states superpose exactly the way our arrows do. For the physical story of how a quantum state is built as a vector and what its components mean, see quantum state vectors; this book hands you the linear algebra that makes that story precise. We seed the qubit here and keep returning to it — informally again in Chapter 5, then seriously in Chapters 21, 27, and 34, where Hilbert space (an infinite-dimensional vector space with geometry) closes the loop.

Data science: finding the patterns that matter

Data science lives on a single insight: a dataset is a matrix. Rows are samples (customers, patients, days, documents); columns are features (age, blood pressure, temperature, word counts). The moment your data is a matrix, the entire arsenal of linear algebra is available. The flagship technique is principal component analysis (PCA, Chapter 32), which finds the few directions in a high-dimensional dataset along which the data varies the most — compressing hundreds of correlated features into a handful of meaningful ones. PCA is, underneath, an eigenvalue problem (Chapter 23) and an SVD (Chapter 30). The same SVD that powers PCA also compresses images by throwing away the least important patterns — a demonstration so striking that we have reserved it for Chapter 31, where a photograph stored with just a few patterns looks blurry, and with a couple hundred becomes indistinguishable from the original.

Signals: sound, images, and the Fourier transform

A digital sound is a long vector of air-pressure samples; a digital image is a grid (a matrix) of pixel intensities. Signal processing asks how to filter, compress, and clean these. The central tool is the Fourier transform, which we already met in the audio application above: it is a change of basis (Chapter 16) that rewrites a signal as a combination of pure sine waves — a different set of building-block "directions" in which the signal's structure becomes simple. Noise reduction, MP3 and JPEG compression, the equalizer on your music app, and the reconstruction of an MRI image from raw scanner data are all linear-algebraic operations on these signal vectors. The Fourier story gets its own chapter (Chapter 22), where the sine waves turn out to be an orthonormal basis of a function space.

Economics: who depends on whom

Finally, a field far from physics, to honor the promise that linear algebra is everywhere. Economists model how industries depend on one another with input–output models (a Nobel Prize-winning idea of Wassily Leontief [verify]). If making one dollar of steel requires so much coal, electricity, and labor, and making electricity requires steel, you get a web of linear dependencies that is exactly a system of linear equations — a matrix equation $\mathbf{x} = A\mathbf{x} + \mathbf{d}$ relating total production to consumer demand. Solving it (Chapters 3, 4, and 9) tells you how much each industry must produce to meet a given demand. Market equilibrium, portfolio optimization, and linear programming all rest on the same foundation. Wherever quantities combine additively and proportionally, linear algebra is the natural language.

Epidemiology: how an outbreak's matrix predicts whether it grows

Here is one more field, because it shows the same weighted-sum-of-columns machinery you just learned doing surprisingly heavy lifting in public health. When epidemiologists model the early spread of a disease across a population split into groups — say children, adults, and seniors, who mix at different rates — they build a single matrix that captures who infects whom. Write $M$ for the $3 \times 3$ matrix whose entry in row $i$, column $j$ is the expected number of new infections in group $i$ caused by one infectious person in group $j$. The column for "adults," then, is the complete profile of what one infectious adult does to the whole population: how many children, adults, and seniors they go on to infect.

Now watch the chapter's central idea reappear. Suppose this generation's infectious people form the vector $\mathbf{x} = (10, 4, 2)$ — ten infectious children, four adults, two seniors. The next generation of infections is $M\mathbf{x}$, and by everything we built in Section 1.4 that is nothing but a weighted sum of $M$'s columns: ten copies of the children-column, plus four copies of the adults-column, plus two copies of the seniors-column. With a concrete

$$M = \begin{bmatrix} 2.0 & 1.0 & 0.5 \\ 1.0 & 1.5 & 1.0 \\ 0.5 & 1.0 & 2.0 \end{bmatrix},$$

a single infectious adult (the input $(0,1,0)$, which just selects the middle column) produces $(1.0, 1.5, 1.0)$ new cases, and the mixed group $(10,4,2)$ produces $10(2.0,1.0,0.5) + 4(1.0,1.5,1.0) + 2(0.5,1.0,2.0) = (25, 18, 13)$ in the next round. Applying $M$ again advances another generation, and again, and again — each step is the same matrix, re-applied to its own output. The whole forecast of early spread is iterated matrix–vector multiplication.

The column structure is not just bookkeeping; it tells a planner where to act. Because the next generation is built from $M$'s columns weighted by how many infectious people are in each group, the group whose column carries the largest total is the one seeding the most onward infections — and that is precisely the group where a vaccination campaign or a contact-reduction measure buys the most. Reading a matrix column-by-column, the habit this chapter is drilling into you, turns an abstract grid of transmission rates into a concrete map of where an intervention will do the most good.

# Early-outbreak spread as repeated weighted sums of a transmission matrix's columns.
import numpy as np
M = np.array([[2.0, 1.0, 0.5],
              [1.0, 1.5, 1.0],
              [0.5, 1.0, 2.0]])
x = np.array([10, 4, 2])                 # this generation: children, adults, seniors
print(M @ x)                             # next generation
# [25. 18. 13.]
print(10*M[:, 0] + 4*M[:, 1] + 2*M[:, 2])  # same thing, as a weighted sum of columns
# [25. 18. 13.]
print(max(np.linalg.eigvals(M).real))    # dominant eigenvalue of M
# 3.5

Warning

— This linear picture is only honest near the start of an outbreak, when almost everyone is still susceptible. The famous SIR model of epidemics is genuinely nonlinear: new infections depend on the product of the number of susceptible people and the number of infectious people (an $S \times I$ term — a product of two varying quantities, exactly the kind of nonlinearity Section 1.3 flagged), and as the susceptible pool runs dry the growth bends and stalls. What we have written down is the linearized model valid while susceptibles are abundant — and that early regime is precisely where the question "will this outbreak take off or fizzle?" is decided, so the linear approximation earns its keep.

Real-World ApplicationThe basic reproduction number (public health). The single number epidemiologists watch most — $R_0$, the average number of people one infectious person infects in a fully susceptible population — is, for a mixing model like this, the dominant eigenvalue of the transmission matrix $M$. For the matrix above that eigenvalue is exactly $3.5$, comfortably greater than $1$, so each generation is larger than the last and the outbreak grows; an $R_0$ below $1$ would mean each generation is smaller and the outbreak dies out. We are previewing eigenvalues here only as a teaser — they are the subject of Chapter 23 — but notice the shape of the result: a property a matrix has "deep down" (its dominant eigenvalue) governs the long-run behavior of applying it over and over. That is exactly the structure behind Google's PageRank in Chapter 29, where the same idea ranks the entire web.

Geometric Intuition — Step back and notice the unity. In every field on this tour, the same three objects appeared: a vector (a user's taste, a vertex, a quantum state, a data sample, a signal, a production plan), a matrix (a neural-net layer, a rotation, a quantum gate, a covariance, a Fourier transform, a dependency web), and the act of a matrix transforming a vector. Different costumes, one cast of characters. That is why learning linear algebra once pays off in a dozen fields: you are not learning six subjects, you are learning one subject that wears six masks.

1.7 What questions does the rest of this book answer?

This book has eight parts, and it helps to know the shape of the journey before you start walking. Each part answers one big question, and the questions build on each other.

Part I — Vectors and Systems (Chapters 1–6): What are the raw materials? We build vectors from scratch (Chapter 2), learn what systems of linear equations look like and how many solutions they can have (Chapter 3), master the row-reduction algorithm that solves them (Chapter 4), and then take the first abstract leap — discovering that polynomials and functions are "vectors" too (Chapters 5–6). This part is the vocabulary.

Part II — Matrices as Transformations (Chapters 7–12): What is a matrix, really? Here the book's central idea gets its full treatment. A matrix is revealed as a linear map (Chapter 7); matrix multiplication is unmasked as composition of transformations (Chapter 8); we learn to undo transformations with inverses (Chapter 9), to factor them efficiently (Chapter 10), to measure their area-scaling with the determinant (Chapter 11), and to apply all of it to computer graphics (Chapter 12).

Part III — The Four Fundamental Subspaces (Chapters 13–17): What can a transformation reach, and what does it destroy? This is Gilbert Strang's signature framework — four special spaces attached to every matrix (column, null, row, left-null) that organize the entire subject. It culminates in linear regression (Chapter 17) as a projection.

Part IV — Orthogonality (Chapters 18–22): What does it mean for vectors to be perpendicular, and why is that so useful? Dot products, angles, projections, the Gram–Schmidt process, rotations, and the Fourier series all live here. Perpendicularity is the secret to numerical stability and to "best approximation."

Part V — Eigenvalues and Eigenvectors (Chapters 23–29): the heart of the book. Every matrix has special directions it doesn't rotate — its eigenvectors — and stretch factors along them — its eigenvalues. These reveal what a matrix really does, stripped of coordinate-system clutter. This part climaxes in Google's PageRank algorithm (Chapter 29), which is, astonishingly, the computation of a single eigenvector.

Part VI — Matrix Decompositions (Chapters 30–33): How do we break a matrix into simple, meaningful pieces? The crown jewel is the singular value decomposition (Chapter 30), which factors any matrix into rotate–stretch–rotate. From it flow image compression (Chapter 31), PCA (Chapter 32), and the linear algebra of machine learning (Chapter 33).

Part VII — Advanced Topics (Chapters 34–38): How far does the idea generalize? Inner-product and abstract vector spaces, the Jordan form, the matrix exponential for solving differential equations, and the realities of doing all this on a finite-precision computer.

Part VIII — Synthesis (Chapters 39–40): Putting it together. A capstone project that integrates the from-scratch toolkit you've been building all along, and a closing look at where linear algebra goes next — tensors, functional analysis, and beyond.

You do not need to read it strictly in order to benefit, but the parts are designed to be read in sequence, each leaning on the last. And through every one of them runs the visualizer you just met: the moving unit square is the thread that ties Chapter 1 to Chapter 40.

1.8 Build your own toolkit

Throughout this book you will build a small Python library, from scratch, that implements linear algebra rather than just calling it. The point is that you understand a thing best when you've built it. Each chapter contributes one module, and the rule is strict: inside the toolkit you implement the operations yourself in plain Python, and you may use numpy only to check your work. (Today's contribution is the one exception — the visualizer is a display helper, so it gets to use numpy and matplotlib directly.) By Chapter 39 you will have a working linear-algebra library and the capstone assembles it into a real application — image compression, a recommender, PageRank, or a 3D renderer of your choice.

Let's lay the foundation.

Build Your Toolkit — Create a folder named toolkit/ in your working directory, and inside it create two files. First, an empty __init__.py (this tells Python that toolkit/ is an importable package). Second, visualizer.py containing the exact visualize_2d code printed in Section 1.5 — copy it verbatim; do not change the colors, the figure size, or the layout, because every figure in this book depends on it looking identical. Then write a tiny script that runs the visualizer on the four transformations below and look at what each does to the unit square: ```python

try_visualizer.py — run from the folder that contains toolkit/

import matplotlib.pyplot as plt from toolkit.visualizer import visualize_2d fig, axes = plt.subplots(1, 4, figsize=(16, 4)) visualize_2d([[1, 0], [0, 1]], "Identity", axes[0]) # det 1: nothing moves visualize_2d([[2, 0], [0, 3]], "Scaling", axes[1]) # det 6: area ×6 visualize_2d([[0, -1], [1, 0]], "Rotation", axes[2]) # det 1: quarter turn visualize_2d([[1, 1], [0, 1]], "Shear", axes[3]) # det 1: slanted square plt.tight_layout(); plt.show() `` Watch the determinant printed in each title (1, 6, 1, 1) and connect it to the area you see. You have now built the tool that powers this entire book. Keeptoolkit/— every later chapter adds to it. *(Setup help: Appendix C walks through installing Python,numpy, andmatplotlib` if you're starting fresh.)*

When you run that script you'll see four panels: an unchanged square, a tall-wide rectangle (with det = 6.00 in its title), a quarter-turned square, and a leaning parallelogram. You have reproduced Figures 1.1–1.4 with your own code. That is a genuinely good feeling, and it's the feeling this book aims for in every chapter — understanding you can run.

1.9 A little history, and the one idea to carry forward

Historical Note — The word matrix was coined by the English mathematician James Joseph Sylvester in 1850, who used the Latin word for "womb" to describe a rectangular array of numbers out of which determinants ("minors") could be born [verify]. His friend and collaborator Arthur Cayley developed the algebra of matrices — including matrix multiplication and the notion of an inverse — in a landmark 1858 memoir [verify]. Strikingly, the transformations came first and the matrices second: mathematicians had been studying linear substitutions and the geometry of motions for decades (Gauss's work on solving linear systems predates the word "matrix" by half a century), and the matrix was invented as a compact notation for transformations people were already using. The historical order mirrors the pedagogical order of this book: the transformation is the real thing; the matrix is how we write it down.

That historical accident — transformation first, notation second — is exactly the lesson of this chapter. It is tempting, once you start computing, to think of linear algebra as a set of procedures for manipulating grids of numbers. Resist that. Whenever you see a matrix in the coming chapters, ask the question that organizes the whole subject:

The Key InsightWhat does this matrix DO to space? Does it rotate, stretch, shear, project, or some combination? The grid of numbers is just a costume; underneath, a matrix is always a function that transforms space, and almost every theorem in this book is a statement about that transformation. Hold this idea, and the rest of linear algebra unfolds from it.

In the next chapter we build the vector — the arrow — properly, from the ground up, as both a geometric object and a list of numbers, and we add our first real module, vectors.py, to the toolkit. The picture of the moving unit square goes with you from here to the end.