LibreCanon › Math
AI Canon. Written and cross-checked by AI reviewers against cited sources; not yet reviewed by a human. Errors are possible. What this means

Matrices as transformations of space

A matrix is a grid of numbers, and a linear map is a function between vector spaces that respects addition and scalar multiplication. Chapter Three of Hefferon’s Linear Algebra shows that once bases are chosen these are two views of one thing: each linear map has a matrix, each matrix gives a linear map, and the operations on matrices are defined to mirror operations on maps. That is also why matrix multiplication is not commutative: in the book’s words, “matrix multiplication represents function composition” [32]. This article follows sections II to V of the chapter; the examples are ours unless marked. Eigenvalues, which build on this, are in Eigenvalues and eigenvectors, and determinants in Determinants and what they measure.

Linear maps

Definition. For vector spaces V and W, a linear map (the book uses homomorphism interchangeably) is a function h from V to W that satisfies h(u + w) = h(u) + h(w) and h(r·u) = r·h(u) [1, 2]. An equivalent test is that h keeps every linear combination; a consequence is h(0) = 0 [3]. The book reserves linear transformation for the case V = W, a narrower sense than some other texts use [5]. Taken together, the linear maps V → W make up a vector space, written L(V, W) [5, 6].

Three examples, one linear and two not:

  • Evaluation at two points, p ↦ (p(0), p(1)), from the quadratic polynomials P₂ to R². Evaluating p + q at a point gives p’s value plus q’s, and evaluating 5p gives five times p’s value, so the map is linear even though its inputs are polynomials rather than columns. Two different inputs, x² − x and the zero polynomial, share the output (0, 0).
  • A cube, (x, y) ↦ x³ − y. Here (1, 0) goes to 1, but 2·(1, 0) = (2, 0) goes to 8 rather than 2. One counterexample of this kind settles non-linearity [2].
  • The larger coordinate, (x, y) ↦ max(x, y). (1, 0) and (0, 1) each go to 1, but their sum (1, 1) also goes to 1, not 2.

A basis decides everything. The book’s Theorem 1.9: given a basis ⟨β₁, …, βₙ⟩ of V and any vectors w₁, …, wₙ in W, repeats allowed, there is exactly one linear map with h(βᵢ) = wᵢ for every i [3]. Existence and uniqueness both rest on coordinates. The rule c₁β₁ + ⋯ + cₙβₙ ↦ c₁w₁ + ⋯ + cₙwₙ gives each vector exactly one output, since its coordinates in a basis are unique; and linearity fixes a map’s value on every combination once its values on the basis are fixed [4]. On R², for example, choosing images for (1, 0) and (0, 1) settles the whole map. The book follows this with “a convenient scheme for computations like this one, using matrices” [4], the subject of the next section.

Range and null space.

Range space R(h) Null space N(h)
Subspace of W, the codomain [8] V, the domain [10]
Consists of every output h(v) every input with h(v) = 0
Its dimension is called the rank [8] the nullity [10]

The range can be smaller than the codomain; a map is onto only when they coincide [7]. Images of subspaces are subspaces, which is why the range is one [8]. Take h(x, y) = (x − 2y, 3x − 6y) on R². Every output is a multiple of (1, 3), so the range is that line and the rank is 1; the map is not onto R². The null space is the line of multiples of (2, 1), so the nullity is 1.

The book reads a linear map as saying that its domain is “like” its range [9]: the inputs that share one output form a class, and classes add the way their outputs add. In the example, the class of c is the line x − 2y = c, all of whose points go to (c, 3c). (1, 0) lies on the line for 1 and (0, 1) on the line for −2; their sum (1, 1) lies on the line for −1, and its image (−1, −3) is (1, 3) + (−2, −6).

Rank plus nullity. For any linear map, dim V = rank + nullity (Theorem 2.14) [11]. In the example, 2 = 1 + 1. The book proves it by extending a basis of the null space to a basis of V; the images of the added vectors then form a basis of the range [11]. What follows from it:

  • rank h ≤ dim V, and rank h = dim V ⇔ nullity h = 0. In the book’s words, “there is no homomorphism from R² onto R³” [12].
  • A linear map may send independent vectors to dependent ones; it never sends dependent vectors to independent ones [12].
  • For a domain of dimension n, these are equivalent: h is one-to-one; h has a linear inverse from its range; the nullity is 0; the rank is n; h takes every basis to a basis of the range [13, 14].

