Linear algebra, from vectors to singular values
A single number can describe one measurement. Most things worth describing take several — a point in space, a set of features, a signal sampled at many times. The moment you bundle numbers into a list and want to add two such lists, or scale one, you’re already doing linear algebra; the whole subject is what happens when you take those two operations (adding, scaling) seriously and ask exactly what structure they support.
Vector spaces
Geometric vectors in the plane obey some obvious rules: , there’s a zero vector that does nothing, every vector has an opposite, scaling twice is the same as scaling by the product, and so on. A vector space over is any set with an addition and a scalar multiplication satisfying exactly these rules (associativity and commutativity of addition, existence of a zero vector and additive inverses, and compatibility of scalar multiplication with addition and with itself) — abstracted away from any particular picture of arrows.
The point of abstracting is that other things satisfy the exact same rules. Polynomials of degree add and scale exactly like vectors do, and so do matrices. Anything you prove using only the vector space axioms automatically holds for all of these at once — that’s the payoff for formalizing what could otherwise feel like an unnecessary relabeling of .
Span, independence, basis, dimension
A set of vectors spans a space if every vector in the space is some linear combination of them. A set is linearly independent if no vector in it is a linear combination of the others (equivalently: the only linear combination equal to zero is the trivial one, all coefficients zero). A basis is an independent spanning set — enough vectors to reach everywhere, none of them redundant.
A space can have many different bases, but they all have the same size. This isn’t obvious from the definition, and it’s worth actually proving, because “dimension” only makes sense as a single number if this is true.
Claim. If and are both bases of the same finite-dimensional vector space, then .
Proof sketch (exchange argument). Suppose . Since spans the space, write ; some (else , contradicting independence of the ‘s), so we can solve for that in terms of and the other ‘s, and swap it in: still spans the space. Repeat, bringing in next and eliminating some remaining (always possible, because a set that already spans can absorb one more independent vector by ejecting some old spanning vector it’s now linearly dependent with) — after such swaps every has been replaced by a , and the set spans the whole space. But then (which exists since ) would be a linear combination of , contradicting the independence of . So , and by the symmetric argument ; hence .
So dimension — the common size of every basis — is well-defined. This one proof is what makes every later statement of the form “an -dimensional space” meaningful rather than dependent on an arbitrary choice of basis.
Linear maps and matrices
A linear map satisfies and . Here’s the key structural fact: once you fix a basis of the domain, is completely determined by the values , because any vector has
by linearity — no other information about is needed. Writing each in coordinates with respect to a basis of the codomain, and stacking those coordinate vectors as the columns of a table, gives exactly a matrix ; the formula above says computing in coordinates is computing where is ‘s coordinate vector. A matrix isn’t an arbitrary grid of numbers with a strange multiplication rule bolted on — it’s a linear map, written down relative to a choice of basis.
This also explains why matrix multiplication is defined the way it is. Composing two linear maps, then , should correspond to some combined matrix. If represents (columns ) and represents , then , and applying via its matrix gives times that column. So the -th column of the matrix representing is times the -th column of — which is exactly the row-times-column rule for computing . Matrix multiplication is function composition, written in coordinates; it isn’t an independent definition you separately have to memorize.
Systems of equations, rank, and rank–nullity
Solving is asking: is in the image of the linear map , and if so, which map to it? Gaussian elimination is the mechanical procedure for answering this, and the language that organizes what it tells you is rank: the dimension of ‘s column space (equivalently, its image).
Rank–nullity theorem. For a linear map with finite-dimensional,
Proof. Let be a basis of (dimension ). Extend it to a basis of (any independent set can be extended to a basis of a finite-dimensional space — an application of the same exchange-style reasoning as above). I claim is a basis of . Spans: any for equals since each . Independent: if then , so , meaning for some ; but is independent, so this forces every . Hence has dimension exactly , giving .
This single theorem is why, for a square matrix, “no nontrivial kernel” and “surjective” and “invertible” all turn out to be the same condition — they’re just the two sides of rank–nullity forced together when .
Determinants
Geometrically, is the signed factor by which scales volume: the unit square (or cube, or hypercube) maps to a parallelepiped of volume , with the sign flipping when reverses orientation. Defined via cofactor expansion, the two properties that matter most are:
- Multiplicativity: . This isn’t a coincidence — it has to hold, because applying then scales volume by then by , and the combined map scales volume by the product.
- is singular. If ‘s columns are linearly dependent, the parallelepiped they span is flattened into a lower-dimensional set, which has zero volume in the ambient dimension — hence . Conversely a nonzero determinant means genuine full-dimensional volume, which requires the columns to be independent, i.e. invertible.
Eigenvalues and eigenvectors
Most directions get rotated or sheared by a linear map. An eigenvector is a direction that doesn’t: for some scalar (the eigenvalue) — the map merely stretches or shrinks it. Rearranging, has a nonzero solution exactly when is singular, i.e.
the characteristic equation, whose roots are ‘s eigenvalues.
Worked example. Let . The characteristic polynomial is
so or . For : gives , so , e.g. . For : gives , so , e.g. . Check: ✓, and ✓.
A matrix is diagonalizable exactly when it has a full basis of independent eigenvectors (then with diagonal and ‘s columns the eigenvectors — directly from , which just restates column by column). Not every matrix qualifies: has characteristic polynomial , so its only eigenvalue is with multiplicity , but gives only the one-dimensional solution space — there’s no second independent eigenvector to complete a basis. This matrix (a Jordan block) is a genuine, unavoidable obstruction, not an edge case that better bookkeeping removes.
The capstone: singular value decomposition
Eigendecomposition is elegant but fragile — it requires enough eigenvectors to form a basis, and even when it exists, eigenvectors of a non-symmetric matrix aren’t generally orthogonal, and needn’t even be square. The singular value decomposition fixes all of this at once, for any matrix:
with () and () orthogonal, and () diagonal with non-negative entries (the singular values).
Where do come from? Consider , an symmetric matrix. Symmetric matrices are always diagonalizable by an orthogonal matrix (the spectral theorem — I’ll state this rather than prove it here, but it’s the one fact this whole construction leans on), so with orthogonal and diagonal. Since is also positive semidefinite ( for every ), its eigenvalues are ; write , i.e. . Now define for each with — these turn out to be orthonormal:
which is for (since ) and for (since and ). Collect these as columns of (extended to a full orthogonal basis if the number of nonzero ), and for every is exactly the statement , i.e. . So ‘s columns are eigenvectors of , ‘s are (scaled) images of those under — equivalently eigenvectors of — and ‘s entries are square roots of the shared eigenvalues.
Two things this buys you, stated briefly and honestly rather than fully derived: the best rank- approximation to (in the sense of minimizing approximation error) is obtained by keeping only the largest singular values and their vectors — truncating the SVD — which is the Eckart–Young theorem; and PCA, a workhorse of applied statistics, is exactly the SVD applied to a (mean-centered) data matrix, with the top singular vectors giving the directions of greatest variance in the data. Both are substantial results in their own right that I’m naming rather than proving here.
What’s left out
This covers real, finite-dimensional linear algebra fairly thoroughly, but several real continuations are deliberately out of scope: general inner product spaces beyond (complex spaces, function spaces), the Jordan normal form in full generality (the honest fix for non-diagonalizable matrices, sketched above but not built out), and the numerical-analysis side of the subject (how these computations actually get done in floating point, where naive Gaussian elimination or direct eigenvalue computation can be numerically unstable in ways the pure algebra above says nothing about).