Skip to content
VidiMaster it, module by module
Module 1/Matrices

Matrices ↔ Linear Maps

Every linear map T:Rn→RmT:\mathbb{R}^n\to\mathbb{R}^m is "secretly" multiplication by a single matrix AA, built by seeing what TT does to the standard basis vectors. This lesson shows how to build that matrix, use it to apply the map, and why composing maps means multiplying matrices.

Before you start — give these a try

Attempting first primes your brain for the lesson — even if you miss. Nothing is graded or saved; it's just a warm-up.

Let A=[3−125]A=\begin{bmatrix}3&-1\\2&5\end{bmatrix} be the standard matrix of a linear map TT. Compute T(v)=AvT(\mathbf{v})=A\mathbf{v} for v=[21]\mathbf{v}=\begin{bmatrix}2\\1\end{bmatrix}. Enter the resulting vector.

True or False: For a linear map T:Rn→RmT:\mathbb{R}^n\to\mathbb{R}^m, the jj-th column of its standard matrix equals T(ej)T(\mathbf{e}_j), and consequently the matrix has mm rows and nn columns.

What you’ll be able to do

  • State the definition of a linear map and recognize when a given formula is linear.
  • Construct the standard matrix AA of a linear map TT by evaluating TT on the standard basis vectors e1,…,en\mathbf{e}_1,\dots,\mathbf{e}_n.
  • Compute T(v)T(\mathbf{v}) as the matrix–vector product AvA\mathbf{v}, and read off a single entry of AA as a component of some T(ej)T(\mathbf{e}_j).
  • Explain and use the correspondence between composition of linear maps and matrix multiplication.
  • Determine the size (rows ×\times columns) of a standard matrix from the domain and codomain of the map.

In your course

· MATH2015 · Linear Algebra & Probability
§4.1 Matrices and linear maps ℝ²→ℝ²§4.3 Matrices and linear maps ℝⁿ→ℝᵐ
  • Theorem 4.2Every linear map is x↦Axx\mapsto Ax for a unique matrix
    For every linear f:Rn→Rmf:\mathbb{R}^n\to\mathbb{R}^m there is exactly one A∈Rm×nA\in\mathbb{R}^{m\times n} with f(x)=Axf(x)=Ax; the columns of AA are the images f(ej)f(e_j) of the standard basis vectors.
  • Remark 4.3A map ℝⁿ→ℝᵐ needs an m×nm\times n matrix
1

The big idea: a linear map is decided by the basis

A linear map (or linear transformation) is a function T:Rn→RmT:\mathbb{R}^n\to\mathbb{R}^m that respects addition and scaling. Here Rn\mathbb{R}^n is the set of vectors (lists) with nn real entries — the domain — and Rm\mathbb{R}^m is the codomain. "Respects addition and scaling" means for all vectors u,v∈Rn\mathbf{u},\mathbf{v}\in\mathbb{R}^n and every scalar (real number) cc:

T(u+v)=T(u)+T(v),T(c u)=c T(u).T(\mathbf{u}+\mathbf{v}) = T(\mathbf{u})+T(\mathbf{v}), \qquad T(c\,\mathbf{u}) = c\,T(\mathbf{u}).

These two rules combine into one: T(au+bv)=aT(u)+bT(v)T(a\mathbf{u}+b\mathbf{v}) = aT(\mathbf{u})+bT(\mathbf{v}) for all scalars a,ba,b.

Here is the key consequence. The standard basis vectors of Rn\mathbb{R}^n are e1=[10⋮0], e2=[01⋮0], …, en=[00⋮1],\mathbf{e}_1=\begin{bmatrix}1\\0\\\vdots\\0\end{bmatrix},\ \mathbf{e}_2=\begin{bmatrix}0\\1\\\vdots\\0\end{bmatrix},\ \dots,\ \mathbf{e}_n=\begin{bmatrix}0\\0\\\vdots\\1\end{bmatrix}, where ej\mathbf{e}_j has a 11 in position jj and 00 everywhere else. Any vector v=[v1⋮vn]\mathbf{v}=\begin{bmatrix}v_1\\\vdots\\v_n\end{bmatrix} can be written as v=v1e1+⋯+vnen\mathbf{v}=v_1\mathbf{e}_1+\cdots+v_n\mathbf{e}_n. Applying TT and using linearity: T(v)=v1 T(e1)+v2 T(e2)+⋯+vn T(en).T(\mathbf{v}) = v_1\,T(\mathbf{e}_1)+v_2\,T(\mathbf{e}_2)+\cdots+v_n\,T(\mathbf{e}_n). So once you know the nn output vectors T(e1),…,T(en)T(\mathbf{e}_1),\dots,T(\mathbf{e}_n), you know TT on every input. A linear map is completely determined by what it does to the basis. That is exactly the information a matrix stores.

2

The standard matrix: columns are $T(\mathbf{e}_j)$