Representing a map by a matrix

Because h(c₁β₁ + ⋯ + cₙβₙ) = c₁h(β₁) + ⋯ + cₙh(βₙ), the values on a basis are enough to compute h everywhere, and the book organizes that computation as follows [15]:

  1. Pick bases: B in the domain, D in the codomain [15].
  2. Find each h(βᵢ) and write it in D-coordinates [15, 16].
  3. Place these coordinate columns side by side. The result is the matrix representation RepB,D(h); it has one column per dimension of the domain and one row per dimension of the codomain [16].

Theorem 1.5 then says that the D-coordinates of h(v) are RepB,D(h) times the B-coordinates of v: “briefly, application of a linear map is represented by the matrix-vector product of the map’s representative and the vector’s representative” [17]. The matrix was defined backwards from this theorem, chosen “precisely to make the theorem true”, and the book proves the theorem anyway [17, 18].

Example: the shear (x, y) ↦ (x + 3y, y) sends (1, 0) to (1, 0) and (0, 1) to (3, 1). With standard bases those are the columns, so the matrix has rows (1, 3) and (0, 1), and multiplying it by (x, y) returns (x + 3y, y). The book checks a projection this way and builds the rotation matrix the same way, from the images of the basis vectors [19, 20].

A matrix-vector product with mismatched sizes is undefined “for a reason”: the column must have as many entries as the domain has dimensions [20]. A defined product can be computed in either of two ways:

  • by rows: entry i is row i of the matrix dotted with the vector [20];
  • by columns: add up the matrix’s columns, column j weighted by entry j of the vector [21].

Any matrix represents a map. The construction also runs backwards [21]. An m×n matrix, together with any n-dimensional domain and m-dimensional codomain and a basis for each, defines a linear map by the same rule [22]. Different choices give different maps; the matrix alone “does not define a unique function”, because the map “depends on the bases that we choose” [22, 23]. Our shear matrix, with rows (1, 3) and (0, 1), shows this: on the linear polynomials P₁ with basis ⟨1, x⟩ in both places it is the map a + bx ↦ (a + 3b) + bx. With the standard bases of Rⁿ and Rᵐ, however, “vector representation is transparent”, and one can “work solely with matrices” [23]. Facts that pass between a matrix and any map it represents:

  • they have the same rank [23, 24];
  • for an m×n matrix of rank r: onto ⇔ r = m, one-to-one ⇔ r = n (Corollary 2.6) [24];
  • the matrices of isomorphisms are exactly the square nonsingular matrices [25].

Operations on matrices are operations on maps

The book’s plan: “our program is to define matrix operations by referencing function operations. Simplicity is a bonus” [27]. Each matrix operation is defined to match an operation on maps:

Operation on maps Matching operation on matrices Source
sum h + g, multiple r·h entry-by-entry sum, entry-by-entry multiple [26, 27]
composite g∘h matrix product GH [28, 29, 30]
inverse h⁻¹ inverse matrix H⁻¹ [40, 41]

The product is where the plan departs from the obvious choice. An entry-by-entry product is a “naive thought” that the book sets aside, to combine entries “in the way that represents the function operation of composition” instead [27].

The product. Composites of linear maps are linear [28]. Working out the matrix of g∘h from explicit matrices G and H, the book finds that it “has the rows of G combined with the columns of H” [29]. That becomes the definition: if G is m×r and H is r×n, then GH is m×n, and its i, j entry is row i of G dotted with column j of H [29]. Theorem 2.7 states the match, RepB,D(g∘h) = RepC,D(g)·RepB,C(h) [30]. The inner sizes must agree “because we want that the underlying function composition is possible” [31]. Sizes and dimensions run in opposite orders (a map from n to m dimensions has an m×n matrix) because in g∘h the map that acts first, h, is written on the right [31].

