Survey of Mathematics
Unit 2

Linear algebra

Vectors, linear maps and matrices: the language of almost everything.

11 chapters written · 69 definitions · 97 theorems · builds on Unit 0

The story

Linear algebra studies one kind of function, the linear map, which respects addition and scaling. That sounds narrow, but it is the only kind of function we can understand completely, and calculus works by approximating every other function with one.

The unit builds the setting first (2.1 and 2.2: vector spaces, span, independence, basis, dimension), then the maps (2.3 to 2.5: null space, range, rank-nullity, inverses, matrices as maps). With that in place, elimination (2.6) and determinants (2.7) become tools with reasons behind them, not recipes. Eigenvalues (2.8) find the directions a map only stretches.

The last three chapters add length and angle (2.9: inner products and projection) and put everything to work: least squares and regression (2.10), and Markov chains and PageRank (2.11).

Chapters

  1. 2.1Vector spaces and subspacesArrows, lists of numbers, polynomials and functions can all be added and scaled by the same ten rules, so we study the rules once and get results for all of them.
  2. 2.2Span, independence, basis, dimensionA basis is a set of building blocks with no waste. Every vector is built from it in exactly one way, and every basis of a space has the same size, its dimension.
  3. 2.3Linear maps, null space, range, rank–nullityA linear map is a function that respects adding and scaling. What it sends to zero (the null space) and what it can reach (the range) trade off exactly. Their dimensions add up to the dimension of the input space.
  4. 2.4Inverses, one-to-one maps, isomorphismLinear maps can be added, scaled and chained. A map can be undone exactly when no two inputs land on the same output, and an undoable linear map between two spaces makes them the same space under different names.
  5. 2.5Matrices as maps, multiplication, change of basisA matrix is the list of where a linear map sends the basis vectors. Multiplying matrices is composing maps, and changing basis changes the matrix but not the map.
  6. 2.6Systems of equations and eliminationSolving Ax = b asks whether b is in the range of A and how much freedom is left over. Row operations answer both without changing the solutions, and the pivots they expose give the rank, the four fundamental subspaces and the inverse.
  7. 2.7DeterminantsThe determinant is the one number that says by what factor a square matrix scales area or volume, with a sign for flipping. It is zero exactly when the matrix cannot be undone, and four rules pin it down completely.
  8. 2.8Eigenvalues and eigenvectorsSome directions are only stretched by a linear map, never turned. Finding them (the eigenvectors) turns a hard-looking map into a list of stretch factors, and turns "apply it 100 times" into powers of ordinary numbers.
  9. 2.9Inner products, orthogonality, Gram–Schmidt, projectionAn inner product gives any vector space lengths, angles and perpendicularity. With it, orthogonal bases make coordinates easy, Gram–Schmidt builds them, and projection onto a subspace gives the closest point.
  10. 2.10Least squares and regression as projectionWhen Ax = b has no solution, the best we can do is the point of the column space closest to b. The error of that best choice is perpendicular to every column, and that single fact gives the normal equations, the projection matrix, and the line of best fit.
  11. 2.11Markov chains and PageRankA random walker who moves by fixed probabilities is described by a matrix whose columns add to 1. Its long-run behaviour is an eigenvector with eigenvalue 1, and Google ranked the web by computing that eigenvector.

The theorem chain

Every theorem in the unit, in the order it is proved. Each one is used by the ones after it. The label says whether it is on the 375/376 exams (T), an Apostol extra (A), or beyond both (B).

2.1 Vector spaces and subspaces

  1. Theorem · T Uniqueness of the zero vector A vector space has exactly one zero element.
  2. Theorem · T Uniqueness of negatives Each xx has exactly one yy with x+y=Ox + y = O, namely (−1)x(-1)x.
  3. Theorem · T Scaling by zero 0x=O0x = O for every vector xx.
  4. Theorem · T Subspace test A non-empty subset of a vector space is a subspace exactly when it is closed under addition and under scalar multiplication.

