Tutorials › Linear Algebra › Entry Maps Between Matrix Spaces and R^n

Isomorphisms · Tutorial 459 of 1000

Entry Maps Between Matrix Spaces and R^n

Learn to encode every entry of a real matrix as an ordered coordinate vector and verify that this encoding is a linear isomorphism.

Intermediate 9 min read

What You'll Learn

  • Define a row-by-row entry map from real matrix space to \(\mathbb{R}^{mn}\)
  • Write the inverse map explicitly using the coordinate index \((i-1)n+j\)
  • Prove that the entry map is linear and bijective
  • Track matrix units under the entry map
  • Identify and correct inconsistent row-major and column-major ordering

Turning a Matrix into an Ordered Coordinate Vector

A real \(m\times n\) matrix has \(mn\) entries, but a list of entries becomes a vector only after an order has been specified. This matters whenever we want to compare a matrix space with an ordinary coordinate space: each matrix must correspond to exactly one vector, and each vector must recover exactly one matrix. We will use row-by-row order throughout. Once the order is fixed, the correspondence is explicit, and we can prove that it preserves addition and scalar multiplication and has an inverse.

Let \(m,n\in\mathbb{N}\), so both are positive integers. The space \(\mathbb{R}^{m\times n}\) consists of all real \(m\times n\) matrices. Write a matrix in this space as \(\mathbf{A}=[a_{ij}]\), where \(a_{ij}\) is the entry in row \(i\), column \(j\). The target \(\mathbb{R}^{mn}\) consists of column vectors with \(mn\) real coordinates. The order we choose lists all entries in row 1 from left to right, then all entries in row 2, and so on.

Definition: The row-by-row entry map \(\Phi:\mathbb{R}^{m\times n}\to\mathbb{R}^{mn}\) is defined by $$\Phi(\mathbf{A})=(a_{11},a_{12},\ldots,a_{1n},a_{21},\ldots,a_{2n},\ldots,a_{m1},\ldots,a_{mn})^{\top}.$$ Equivalently, the entry \(a_{ij}\) occupies coordinate \((i-1)n+j\) of \(\Phi(\mathbf{A})\).

The index formula makes the ordering precise. For fixed row \(i\), the entries \(a_{i1},\ldots,a_{in}\) occupy coordinates \((i-1)n+1,\ldots,in\). Thus each row fills one consecutive block of \(n\) coordinates, and the blocks occur in increasing row order. For example, the last entry of row \(i\) is in coordinate \(in\), while the first entry of row \(i+1\) is in coordinate \(in+1\).

The Inverse: Rebuilding the Matrix

To recover a matrix from a vector, assign coordinate \((i-1)n+j\) to entry in row \(i\), column \(j\). This gives a map in the reverse direction. The formula does not require solving equations or making choices: every matrix position has a prescribed coordinate, and every coordinate is used once.

Definition: Define \(\Psi:\mathbb{R}^{mn}\to\mathbb{R}^{m\times n}\) by requiring that, for \(\mathbf{x}=(x_1,\ldots,x_{mn})^{\top}\), $$\bigl(\Psi(\mathbf{x})\bigr)_{ij}=x_{(i-1)n+j}\qquad (1\le i\le m,\ 1\le j\le n).$$ Thus \(\Psi\) places the first \(n\) coordinates in row 1, the next \(n\) in row 2, and continues in that order.

Worked Example: Encoding a \(2\times3\) Matrix

Apply the row-by-row entry map to \(\mathbf{A}=\begin{bmatrix}2&-1&4\\0&3&5\end{bmatrix}\), where \(m=2\) and \(n=3\).

List row 1 first, then row 2. The six entries in order are \(2,-1,4,0,3,5\), so \(\Phi(\mathbf{A})=(2,-1,4,0,3,5)^{\top}\).

Check: Apply \(\Psi\) using \(x_{(i-1)3+j}\). Row 1 uses \(x_1,x_2,x_3\), and row 2 uses \(x_4,x_5,x_6\):

$$ \Psi\!\left(\begin{bmatrix}2\\-1\\4\\0\\3\\5\end{bmatrix}\right) = \begin{bmatrix} x_1&x_2&x_3\\ x_4&x_5&x_6 \end{bmatrix} = \begin{bmatrix}2&-1&4\\0&3&5\end{bmatrix} =\mathbf{A}. $$

The reconstruction returns the original matrix, entry for entry.

Worked Example: Reconstructing a Matrix from Coordinates

