Tutorials › Linear Algebra › Trace and Transpose on Matrix Spaces

Linear Maps Between Vector Spaces · Tutorial 403 of 1000

Trace and Transpose on Matrix Spaces

Learn to verify trace and transpose as linear maps and describe exactly which inputs map to zero and which outputs each map can produce.

Intermediate 9 min read

What You'll Learn

  • State the domains and codomains of trace and transpose.
  • Verify additivity and homogeneity directly from matrix entries.
  • Describe the kernel and image of the trace map on square matrices.
  • Determine the kernel and image of transpose on rectangular matrix spaces.
  • Check matrix dimensions and distinguish diagonal entries from all entries.

Two Maps Defined Directly from Matrix Entries

Some linear maps are best understood through what they do to the entries of a matrix. The trace keeps only the diagonal entries and adds them. Transpose rearranges the entries by exchanging row and column positions. These operations look different, but each respects addition and scalar multiplication. Determining their kernels and images makes those statements precise: the kernel records which inputs become zero, while the image records which outputs can occur.

Throughout, scalars are real. For positive integers \(m,n\), the space \(\mathbb{R}^{m\times n}\) consists of all \(m\)-by-\(n\) real matrices, with addition and scalar multiplication performed entry by entry. The zero matrix in this space is denoted by \(\mathbf{O}\); its size is determined by the space in which it appears. A map \(T:V\to W\) between real vector spaces is linear if \(T(a\mathbf{u}+b\mathbf{v})=aT(\mathbf{u})+bT(\mathbf{v})\) for all \(\mathbf{u},\mathbf{v}\in V\) and \(a,b\in\mathbb{R}\). Equivalently, it preserves addition and scalar multiplication.

Definition: For a linear map \(T:V\to W\), its kernel is \(\ker T=\{\mathbf{v}\in V:T(\mathbf{v})=\mathbf{0}\}\), and its image is \(\operatorname{im}T=\{T(\mathbf{v}):\mathbf{v}\in V\}\subseteq W\). The zero in the kernel condition is the zero vector or zero matrix in the codomain.

For a square matrix \(\mathbf{A}=(a_{ij})\in\mathbb{R}^{n\times n}\), the trace is \(\operatorname{tr}\mathbf{A}=a_{11}+a_{22}+\cdots+a_{nn}\). It is a real number, so trace defines a map from \(\mathbb{R}^{n\times n}\) to \(\mathbb{R}\). Transpose is defined for a rectangular matrix as well: if \(\mathbf{A}\in\mathbb{R}^{m\times n}\), then \(\mathbf{A}^{\top}\in\mathbb{R}^{n\times m}\), with \((\mathbf{A}^{\top})_{ij}=a_{ji}\). Thus transpose defines a map from \(\mathbb{R}^{m\times n}\) to \(\mathbb{R}^{n\times m}\), not generally from a matrix space to itself.

Trace: Linearity, Kernel, and Image

The trace map can ignore most of a matrix's entries: only the diagonal contributes to its value. Still, because each diagonal entry behaves linearly under matrix addition and scalar multiplication, their sum does too.

Theorem: For every positive integer \(n\), the map \(\operatorname{tr}:\mathbb{R}^{n\times n}\to\mathbb{R}\) is linear. Its kernel consists exactly of the matrices whose diagonal entries sum to zero, and its image is all of \(\mathbb{R}\).

Proof. Let \(\mathbf{A}=(a_{ij})\) and \(\mathbf{B}=(b_{ij})\) be in \(\mathbb{R}^{n\times n}\), and let \(c\in\mathbb{R}\). The diagonal entries of \(\mathbf{A}+\mathbf{B}\) are \(a_{ii}+b_{ii}\), so \(\operatorname{tr}(\mathbf{A}+\mathbf{B})=\sum_{i=1}^{n}(a_{ii}+b_{ii})=\sum_{i=1}^{n}a_{ii}+\sum_{i=1}^{n}b_{ii}=\operatorname{tr}\mathbf{A}+\operatorname{tr}\mathbf{B}\). The diagonal entries of \(c\mathbf{A}\) are \(ca_{ii}\), so \(\operatorname{tr}(c\mathbf{A})=\sum_{i=1}^{n}ca_{ii}=c\operatorname{tr}\mathbf{A}\). These two identities establish linearity. By the definition of the kernel, \(\mathbf{A}\in\ker(\operatorname{tr})\) exactly when \(\operatorname{tr}\mathbf{A}=0\), which is exactly when its diagonal entries sum to zero. To determine the image, take any \(r\in\mathbb{R}\) and choose the matrix with \(r\) in its first diagonal position and zero in every other position. Its trace is \(r\). Hence every real number occurs as a trace, and the image is \(\mathbb{R}\). \(\square\)