Order matters. The reason is the composition behind the product: “matrix multiplication represents function composition and function composition is not commutative” [32]. Two examples:

  • Matrices: A with rows (1, 1) and (0, 1), B with rows (1, 0) and (1, 1). AB has rows (2, 1) and (1, 1); BA has rows (1, 1) and (1, 2).
  • Maps: f(x, y) = (x + y, y) and g(x, y) = (2x, y). Then g∘f(x, y) = (2x + 2y, y), while f∘g(x, y) = (2x + y, y).

Sometimes only one order is even defined, since the sizes may fit one way and not the other [31, 32]. The other familiar laws survive. Where the products exist, multiplication is associative and distributes over addition, and each proof is one line because composition is associative and the maps are linear [32]. The book sets this against a proof by indices whose arithmetic “seems unconnected to any idea” [33].

Matrix mechanics. The entries also follow rules that can be stated without the maps [34]. The product GH can be computed column by column, as G times each column of H, or row by row, as each row of G times H [35]. Some special factors:

Factor On the left On the right
zero matrix gives a zero matrix [34] gives a zero matrix [34]
unit matrix E₁₂ (single 1 in row 1, column 2) E₁₂·[[a, b], [c, d]] = [[c, d], [0, 0]] [34] [[a, b], [c, d]]·E₁₂ = [[0, a], [0, c]] [34]
identity matrix changes nothing [36] changes nothing [36]
diagonal matrix rescales the rows [36, 37] rescales the columns [36, 37]
permutation matrix reorders the rows [37] reorders the columns [37]

An elementary reduction matrix is the identity with one Gaussian row operation applied, and multiplying by it on the left performs that operation [37, 38]. So “matrix multiplication can do Gaussian reduction”: a suitable product of elementary matrices turns any matrix into its reduced echelon form [38]. The book still treats maps as primary, “but we will be pragmatic — if the matrix point of view gives some clearer idea then we will go with it” [38].

Inverses.

  • Two-sided inverses exist only for functions that are both one-to-one and onto, and every such function has one. It is unique, and when the function is a linear map, so is its inverse [39, 40].
  • A one-sided inverse can exist on its own [39]. Example: (x, y) ↦ 2x − y from R² to R has the right inverse t ↦ (t, t), since 2t − t = t. It has no left inverse, because (1, 2) and (0, 0) both go to 0, and no function can send 0 back to both.
  • A matrix with a two-sided inverse is called invertible, and that happens exactly when it is nonsingular; as the book argues, “the statements are true about the map and therefore they are true about the matrix” [40, 41].
  • Invertibility survives multiplication, with the order reversed: (GH)⁻¹ = H⁻¹G⁻¹ for invertible G, H whose product exists [41].
  • Uses: a linear system is the matrix equation Hx = d [41]. When many systems share H and differ only in d, knowing H⁻¹ solves each one by a single product [42]. H⁻¹ also shows how far the solution moves when d changes, which “we could use … to decide how accurately we must specify the data in a linear model” [42, 43].
  • Computing H⁻¹: the invertible matrices are exactly the products of elementary reduction matrices, so applying the Gauss–Jordan steps that reduce H to the identity, to the identity itself, produces H⁻¹ [43]. If H does not reduce to the identity, it has no inverse. In the 2×2 case the method yields the formula with the factor 1/(ad − bc), which requires ad − bc ≠ 0 [44].

Change of basis

Change the basis and the same vector, or the same map, gets a different representation [45]. The translation is done by the identity map, represented with one basis on the input side and another on the output side.

Definition. RepB,D(id) is the change of basis matrix from B to D. Its columns are the vectors of B written in D-coordinates, and multiplying RepB(v) by it on the left gives RepD(v) [45, 46]. The book admits that “a better name would be ‘change of representation matrix’ but the above name is standard” [45, 46]. Every matrix that converts coordinates this way represents the identity map [46]. The matrices that can serve as change of basis matrices are exactly the nonsingular ones; the proof factors such a matrix into elementary matrices and shows that each factor takes a basis to a basis [47, 48].

A map in new bases. Suppose H = RepB,D(h), and new bases B̂ and D̂ are wanted. Theorem 2.1 gives Ĥ = P·H·Q, where Q = RepB̂,B(id) and P = RepD,D̂(id) [49]. Reading the product from right to left, as for composition, Q converts coordinates into the old domain basis, H applies the map, and P converts out of the old codomain basis [49, 50]. The book’s worked example produces a new matrix that looks quite different from the old one while representing the same map [50, 51].

Basis changes are often made to simplify a map’s matrix. Example: (x, y) ↦ (x + 2y, 2x + y) has the standard matrix with rows (1, 2) and (2, 1). It sends (1, 1) to (3, 3) = 3·(1, 1) and (1, −1) to (−1, 1) = −1·(1, −1), so in the basis ⟨(1, 1), (1, −1)⟩ its matrix is diagonal, with 3 and −1 on the diagonal. Diagonalized means: RepB,B(h) is diagonal for some basis B, the same B for domain and codomain. The book’s chapter Five works out which maps admit such a B [51, 52].

Matrix equivalence. H and Ĥ, of equal size, are matrix equivalent if Ĥ = PHQ with P and Q nonsingular; they then represent one map with respect to suitable bases [52]. P and Q are products of elementary matrices, so matrix equivalence allows column operations as well as row operations. Row-equivalent matrices are therefore matrix equivalent, but not the other way around [52, 53]. Suitable P and Q bring every m×n matrix of rank k to one block form: k ones at the start of the diagonal, zeros everywhere else [53]. So the equivalence classes “are characterized by rank” [54]; the book’s own example is the 2×2 case, with three classes for ranks 0, 1 and 2 [54]. In that form the map sends βᵢ to δᵢ for i ≤ k and the remaining βᵢ to 0, which is why “we can view any linear map as a projection” [54].

Not covered here

Isomorphisms (section I), orthogonal projection (section VI), determinants (chapter Four), diagonalizability and eigenvalues (chapter Five), the book’s exercises, and anything about computer graphics, physics or statistics, which the chapter does not discuss.

