LeoMath

Foundations of linear algebra · Section 4 of 5

Matrices

Coordinate representation of linear maps; why matrix multiplication is defined the way it is.

about 8 min

Start from a problem

Problem

A linear map is determined by the images of a basis. But to evaluate a map, store it, and compose two maps, we need a notation that turns these operations into mechanical arithmetic.

Matrices are that notation. The "row times column" rule for multiplication looks odd; this section shows it is the only natural choice.

Observe

In the previous experiment you dragged T(𝐞1) and T(𝐞2), and the matrix A below changed with them. Watch how: the coordinates of T(𝐞1) are the first column, those of T(𝐞2) the second. A matrix is nothing but the two image vectors written side by side.

Interactive experimentLinear transformation
A=
Determinant (signed area) 1
Eigenvalues 1, 1

What did you observe?Play first, then answer. Read the explanation only after you have thought it through.

  1. 1.Drag e₁ and e₂ onto the same line. What happens to the grid, and what is the determinant?
  2. 2.Drag only e₁. Do the origin and the whole vertical line through e₂ move? Why?
  3. 3.Press “Rotate”: the eigenvalues become complex. Is there any line in the plane that maps to itself under a rotation?
Conjecture

Since a linear map is determined by the images of a basis, writing those images as columns of a table records the map completely. "Matrix times vector" should be "evaluate the map", and "matrix times matrix" should be "compose the maps". If so, the odd-looking definition of matrix multiplication stops being odd.

Definitions

Definition 4.1Matrix of a linear map

Let T:ℝn→ℝm be linear and 𝐞1,…,𝐞n the standard basis. The matrix of T is the m×n array A whose j-th column is the coordinate vector of T(𝐞j):

A=[T(𝐞1)  T(𝐞2) ⋯ T(𝐞n)].
Definition 4.2Matrix times vector

For A=[aij] and x=(x1,…,xn), Ax is the linear combination of the columns of A:

Ax=x1A⋅1+x2A⋅2+⋯+xnA⋅n,i.e. (Ax)i=∑j=1naijxj.
Proposition 4.1

If A is the matrix of T, then T(x)=Ax for all x.

Proof

x=∑xj𝐞j, so by linearity T(x)=∑xjT(𝐞j)=∑xjA⋅j=Ax.

Why matrix multiplication is defined this way

Definition 4.3Matrix product

For A of size m×n and B of size n×p, AB is the m×p matrix whose j-th column is A(B⋅j), i.e.

(AB)ij=∑k=1naikbkj.
Theorem 4.2Matrix product = composition

If S:ℝp→ℝn has matrix B and T:ℝn→ℝm has matrix A, then T∘S has matrix AB.

Proof

T∘S is linear (check both properties). Its j-th column is (T∘S)(𝐞j)=T(S(𝐞j))=T(B⋅j)=A(B⋅j), the j-th column of AB.

That is the whole origin of "row times column". Immediate consequences:

  • Associativity (AB)C=A(BC), because composition of maps is associative. No sums need expanding.
  • Non-commutativity AB≠BA: rotating then stretching differs from stretching then rotating. Try it in the experiment.
  • The identity matrix I is the identity map, AI=IA=A.

The determinant

In the experiment the unit square becomes a parallelogram whose area depends on the matrix.

Definition 4.42×2 determinant
det⁡(abcd)=ad−bc.
Theorem 4.3The determinant is signed area

The signed area of the parallelogram spanned by T(𝐞1)=(a,c) and T(𝐞2)=(b,d) is ad−bc. It is negative exactly when T reverses orientation (the turn from 𝐞1 to 𝐞2 changes from counter-clockwise to clockwise).

Proof

Let u=(a,c), v=(b,d), and u⟂=(−c,a) the counter-clockwise quarter-turn of u. The area is |u| times the signed projection of v onto u⟂: |u|⋅v⋅u⟂|u⟂|=v⋅u⟂=−bc+ad. The projection is positive when v lies on the counter-clockwise side of u.

Theorem 4.4Multiplicativity

det⁡(AB)=det⁡A⋅det⁡B.

Proof

Geometrically: B turns the unit square into a parallelogram of area det⁡B, and A multiplies the area of any region by det⁡A (it sends every small grid cell to the same parallelogram, and any region's area is a limit of sums of cells). So AB multiplies area by det⁡Adet⁡B; orientation signs multiply likewise.

Proposition 4.5Invertibility

A is invertible iff det⁡A≠0, and then A−1=1ad−bc(d−b−ca).

det⁡A=0 is the "Collapse" preset: the plane is flattened onto a line (or a point), information is lost, nothing can be undone.

Try it in the matrix calculator →

Common mistake

AB≠BA. Matrix multiplication is composition: AB means apply B first, then A (acting on a vector to the right, B touches it first). Writing the factors in the wrong order is the most common mistake.

Application

ApplicationRotation matrices

Counter-clockwise rotation by θ: 𝐞1↦(cos⁡θ,sin⁡θ), 𝐞2↦(−sin⁡θ,cos⁡θ); as columns,

Rθ=(cos⁡θ−sin⁡θsin⁡θcos⁡θ),det⁡Rθ=1.

Expanding RαRβ=Rα+β yields the angle-addition formulas: matrix multiplication turns them into the triviality "rotate by β, then by α".

Remark

One sentence suffices: the columns of a matrix are where the basis vectors go. Every definition and theorem about matrices can be re-derived from that sentence and linearity. The next section, Eigenvalues, asks: is there a vector whose direction the map leaves unchanged?

Exercises

0 of 2 done

1
Compute det⁡(2134).

Enter the exact value; a fraction such as 1/3 is fine.

2
The matrix (in the standard basis) of the counter-clockwise rotation by 90∘ is
Answer to exercise 2

Discussion

Found a mistake, have a question or a suggestion? You can also write to 620026600@qq.com

No comments yet. Share your understanding, ask a question, or point out an error on this page.

Log in to join the discussion