University Mathematics — Year 1 · Bachelor Year 1
21Matrices
A matrix is a linear map written in coordinates. This chapter sets up the dictionary — composition becomes matrix product, bijectivity becomes invertibility, change of basis becomes conjugation — and the algorithmic side: row operations, computation of ranks and inverses. First met in the High School volume, matrices are now grounded in the theory of Chapters 18, 19 and 20.
21.1 Matrices and linear maps
Definition 21.1
is the vector space of arrays of scalars (: row, : column), of dimension (basis: the matrices with a single ). Given bases of and of (), the matrix of is the array whose -th column lists the coordinates of in :
The map is an isomorphism from onto (Proposition 20.2: a linear map is exactly a choice of images of the ).
Example 21.2 (The derivative, as a matrix)
Let on . In the monomial basis : , , , , so
In the divided basis , each basis vector maps to the previous one (), and the matrix becomes the pure shift: ones on the superdiagonal, zeros elsewhere. Two morals: the matrix belongs to the pair (map, basis), not to the map alone; and a good basis makes structure visible at a glance — the shift form shows instantly that on , each power of the matrix pushing its diagonal of ones one step further out.
Definition 21.3 (Product)
For and :
This is precisely the matrix of the composition: (bases matching in the middle). Similarly, if is the column of coordinates of , the column of is .
Proof of the composition formula.
∎
Proposition 21.4 (The algebra )
Square matrices form a (non-commutative for ) ring, with identity ; its group of units is the general linear group , corresponding to bijective endomorphisms. For :
(one-sided inverses are two-sided, by Corollary 20.9).
Proof. Ring axioms transport from through the isomorphism of Definition 21.1: it converts composition into product and sum into sum, so associativity, distributivity and the role of are inherited from the corresponding facts about maps, with no entrywise verification. Non-commutativity: . If : the endomorphism of satisfies , so is surjective ( exhibits a preimage of every ), hence bijective in finite dimension (Corollary 20.9); composing with on the left gives , and then too: the one-sided inverse was two-sided all along — a strictly finite-dimensional favor. ∎
Definition 21.5 (Transpose; trace)
The transpose of is ; it satisfies and . The trace of a square matrix is ; it is linear, and
Proof of the trace identity. and : the same double sum. ∎
Example 21.6 (The trace at work)
The projection of Chapter 20 onto along , , has matrix in the canonical basis: indeed , and
illustrating Exercise 21.8: for idempotents the trace counts the dimension of the image, whatever slanted basis the matrix is written in. The invariance mechanism is the identity :
so all matrices similar to share its trace — the first numerical invariant of an endomorphism, to be joined by the determinant in Chapter 22 (the pair of the weekend problem below).
Example 21.7 (Symmetric plus antisymmetric)
Call symmetric when , antisymmetric when . Every square matrix splits uniquely as one plus the other:
and a matrix that is both is zero (): the two sets are supplementary subspaces of — the exact analogue of the even/odd split of functions (Example 18.11), with transposition playing the role of . Dimensions: a symmetric matrix is free on and above the diagonal, an antisymmetric one strictly above (zero diagonal):
and the count balancing is Grassmann’s confirmation of directness. For : . Symmetric matrices return as the second-derivative data of Chapter 25 (the Monge triple ), and the symmetric-orthogonal ones are classified in Exercise 23.12.
21.2 Change of basis
Definition 21.8
Let be bases of . The change of basis matrix has for columns the coordinates of the new basis vectors in the old basis. It is invertible, , and coordinates transform by (old new).
Example 21.9 (Reading the change-of-basis matrix)
In , from the canonical to :
(new vectors written in old coordinates, column by column). The vector of old coordinates has new coordinates : indeed . Mind the direction — the matrix is built from the new basis but converts new to old coordinates (); passing from old to new costs the inverse. Writing the sanity check after every conversion catches the inverted- error, which is the most common mistake of the chapter.
Theorem 21.10 (Change of basis for a map)
Let with matrix in and in , and . Then
Two matrices related this way are similar. (For with two pairs of bases, the formula is — equivalent matrices.)
Proof. For any : and the image satisfies , . So , i.e. for all : the matrix of in the new basis is (take for the canonical columns). ∎
Example 21.11 (A good basis makes a map transparent)
Let (swap), with matrix in the canonical basis. In the basis :
No matrix product was really needed: fixes and reverses , so in its matrix must be — the swap is the reflection across the line . Finding, for a given endomorphism, a basis in which its matrix becomes diagonal is the central problem of the Year 2 volume (reduction theory); the weekend problem below shows how far polynomial identities alone already go.
Example 21.12 (Change of basis, run in reverse)
The projection onto along has, in the adapted basis , the transparent matrix . To get its canonical-basis matrix, run Theorem 21.10 backwards, :
Check: (idempotent), , and , , as prescribed. This reverse direction — design the matrix in the good basis, then conjugate back — is how rotation, reflection and projection matrices are actually produced in practice.
Theorem 21.13 (Rank normal form)
The rank of a matrix (the rank of its columns, equivalently of the associated linear map) is the only invariant of equivalence: every of rank is equivalent to
and : row rank equals column rank.
Proof. Let have rank . Choose a supplementary of (, Theorem 20.7) with basis , completed by a basis of into a basis of ; the images , , form a basis of (the restriction is an isomorphism), completed into a basis of . In these bases the matrix of is exactly . So for invertible .
Transposing: with of the same form (rank ) and the outer factors invertible (transpose of invertible is invertible, from applied to ): . ∎
21.3 Row operations
Method 21.14 (Gaussian elimination on matrices)
The three elementary row operations — swap two rows, multiply a row by , add a multiple of a row to another — do not change the rank (each is left multiplication by an invertible matrix). Algorithm: create a pivot (leftmost nonzero entry), clear its column below, move to the next row and column; the number of pivots of the resulting echelon form is the rank.
Inverse computation: run the algorithm on the block until the left block becomes (possible iff is invertible); the right block is then — indeed the product of the elementary matrices used equals .
Example 21.15
: reduce :
(operations: ; then , ). So . Check: .
Example 21.16 (Rank with a parameter, by rows alone)
For , the rank of . Reduce: and give the rows
Case : the last two rows vanish — one pivot, (all three original rows were equal). Case : scale by and by to get and , then . If : two pivots, rank ; otherwise three pivots, rank . Summary:
The same thresholds will drop out of one determinant computation in Chapter 22 (the polynomial of Exercise 22.7) — but note what elimination gives that the determinant does not: the value of the rank in the degenerate cases, not just the fact that it dropped.
Example 21.17 (Computing powers)
with , . Since and commute, the binomial theorem (Proposition 7.20) truncates:
Method 21.18 (Computing : the three routes)
- Binomial route: if with nilpotent, the binomial theorem truncates (Example 21.17, Exercise 21.5); it applies because commutes with everything.
- Polynomial route: find a polynomial identity satisfied by (in dimension , always ) and reduce modulo it; the weekend problem below builds this route completely.
- Similarity route: find an invertible with simple (diagonal, or shift), compute , and undo: (Theorem 21.10, Example 21.11); the systematic search for such is Year 2’s reduction theory.
Whatever the route, check the result on : three cheap tests that catch nearly every slip.
Remark 21.19 (Common pitfalls: the price of non-commutativity)
Every identity of scalar algebra whose proof reorders factors dies in , . Squares: , and the middle collapses to only if (Exercise 21.1). Powers of products: is , not . Zero divisors: with ; consequently no cancellation: implies only when is invertible (multiply by — on the correct side). Traces: always, but in general (take : ), and (cyclic) while may differ. Transposes reverse: — forgetting the reversal is the most common error in orthogonality computations (Chapter 23). When in doubt, test any claimed identity on and : the smallest non-commuting pair refutes most false formulas in one line.
Remark 21.20 (Where the dictionary goes)
The matrix dictionary is used on every remaining page of this volume: Chapter 22 attaches to each square matrix a single number deciding invertibility, and solves systematically; Chapter 23 singles out the matrices preserving lengths (orthogonal matrices); and in Chapter 25, the second-order behavior of a function of two variables is a symmetric matrix. The trace, introduced above almost in passing, becomes a powerful invariant: Exercises 21.6 and 21.8 give a first taste, and the Year 2 volume builds eigenvalue theory on it. The weekend problem develops the other workhorse: polynomial identities satisfied by a matrix, which turn the computation of into a two-term linear recurrence.
Remark 21.21 (Perspectives inside Book 3)
Three matrix families introduced here have appointments later in this volume. Symmetric matrices (Example 21.7) carry the second-order data of functions of two variables: the Monge test of Chapter 25 is a statement about the sign behavior of a symmetric matrix, and its determinant is computed by Chapter 22’s machinery. Orthogonal matrices () are the isometries of Chapter 23, where the transpose finally acquires its geometric meaning: it is the algebraic shadow of the inner product. Invertible matrices meet their practical test in Chapter 22 — one number, — closing the search this chapter began with row reduction. Trace and determinant then travel as the invariant pair of the weekend problem, all the way to the eigenvalue theory of Year 2.
21.4 Exercises
Exercise 21.1 ★
Let and . Compute , , and ; explain why the last two differ.
Solution
Solution of Exercise 21.1.
They differ by : the identity requires commutativity, which fails here.
Exercise 21.2 ★
Compute the rank of
Solution
Solution of Exercise 21.2.
: kills the second row; gives . Two pivots: .
: gives ; then . Two pivots: .
Exercise 21.3 ★
Invert, by row reduction, , and check on one product.
Solution
Solution of Exercise 21.3.
Reducing : , :
then , :
Check: first row of times first column of : ; times second column: ; times third: .
Exercise 21.4 ★
Write the matrix, in the canonical basis of , of the endomorphism . Explain, without computation, why it is invertible, and give the matrix of .
Solution
Solution of Exercise 21.4.
, , : columns of coordinates in give
is invertible because it has the obvious inverse (composition of substitutions). Its matrix is obtained the same way from :
Exercise 21.5 ★★
Let . Write , compute , and deduce for all by the binomial theorem.
Solution
Solution of Exercise 21.5.
, . Since and commute, the binomial expansion truncates after two terms:
(Check : , correct by direct product.)
Exercise 21.6 ★★
Prove that there are no matrices (with or ) such that . (Take traces.)
Solution
Solution of Exercise 21.6.
Traces: (Definition 21.5), while in or . No solution. (On infinite-dimensional spaces the identity is realizable — differentiation and multiplication by satisfy it — precisely because no trace exists there.)
Exercise 21.7 ★★
A matrix is nilpotent when for some . Prove that is then invertible, with
Application: invert .
Solution
Solution of Exercise 21.7.
Telescoping product, all powers of commuting:
and Proposition 21.4 upgrades the one-sided inverse. For the application: the given matrix is with
so, replacing by in the formula:
Exercise 21.8 ★★
Let satisfy (idempotent). Prove that . (Interpret as a projection and choose an adapted basis; Theorem 21.10 says the trace is basis-independent since .)
Solution
Solution of Exercise 21.8.
: the endomorphism is a projection (Theorem 20.15), with . In a basis adapted to this decomposition ( vectors of the image, then a basis of the kernel), the matrix of is , of trace . The trace is invariant under change of basis: by the cyclic identity. Hence .
Exercise 21.9 ★★★
Let be the all-ones matrix. Compute , and deduce, for , the condition of invertibility of together with (look for an inverse of the same form ).
Solution
Solution of Exercise 21.9.
(each entry of sums ones). Seek :
This equals iff and , i.e. and . If and :
Conversely, if : has rank (for ): not invertible ( is the scalar case). If : the vector satisfies with : not invertible. So and .
Exercise 21.10 ★★★
(Rank inequalities) For , prove
(For the second — Sylvester’s inequality — apply rank–nullity to the restriction of the map of to .)
Exercise 21.11 ★★
Let with the pairwise distinct.
- Prove that a matrix commutes with if and only if is diagonal. (Compare the entries of and .)
- Deduce the center of : the matrices commuting with every matrix are exactly the scalar matrices . (Test against , then against the matrices .)
Solution
Solution of Exercise 21.11.
- Entrywise, and . So iff for all ; when the factor is nonzero, forcing : is diagonal. Conversely diagonal matrices commute with each other.
- If commutes with every matrix, it commutes with , so by (1). Then (only row of survives) while : commuting with forces . Hence ; and scalar matrices do commute with everything. The center of is .
Exercise 21.12 ★★★
(Rank-one matrices) Let , .
- Prove that if and only if for a nonzero column and a nonzero row .
- For such an , prove ; deduce that a rank-one matrix is nilpotent if and only if its trace is zero.
If , prove that is invertible with
and that is not invertible when . (Find a vector killed by .)
Solution
Solution of Exercise 21.12.
- If : the image of is a line , , so the -th column of is for scalars (not all zero), i.e. with . Conversely if , all columns are multiples of : rank .
- , and is the scalar . So , hence by induction . If , no power vanishes; if , then : a rank-one matrix is nilpotent iff its trace is zero.
With :
using . If : with , so kills every (nonzero) column of : not injective, not invertible.
21.5 Problem: powers of a matrix by polynomial division
Problem 21.1
Computing entry by entry is hopeless; computing it through a polynomial identity satisfied by is three lines. This problem builds the method from scratch: euclidean division of , the identity verified by every matrix (the Cayley–Hamilton theorem in dimension ), and the dictionary between matrix powers and linear recurrences — with the Fibonacci numbers as running example.
Part I — The remainder calculus. Fix and .
Justify that for each there are unique and with
and compute and .
Multiplying by and dividing again, establish the recurrences
and deduce : the coefficient sequence obeys the linear recurrence attached to .
Suppose has two distinct roots . Evaluating the division identity, prove
- Suppose . Using the derivative of the division identity, prove and .
Show that substituting a fixed matrix into polynomials respects sums and products: . Deduce that if , then
Part II — Dimension 2: trace, determinant number, Cayley–Hamilton. For set and (the number that Chapter 22 will name the determinant).
Verify by direct computation the Cayley–Hamilton identity in dimension :
Prove by direct expansion that is multiplicative: with obvious notation, . Then show: is invertible if and only if , in which case
- Let . Compute , , the roots of , and deduce a closed formula for ; check it against a direct computation of .
- Let . Show that has a double root and compute ; check at .
Let and define the Fibonacci numbers by , , . Prove
deduce Binet’s formula where , , and, using question 7, Cassini’s identity .
Part III — Linear recurrences, structurally. Fix with , and let be the set of sequences with for all .
- Show that is a vector space of dimension (adapt Exercise 19.10).
Show that the sequence of Part I is the element of with initial values , and that every satisfies
with as in Part I: the division remainders solve all recurrences at once.
- If are the roots of , show that is a basis of ; if with , show that is one.
- Solve completely: , , ; check the answer on and .
Let (the companion matrix of ). Show that
and that and : the recurrence and the matrix carry the same polynomial .
Part IV — Degree three. Let and
- Show that . (Compute the images of the canonical basis vectors under powers of : the map of sends a combination forced by the last row.)
- Show that if has three distinct roots , the remainder of divided by is the Lagrange interpolant of the values at the nodes (Theorem 8.23); deduce that every entry of is a fixed linear combination of .
- Solve: with , , . (Factor .) Check on .
- Compute the remainder of modulo (Taylor expansion of at ), and deduce a formula for when and commutes with everything in sight; check it against the binomial theorem.
- Show that for with distinct roots, the general solution of the order- recurrence is : prove that the three geometric sequences form a basis of the solution space. (For freeness, evaluate a null combination at and recognize an interpolation system at the distinct nodes .)
Part V — Fibonacci dividends, and synthesis.
- Prove .
From , derive the addition formula
and deduce .
- Prove that is the nearest integer to for every .
- Let (the Lucas numbers ). Show , , , that , and recover .
- Synthesis, in four sentences: why the powers of a matrix live in the plane of (which dimension argument guarantees a quadratic identity, and which explicit identity Part II produced); how euclidean division converts exponentiation into a two-term recurrence; which statement of this problem is the case of a theorem valid in all dimensions (name it, and say where it is proved in this series); and what the companion matrix construction adds to the picture.
Solution
Solution of Problem 21.1.
1. Euclidean division of by the degree- monic (Theorem 8.3): quotient and remainder exist and are unique, and the remainder has degree : . For : , ; for : .
2. Multiply by and reduce :
The last expression has remainder shape (degree ), so by uniqueness and . Substituting into gives .
3. Evaluate at the roots: and . Subtracting and dividing by :
4. At the double root: . Differentiating the identity, , and evaluating at : ; then .
5. For and ,
because powers of the single matrix commute with each other (sums are clear by linearity). If , substituting into gives .
6. Direct products:
so has zero off-diagonal entries and diagonal entries : .
7. With , expanding : the terms and cancel, the terms and cancel, and what remains is
If , Cayley–Hamilton gives , whence the inverse (and Proposition 21.4 makes it two-sided). If and were invertible, multiplicativity gives : impossible. So .
8. , , : , , so and (question 3). Hence
Check: both by the formula and by squaring directly.
9. , : , double root . Question 4: , , so
At : , which is computed directly.
10. Induction: , and
Here , , with roots (, ). The sequence has , and obeys the same recurrence as : , Binet’s formula. Cassini: applying question 7’s multiplicativity to ,
11. The condition is linear and contains the zero sequence: a subspace. By induction determine linearly, and every pair of initial values is realized by exactly one solution: as in Exercise 19.10, is parametrized bijectively and linearly by : .
12. obeys the recurrence (question 2) with , . So does : (using twice), with , . The combination is then a solution with , ; two solutions with the same initial values coincide (induction), so for all .
13. is a solution iff for all , i.e. (after dividing by ; note since ). Freeness of : a relation at gives , , so : . Two free vectors in dimension : a basis. Double root: is a solution since, with , :
freeness at : , then with .
14. . General solution ; the initial conditions give and , so , :
Check: ; .
15. , and induction gives the formula with . Moreover and : the companion matrix has exactly as its Cayley–Hamilton polynomial.
16. For any solution of , the state vectors satisfy (the first two rows shift, the last row applies the recurrence). Hence
whose three components are (). As the initial state ranges over all of (initial values are free), the matrix kills every vector: .
17. Write with and evaluate at each root: . So is a polynomial of degree interpolating the three values at the three distinct nodes : by uniqueness in Theorem 8.23, with the Lagrange basis of the nodes. Substituting (questions 5 and 16):
with the three matrices independent of : every entry of is a fixed combination of .
18. . General solution . Initial conditions: , , . Subtracting the first from the third: , ; then and : , . Hence
(the Jacobsthal numbers). Check: .
19. Taylor expansion of the polynomial at :
and all terms with are divisible by : the remainder is
For with : , so question 5 gives
which is exactly the binomial expansion of truncated at — the two methods agree.
20. The solution space has dimension (same parametrization by as in question 11), and each is a solution. Freeness: suppose for . Fix and let be the Lagrange polynomial of the nodes with . Then
So all : three free solutions in dimension , a basis; the general solution is .
21. From , the sum telescopes:
22. Take the entry of : the left side is ; the right side is (row of ) times (column of ), i.e. . With :
23. By Binet, , and , so
is the nearest integer to .
24. is a combination of shifted Fibonacci sequences, hence satisfies the same recurrence: ; and , : these are the Lucas numbers . The sequence is a solution with the same first two values (, ), so . Finally
recovering question 22.
25. (i) The five matrices live in the -dimensional , so some nonzero polynomial of degree kills ; Part II sharpened this to the explicit quadratic , which locks all powers into the plane . (ii) Euclidean division reduces modulo that quadratic, and the remainder’s two coefficients obey the two-term recurrence : exponentiation has become iteration. (iii) Question 6 is the case of the Cayley–Hamilton theorem, valid in every dimension and proved in the Year 2 volume. (iv) The companion matrix closes the loop: every linear recurrence is a matrix power, with the same polynomial appearing as trace-and-determinant data, so the remainder calculus solves recurrences and computes powers in one stroke.