This description applies to every positive size \(n\), including \(n=1\). When \(n=1\), the trace map sends the one-entry matrix \([a]\) to \(a\), so its kernel contains only \([0]\), while its image is still all of \(\mathbb{R}\). For larger \(n\), the zero-trace condition allows nonzero matrices: off-diagonal entries are unrestricted, and diagonal entries need only balance to a sum of zero.

Worked Example: Trace on 2-by-2 Matrices

Consider \(\operatorname{tr}:\mathbb{R}^{2\times2}\to\mathbb{R}\) and the matrix \(\mathbf{A}=\begin{bmatrix}3&-2\\5&4\end{bmatrix}\). Its trace is the sum of its two diagonal entries:

$$ \operatorname{tr}\mathbf{A}=3+4=7. $$

To describe the whole kernel, write a general input as \(\begin{bmatrix}a&b\\c&d\end{bmatrix}\). Its trace is \(a+d\), so it is in the kernel exactly when \(a+d=0\), or \(d=-a\). Therefore

$$ \ker(\operatorname{tr})= \left\{ \begin{bmatrix}a&b\\c&-a\end{bmatrix} :a,b,c\in\mathbb{R} \right\}. $$

For example, \(\begin{bmatrix}2&-1\\4&-2\end{bmatrix}\) belongs to this kernel because its trace is \(2+(-2)=0\). To produce any desired output \(r\in\mathbb{R}\), use \(\begin{bmatrix}r&0\\0&0\end{bmatrix}\); its trace is \(r+0=r\). This verifies directly that the image is \(\mathbb{R}\).

Check: the original input gives \(3+4=7\), as stated. The proposed kernel matrix gives \(2+(-2)=0\), and the proposed preimage of \(r\) gives trace \(r\).

Worked Example: Trace on 3-by-3 Matrices

Let \(\mathbf{C}=\begin{bmatrix}2&1&-1\\0&-3&4\\5&2&6\end{bmatrix}\). Its trace is \(2+(-3)+6=5\), so \(\mathbf{C}\) is not in the kernel. A general 3-by-3 matrix is in the kernel when its three diagonal entries sum to zero. Writing the first two diagonal entries as \(a\) and \(e\), the third must be \(-a-e\). Thus the kernel consists exactly of the matrices

$$ \begin{bmatrix} a&b&c\\ d&e&f\\ g&h&-a-e \end{bmatrix}, \qquad a,b,c,d,e,f,g,h\in\mathbb{R}. $$

For a concrete check, choose \(a=1\), \(e=2\), and all six other free entries equal to zero. This gives \(\begin{bmatrix}1&0&0\\0&2&0\\0&0&-3\end{bmatrix}\), whose trace is \(1+2-3=0\). For the image, any \(r\in\mathbb{R}\) is obtained from \(\begin{bmatrix}r&0&0\\0&0&0\\0&0&0\end{bmatrix}\), whose trace is \(r+0+0=r\). This calculation illustrates why the kernel is not just the zero matrix, even though the output is only one real number.

Transpose: Linearity, Kernel, and Image

Transpose does not add entries. Instead, the entry in row \(i\), column \(j\) moves to row \(j\), column \(i\). The positions change, but no information is lost: transposing a second time returns every entry to its original position.

Theorem: For positive integers \(m,n\), the map \(T:\mathbb{R}^{m\times n}\to\mathbb{R}^{n\times m}\) defined by \(T(\mathbf{A})=\mathbf{A}^{\top}\) is linear. Its kernel is \(\{\mathbf{O}\}\), and its image is all of \(\mathbb{R}^{n\times m}\).

Proof. Let \(\mathbf{A},\mathbf{B}\in\mathbb{R}^{m\times n}\), let \(c\in\mathbb{R}\), and consider entry \((i,j)\) in the output. By the definition of transpose, \((\mathbf{A}+\mathbf{B})^{\top}_{ij}=a_{ji}+b_{ji}=(\mathbf{A}^{\top})_{ij}+(\mathbf{B}^{\top})_{ij}\), and \((c\mathbf{A})^{\top}_{ij}=ca_{ji}=c(\mathbf{A}^{\top})_{ij}\). Since these equalities hold for every valid \(i,j\), they give \((\mathbf{A}+\mathbf{B})^{\top}=\mathbf{A}^{\top}+\mathbf{B}^{\top}\) and \((c\mathbf{A})^{\top}=c\mathbf{A}^{\top}\). Thus \(T\) is linear. Next, \(\mathbf{A}\in\ker T\) exactly when \(\mathbf{A}^{\top}=\mathbf{O}\). This equality says \(a_{ji}=0\) for every entry position \((i,j)\) of the transpose, which covers every entry of \(\mathbf{A}\); hence \(\mathbf{A}=\mathbf{O}\). Conversely, \(\mathbf{O}^{\top}=\mathbf{O}\), so the kernel is exactly \(\{\mathbf{O}\}\). Finally, take any \(\mathbf{D}\in\mathbb{R}^{n\times m}\). The matrix \(\mathbf{D}^{\top}\) belongs to \(\mathbb{R}^{m\times n}\), and \(T(\mathbf{D}^{\top})=(\mathbf{D}^{\top})^{\top}=\mathbf{D}\), because each entry returns to its original position. Thus every matrix in the codomain is an output, and the image is all of \(\mathbb{R}^{n\times m}\). \(\square\)