Collect those output vectors as the columns of a matrix. The standard matrix of a linear map T:Rn→RmT:\mathbb{R}^n\to\mathbb{R}^m is

A=[ T(e1)  T(e2)  ⋯  T(en) ].A = \big[\,T(\mathbf{e}_1)\ \ T(\mathbf{e}_2)\ \ \cdots\ \ T(\mathbf{e}_n)\,\big].

Each T(ej)T(\mathbf{e}_j) lives in Rm\mathbb{R}^m, so it contributes mm numbers (one column); there are nn of them. Therefore AA has mm rows and nn columns — it is an m×nm\times n matrix. A handy slogan: rows = codomain dimension, columns = domain dimension.

Recipe to build AA:

  1. Plug e1=(1,0,…,0)\mathbf{e}_1=(1,0,\dots,0) into the formula for TT. The result is column 11.
  2. Plug e2=(0,1,0,…,0)\mathbf{e}_2=(0,1,0,\dots,0) into TT. The result is column 22.
  3. Continue through en\mathbf{e}_n.

Reading one entry. The entry of AA in row ii, column jj — written aija_{ij} or AijA_{ij} — is the ii-th component of the vector T(ej)T(\mathbf{e}_j). So you can find a single entry without building the whole matrix: evaluate T(ej)T(\mathbf{e}_j) and look at coordinate ii.

3

Applying the map is the matrix–vector product $A\mathbf{v}$

The matrix AA isn't just a storage box — multiplying by it is the map. For every v∈Rn\mathbf{v}\in\mathbb{R}^n, T(v)=Av.T(\mathbf{v}) = A\mathbf{v}.

Why? Writing A=[ a1 ⋯ an ]A=[\,\mathbf{a}_1\ \cdots\ \mathbf{a}_n\,] with columns aj=T(ej)\mathbf{a}_j=T(\mathbf{e}_j), the matrix–vector product is defined as the linear combination of the columns weighted by the entries of v\mathbf{v}: Av=v1a1+v2a2+⋯+vnan=v1T(e1)+⋯+vnT(en)=T(v).A\mathbf{v} = v_1\mathbf{a}_1 + v_2\mathbf{a}_2 + \cdots + v_n\mathbf{a}_n = v_1 T(\mathbf{e}_1)+\cdots+v_n T(\mathbf{e}_n) = T(\mathbf{v}). That last equality is exactly the linearity identity from the first section.

In practice you compute AvA\mathbf{v} row by row: the ii-th entry of AvA\mathbf{v} is the dot product of row ii of AA with v\mathbf{v}. For example, [231−1][41]=[2⋅4+3⋅11⋅4+(−1)⋅1]=[113].\begin{bmatrix}2&3\\1&-1\end{bmatrix}\begin{bmatrix}4\\1\end{bmatrix}=\begin{bmatrix}2\cdot4+3\cdot1\\1\cdot4+(-1)\cdot1\end{bmatrix}=\begin{bmatrix}11\\3\end{bmatrix}. For the product AvA\mathbf{v} to be defined, the number of columns of AA must equal the number of entries of v\mathbf{v} — which is exactly nn, the domain dimension. The output has mm entries, landing in the codomain Rm\mathbb{R}^m.

4

Composition of maps = product of matrices

Suppose you do one linear map and then another. Let S:Rn→RpS:\mathbb{R}^n\to\mathbb{R}^p have standard matrix BB (size p×np\times n), and T:Rp→RmT:\mathbb{R}^p\to\mathbb{R}^m have standard matrix AA (size m×pm\times p). The composition T∘S:Rn→RmT\circ S:\mathbb{R}^n\to\mathbb{R}^m means "apply SS first, then TT": (T∘S)(v)=T(S(v))(T\circ S)(\mathbf{v}) = T\big(S(\mathbf{v})\big).

Its standard matrix is the matrix product ABAB: (T∘S)(v)=T(S(v))=A(Bv)=(AB)v.(T\circ S)(\mathbf{v}) = T(S(\mathbf{v})) = A(B\mathbf{v}) = (AB)\mathbf{v}.

Note the order carefully: SS acts first, but its matrix BB sits on the right, because it touches the vector first. The sizes must chain correctly: AA is m×pm\times p and BB is p×np\times n, so ABAB is m×nm\times n — the inner dimensions (pp) match and cancel. This is the deep reason matrix multiplication is defined the way it is: it is engineered so that multiplying matrices mirrors composing the maps they represent. Matrix multiplication is generally not commutative (AB≠BAAB\neq BA in general), which matches the fact that doing SS then TT usually differs from doing TT then SS.

Standard Matrix of a Linear Map

