## Modular computation of the determinant

Consider a square matrix of order with coefficients in . It is known that , the determinant of , can be computed in at most operations in by means of Gaussian elimination. Let us estimate the growth of the coefficients. For simplicity, assume
• is not singular,
• no row or column permutations are necessary,
After pivoting stages the current matrxi looks like

 (110)

The entries of the matrix for and change according to the formula

 (111)

We consider the following numbers.
• Let be an upper bound for the absolute value of the numerators and the denominators of all .
• In particular for we have .
From Relation (111) we obtain

 (112)

This shows an exponential upper bound. (However a polynomial bound in can be established but the proof is far from trivial and the formula still not very encouraging.)

In what follows, we present an approach whose goal is to control the growth of the intermediate computations when calculating the determinant of . Let be this determinant. Let us choose a prime number such that

 (113)

Let be the determinant of regarded as a matrix over and let us choose for representing the integers in the symmetric range

 (114)

Hence we have

 (115)

 (116)

Observe that is a polynomial in the coefficients of . For instance with we have

 (117)

which shows that (for ) is a polynomial in . Observe also the map

 (118)

is a ring homomorphism. In other words for every we have

 (119)

Hence for we have

 (120)

More generally we have

 (121)

that is

 (122)

which means that divides . This with Relation (116) leads to

 (123)

Hence the determinant of as a matrix over is equal to the determinant of regarded as a matrix over . Therefore the computation of the determinant of as a matrix over can be done modulo , which provides a control on the intermediate computations. Now we have to answer the following questions:
1. How to choose ?
2. What do we win?
For choosing we need an a-priori bound for the determinant of . This is given by the following Hadamard's inequality.

Theorem 7   Let be the maximal absolute value of an entry of . Then we have

 (124)

Example 4   Consider

 (125)

 (126)

Hence . The Hadamard's inequality gives

 (127)

The number is prime and satisfies . Gaussian elimination leads to

 (128)

So in .

Let us study what is the cost of this approach. Let us denote by the determinant bound of Hadamard's inequality. Assume that our machine words are -bit long. We make the following observations.
• The word length of is in the order of magnitude of

 (129)

• Prime numbers are frequent enough to find one with a word length in the same order of magnitude as .
• So each element of can be coded by an array with at most words.
• Hence, each operation (like addition, multiplication, inverse computation) in costs at most word operations.
• Gaussian elimination will require operations in .
Therefore we have proved the following theorem

Theorem 8   The determinant of a square matrix with order , coefficients in and as the maximal absolute value of a coefficient can be computed in word operations.

This is not in fact a big progress w.r.t. Gaussian elimination over . But this can be improved using a small primes modular computation as follows.

Algorithm 5

Proof. Recall that is a polynomial expression in the coefficients of . Hence by using the ring homomorphism between and for we have

 (130)

Using the ring isomorphism of Corollary 2

 (131)

we deduce

 (132)

where is the product of the moduli . Now observe that

 (133)

Hence actually we have .

Example 5   Consider again

 (134)

We choose the four primes so that . We get

 (135)

The solutions of the system for are in

 (136)

Finally again.

Based on this small primes modular computation approach one could prove the following theorem

Theorem 9   The determinant of a square matrix with order , coefficients in and as the maximal absolute value of a coefficient can be computed in word operations.

Proof. See Theorem 5.12 in [GG99]

Remark 10   With Algorithm 5 we achieve the following goals.
• All intermediate computations can be made modulo small prime numbers. In practice these small primes are machine integers allowing fast computations.
• The only possible large value is the determinant itself.
• The space and the time required for the whole computation can be estimated in advance.
Moreover the computations of the modular determinants (the 's) are pairwise independent and thus can be distributed.

Marc Moreno Maza
2008-01-07