Linear algebra, from vectors to singular values

June 28, 2026 · math, algebra

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: u+v=v+uu+v=v+u, 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 R\mathbb{R} 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 n\le n add and scale exactly like vectors do, and so do m×nm\times n 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 Rn\mathbb{R}^n.

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 {v1,,vn}\{v_1,\ldots,v_n\} and {w1,,wm}\{w_1,\ldots,w_m\} are both bases of the same finite-dimensional vector space, then n=mn=m.

Proof sketch (exchange argument). Suppose m<nm<n. Since {w1,,wm}\{w_1,\ldots,w_m\} spans the space, write v1=ciwiv_1 = \sum c_i w_i; some ci0c_i\neq0 (else v1=0v_1=0, contradicting independence of the vv‘s), so we can solve for that wiw_i in terms of v1v_1 and the other ww‘s, and swap it in: {v1,w1,,wi^,,wm}\{v_1,w_1,\ldots,\widehat {w_i},\ldots,w_m\} still spans the space. Repeat, bringing in v2v_2 next and eliminating some remaining wjw_j (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 mm such swaps every ww has been replaced by a vv, and the set {v1,,vm}\{v_1,\ldots,v_m\} spans the whole space. But then vm+1v_{m+1} (which exists since m<nm<n) would be a linear combination of v1,,vmv_1,\ldots,v_m, contradicting the independence of {v1,,vn}\{v_1,\ldots,v_n\}. So mnm\ge n, and by the symmetric argument nmn\ge m; hence n=mn=m. \blacksquare

So dimension — the common size of every basis — is well-defined. This one proof is what makes every later statement of the form “an nn-dimensional space” meaningful rather than dependent on an arbitrary choice of basis.

Linear maps and matrices

A linear map TT satisfies T(u+v)=T(u)+T(v)T(u+v)=T(u)+T(v) and T(cv)=cT(v)T(cv)=cT(v). Here’s the key structural fact: once you fix a basis {v1,,vn}\{v_1,\ldots,v_n\} of the domain, TT is completely determined by the values T(v1),,T(vn)T(v_1),\ldots,T(v_n), because any vector x=civix=\sum c_iv_i has

T(x)=T(civi)=ciT(vi)T(x) = T\left(\sum c_iv_i\right) = \sum c_i\,T(v_i)

by linearity — no other information about TT is needed. Writing each T(vj)T(v_j) 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 AA; the formula above says computing T(x)T(x) in coordinates is computing AcAc where cc is xx‘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, TT then SS, should correspond to some combined matrix. If AA represents TT (columns T(vj)T(v_j)) and BB represents SS, then (ST)(vj)=S(T(vj))=S(the j-th column of A)(S\circ T)(v_j) = S(T(v_j)) = S(\text{the }j\text{-th column of }A), and applying SS via its matrix BB gives BB times that column. So the jj-th column of the matrix representing STS\circ T is BB times the jj-th column of AA — which is exactly the row-times-column rule for computing BABA. 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 Ax=bAx=b is asking: is bb in the image of the linear map AA, and if so, which xx 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 AA‘s column space (equivalently, its image).

Rank–nullity theorem. For a linear map T:VWT:V\to W with VV finite-dimensional,

dim(kerT)+dim(imT)=dimV.\dim(\ker T) + \dim(\operatorname{im} T) = \dim V.

Proof. Let {u1,,uk}\{u_1,\ldots,u_k\} be a basis of kerT\ker T (dimension kk). Extend it to a basis {u1,,uk,v1,,vnk}\{u_1,\ldots,u_k,v_1,\ldots,v_{n-k}\} of VV (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 {T(v1),,T(vnk)}\{T(v_1),\ldots,T(v_{n-k})\} is a basis of imT\operatorname{im}T. Spans: any T(x)T(x) for x=aiui+bjvjx=\sum a_iu_i+\sum b_jv_j equals aiT(ui)+bjT(vj)=bjT(vj)\sum a_iT(u_i)+\sum b_jT(v_j) = \sum b_jT(v_j) since each T(ui)=0T(u_i)=0. Independent: if bjT(vj)=0\sum b_jT(v_j)=0 then T(bjvj)=0T(\sum b_jv_j)=0, so bjvjkerT\sum b_jv_j\in\ker T, meaning bjvj=aiui\sum b_jv_j = \sum a_iu_i for some aia_i; but {ui}{vj}\{u_i\}\cup\{v_j\} is independent, so this forces every bj=0b_j=0. Hence imT\operatorname{im}T has dimension exactly nkn-k, giving k+(nk)=n=dimVk+(n-k)=n=\dim V. \blacksquare

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 dimV=dimW\dim V=\dim W.

Determinants

Geometrically, det(A)\det(A) is the signed factor by which AA scales volume: the unit square (or cube, or hypercube) maps to a parallelepiped of volume detA|\det A|, with the sign flipping when AA reverses orientation. Defined via cofactor expansion, the two properties that matter most are:

Eigenvalues and eigenvectors

Most directions get rotated or sheared by a linear map. An eigenvector is a direction that doesn’t: Av=λvAv=\lambda v for some scalar λ\lambda (the eigenvalue) — the map merely stretches or shrinks it. Rearranging, (AλI)v=0(A-\lambda I)v=0 has a nonzero solution vv exactly when AλIA-\lambda I is singular, i.e.

det(AλI)=0,\det(A-\lambda I)=0,

the characteristic equation, whose roots are AA‘s eigenvalues.

Worked example. Let A=(2112)A=\begin{pmatrix}2&1\\1&2\end{pmatrix}. The characteristic polynomial is

det(2λ112λ)=(2λ)21=λ24λ+3=(λ1)(λ3),\det\begin{pmatrix}2-\lambda&1\\1&2-\lambda\end{pmatrix} = (2-\lambda)^2-1 = \lambda^2-4\lambda+3=(\lambda-1)(\lambda-3),

so λ=1\lambda=1 or λ=3\lambda=3. For λ=1\lambda=1: (AI)v=0(A-I)v=0 gives (1111)v=0\begin{pmatrix}1&1\\1&1\end{pmatrix}v=0, so v1+v2=0v_1+v_2=0, e.g. v=(1,1)v=(1,-1). For λ=3\lambda=3: (A3I)v=0(A-3I)v=0 gives (1111)v=0\begin{pmatrix}-1&1\\1&-1\end{pmatrix}v=0, so v1=v2v_1=v_2, e.g. v=(1,1)v=(1,1). Check: A(1,1)=(1,1)=1(1,1)A(1,-1)=(1,-1)=1\cdot(1,-1) ✓, and A(1,1)=(3,3)=3(1,1)A(1,1)=(3,3)=3\cdot(1,1) ✓.

A matrix is diagonalizable exactly when it has a full basis of nn independent eigenvectors (then A=PDP1A=PDP^{-1} with DD diagonal and PP‘s columns the eigenvectors — directly from AP=PDAP=PD, which just restates Avi=λiviAv_i=\lambda_iv_i column by column). Not every matrix qualifies: (0100)\begin{pmatrix}0&1\\0&0\end{pmatrix} has characteristic polynomial λ2\lambda^2, so its only eigenvalue is 00 with multiplicity 22, but (A0I)v=0(A-0I)v=0 gives only the one-dimensional solution space v=(v1,0)v=(v_1,0) — 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 AA needn’t even be square. The singular value decomposition fixes all of this at once, for any m×nm\times n matrix:

A=UΣVT,A = U\Sigma V^T,

with UU (m×mm\times m) and VV (n×nn\times n) orthogonal, and Σ\Sigma (m×nm\times n) diagonal with non-negative entries σ1σ20\sigma_1\ge\sigma_2\ge\cdots\ge0 (the singular values).

Where do U,V,ΣU,V,\Sigma come from? Consider ATAA^TA, an n×nn\times n 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 ATA=VΛVTA^TA = V\Lambda V^T with VV orthogonal and Λ\Lambda diagonal. Since ATAA^TA is also positive semidefinite (xTATAx=Ax20x^TA^TAx = \|Ax\|^2\ge0 for every xx), its eigenvalues are 0\ge0; write Λ=Σ2\Lambda=\Sigma^2, i.e. σi=λi\sigma_i=\sqrt{\lambda_i}. Now define ui=1σiAviu_i = \frac1{\sigma_i}Av_i for each viv_i with σi>0\sigma_i>0 — these turn out to be orthonormal:

uiTuj=1σiσjviTATAvj=1σiσjviT(σj2vj)=σjσiviTvj,u_i^Tu_j = \frac1{\sigma_i\sigma_j}v_i^TA^TAv_j = \frac1{\sigma_i\sigma_j}v_i^T(\sigma_j^2v_j) = \frac{\sigma_j}{\sigma_i}v_i^Tv_j,

which is 00 for iji\neq j (since vivjv_i\perp v_j) and 11 for i=ji=j (since σi/σi=1\sigma_i/\sigma_i=1 and viTvi=1v_i^Tv_i=1). Collect these uiu_i as columns of UU (extended to a full orthogonal basis if m>m> the number of nonzero σi\sigma_i), and Avi=σiuiAv_i=\sigma_iu_i for every ii is exactly the statement AV=UΣAV=U\Sigma, i.e. A=UΣVTA=U\Sigma V^T. So VV‘s columns are eigenvectors of ATAA^TA, UU‘s are (scaled) images of those under AA — equivalently eigenvectors of AATAA^T — and Σ\Sigma‘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-kk approximation to AA (in the sense of minimizing approximation error) is obtained by keeping only the kk 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 Rn\mathbb{R}^n (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).