For every linear map T:Rn→RmT:\mathbb{R}^n\to\mathbb{R}^m there is a unique m×nm\times n matrix AA such that T(v)=AvT(\mathbf{v})=A\mathbf{v} for all v∈Rn\mathbf{v}\in\mathbb{R}^n. Its columns are the images of the standard basis vectors: A=[ T(e1) ⋯ T(en) ]A=\big[\,T(\mathbf{e}_1)\ \cdots\ T(\mathbf{e}_n)\,\big], and the entry aija_{ij} equals the ii-th component of T(ej)T(\mathbf{e}_j).

Intuition. A linear map is pinned down entirely by what it does to the basis vectors, because every input is a combination of them. Packing those nn output vectors into the columns of a matrix lets a single multiplication reproduce the map on every input.
Composition Corresponds to Matrix Product

If S:Rn→RpS:\mathbb{R}^n\to\mathbb{R}^p has standard matrix BB and T:Rp→RmT:\mathbb{R}^p\to\mathbb{R}^m has standard matrix AA, then the composition T∘S:Rn→RmT\circ S:\mathbb{R}^n\to\mathbb{R}^m has standard matrix ABAB (an m×nm\times n matrix). That is, (T∘S)(v)=(AB)v(T\circ S)(\mathbf{v})=(AB)\mathbf{v} for all v\mathbf{v}.

Intuition. Applying SS then TT to a vector is A(Bv)A(B\mathbf{v}); associativity lets us regroup this as (AB)v(AB)\mathbf{v}. Matrix multiplication is precisely defined so that this works, which is why the map applied first (SS, matrix BB) appears on the right.

Worked examples

Example 1

Let T:R2→R2T:\mathbb{R}^2\to\mathbb{R}^2 be the linear map T(x,y)=(2x+3y, x−y)T(x,y)=(2x+3y,\ x-y). (a) Find the standard matrix AA of TT. (b) Use AA to compute T(4,1)T(4,1).

  1. 1

    Set up part (a). The standard matrix has columns T(e1)T(\mathbf{e}_1) and T(e2)T(\mathbf{e}_2), where e1=(1,0)\mathbf{e}_1=(1,0) and e2=(0,1)\mathbf{e}_2=(0,1). So we just feed each standard basis vector into the formula for TT.

  2. 2

    Compute the first column. Plug in x=1, y=0x=1,\ y=0: T(1,0)=(2⋅1+3⋅0, 1−0)=(2,1)T(1,0)=(2\cdot1+3\cdot0,\ 1-0)=(2,1). This is column 11: [21]\begin{bmatrix}2\\1\end{bmatrix}.

  3. 3

    Compute the second column. Plug in x=0, y=1x=0,\ y=1: T(0,1)=(2⋅0+3⋅1, 0−1)=(3,−1)T(0,1)=(2\cdot0+3\cdot1,\ 0-1)=(3,-1). This is column 22: [3−1]\begin{bmatrix}3\\-1\end{bmatrix}.

  4. 4

    Assemble AA. Place the columns side by side: A=[231−1]A=\begin{bmatrix}2&3\\1&-1\end{bmatrix}. It is 2×22\times2, matching T:R2→R2T:\mathbb{R}^2\to\mathbb{R}^2 (2 rows for the codomain, 2 columns for the domain).

  5. 5

    Part (b): compute AvA\mathbf{v} with v=(4,1)\mathbf{v}=(4,1). Take the dot product of each row of AA with v\mathbf{v}. Row 1: 2⋅4+3⋅1=8+3=112\cdot4+3\cdot1=8+3=11. Row 2: 1⋅4+(−1)⋅1=4−1=31\cdot4+(-1)\cdot1=4-1=3. So Av=[113]A\mathbf{v}=\begin{bmatrix}11\\3\end{bmatrix}.

  6. 6

    Sanity check against the formula. Directly, T(4,1)=(2⋅4+3⋅1, 4−1)=(11,3)T(4,1)=(2\cdot4+3\cdot1,\ 4-1)=(11,3). It matches AvA\mathbf{v}, confirming T(v)=AvT(\mathbf{v})=A\mathbf{v}.

Answer. A=[231−1]A=\begin{bmatrix}2&3\\1&-1\end{bmatrix} and T(4,1)=[113]T(4,1)=\begin{bmatrix}11\\3\end{bmatrix}.
Example 2

Let T:R3→R2T:\mathbb{R}^3\to\mathbb{R}^2 be T(x,y,z)=(x+2z, 3y−z)T(x,y,z)=(x+2z,\ 3y-z). Find its standard matrix AA, and compute T(2,1,3)T(2,1,3).

Example 3

Let S:R2→R2S:\mathbb{R}^2\to\mathbb{R}^2 be rotation by 90∘90^\circ counterclockwise, with matrix B=[0−110]B=\begin{bmatrix}0&-1\\1&0\end{bmatrix}, and let T:R2→R2T:\mathbb{R}^2\to\mathbb{R}^2 be the scaling with matrix A=[2003]A=\begin{bmatrix}2&0\\0&3\end{bmatrix}. Find the standard matrix of the composition T∘ST\circ S (rotate first, then scale).