2.2 Span, independence, basis, dimension

  1. Theorem · T The span is a subspace For any finite set SS in VV, the span L(S)L(S) is a subspace of VV.
  2. Theorem · T More vectors than a spanning set means dependent If kk vectors span a space, then any k+1k + 1 vectors in that space are linearly dependent.
  3. Theorem · T All bases have the same size If VV has a basis with nn elements, every basis of VV has nn elements.
  4. Theorem · T Extending to a basis In an nn-dimensional space, any independent set can be extended to a basis, and any nn independent vectors already form a basis.
  5. Theorem · T Unique coordinates If e1,…,ene_1, \dots, e_n is a basis, each vector is ∑ciei\sum c_i e_i for exactly one list (c1,…,cn)(c_1, \dots, c_n).

2.3 Linear maps, null space, range, rank–nullity

  1. Theorem · T Null space and range are subspaces N(T)N(T) is a subspace of the domain and T(V)T(V) is a subspace of the codomain.
  2. Theorem · T Rank–nullity theorem For a linear map out of a finite-dimensional space, dim⁡V=rank⁡T+nullity⁡T\dim V = \operatorname{rank} T + \operatorname{nullity} T.

2.4 Inverses, one-to-one maps, isomorphism

  1. Theorem · T Linear maps form a vector space The set L(V,W)L(V, W) of all linear maps from VV to WW is a vector space under pointwise addition and scaling.
  2. Theorem · T Composition of linear maps is linear If T:U→VT: U \to V and S:V→WS: V \to W are linear, then ST:U→WST: U \to W is linear.
  3. Theorem · T Composition is associative For any three functions that can be chained, R(ST)=(RS)TR(ST) = (RS)T.
  4. Proposition · A Composition distributes over addition (S+T)R=SR+TR(S + T)R = SR + TR and R(S+T)=RS+RTR(S + T) = RS + RT (the second needs RR linear); scalars pass through too.
  5. Theorem · T Left inverse exists exactly when one-to-one A function TT has a left inverse if and only if different inputs always give different outputs.
  6. Theorem · T A left inverse is unique and two-sided A function has at most one left inverse, and a left inverse is also a right inverse.
  7. Theorem · T Equivalent forms of one-to-one for linear maps For a linear map TT, these are equivalent: one-to-one; invertible with a linear inverse; and N(T)={O}N(T) = \{O\}.
  8. Theorem · T One-to-one in finite dimension For a linear TT on an nn-dimensional VV, these are equivalent: TT is one-to-one; independent sets stay independent; dim⁡T(V)=n\dim T(V) = n; bases go to bases.
  9. Theorem · T Inverse of a composition reverses the order If SS and TT are invertible, so is STST, and (ST)−1=T−1S−1(ST)^{-1} = T^{-1}S^{-1}.
  10. Theorem · B Isomorphic is an equivalence relation Every space is isomorphic to itself, if V≅WV \cong W then W≅VW \cong V, and if V≅WV \cong W and W≅XW \cong X then V≅XV \cong X.
  11. Theorem · B Every n-dimensional space is isomorphic to R^n If dim⁡V=n\dim V = n and (e1,…,en)(e_1, \dots, e_n) is an ordered basis, then x↦(c1,…,cn)x \mapsto (c_1, \dots, c_n), the coordinates of xx, is an isomorphism V→RnV \to \mathbb R^n.
  12. Theorem · B Same dimension exactly when isomorphic Two finite-dimensional vector spaces are isomorphic if and only if they have the same dimension.
  13. Theorem · A Prescribed values on a basis Given a basis e1,…,ene_1, \dots, e_n of VV and ANY vectors u1,…,unu_1, \dots, u_n in WW, there is exactly one linear map TT with T(ek)=ukT(e_k) = u_k.
  14. Corollary · A Building a linear map from the images of a basis If T(ek)=ukT(e_k) = u_k on a basis, then TT is onto WW exactly when the uku_k span WW, one-to-one exactly when they are independent, and an isomorphism exactly when they are a basis of WW.