Let \(m=2\), \(n=3\), and \(\mathbf{x}=(1,0,-2,3,4,1)^{\top}\). Find \(\Psi(\mathbf{x})\), then check by applying \(\Phi\).

Here \(n=3\). The first three coordinates fill row 1 and the next three fill row 2, giving \(\Psi(\mathbf{x})=\begin{bmatrix}1&0&-2\\3&4&1\end{bmatrix}\).

Check: Listing this matrix row by row gives \(1,0,-2,3,4,1\). Therefore \(\Phi(\Psi(\mathbf{x}))=(1,0,-2,3,4,1)^{\top}=\mathbf{x}\).

Why the Entry Map Is an Isomorphism

A map between real vector spaces is linear if it preserves addition and scalar multiplication. It is an isomorphism if it is both linear and bijective. We now verify these properties for \(\Phi\). The proof uses the entry-by-entry definitions of matrix addition and scalar multiplication: the \((i,j)\) entry of \(\mathbf{A}+\mathbf{B}\) is \(a_{ij}+b_{ij}\), and that of \(c\mathbf{A}\) is \(ca_{ij}\).

Theorem: For positive integers \(m,n\), the row-by-row entry map \(\Phi:\mathbb{R}^{m\times n}\to\mathbb{R}^{mn}\) is a linear isomorphism. Its inverse is the reconstruction map \(\Psi\) defined by \(\bigl(\Psi(\mathbf{x})\bigr)_{ij}=x_{(i-1)n+j}\).

Proof. First let \(\mathbf{A}=[a_{ij}]\), \(\mathbf{B}=[b_{ij}]\), and \(c\in\mathbb{R}\). At coordinate \((i-1)n+j\), the vector \(\Phi(\mathbf{A}+\mathbf{B})\) has entry \(a_{ij}+b_{ij}\). The same coordinate of \(\Phi(\mathbf{A})+\Phi(\mathbf{B})\) is also \(a_{ij}+b_{ij}\). This holds for every \(i,j\), so \(\Phi(\mathbf{A}+\mathbf{B})=\Phi(\mathbf{A})+\Phi(\mathbf{B})\). At that coordinate, \(\Phi(c\mathbf{A})\) has entry \(ca_{ij}\), which is also the entry of \(c\Phi(\mathbf{A})\). Thus \(\Phi(c\mathbf{A})=c\Phi(\mathbf{A})\), and \(\Phi\) is linear.

Next, for any \(\mathbf{A}=[a_{ij}]\), the \((i,j)\) entry of \(\Psi(\Phi(\mathbf{A}))\) is coordinate \((i-1)n+j\) of \(\Phi(\mathbf{A})\), which is \(a_{ij}\). Hence \(\Psi(\Phi(\mathbf{A}))=\mathbf{A}\). Conversely, for any \(\mathbf{x}=(x_1,\ldots,x_{mn})^{\top}\), coordinate \((i-1)n+j\) of \(\Phi(\Psi(\mathbf{x}))\) is the \((i,j)\) entry of \(\Psi(\mathbf{x})\), namely \(x_{(i-1)n+j}\). Every coordinate index from \(1\) to \(mn\) occurs in this form exactly once: the \(i\)th row contributes the block from \((i-1)n+1\) to \(in\). Therefore \(\Phi(\Psi(\mathbf{x}))=\mathbf{x}\). The two identities show that \(\Psi\) is a two-sided inverse of \(\Phi\), so \(\Phi\) is bijective. Since it is also linear, it is an isomorphism. \(\square\)

The two inverse identities are worth distinguishing. The identity \(\Psi\circ\Phi=\operatorname{id}_{\mathbb{R}^{m\times n}}\) says that encoding and then rebuilding preserves every matrix. The identity \(\Phi\circ\Psi=\operatorname{id}_{\mathbb{R}^{mn}}\) says that every coordinate vector is reached by the encoding. Together they establish both directions of the correspondence, not merely that matrices can be encoded without collisions.

Matrix Units and the Coordinate Directions

The entry map also makes the standard coordinate directions visible inside matrix space. For \(1\le i\le m\) and \(1\le j\le n\), let \(\mathbf{E}_{ij}\) be the \(m\times n\) matrix whose \((i,j)\) entry is \(1\) and whose other entries are \(0\). These matrices are called matrix units. Under row-by-row encoding, \(\mathbf{E}_{ij}\) becomes the standard coordinate vector with a \(1\) in position \((i-1)n+j\) and zero in every other position.

