# Rouché–Capelli theorem

In linear algebra, the Rouché–Capelli theorem determines the number of solutions for a system of linear equations, given the rank of its augmented matrix and coefficient matrix. The theorem is variously known as the:

## Formal statement

A system of linear equations with n variables and coefficients in a field K has a solution if and only if its coefficient matrix A and its augmented matrix [A|b] have the same rank.[1] If there are solutions, they form an affine subspace of ${\displaystyle K^{n}}$  of dimension n − rank(A). In particular:

• if n = rank(A), the solution is unique,
• if n > rank(A) and K is an infinite field, the system of linear equations admits infinitively many solutions,
• if K is a finite field, the number of solutions is finite, namely ${\displaystyle |K|^{n-\mathrm {rank} (A)}}$ .

## Example

Consider the system of equations

x + y + 2z = 3,
x + y + z = 1,
2x + 2y + 2z = 2.

The coefficient matrix is

${\displaystyle A={\begin{bmatrix}1&1&2\\1&1&1\\2&2&2\\\end{bmatrix}},}$

and the augmented matrix is

${\displaystyle (A|B)=\left[{\begin{array}{ccc|c}1&1&2&3\\1&1&1&1\\2&2&2&2\end{array}}\right].}$

Since both of these have the same rank, namely 2, there exists at least one solution; and since their rank is less than the number of unknowns, the latter being 3, there are infinitely many solutions.

In contrast, consider the system

x + y + 2z = 3,
x + y + z = 1,
2x + 2y + 2z = 5.

The coefficient matrix is

${\displaystyle A={\begin{bmatrix}1&1&2\\1&1&1\\2&2&2\\\end{bmatrix}},}$

and the augmented matrix is

${\displaystyle (A|B)=\left[{\begin{array}{ccc|c}1&1&2&3\\1&1&1&1\\2&2&2&5\end{array}}\right].}$

In this example the coefficient matrix has rank 2, while the augmented matrix has rank 3; so this system of equations has no solution. Indeed, an increase in the number of linearly independent columns has made the system of equations inconsistent.

## Proof

There are several proofs of the theorem. One of them is the following one.

The use of Gaussian elimination for putting the augmented matrix in reduced row echelon form does not change the set of solutions and the ranks of the involved matrices. The theorem can be read almost directly on the reduced row echelon form as follows.

The rank of a matrice is number of nonzero rows in its reduced row echelon form. If the ranks of the coefficient matrix and the augmented matrix are different, then the last non zero row has the form ${\displaystyle [0\ldots 0\mid 1],}$  corresponding to the equation 0 = 1. Otherwise, the ith row of the reduced row echelon form allows expressing the ith pivot variable as the sum of a constant and a linear combination of the non-pivot variables, showing that the dimension of the set of solutions is the number of non-pivot variables.