Worked Example: Transpose from 2-by-3 to 3-by-2 Matrices

Let \(\mathbf{B}=\begin{bmatrix}1&-2&0\\3&4&5\end{bmatrix}\in\mathbb{R}^{2\times3}\). Its transpose has three rows and two columns: the first row of \(\mathbf{B}\) becomes the first column, and the second row becomes the second column.

$$ \mathbf{B}^{\top} = \begin{bmatrix} 1&3\\ -2&4\\ 0&5 \end{bmatrix} \in\mathbb{R}^{3\times2}. $$

The kernel of this transpose map consists only of the 2-by-3 zero matrix. Indeed, if a 2-by-3 input transposes to the 3-by-2 zero matrix, each of its six entries must be zero. Its image is every 3-by-2 matrix. For instance, for the target \(\mathbf{D}=\begin{bmatrix}1&-2\\0&3\\4&5\end{bmatrix}\), choose the input \(\mathbf{D}^{\top}=\begin{bmatrix}1&0&4\\-2&3&5\end{bmatrix}\). Then

$$ \begin{bmatrix}1&0&4\\-2&3&5\end{bmatrix}^{\top} = \begin{bmatrix}1&-2\\0&3\\4&5\end{bmatrix} =\mathbf{D}. $$

Check: transposing this output returns the chosen input, \(\mathbf{D}^{\top}=\begin{bmatrix}1&0&4\\-2&3&5\end{bmatrix}\). The dimensions also match: the input is 2-by-3 and the output is 3-by-2.

Reading the Two Maps Carefully

Trace and transpose have different codomains and different kinds of outputs. Trace maps a square matrix to a single real number. Transpose maps a matrix to another matrix, with its number of rows and columns exchanged. Their kernel and image descriptions follow from these differences:

MapKernelImage
\(\operatorname{tr}:\mathbb{R}^{n\times n}\to\mathbb{R}\), \(n\ge1\)Matrices with diagonal sum zeroAll real numbers
\(T:\mathbb{R}^{m\times n}\to\mathbb{R}^{n\times m}\), \(T(\mathbf{A})=\mathbf{A}^{\top}\)Only the zero matrixAll \(n\)-by-\(m\) matrices

The image statements can also be read as concrete instructions for finding an input. To obtain a prescribed real number \(r\) as a trace, put \(r\) in one diagonal position and zeros elsewhere. To obtain a prescribed matrix \(\mathbf{D}\) as a transpose, use \(\mathbf{D}^{\top}\) as the input. These constructions establish that the stated outputs actually occur; they are not just guesses based on the formulas.

Common Pitfalls

Do not add every entry when computing trace. For example, a common incorrect calculation is \(\operatorname{tr}\begin{bmatrix}1&2\\3&4\end{bmatrix}=1+2+3+4=10\). The entries \(2\) and \(3\) are off the diagonal and do not contribute. The correct calculation is \(\operatorname{tr}\begin{bmatrix}1&2\\3&4\end{bmatrix}=1+4=5\).

Do not keep the same matrix dimensions after transposing. A 2-by-3 matrix becomes a 3-by-2 matrix, as in the worked example. Writing its transpose as another 2-by-3 matrix is a dimension error, even if some entries have been rearranged. For a square matrix, the dimensions happen to remain the same, but the entries still exchange positions across the diagonal.

Finally, a map's formula does not by itself specify its domain and codomain. Trace requires square matrices in this setting and outputs real numbers; transpose accepts rectangular as well as square matrices and outputs a matrix of the reversed size. Naming those spaces first makes the kernel and image questions precise.

Check Your Understanding

For each question, use the definitions and check matrix dimensions before computing.

  1. Compute the trace of \(\begin{bmatrix}4&-1\\2&-3\end{bmatrix}\). Is this matrix in the kernel of the trace map?
  2. Describe all matrices in the kernel of the trace map \(\mathbb{R}^{2\times2}\to\mathbb{R}\).
  3. Give a 3-by-3 matrix whose trace is \(-5\), and verify its trace.
  4. If \(\mathbf{A}\in\mathbb{R}^{3\times2}\), what are the dimensions of \(\mathbf{A}^{\top}\)? What is the kernel of the transpose map on this domain?
  5. For \(\mathbf{D}=\begin{bmatrix}2&0\\-1&3\\4&5\end{bmatrix}\), find an input whose transpose is \(\mathbf{D}\), and multiply out the transpose to check.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon