Linear algebra speedrun
Cram notes for a first linear algebra course: extracting a maximal independent subset, null space bases, change of basis, rank, determinants and LU, the adjugate, diagonalization, Gram-Schmidt, and quadratic forms.
Exam-cram notes from February 2023, rebuilt and carefully checked afterwards.
Vectors and independence
Extracting a maximal independent subset
Given vectors , select a maximal subset of them that is linearly independent. A basis of the span could be assembled from combinations; here the answer must be drawn from the given vectors themselves.
Put the vectors in as the columns of a matrix , row-reduce to reduced row echelon form, and note which columns hold pivots. The original columns in those positions are a maximal linearly independent subset, and there are of them.
This works because row operations preserve every linear dependence among the columns. A relation is a vector in the null space, row operations leave the null space untouched, and so the dependencies visible in the echelon form are the dependencies in the original.
Row-reducing a matrix whose rows are the vectors returns a basis for the span built out of combinations of the inputs. The singular value decomposition gives as the number of nonzero singular values, with the leading columns of an orthonormal basis for the column space. Both describe the span without selecting from the inputs.
The change of basis matrix
Let and be bases of a vector space . Express each new basis vector in the old basis:
The scalar is the -th coordinate of , so the -th column of is the coordinate vector of in the basis . In matrix form,
is invertible, both families being bases. A vector with coordinate column with respect to has coordinates with respect to , and carries coordinates back.
A basis for the null space
To solve , row-reduce to reduced row echelon form. Variables in pivot columns are the leading variables, determined by the rest; variables in non-pivot columns are free. With and columns there are free variables, and setting one of them to with the others at and back-substituting produces solutions forming a basis for the null space.
Row operations are the only ones available here. They recombine equations and leave the solution set alone, whereas column operations recombine the variables and give the null space of a different system.
Rank
Row rank equals column rank
The row rank is the dimension of the span of the rows, the column rank the dimension of the span of the columns. They agree for every matrix, including rectangular ones where the two spans live in different spaces.
Reducing to echelon form establishes that the row rank is the number of nonzero rows that survive, and a separate argument has to bring the columns in. A factorization does it. Let be the column rank and be with columns a basis of the column space. Every column of is a combination of those, so for some matrix . Read that product by rows instead: every row of is a combination of the rows of , so the row rank is at most . The same argument applied to gives the reverse inequality.
The geometric reason
An matrix is a map .
Inside the domain , the null space and the row space are orthogonal complements, since says precisely that is orthogonal to every row. So
while rank-nullity says
Subtract to get the theorem. Geometrically, annihilates the null space and maps the row space isomorphically onto the column space. If lies in the row space with , then is orthogonal to itself and therefore zero, so the restriction is injective; and splitting any into row-space and null-space parts leaves only the first contributing, so the restriction is onto. The two spaces are copies of one another, which is why their dimensions match.
The theorem makes rank stable under transposition. Reordering a product is a different matter: with and , is the zero matrix of rank while has rank .
Determinants
Cofactor expansion
The minor is the determinant of the submatrix left after deleting row and column . The cofactor attaches a sign depending on the parity of :
Expanding along any row,
The diagonal rule, taking signed products along wrapped diagonals, is valid only for . The full expansion is a sum over all permutations signed by parity, and wrapped diagonals supply just of them.
Cramer’s rule runs in the other direction, solving a linear system from determinants already in hand: , where is with column replaced by the right-hand side.
The adjugate
Collect the cofactors into a matrix with and transpose it, the sign going on once as the cofactor is formed:
The defining property is
from which when .
Every square matrix has an adjugate, singular ones included, since it is assembled from determinants of submatrices and divides by nothing. What a singular matrix lacks is the inverse. There the identity above reads , and the rank of the adjugate follows from the rank of : at the adjugate has rank and its columns span the null space of , and below that every minor vanishes and the adjugate is zero. For , of rank , the adjugate is , whose columns are multiples of , spanning the null space.
By elimination
Reduce to triangular form and multiply the diagonal, tracking what each operation does. Adding a multiple of one row to another leaves the determinant unchanged, which is what makes elimination usable. Swapping two rows negates it. Scaling a row by multiplies it by .
LU decomposition
Elimination without row swaps factors , with unit lower triangular holding the multipliers and upper triangular. Take
Eliminating by , , then leaves
the multipliers , , sitting at the positions they cleared.
Since , . For
the multipliers are , , , giving and , which cofactor expansion confirms.
Not every matrix factors this way. A zero pivot forces a row swap, and the general statement is with a permutation matrix, whence for swaps. Numerical work uses partial pivoting regardless, for stability.
Cofactor expansion is and elimination is , which is the difference between infeasible and routine somewhere around .
Eigenvalues and diagonalization
Computing them
The eigenvalues of an matrix are the roots of the characteristic polynomial , of degree . For each , the eigenvectors are the nonzero solutions of
That system always has nontrivial solutions, which is what being an eigenvalue means: , so the matrix is singular and its null space is larger than . The system is homogeneous, so it is never inconsistent, and its matrix is singular, so the solution is never unique.
Eigenvalues come from the characteristic polynomial first, eigenvectors from the null space of second, since the definition of an eigenvector already presumes a .
For a repeated eigenvalue, take a basis of that null space, the eigenspace. Its dimension is the geometric multiplicity, which can fall short of the algebraic multiplicity and never exceeds it.
When a matrix is diagonalizable
is diagonalizable when some invertible makes diagonal, equivalently with the columns of eigenvectors and the diagonal of their eigenvalues.
The criterion is that has linearly independent eigenvectors, which holds exactly when geometric multiplicity equals algebraic multiplicity for every eigenvalue.
An with distinct eigenvalues is diagonalizable, because eigenvectors belonging to distinct eigenvalues are always linearly independent, which makes distinctness the cheapest sufficient test available. It is sufficient without being necessary: the identity matrix has a single eigenvalue and is already diagonal.
Failure requires a repeated eigenvalue whose eigenspace is too small. The smallest instance is
with eigenvalue of algebraic multiplicity and a one-dimensional eigenspace. Such a matrix is similar to a Jordan form whose blocks exceed .
Gram-Schmidt
Given linearly independent , set and, for each in turn,
Each step strips from its projection onto everything already orthonormalized, leaving the part orthogonal to that span.
Correctness is an induction. Suppose are orthonormal. For any ,
since vanishes unless , where it is . So is orthogonal to all its predecessors, and normalizing preserves that.
If lies in the span of its predecessors, is and the normalization divides by zero, which is how the algorithm reports the dependence.
Collecting the as columns of gives with upper triangular. In floating point, classical Gram-Schmidt loses orthogonality badly; modified Gram-Schmidt and Householder reflections are what numerical libraries use.
Quadratic forms
Definition
A quadratic form in variables is a homogeneous polynomial of degree two,
Take symmetric. Nothing is lost, since and agree for every , and symmetry delivers the real eigenvalues and orthogonal eigenbasis everything below relies on.
Cross terms with are degree two and belong here. They are what diagonalization clears.
Standard form and normal form
The standard form is what an orthogonal change of variables produces. By the spectral theorem a real symmetric factors as with orthogonal, so , and substituting gives
with the the eigenvalues of . The are the new coordinates; the eigenvectors are the columns of .
The normal form allows any nonsingular change of variables, which can rescale each coordinate and drive every nonzero coefficient to :
Sylvester’s law of inertia says and do not depend on the route taken. The standard form keeps the eigenvalues; the normal form keeps only their signs.
Eigenvectors for distinct eigenvalues of a symmetric matrix are automatically orthogonal, so normalizing is enough for them. Within a repeated eigenvalue any basis of the eigenspace will do, and it has to be orthonormalized by Gram-Schmidt before going into ; the product then reassembles .
Definiteness
For a real symmetric :
- Positive definite: for all , equivalently every eigenvalue is positive.
- Negative definite: for all , equivalently every eigenvalue is negative.
- Positive semidefinite: for all , equivalently every eigenvalue is nonnegative.
- Negative semidefinite: for all , equivalently every eigenvalue is nonpositive.
- Indefinite: takes both signs, equivalently eigenvalues of both signs occur.
Each criterion quantifies over all the eigenvalues, so semidefiniteness turns on the absence of eigenvalues of the opposite sign. A zero eigenvalue rules out the strict forms and decides nothing further: eigenvalues , and give an indefinite form, while , and give a positive semidefinite one.