Home › Matrix Math › Lesson 1

Matrices as Linear Maps

Lesson 1 of 12

Key idea of this section

[S ∘ T] = [S] [T]          dim V = dim ker T + dim im T
a change of basis replaces A by P⁻¹ A P

Linear maps and their matrices

Let V and W be vector spaces over 𝔽 with dim V = n and dim W = m. A map T : V → W is linear if T(αx + βy) = αT(x) + βT(y) for all vectors x, y and scalars α, β. Fix ordered bases B = (v₁, …, vₙ) of V and C = (w₁, …, wm) of W. Since C is a basis, each T(vj) has a unique expansion T(vj) = a1j w₁ + ⋯ + amj wm. The m × n array A = (aij) is the matrix of T with respect to B and C, written [T]C←B. In words: column j of A holds the C-coordinates of the image of the j-th basis vector.

If x has B-coordinate vector [x]B = (c₁, …, cₙ)ᵀ, then by linearity T(x) = ∑j cj T(vj) = ∑i (∑j aij cj) wi, so [T(x)]C = A [x]B. Matrix-vector multiplication is therefore nothing more than linearity written in coordinates. The assignment T ↦ [T]C←B is a vector-space isomorphism from the space Hom(V, W) of linear maps onto 𝔽m×n, so dim Hom(V, W) = mn.

Theorem 1.1 (Composition is multiplication). Let T : U → V and S : V → W be linear, with bases B, C, D of U, V, W. Then [S ∘ T]D←B = [S]D←C [T]C←B, where the product on the right is the usual row-by-column product.

Proof. For every u ∈ U, [S(T(u))]D = [S]D←C [T(u)]C = [S]D←C [T]C←B [u]B. Taking u to be the j-th vector of B, the left side is column j of [S ∘ T]D←B and the right side is column j of the product. ∎

This is the real reason the product is defined row by column. Two consequences follow without any computation. Matrix multiplication is associative, because composition of functions is associative. It is not commutative, because composition is not: rotating the plane by 90° and then reflecting in the x-axis is a different map from reflecting first and rotating second.

Two further views of the product are indispensable. Writing A by columns as [a₁ ⋯ aₙ], the product Ax = x₁a₁ + ⋯ + xₙaₙ is a linear combination of the columns, so the column space col(A) is exactly the image of x ↦ Ax. Writing A by columns and B by rows b₁ᵀ, …, bₙᵀ, the product is a sum of outer products:

AB = a₁ b₁ᵀ + a₂ b₂ᵀ + ⋯ + aₙ bₙᵀ        (each term has rank at most 1)

The outer-product form is the starting point for low-rank approximation in Lesson 10.

Change of basis and similarity

Let B and B′ be two bases of V, and let P be the matrix whose j-th column is the B-coordinate vector of the j-th vector of B′. Then [x]B = P [x]B′, P is invertible, and for an operator T : V → V,

[T]B′ = P⁻¹ [T]B P

Square matrices A and A′ are similar if A′ = P⁻¹AP for some invertible P; similar matrices represent the same operator in different bases. Any quantity defined in terms of the operator alone, such as its rank, determinant, trace, characteristic polynomial or eigenvalues, is a similarity invariant. A recurring theme of this course is the search for a basis in which [T]B is as simple as possible.

Worked example: let T(x, y) = (2x + y, x + 2y), so that in the standard basis T has matrix A = [ 2 1 ; 1 2 ]. Take the new basis b₁ = (1, 1), b₂ = (1, −1). Then T(b₁) = (3, 3) = 3b₁ and T(b₂) = (1, −1) = b₂, so in the new basis T is simply diag(3, 1). In matrix form, with P = [ 1 1 ; 1 −1 ],

P⁻¹ A P = (1/2) [ 1   1 ] [ 2  1 ] [ 1   1 ]  =  [ 3  0 ]
                [ 1  −1 ] [ 1  2 ] [ 1  −1 ]     [ 0  1 ]

The rank–nullity theorem

The kernel ker T = {x : T(x) = 0} and image im T = {T(x) : x ∈ V} are subspaces. Their dimensions are the nullity and the rank of T.

Theorem 1.2 (Rank–nullity). If V is finite-dimensional and T : V → W is linear, then dim V = dim ker T + dim im T.

Proof. Choose a basis u₁, …, uk of ker T and extend it to a basis u₁, …, uk, v₁, …, vr of V, so dim V = k + r. Every vector of im T has the form T(∑ αi ui + ∑ βj vj) = ∑ βj T(vj), so T(v₁), …, T(vr) span im T. They are independent: if ∑ βj T(vj) = 0, then ∑ βj vj lies in ker T, hence equals some ∑ αi ui, and independence of the extended basis forces every βj = 0. Therefore dim im T = r. ∎

Corollary 1.3. For a linear operator T on a finite-dimensional space, T is injective if and only if T is surjective if and only if T is invertible. For square matrices, a one-sided inverse is automatically two-sided: if AB = I then BA = I.

Proof. Injective means dim ker T = 0, surjective means dim im T = dim V, and these are equivalent by Theorem 1.2. If AB = I then B is injective (Bx = 0 implies x = ABx = 0), hence invertible, and A = AB B⁻¹ = B⁻¹, so BA = I. ∎

The corollary is false in infinite dimensions: on the space of all sequences, the right shift (x₁, x₂, …) ↦ (0, x₁, x₂, …) is injective but not surjective. Finite dimensionality is doing real work.

For A ∈ 𝔽m×n of rank r, the four fundamental subspaces are the column space col(A) ⊆ 𝔽m of dimension r, the null space null(A) ⊆ 𝔽ⁿ of dimension n − r, the row space col(Aᵀ) ⊆ 𝔽ⁿ of dimension r, and the left null space null(Aᵀ) ⊆ 𝔽m of dimension m − r. That row space and column space have the same dimension is a genuine theorem, proved in Lesson 2. Over ℝ the row space and null space are orthogonal complements in ℝⁿ, because Ax = 0 says exactly that x is orthogonal to every row.

How fast can matrices be multiplied

The definition uses n³ multiplications for two n × n matrices. In 1969 Strassen found a way to multiply 2 × 2 block matrices with 7 block products instead of 8; applied recursively this gives O(nlog₂ 7) ≈ O(n2.807) operations. The infimum ω of exponents for which O(nω) multiplication is possible is one of the central open problems of algebraic complexity theory: it is known that 2 ≤ ω, and a sequence of improvements since Coppersmith and Winograd (1990) has pushed the upper bound below 2.372. Whether ω = 2 is unknown.

Exercise

  • (a)
    A is a 5 × 7 real matrix of rank 3. Give the dimensions of its four fundamental subspaces.
  • (b)
    Find the dimension of the space of 3 × 3 matrices X that commute with D = diag(1, 2, 3).
  • (c)
    Let V be the space of real polynomials of degree at most 3 with basis 1, x, x², x³, and let T = d/dx. Write [T] and state its rank and nullity.
Show solution

Answers: (a) col(A) has dimension 3, null(A) has dimension 7 − 3 = 4, the row space has dimension 3, and null(Aᵀ) has dimension 5 − 3 = 2. (b) (DX − XD)ij = (di − dj) xij, which vanishes for all i, j exactly when xij = 0 for i ≠ j, so the commutant is the diagonal matrices: dimension 3. (c) T(1) = 0, T(x) = 1, T(x²) = 2x, T(x³) = 3x², so [T] = [ 0 1 0 0 ; 0 0 2 0 ; 0 0 0 3 ; 0 0 0 0 ]; the rank is 3 and the nullity is 1 (the kernel is the constants).

V.3.1