2.5 Matrices as maps, multiplication, change of basis

  1. Theorem · A Matrix space has dimension mn The space of m×nm \times n matrices has dimension mnmn.
  2. Theorem · T Matrix times vector If xx has coordinates xkx_k, then T(x)T(x) has coordinates yi=∑ktikxky_i = \sum_k t_{ik}x_k, which is x1⋅(column 1)+⋯+xn⋅(column n)x_1 \cdot (\text{column }1) + \dots + x_n \cdot (\text{column }n).
  3. Theorem · T Maps and matrices are the same thing For fixed bases, the function T↦m(T)T \mapsto m(T) is an isomorphism from L(V,W)L(V, W) onto Rm×n\mathbb R^{m \times n}.
  4. Theorem · T Matrix of a composition The (i,j)(i, j) entry of m(ST)m(ST) is ∑ksiktkj\sum_{k} s_{ik}t_{kj}: row ii of m(S)m(S) times column jj of m(T)m(T).
  5. Theorem · T Matrix multiplication is associative and distributive A(BC)=(AB)CA(BC) = (AB)C, (A+B)C=AC+BC(A + B)C = AC + BC and C(A+B)=CA+CBC(A + B) = CA + CB whenever the products are defined.
  6. Theorem · T The matrix of an inverse is the inverse of the matrix If T:V→VT: V \to V is invertible and A=m(T)A = m(T) in one basis, then A−1=m(T−1)A^{-1} = m(T^{-1}) in the same basis, and AA−1=A−1A=IAA^{-1} = A^{-1}A = I.
  7. Proposition · A Inverse of a 2 by 2 matrix [abcd]\begin{bmatrix}a&b\\c&d\end{bmatrix} is invertible exactly when ad−bc≠0ad - bc \ne 0, and then its inverse is 1ad−bc[d−b−ca]\frac{1}{ad - bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}.
  8. Theorem · T Transpose of a product (AB)T=BTAT(AB)^{\mathsf T} = B^{\mathsf T}A^{\mathsf T}.
  9. Theorem · T Coordinates change by C [x]E=C [x]F[x]_{\mathcal E} = C\,[x]_{\mathcal F}, and CC is invertible with C−1=mE→F(I)C^{-1} = m_{\mathcal E \to \mathcal F}(I).
  10. Theorem · T Change of basis rewrites the matrix of a map If AA and BB are the matrices of TT in the old and new bases, then B=C−1ACB = C^{-1}AC. Conversely every C−1ACC^{-1}AC is the matrix of the same map in some basis.
  11. Theorem · T Diagonal form of a linear map For T:V→WT: V \to W of rank rr there are bases of VV and WW in which the matrix has 11s in the first rr diagonal places and 00 everywhere else.

2.6 Systems of equations and elimination

  1. Theorem · T Solutions are a particular solution plus the null space If xpx_p solves Ax=bAx = b, then the solutions are exactly xp+yx_p + y with yy in the null space of AA.
  2. Corollary · T A system has zero, one or infinitely many solutions No solution if bb is not in the range of AA. Otherwise one solution if the null space is {O}\{O\}, and infinitely many if it is bigger.
  3. Theorem · T Matrix times vector is a combination of the columns Ax=x1a1+⋯+xnanAx = x_1 a_1 + \dots + x_n a_n, so the column space is the range of x↦Axx \mapsto Ax and the rank of AA is its dimension.
  4. Theorem · T Row operations do not change the solutions If [A′∣b′][A' \mid b'] comes from [A∣b][A \mid b] by row operations, the two systems have exactly the same solutions.
  5. Theorem · T Every matrix reduces to reduced row echelon form Row operations can turn any matrix into one in reduced row echelon form.
  6. Theorem · T Reading the solutions off the reduced form The system is inconsistent exactly when the last column is a pivot column. Otherwise each pivot variable equals its right side minus a combination of the free variables.
  7. Theorem · T Rank equals the number of pivots If an echelon form of AA has rr pivots, then rank A=rA = r, nullity =n−r= n - r, and the pivot columns of the original AA are a basis of the column space.
  8. Theorem · T Row rank equals column rank The row space and the column space of a matrix have the same dimension, the number of pivots. So rank AA = rank ATA^{\mathsf T}.
  9. Theorem · T A left inverse of a square matrix is a full inverse If AA and BB are n×nn \times n and BA=IBA = I, then AB=IAB = I too, so B=A−1B = A^{-1}.
  10. Theorem · T Row operations are multiplication by elementary matrices Doing a row operation to AA gives the same result as multiplying AA on the left by the elementary matrix of that operation. Elementary matrices are invertible, with elementary inverses.
  11. Theorem · T Computing the inverse by row reducing [A | I] Row reduce [A∣I][A \mid I]. If the left block becomes II, the right block is A−1A^{-1}. If the left block cannot become II, AA has no inverse.
  12. Theorem · B Invertible matrix theorem For an n×nn \times n matrix AA, eleven conditions are equivalent: invertible, one-to-one, null space zero, independent columns, rank nn, columns span Rn\mathbb R^n, onto, a unique solution for every bb, nn pivots, product of elementary matrices, invertible transpose.

