Read the Basis Labels Before the Entries
A matrix representing a linear map is not just a rectangular array attached to that map. Its entries depend on the chosen ordered basis of the domain and the chosen ordered basis of the codomain. The labels \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\) record those choices: the matrix accepts coordinates in \(\mathcal{B}\) and returns coordinates in \(\mathcal{C}\). Many errors that look like arithmetic mistakes are actually failures to track this input and output convention.
Throughout this tutorial, the spaces are finite-dimensional over \(\mathbb{R}\). An ordered basis \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) of a vector space \(V\) gives each \(\mathbf{v}\in V\) a unique coordinate vector \([\mathbf{v}]_{\mathcal{B}}\in\mathbb{R}^n\), defined by \(\mathbf{v}=x_1\mathbf{b}_1+\cdots+x_n\mathbf{b}_n\) when \([\mathbf{v}]_{\mathcal{B}}=(x_1,\dots,x_n)^{\top}\). The order of the basis vectors matters because it determines the order of the coordinates.
Keep the two roles separate. The basis to the right of the arrow is the domain basis and determines the input coordinates. The basis to the left is the codomain basis and determines how the output is expressed. If \(T:V\to W\), then the number of columns is \(\dim V\) and the number of rows is \(\dim W\). A matrix with the right dimensions can still be wrong if either basis label is wrong.
Why Columns, Not Rows, Record the Images
Proof. Let \(\mathbf{A}=[T]_{\mathcal{C}\leftarrow\mathcal{B}}\), and let \(\mathbf{a}_j\) be its \(j\)th column. The coordinate vector of \(\mathbf{b}_j\) in the ordered basis \(\mathcal{B}\) is the \(j\)th standard coordinate vector \(\mathbf{e}_j\). By the defining property of the representation matrix, \([T(\mathbf{b}_j)]_{\mathcal{C}}=\mathbf{A}\mathbf{e}_j\). Multiplication by \(\mathbf{e}_j\) selects column \(j\), so \(\mathbf{a}_j=[T(\mathbf{b}_j)]_{\mathcal{C}}\). This argument applies to every \(j\) from \(1\) to \(n\). \(\square\)
This is why the standard construction places the coordinate vectors of the images of the domain basis vectors in the columns. Rows have a different role: a row collects the contributions to one output coordinate from all input coordinates. Reading a row as the image of a basis vector confuses these two roles.
Worked Example: Columns Give the Images
Let \(T:\mathbb{R}^2\to\mathbb{R}^2\) be \(T(x,y)=(x+2y,3x+4y)\), using the standard ordered basis \(\mathcal{E}=(\mathbf{e}_1,\mathbf{e}_2)\) in both spaces. Find the representation matrix and check its columns.
The first domain basis vector is \(\mathbf{e}_1=(1,0)^{\top}\), so \(T(\mathbf{e}_1)=(1,3)^{\top}\). The second is \(\mathbf{e}_2=(0,1)^{\top}\), so \(T(\mathbf{e}_2)=(2,4)^{\top}\). Standard coordinates are the vectors themselves, so these image coordinate vectors become the columns:
For an arbitrary input \(\mathbf{x}=(x,y)^{\top}\), multiplication gives
Check: Applying the matrix to \(\mathbf{e}_1\) gives \((1,3)^{\top}=T(\mathbf{e}_1)\), and applying it to \(\mathbf{e}_2\) gives \((2,4)^{\top}=T(\mathbf{e}_2)\). The columns match the images.
Common wrong calculation: Writing the rows \((1,2)^{\top}\) and \((3,4)^{\top}\) as the images would give the transposed matrix \(\begin{bmatrix}1&3\\2&4\end{bmatrix}\). That matrix sends \(\mathbf{e}_1\) to \((1,2)^{\top}\), but the actual image is \(T(\mathbf{e}_1)=(1,3)^{\top}\). The correction is to place each image coordinate vector in a column.
Swapping Bases Changes What the Coordinates Mean
Even for the same map, changing the domain basis or codomain basis generally changes the matrix. The identity map makes this dependence especially visible: it leaves each vector unchanged, but its input and output coordinates can be different when the bases differ. In particular, \([T]_{\mathcal{B}\leftarrow\mathcal{C}}\) is not an instruction to take \(\mathcal{B}\)-coordinates as input. Its input is \(\mathcal{C}\)-coordinates, and its output is \(\mathcal{B}\)-coordinates.
Worked Example: The Identity Map with Two Bases
Let \(V=W=\mathbb{R}^2\), let \(\mathcal{B}=(\mathbf{e}_1,\mathbf{e}_2)\), and let \(\mathcal{C}=(\mathbf{c}_1,\mathbf{c}_2)\), where \(\mathbf{c}_1=(1,1)^{\top}\) and \(\mathbf{c}_2=(1,-1)^{\top}\). Find the matrices of the identity map in both directions and track the coordinates of \(\mathbf{e}_1\).
For \([I]_{\mathcal{C}\leftarrow\mathcal{B}}\), the inputs are \(\mathcal{B}\)-coordinates and the outputs are \(\mathcal{C}\)-coordinates. Write each domain basis vector in the codomain basis. Since \(\mathbf{e}_1=\tfrac12\mathbf{c}_1+\tfrac12\mathbf{c}_2\) and \(\mathbf{e}_2=\tfrac12\mathbf{c}_1-\tfrac12\mathbf{c}_2\), the columns are \((\tfrac12,\tfrac12)^{\top}\) and \((\tfrac12,-\tfrac12)^{\top}\):
For the reversed labels, the inputs are \(\mathcal{C}\)-coordinates and the outputs are \(\mathcal{B}\)-coordinates. The columns are now the \(\mathcal{B}\)-coordinate vectors of \(\mathbf{c}_1\) and \(\mathbf{c}_2\):
The actual input coordinates for \(\mathbf{e}_1\) in \(\mathcal{C}\) are \([\mathbf{e}_1]_{\mathcal{C}}=(\tfrac12,\tfrac12)^{\top}\). Applying the reversed-basis matrix correctly gives
Check: The output is \(\mathcal{B}\)-coordinates, as the arrow specifies; those coordinates represent \(\mathbf{e}_1\). A tempting but incorrect move is to feed \((1,0)^{\top}\), the \(\mathcal{B}\)-coordinates of \(\mathbf{e}_1\), into this reversed-basis matrix and then read the result as \(\mathcal{C}\)-coordinates. The matrix gives \((1,1)^{\top}\), but according to its labels this is the \(\mathcal{B}\)-coordinate vector of the input vector \(\mathbf{c}_1\), since \((1,0)^{\top}\) was treated as \(\mathcal{C}\)-coordinates. Interpreting \((1,1)^{\top}\) instead as \(\mathcal{C}\)-coordinates would represent \(\mathbf{c}_1+\mathbf{c}_2=(2,0)^{\top}\), not \(\mathbf{e}_1\). The mistake is using coordinates in the wrong input basis and then misreading the output basis.
Composition Matrices Multiply in Application Order
Suppose \(S:U\to V\) is applied first and \(T:V\to W\) second. The output coordinates of \(S\) must be the input coordinates for \(T\). Thus the basis used to express the intermediate vector must agree on both sides of the matrix product. This agreement is what makes the order of multiplication unavoidable.
Proof. Let \(\mathbf{u}\in U\). By the defining property of the matrix of \(S\), \([S(\mathbf{u})]_{\mathcal{B}}=[S]_{\mathcal{B}\leftarrow\mathcal{A}}[\mathbf{u}]_{\mathcal{A}}\). Apply the defining property of the matrix of \(T\) to the vector \(S(\mathbf{u})\in V\): \([T(S(\mathbf{u}))]_{\mathcal{C}}=[T]_{\mathcal{C}\leftarrow\mathcal{B}}[S(\mathbf{u})]_{\mathcal{B}}\). Substituting the first equality into the second gives \[ [T(S(\mathbf{u}))]_{\mathcal{C}} = [T]_{\mathcal{C}\leftarrow\mathcal{B}} [S]_{\mathcal{B}\leftarrow\mathcal{A}} [\mathbf{u}]_{\mathcal{A}}. \] This holds for every \(\mathbf{u}\in U\), so the product matrix represents \(T\circ S\) from \(\mathcal{A}\)-coordinates to \(\mathcal{C}\)-coordinates. \(\square\)
The rightmost matrix acts first. In \([T]_{\mathcal{C}\leftarrow\mathcal{B}}[S]_{\mathcal{B}\leftarrow\mathcal{A}}\), the right factor takes \(\mathcal{A}\)-coordinates to \(\mathcal{B}\)-coordinates; the left factor then takes \(\mathcal{B}\)-coordinates to \(\mathcal{C}\)-coordinates. Reversing the factors generally fails both the basis-label check and the numerical check.
Worked Example: Reversing the Composition Order
Let \(S:\mathbb{R}^2\to\mathbb{R}^2\) be \(S(x,y)=(x+y,y)\), and let \(T:\mathbb{R}^2\to\mathbb{R}^2\) be \(T(x,y)=(x,x+y)\). Use the standard basis for all three spaces. Find the matrix of \(T\circ S\), and compare it with the incorrectly reversed product.
The images of the standard basis vectors give
Since \(S\) is applied first, the composition matrix is \([T][S]\):
Directly, \(T(S(x,y))=T(x+y,y)=(x+y,x+2y)\), which has the same matrix. The reversed product is instead
Check: For \(\mathbf{e}_2=(0,1)^{\top}\), first apply \(S\): \(S(\mathbf{e}_2)=(1,1)^{\top}\). Then \(T(1,1)^{\top}=(1,2)^{\top}\). The correct product gives \([T][S]\mathbf{e}_2=(1,2)^{\top}\), whereas the reversed product gives \([S][T]\mathbf{e}_2=(1,1)^{\top}\). The latter is not \(T(S(\mathbf{e}_2))\).
A Reliable Convention Check
Before trusting a proposed matrix, check its labels and its action. These checks are short, but they catch different errors:
- Check dimensions. If the domain has dimension \(n\) and the codomain has dimension \(m\), the matrix must have \(n\) columns and \(m\) rows.
- Check a basis vector. Column \(j\) should equal the codomain-coordinate vector of the image of domain basis vector \(j\).
- Check coordinate meanings. The input column must use the basis named on the right of the arrow, and the output must be interpreted in the basis named on the left.
- Check composition compatibility. The output basis of the right-hand factor must be the input basis of the left-hand factor. The right-hand factor acts first.
When diagnosing a wrong answer, ask whether it fails because of a numerical computation or because the coordinate vector was assigned the wrong meaning. For example, the multiplication in the reversed-basis example is numerically correct: the error occurs only when \(\mathcal{B}\)-coordinates are supplied where \(\mathcal{C}\)-coordinates are required. Likewise, a transposed matrix may have the correct entries but put image vectors in rows rather than columns. Stating the bases beside every matrix makes these distinctions visible.
Check Your Understanding
For each question, track both the numerical vector and the basis in which its coordinates are expressed.
- If \(T:V\to W\), what input basis and output basis are specified by \([T]_{\mathcal{C}\leftarrow\mathcal{B}}\)?
- For a matrix of a map in ordered bases \(\mathcal{B}=(\mathbf{b}_1,\dots,\mathbf{b}_n)\) and \(\mathcal{C}\), what does column \(j\) represent?
- Let \(\mathcal{B}\) be the standard basis and \(\mathcal{C}=((1,1)^{\top},(1,-1)^{\top})\). What is \([\mathbf{e}_2]_{\mathcal{C}}\)?
- If \(S:U\to V\) and \(T:V\to W\), which matrix factor acts first in the product representing \(T\circ S\)?
- For the maps in the composition example, compute \(T(S(\mathbf{e}_1))\) directly and compare it with the first column of \([T][S]\).
- A proposed representation matrix has \(3\) rows and \(2\) columns. What dimensions must its domain and codomain have?