Tutorials › Linear Algebra › How the Field Changes Rank and Invertibility

Linear Algebra Beyond the Reals · Tutorial 971 of 1000

How the Field Changes Rank and Invertibility

Learn why the same integer matrix can have different ranks and invertibility over the reals and modulo a prime.

Intermediate 12 min read

What You'll Learn

  • Interpret an integer matrix over the real numbers or a prime field.
  • Use row reduction to compare ranks across fields.
  • Relate invertibility over a prime field to divisibility of the determinant.
  • Track how a change of field can affect solutions of a linear system.
  • Avoid invalid pivots and divisions in modular arithmetic.

One Integer Matrix, Different Arithmetic

An integer matrix can be viewed over different fields by interpreting each entry in the chosen field. Over \(\mathbb{R}\), the entries retain their usual values. Over \(\mathbb{F}_p\), where \(p\) is prime, each integer is replaced by its residue class modulo \(p\). The matrix entries may look similar, but the arithmetic governing row reduction has changed: for example, \(2\) is nonzero in \(\mathbb{R}\), while its residue is zero in \(\mathbb{F}_2\). A pivot that exists over one field may disappear over another.

For a matrix over a field, its rank is the dimension of the span of its columns over that field. Row reduction computes this rank by counting pivot columns, with every row operation performed in the field being used. An integer matrix does not have a single field-independent rank: its rank is determined only after its scalar field has been specified.

Definition: Let \(\mathbf{A}\) be an integer matrix and let \(p\) be prime. The matrix \(\mathbf{A}\) over \(\mathbb{F}_p\) is obtained by replacing each integer entry \(a_{ij}\) by its residue class modulo \(p\). We write this matrix as \(\mathbf{A}\) over \(\mathbb{F}_p\), or describe its entries as reduced modulo \(p\). All additions, multiplications, and divisions in a row reduction over \(\mathbb{F}_p\) are performed modulo \(p\); division is allowed only by a nonzero field element.

For instance, modulo \(2\), the classes of \(0\) and \(2\) are both zero, while the class of \(3\) is \(1\). The field operations then use \(1+1=0\) and \(1\cdot1=1\). In particular, a nonzero integer need not give a nonzero element of \(\mathbb{F}_p\).

Invertibility and the Determinant in Each Field

For a square matrix over a field, invertibility can be tested by row reduction: the matrix is invertible exactly when there is a pivot in every column. The determinant gives the corresponding scalar test. The next theorem states both criteria for an arbitrary field \(\mathbb{F}\). Here, \(\det\mathbf{A}\ne0\) means nonzero in that field.

Theorem: Let \(\mathbf{A}\in\mathbb{F}^{n\times n}\), where \(\mathbb{F}\) is a field and \(n\ge1\). The following are equivalent: (1) \(\mathbf{A}\) is invertible over \(\mathbb{F}\); (2) \(\operatorname{rref}(\mathbf{A})=\mathbf{I}_n\); (3) \(\det\mathbf{A}\ne0\) in \(\mathbb{F}\).

Proof. Each elementary row operation is multiplication on the left by an invertible elementary matrix, so it preserves whether the matrix is invertible. If the RREF is \(\mathbf{I}_n\), the row operations give \(\mathbf{E}\mathbf{A}=\mathbf{I}_n\), where \(\mathbf{E}\) is a product of invertible elementary matrices. Thus \(\mathbf{A}\) has inverse \(\mathbf{E}\). If the RREF has fewer than \(n\) pivots, the homogeneous system \(\mathbf{A}\mathbf{x}=\mathbf{0}\) has a free variable and hence a nonzero solution. An invertible matrix cannot have such a solution: multiplying by its inverse would give \(\mathbf{x}=\mathbf{0}\). This proves the equivalence of (1) and (2).

For the determinant comparison, row swaps multiply the determinant by \(-1\), scaling a row by a nonzero \(c\) multiplies it by \(c\), and adding a multiple of one row to another leaves it unchanged. These rules follow from the alternating and multilinear properties of the determinant. Each operation therefore preserves whether the determinant is zero. The RREF of a square matrix with \(n\) pivots is \(\mathbf{I}_n\), whose determinant is \(1\); if there are fewer pivots, the RREF has a zero row, so its determinant is \(0\). Consequently, \(\det\mathbf{A}\ne0\) exactly when the RREF has \(n\) pivots. This proves the equivalence with (3). \(\square\)

Now apply this criterion to an integer matrix. Its determinant is an integer, and reducing that integer modulo \(p\) gives the determinant of the reduced matrix. To see why, use the determinant formula as a signed sum of products of entries: reducing the entries before forming the sum gives the same residue as reducing the integer sum and products afterward.