2.7 Determinants

  1. Lemma · T What the first three axioms force on the rows A function with Axioms 1 to 3 is zero if a row is zero, changes sign when two rows are swapped, is unchanged when a multiple of one row is added to another, and is zero when the rows are dependent.
  2. Theorem · T Axioms 1 to 3 force a multiple of the determinant If dd is a determinant function and FF satisfies only Axioms 1 to 3, then F(A)=d(A) F(I)F(A) = d(A)\,F(I) for every AA.
  3. Corollary · T The determinant is unique There is at most one function satisfying all four axioms.
  4. Theorem · T Determinant of a triangular matrix The determinant of a triangular matrix is the product of its diagonal entries.
  5. Theorem · T Determinant by row reduction If row operations turn AA into an upper triangular UU using pp swaps and scalings by c1,…,cqc_1, \dots, c_q, then det⁡A=(−1)p(c1⋯cq)−1u11⋯unn\det A = (-1)^p(c_1\cdots c_q)^{-1}u_{11}\cdots u_{nn}.
  6. Theorem · T A matrix is invertible exactly when its determinant is non-zero For a square matrix, det⁡A≠0\det A \ne 0 if and only if AA is invertible, if and only if the rows are independent, if and only if the columns are independent.
  7. Theorem · T Product rule for determinants det⁡(AB)=det⁡A⋅det⁡B\det(AB) = \det A\cdot\det B for all n×nn \times n matrices.
  8. Corollary · T Consequences of the product rule det⁡(A−1)=1/det⁡A\det(A^{-1}) = 1/\det A, det⁡(Ak)=(det⁡A)k\det(A^k) = (\det A)^k, det⁡(AB)=det⁡(BA)\det(AB) = \det(BA), and det⁡(cA)=cndet⁡A\det(cA) = c^n\det A for an n×nn \times n matrix.
  9. Theorem · T The determinant of the transpose det⁡AT=det⁡A\det A^{\mathsf T} = \det A. So everything true for rows is true for columns.
  10. Theorem · A Determinant of a block-diagonal matrix For square blocks AA and BB, det⁡[AOOB]=det⁡A⋅det⁡B\det\begin{bmatrix}A&O\\O&B\end{bmatrix} = \det A\cdot\det B.
  11. Theorem · T Expansion by cofactors For any row kk: det⁡A=∑j=1nakjCkj\det A = \sum_{j=1}^n a_{kj}C_{kj}. The same holds along any column.
  12. Theorem · A Cofactor formula for the inverse A (cof⁡A)T=(det⁡A) IA\,(\operatorname{cof}A)^{\mathsf T} = (\det A)\,I, so when det⁡A≠0\det A \ne 0, A−1=1det⁡A(cof⁡A)TA^{-1} = \frac1{\det A}(\operatorname{cof}A)^{\mathsf T}.
  13. Theorem · A Cramer's rule is correct If det⁡A≠0\det A \ne 0 then the unique solution of Ax=bAx = b is xj=det⁡Aj(b)/det⁡Ax_j = \det A_j(b)/\det A.
  14. Lemma · B Swapping two values flips the sign of a permutation If σ′\sigma' is σ\sigma with the values at two positions exchanged, then sgn⁡σ′=−sgn⁡σ\operatorname{sgn}\sigma' = -\operatorname{sgn}\sigma.
  15. Theorem · A The permutation formula gives a determinant function det⁡A=∑σsgn⁡(σ) a1σ(1)a2σ(2)⋯anσ(n)\det A = \sum_\sigma\operatorname{sgn}(\sigma)\,a_{1\sigma(1)}a_{2\sigma(2)}\cdots a_{n\sigma(n)} satisfies all four axioms. So the determinant exists for every nn.