Sources

  • [1]Hefferon, J., Linear Algebra, Three.II.1, p. 191 (Definition 1.1; Example 1.2, projection). View at source ↗
  • [2]Same, p. 192 (Examples 1.3–1.5; “interchangably”; the non-linear contrasts). View at source ↗
  • [3]Same, p. 193 (Lemmas 1.6 and 1.7; Example 1.8; Theorem 1.9). View at source ↗
  • [4]Same, p. 194 (proof of Theorem 1.9; Definition 1.10; Example 1.11; “convenient scheme”). View at source ↗
  • [5]Same, p. 195 (Definition 1.12, Remark 1.13; Examples 1.14–1.16; Lemma 1.17). View at source ↗
  • [6]Same, p. 196 (proof of Lemma 1.17; homomorphism “more fruitful”). View at source ↗
  • [7]Same, Three.II.2, p. 199 (the injection map). View at source ↗
  • [8]Same, p. 200 (Lemma 2.1; Definition 2.2, rank; Examples 2.3 and 2.4). View at source ↗
  • [9]Same, pp. 202–203 (Examples 2.7 and 2.8, “shadows”, classes add). View at source ↗
  • [10]Same, p. 204 (Lemma 2.10; Definition 2.11, null space and nullity). View at source ↗
  • [11]Same, p. 205 (Examples 2.12 and 2.13; Theorem 2.14 and proof). View at source ↗
  • [12]Same, p. 206 (Corollary 2.17; “no homomorphism from R² onto R³”; Lemma 2.18). View at source ↗
  • [13]Same, p. 207 (Example 2.19; Theorem 2.20 and proof begun). View at source ↗
  • [14]Same, p. 208 (proof concluded; inverse images as points). View at source ↗
  • [15]Same, Three.III.1, p. 212 (the scheme; Example 1.1). View at source ↗
  • [16]Same, pp. 213–214 (matrix notation; Definition 1.2; Remark 1.3; Example 1.4). View at source ↗
  • [17]Same, p. 215 (Theorem 1.5; Definition 1.6; “briefly”; Remark 1.7 begun). View at source ↗
  • [18]Same, p. 216 (Remark 1.7 concluded; Examples 1.8 and 1.9). View at source ↗
  • [19]Same, p. 217 (checking the projection; Example 1.10 begun). View at source ↗
  • [20]Same, p. 218 (the rotation matrix; Example 1.11; row-by-row view). View at source ↗
  • [21]Same, p. 219 (column-by-column view; Example 1.12; the converse announced). View at source ↗
  • [22]Same, Three.III.2, p. 223 (defining a map from a matrix; “does not define a unique function”). View at source ↗
  • [23]Same, pp. 224–225 (Example 2.1; Theorem 2.2; Example 2.3; standard bases; Theorem 2.4 begun). View at source ↗
  • [24]Same, p. 226 (proof of Theorem 2.4; Example 2.5; Corollary 2.6). View at source ↗
  • [25]Same, pp. 227–228 (Definition 2.7; Lemma 2.9; Examples 2.10 and 2.11). View at source ↗
  • [26]Same, Three.IV.1, pp. 232–233 (Examples 1.1 and 1.2; Definition 1.3). View at source ↗
  • [27]Same, p. 234 (Theorem 1.4; Remark 1.5; Definition 1.6, zero matrix). View at source ↗
  • [28]Same, Three.IV.2, p. 236 (Lemma 2.1; Example 2.2). View at source ↗
  • [29]Same, p. 237 (“rows of G combined with the columns of H”; Definition 2.3; Examples 2.4 and 2.5). View at source ↗
  • [30]Same, p. 238 (Example 2.6; Theorem 2.7 and proof; the arrow diagram). View at source ↗
  • [31]Same, p. 239 (RepB,D(g∘h) = GH; sizes; Remark 2.8; the subscripts). View at source ↗
  • [32]Same, p. 240 (Examples 2.9 and 2.10; Remark 2.11; Theorem 2.12 and proof). View at source ↗
  • [33]Same, p. 241 (Remark 2.13, the index-heavy proof contrasted). View at source ↗
  • [34]Same, Three.IV.3, pp. 244–245 (mechanics; Example 3.1; Definition 3.2; Examples 3.3 and 3.4). View at source ↗
  • [35]Same, pp. 246–247 (Examples 3.5 and 3.6; Lemma 3.7). View at source ↗
  • [36]Same, pp. 247–248 (Definitions 3.8, 3.9, 3.12; Examples 3.10, 3.11, 3.13). View at source ↗
  • [37]Same, pp. 248–249 (Definition 3.14; Examples 3.15–3.18). View at source ↗
  • [38]Same, pp. 250–251 (Definition 3.19; Lemma 3.20; Examples 3.21 and 3.22; Corollary 3.23; “we will be pragmatic”). View at source ↗
  • [39]Same, Three.IV.4, pp. 254–255 (projection and embedding; right and left inverses; two-sided inverses). View at source ↗
  • [40]Same, p. 255 (Definition 4.1; Lemma 4.2). View at source ↗
  • [41]Same, p. 256 (Theorem 4.3 and proof; Lemma 4.4; the arrow diagram; systems as matrix equations). View at source ↗
  • [42]Same, p. 257 (Example 4.5; Remark 4.6, the two advantages). View at source ↗
  • [43]Same, p. 258 (sensitivity analysis; Lemma 4.7 and proof; Example 4.8). View at source ↗
  • [44]Same, p. 259 (Examples 4.9 and 4.10; Corollary 4.11). View at source ↗
  • [45]Same, Three.V.1, p. 262 (representations vary; Definition 1.1). View at source ↗
  • [46]Same, p. 263 (Remark 1.2; Lemma 1.3 and proof; Example 1.4). View at source ↗
  • [47]Same, p. 264 (Lemma 1.5 and the start of its proof). View at source ↗
  • [48]Same, p. 265 (proof concluded; Corollary 1.6). View at source ↗
  • [49]Same, Three.V.2, p. 267 (the arrow diagram; Theorem 2.1). View at source ↗
  • [50]Same, p. 268 (Example 2.2 begun; “reads right to left”). View at source ↗
  • [51]Same, p. 269 (Example 2.2 concluded, “messier”; Example 2.3). View at source ↗
  • [52]Same, p. 270 (diagonalized; Definition 2.4; Corollary 2.5; row versus matrix equivalence). View at source ↗
  • [53]Same, p. 271 (Example 2.6; Theorem 2.7 and proof; Example 2.8 begun). View at source ↗
  • [54]Same, p. 272 (Corollary 2.9; Example 2.10; “any linear map as a projection”). View at source ↗

Wikipedia was not used as a source.

Works cited