Theorem: Let \(\mathbf{A}\in\mathbb{Z}^{n\times n}\) and let \(p\) be prime. The matrix is invertible over \(\mathbb{R}\) exactly when \(\det\mathbf{A}\ne0\) as an integer. It is invertible over \(\mathbb{F}_p\) exactly when \(p\) does not divide \(\det\mathbf{A}\). If \(\det\mathbf{A}=0\), it is singular over both fields.

Proof. By the determinant formula, every term in \(\det\mathbf{A}\) is a signed product of integer entries. Reducing all entries modulo \(p\) reduces each such product modulo \(p\), and reducing the sum gives the same result as summing the reduced terms. Therefore the determinant of the reduced matrix is the residue class of the integer \(\det\mathbf{A}\). The first theorem says that a square matrix over either field is invertible exactly when its determinant is nonzero in that field. A nonzero integer is nonzero as a real number, while its residue in \(\mathbb{F}_p\) is nonzero exactly when it is not divisible by \(p\). The integer zero has zero residue for every prime \(p\). These facts give all three claims. \(\square\)

A Determinant Can Lose Its Nonzero Value

Worked Example: A Unique Real Solution Becomes Inconsistent Modulo 2

Consider the integer matrix \(\mathbf{A}=\begin{bmatrix}1&1\\1&3\end{bmatrix}\) and the right-hand side \(\mathbf{b}=\begin{bmatrix}1\\0\end{bmatrix}\). Compare the system \(\mathbf{A}\mathbf{x}=\mathbf{b}\) over \(\mathbb{R}\) and over \(\mathbb{F}_2\).

Over \(\mathbb{R}\), \(\det\mathbf{A}=1\cdot3-1\cdot1=2\ne0\), so the system has a unique solution. Row reduction of the augmented matrix gives

$$ \begin{bmatrix}1&1&1\\1&3&0\end{bmatrix} \sim \begin{bmatrix}1&1&1\\0&2&-1\end{bmatrix} \sim \begin{bmatrix}1&1&1\\0&1&-\tfrac12\end{bmatrix} \sim \begin{bmatrix}1&0&\tfrac32\\0&1&-\tfrac12\end{bmatrix}. $$

The row operations are \(R_2\to R_2-R_1\), \(R_2\to\tfrac12R_2\), and \(R_1\to R_1-R_2\). Thus \(x_1=\tfrac32\) and \(x_2=-\tfrac12\). Substitution checks the result: \(x_1+x_2=1\), and \(x_1+3x_2=\tfrac32-\tfrac32=0\).

Over \(\mathbb{F}_2\), the entry \(3\) becomes \(1\), so the coefficient matrix becomes \(\begin{bmatrix}1&1\\1&1\end{bmatrix}\). The augmented reduction is

$$ \begin{bmatrix}1&1&1\\1&1&0\end{bmatrix} \sim \begin{bmatrix}1&1&1\\0&0&1\end{bmatrix}. $$

Here \(R_2\to R_2-R_1\), and subtraction is the same as addition modulo \(2\). The last row represents \(0x_1+0x_2=1\), which is impossible in \(\mathbb{F}_2\). Thus the modular system has no solution. The determinant explains the lost invertibility: \(2\) is nonzero over \(\mathbb{R}\), but \(2\) is divisible by \(2\), so its residue is zero in \(\mathbb{F}_2\).

Comparing Ranks by Row Reduction

The determinant test applies only to square matrices and answers whether the rank is full. Row reduction also detects changes in rank for square or rectangular matrices. When reducing modulo \(p\), a nonzero integer entry or pivot may become zero, and operations that were available over \(\mathbb{R}\) may no longer be valid. The examples below show both the loss of a pivot and its effect on rank.

Worked Example: A Triangular Matrix over \(\mathbb{R}\), \(\mathbb{F}_2\), and \(\mathbb{F}_3\)

Let \(\mathbf{T}=\begin{bmatrix}1&1&0\\0&2&1\\0&0&3\end{bmatrix}\). Over \(\mathbb{R}\), it has three pivots and determinant \(1\cdot2\cdot3=6\), so its rank is \(3\) and it is invertible.

Modulo \(2\), its entries give \(\begin{bmatrix}1&1&0\\0&0&1\\0&0&1\end{bmatrix}\). Subtract the second row from the third:

$$ \begin{bmatrix}1&1&0\\0&0&1\\0&0&1\end{bmatrix} \sim \begin{bmatrix}1&1&0\\0&0&1\\0&0&0\end{bmatrix}. $$

There are two pivots, so the rank over \(\mathbb{F}_2\) is \(2\), and the matrix is not invertible there. Modulo \(3\), the matrix becomes \(\begin{bmatrix}1&1&0\\0&2&1\\0&0&0\end{bmatrix}\). Scale the second row by \(2\), the inverse of \(2\) modulo \(3\), then subtract the new second row from the first:

$$ \begin{bmatrix}1&1&0\\0&2&1\\0&0&0\end{bmatrix} \sim \begin{bmatrix}1&1&0\\0&1&2\\0&0&0\end{bmatrix} \sim \begin{bmatrix}1&0&1\\0&1&2\\0&0&0\end{bmatrix}. $$

The rank over \(\mathbb{F}_3\) is also \(2\). In each prime field, a diagonal entry that was a real pivot has become zero. The determinant \(6\) is divisible by both \(2\) and \(3\), in agreement with the failure of invertibility over both fields.

Worked Example: Rank Drops in a Singular Matrix

Consider the integer matrix \(\mathbf{C}=\begin{bmatrix}1&1&0\\1&3&0\\0&0&0\end{bmatrix}\). Over \(\mathbb{R}\), subtracting the first row from the second gives

$$ \begin{bmatrix}1&1&0\\1&3&0\\0&0&0\end{bmatrix} \sim \begin{bmatrix}1&1&0\\0&2&0\\0&0&0\end{bmatrix} \sim \begin{bmatrix}1&0&0\\0&1&0\\0&0&0\end{bmatrix}. $$

The last step scales the second row by \(\tfrac12\) and subtracts it from the first. Thus \(\operatorname{rank}\mathbf{C}=2\) over \(\mathbb{R}\). Modulo \(2\), the matrix is \(\begin{bmatrix}1&1&0\\1&1&0\\0&0&0\end{bmatrix}\), and

$$ \begin{bmatrix}1&1&0\\1&1&0\\0&0&0\end{bmatrix} \sim \begin{bmatrix}1&1&0\\0&0&0\\0&0&0\end{bmatrix}. $$

Its rank over \(\mathbb{F}_2\) is \(1\). Over the reals the second pivot used the entry \(2\); modulo \(2\) that entry is zero, so the pivot disappears. This matrix is singular over both fields, but its ranks are different.

Why the Solution Set Can Change

Rank and invertibility affect systems, but one should distinguish a matrix from a particular system using that matrix. A singular coefficient matrix does not, by itself, determine whether a system is consistent: the right-hand side matters. The first worked example had no solution modulo \(2\), but another right-hand side could yield solutions. For example, with the same reduced coefficient matrix \(\begin{bmatrix}1&1\\1&1\end{bmatrix}\) over \(\mathbb{F}_2\) and right-hand side \(\begin{bmatrix}1\\1\end{bmatrix}\), the equations agree and have solutions. The matrix has rank \(1\), so it is not invertible and cannot give a unique solution for every right-hand side.

For an invertible square matrix, every right-hand side has exactly one solution: multiplication by the inverse gives that solution, and any solution must equal it after multiplying by the inverse. If the determinant changes from nonzero to zero after reduction, that guarantee is lost. A given system may become inconsistent or may have multiple solutions; the augmented matrix must be checked to decide which.

Common Pitfall: Dividing by a Zero Residue

A frequent error is to see a nonzero integer pivot and assume it remains a valid pivot modulo every prime. For the matrix in the second worked example, a tempting but invalid step over \(\mathbb{F}_2\) is to divide the second row by \(2\), just as one could over \(\mathbb{R}\). The wrong calculation treats \(2\) as invertible and tries to turn the row \((0,2,1)\) into \((0,1,\tfrac12)\). In \(\mathbb{F}_2\), however, this row is \((0,0,1)\): the residue of \(2\) is zero, and zero has no multiplicative inverse.

The correction is to reduce every entry modulo \(p\) first, then perform row operations using only nonzero field elements as scaling factors. In \(\mathbb{F}_2\), the row \((0,0,1)\) already has its pivot in column \(3\); it cannot create a pivot in column \(2\). Likewise, a determinant that is a nonzero integer does not guarantee invertibility modulo \(p\): check whether the prime divides it.

Check Your Understanding

For each question, specify the field before interpreting pivots or determinants.

  1. For \(\begin{bmatrix}1&1\\1&5\end{bmatrix}\), find the determinant over \(\mathbb{R}\). For which primes is the matrix invertible over \(\mathbb{F}_p\)?
  2. Reduce \(\begin{bmatrix}1&2\\2&4\end{bmatrix}\) modulo \(2\) and state its rank over \(\mathbb{F}_2\).
  3. Explain why a nonzero determinant over \(\mathbb{R}\) does not always imply invertibility over \(\mathbb{F}_p\).
  4. For the first worked example, verify directly that the real solution satisfies both equations.
  5. Can a singular coefficient matrix yield a consistent system over \(\mathbb{F}_p\)? Give a reason for your answer.

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