2.8 Eigenvalues and eigenvectors

  1. Fact · T An eigenvector has only one eigenvalue If T(x)=λxT(x) = \lambda x and T(x)=μxT(x) = \mu x with x≠Ox \ne O, then λ=μ\lambda = \mu.
  2. Theorem · T Eigenspaces are subspaces E(λ)E(\lambda) is a subspace, because it is the null space of the linear map T−λIT - \lambda I.
  3. Theorem · T Eigenvectors of distinct eigenvalues are independent Eigenvectors that belong to different eigenvalues are linearly independent.
  4. Theorem · T Distinct eigenvalues give an eigenbasis On an nn-dimensional space a linear map has at most nn distinct eigenvalues, and if it has nn, their eigenvectors are a basis.
  5. Theorem · T Eigenvalues are roots of the characteristic polynomial λ\lambda is an eigenvalue of AA exactly when det⁡(λI−A)=0\det(\lambda I - A) = 0.
  6. Theorem · T Shape of the characteristic polynomial det⁡(λI−A)=λn−(tr⁡A)λn−1+⋯+(−1)ndet⁡A\det(\lambda I - A) = \lambda^n - (\operatorname{tr} A)\lambda^{n-1} + \dots + (-1)^n\det A.
  7. Theorem · T Trace and determinant from the eigenvalues The trace is the sum of the eigenvalues and the determinant is their product, each counted with multiplicity.
  8. Theorem · T Similar matrices share a characteristic polynomial If B=C−1ACB = C^{-1}AC then BB and AA have the same characteristic polynomial, hence the same eigenvalues, trace and determinant.
  9. Theorem · T Diagonal form means an eigenbasis A map has a diagonal matrix in a basis exactly when every vector of that basis is an eigenvector. The diagonal entries are the eigenvalues.
  10. Theorem · T Diagonalization as a factorization If AA has nn independent eigenvectors, then A=CDC−1A = CDC^{-1}, where the columns of CC are those eigenvectors and DD is diagonal with the matching eigenvalues.
  11. Theorem · T Distinct roots give a diagonalizable matrix If the characteristic polynomial has nn different roots, the matrix is diagonalizable.
  12. Theorem · T Geometric multiplicity is at most algebraic multiplicity An eigenvalue never has more independent eigenvectors than its multiplicity as a root: 1≤g(λ0)≤m(λ0)1 \le g(\lambda_0) \le m(\lambda_0).
  13. Theorem · B Diagonalizable exactly when the eigenspaces fill the space With all roots among the scalars, AA is diagonalizable if and only if g(λ)=m(λ)g(\lambda) = m(\lambda) for every eigenvalue, that is, if and only if the dimensions of the eigenspaces add up to nn.

2.9 Inner products, orthogonality, Gram–Schmidt, projection

  1. Theorem · T Cauchy–Schwarz inequality ∣(x,y)∣≤∥x∥ ∥y∥|(x, y)| \le \lVert x\rVert\,\lVert y\rVert, with equality exactly when xx and yy are linearly dependent.
  2. Theorem · T Properties of the norm ∥x∥≥0\lVert x\rVert \ge 0 with equality only for OO; ∥cx∥=∣c∣∥x∥\lVert cx\rVert = |c|\lVert x\rVert; and the triangle inequality ∥x+y∥≤∥x∥+∥y∥\lVert x + y\rVert \le \lVert x\rVert + \lVert y\rVert.
  3. Theorem · T Orthogonal sets are independent An orthogonal set of non-zero vectors is linearly independent.
  4. Theorem · T Coordinates in an orthogonal basis In an orthogonal basis, the coordinate of xx on eie_i is (x,ei)/(ei,ei)(x, e_i)/(e_i, e_i); in an orthonormal basis it is (x,ei)(x, e_i) itself.
  5. Theorem · T Gram–Schmidt theorem The ymy_m are non-zero and orthogonal, and y1,…,ymy_1, \dots, y_m span the same space as x1,…,xmx_1, \dots, x_m for every mm.
  6. Theorem · T The orthogonal complement is a subspace meeting S only at O S⊥S^\perp is a subspace, and the only vector in both SS and S⊥S^\perp is OO.
  7. Theorem · T Orthogonal decomposition theorem If SS is a finite-dimensional subspace, every xx splits uniquely as x=s+s⊥x = s + s^\perp with s∈Ss \in S and s⊥∈S⊥s^\perp \in S^\perp, and ∥x∥2=∥s∥2+∥s⊥∥2\lVert x\rVert^2 = \lVert s\rVert^2 + \lVert s^\perp\rVert^2.
  8. Theorem · T Best approximation theorem Among all points of SS, the projection ss is the unique closest point to xx: ∥x−s∥≤∥x−t∥\lVert x - s\rVert \le \lVert x - t\rVert for every t∈St \in S.