Proposition: Each matrix \(\mathbf{A}=[a_{ij}]\in\mathbb{R}^{m\times n}\) has the unique expression \(\mathbf{A}=\sum_{i=1}^{m}\sum_{j=1}^{n}a_{ij}\mathbf{E}_{ij}\). Moreover, \(\Phi(\mathbf{E}_{ij})\) has its only nonzero coordinate, equal to \(1\), in position \((i-1)n+j\).

Proof. In the sum \(\sum_{i=1}^{m}\sum_{j=1}^{n}a_{ij}\mathbf{E}_{ij}\), the matrix \(\mathbf{E}_{ij}\) contributes \(a_{ij}\) to position \((i,j)\) and contributes zero to every other position. Thus the sum has entry \(a_{ij}\) at every position \((i,j)\), so it equals \(\mathbf{A}\). If another expression with coefficients \(c_{ij}\) equals \(\mathbf{A}\), comparison of the \((i,j)\) entries gives \(c_{ij}=a_{ij}\) for every pair, proving uniqueness. Applying \(\Phi\) to \(\mathbf{E}_{ij}\) lists its entries row by row, so exactly coordinate \((i-1)n+j\) is \(1\) and all others are \(0\). \(\square\)

Worked Example: Locating Matrix Units in \(\mathbb{R}^{2\times3}\)

For \(m=2,n=3\), consider \(\mathbf{A}=\begin{bmatrix}2&0&-1\\0&3&4\end{bmatrix}\). Express it using matrix units and encode it.

Each nonzero entry supplies its coefficient and position: \(\mathbf{A}=2\mathbf{E}_{11}-\mathbf{E}_{13}+3\mathbf{E}_{22}+4\mathbf{E}_{23}\). The corresponding coordinate positions are \(1\) for \(\mathbf{E}_{11}\), \(3\) for \(\mathbf{E}_{13}\), \(5\) for \(\mathbf{E}_{22}\), and \(6\) for \(\mathbf{E}_{23}\), because the position formula is \((i-1)3+j\). Consequently \(\Phi(\mathbf{A})=(2,0,-1,0,3,4)^{\top}\).

Check: Applying \(\Psi\) puts coordinates \(1,2,3\) in the first row and \(4,5,6\) in the second row, yielding \(\begin{bmatrix}2&0&-1\\0&3&4\end{bmatrix}\), the original matrix. This also confirms that the coefficients of the matrix units appear in the same positions as the corresponding coordinate directions.

Ordering Is a Convention, Not a Property of the Matrix

There is another possible way to list entries: column by column. That order can also define an isomorphism if its inverse uses the same convention. The essential requirement is consistency. A vector of entries alone does not record whether it came from row-by-row or column-by-column order, so the rule must be stated whenever the encoding is used.

Common mistake: mixing the two orders. For \(\mathbf{A}=\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}\), row-by-row order gives \((1,2,3,4,5,6)^{\top}\). A student may instead list \((1,4,2,5,3,6)^{\top}\), which is column-by-column order, and then try to reconstruct by putting the first three coordinates into row 1. That inconsistent reconstruction gives \(\begin{bmatrix}1&4&2\\5&3&6\end{bmatrix}\), not \(\mathbf{A}\). The correction is to use the stated row-by-row map, or to define and use a column-by-column inverse consistently. The column-by-column list is not inherently invalid; it simply is not the row-by-row entry map defined here.

This explicit isomorphism lets us transfer questions about matrices into familiar coordinate language. For example, adding two matrices corresponds under \(\Phi\) to adding their entry vectors, and multiplying a matrix by a real scalar corresponds to scaling its entry vector. The same coordinate bookkeeping also identifies the matrix units with particular coordinate directions. These facts are useful when translating between matrix calculations and vector-space arguments; the map itself gives the precise translation rather than relying on an informal count of entries.

Check Your Understanding

Use row-by-row order in every part, and state the dimensions of the domain and target where relevant.

  1. Encode \(\begin{bmatrix}3&-2\\1&0\\4&5\end{bmatrix}\) as a vector in \(\mathbb{R}^{6}\), then reconstruct the matrix with \(\Psi\).
  2. For \(m=3,n=2\), which coordinate of \(\Phi(\mathbf{A})\) contains \(a_{32}\)?
  3. Reconstruct a \(2\times2\) matrix from \((2,-1,0,4)^{\top}\), and verify by applying \(\Phi\).
  4. For \(m=2,n=3\), identify the coordinate position corresponding to \(\mathbf{E}_{23}\).
  5. Explain why \(\Psi(\Phi(\mathbf{A}))=\mathbf{A}\) alone does not state that every vector in \(\mathbb{R}^{mn}\) is reached by \(\Phi\).

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