2.10 Least squares and regression as projection

  1. Theorem · T Perpendicular error means closest point If pp is in a subspace WW and b−pb - p is perpendicular to all of WW, then pp is the closest point of WW to bb, and no other point of WW is as close.
  2. Theorem · B Least squares solutions solve the normal equations x^\hat x is a least squares solution of Ax=bAx = b exactly when ATA x^=ATbA^{\mathsf T}A\,\hat x = A^{\mathsf T}b, which says the residual is perpendicular to every column of AA.
  3. Lemma · B A and A-transpose A have the same null space ATAx=OA^{\mathsf T}Ax = O exactly when Ax=OAx = O.
  4. Theorem · B Independent columns give a unique least squares solution The columns of AA are independent exactly when ATAA^{\mathsf T}A is invertible. Then the unique least squares solution is x^=(ATA)−1ATb\hat x = (A^{\mathsf T}A)^{-1}A^{\mathsf T}b.
  5. Theorem · B The projection matrix projects PbPb is the closest point of the column space to bb, P2=PP^2 = P and PT=PP^{\mathsf T} = P.
  6. Theorem · B QR from Gram–Schmidt A matrix AA with independent columns factors as A=QRA = QR: QQ has orthonormal columns and RR is square, upper triangular and invertible. Then x^\hat x solves Rx^=QTbR\hat x = Q^{\mathsf T}b and P=QQTP = QQ^{\mathsf T}.

2.11 Markov chains and PageRank

  1. Theorem · B A stochastic matrix keeps probability vectors If PP is stochastic and xx is a probability vector, then PxPx is a probability vector. Also a product of stochastic matrices is stochastic.
  2. Theorem · B One is always an eigenvalue of a stochastic matrix Every stochastic matrix has eigenvalue 1.
  3. Theorem · B Eigenvalues of a stochastic matrix have size at most one Every eigenvalue λ\lambda of a stochastic matrix, real or complex, satisfies ∣λ∣≤1|\lambda| \le 1.
  4. Lemma · B Other eigenvectors have entries adding to zero If Pv=λvPv = \lambda v with λ≠1\lambda \ne 1, the entries of vv add to 00.
  5. Theorem · B Convergence for a diagonalizable chain with a simple eigenvalue 1 Let PP be stochastic and diagonalizable. If 11 is an eigenvalue with a one-dimensional eigenspace and every other eigenvalue has size less than 1, then Pkx0P^kx_0 approaches the same stationary distribution π\pi from every starting probability vector x0x_0.
  6. Theorem · B Perron–Frobenius theorem for regular chains If some power of the stochastic matrix PP has all entries strictly positive (a regular chain), then 11 is a simple eigenvalue with a positive eigenvector, every other eigenvalue has size less than 1, and Pkx0→πP^kx_0 \to \pi for every probability vector x0x_0.
  7. Theorem · B The Google matrix has a unique stationary distribution For 0≤d<10 \le d < 1, GG has exactly one stationary distribution π\pi, all its entries are at least 1−dn\tfrac{1-d}{n}, and from any starting probability vector ∥Gkx0−π∥1≤2dk\lVert G^kx_0 - \pi \rVert_1 \le 2d^k. Every eigenvalue other than 11 has size at most dd.

Terms this unit defines

Unit review

A mixed set of 12 quick checks drawn at random from the 92 in this unit's chapters. Each one says which chapter it comes from, so a miss tells you what to reread. Press "New set" for another mix.

Where it leads

Units that build on this one: Unit 3, Linear algebra, deeper, Unit 4, Space and closeness, Unit 5, Differential calculus in many variables, Unit 8, Fourier analysis, Unit 10, Probability and statistics, Unit 15, Optimisation, dynamics and computation.