1. Introduction
In some methods, the inversion of an integer matrix is an avoidable operation. For example, Babai’s Round-off Method (RoM) is an approximation method that was proposed by Babai [
1]. This method helps approximate the Closest-Vector Problem (CVP) [
2], which is one of the most established lattice-based computational problems. For instance, Babai’s RoM is used in the decryption algorithm of the lattice-based Goldreich–Goldwasser–Halevi encryption scheme (GGH crypto-system) [
3] and its upgraded version [
4]. The inversion of a large integer matrix in the decryption algorithms of these schemes becomes a significant issue that might trigger decryption errors.
For 
, consider 
 as a full-rank lattice. Suppose that 
, where 
 is a basis for the lattice 
. To approximate the CVP in the lattice 
, the input of Babai’s RoM is the lattice basis 
B. For that purpose, this basis is represented in matrix form as 
, where 
 become the columns of the matrix 
B. One of the crucial steps in this method involves the inversion of the lattice basis 
B. For the purpose of computational efficiency, the basis 
B is generated as an integer matrix 
 [
3].
Nevertheless, the inverse 
 is not necessarily an integer matrix. The non-integer entries of the matrix 
 could be long floating-point numbers. For small dimensions, 
n, the inversion of the basis 
B is efficiently performed, and storing all entries, including the non-integer entries in the matrix 
, requires a low storage capacity. However, these tasks could become cumbersome once the dimension 
n becomes larger, such as 
. The matrix 
 may consist of countless numbers of non-integer entries in the form of long floating-point numbers. Storing, transmitting, or operating such a matrix would require expensive computational costs [
5]. In other methods where the inversion of a large integer matrix is necessary, the same issues could also arise, and this drawback may limit the true potential of the method, either in terms of its performance or precision. The only square integer matrix that is guaranteed to have an integer inverse is a unimodular matrix 
, where 
 [
6]. With this property, it can be guaranteed that 
 such that 
, where 
 is an identity matrix.
Hanson introduced a new class of unimodular matrices—dubbed nice matrices—in 1982. These matrices are also invertible, with an inverse comprising entirely integer elements [
7]. The nice matrices are triangular in shape, with their diagonal elements having a product equal to 
. As a result, they have a determinant equal to 
. Nice matrices are also considered unimodular matrices due to their features. Hanson later presented another class of unimodular matrices in 1985, dubbed very nice matrices. Assume that the matrix 
 is a nice matrix. If 
A’s inverse equals itself, it is classified as a very nice matrix [
8]. Nonetheless, the very nice matrix is likewise a unimodular matrix with determinant 
. The primary difference between Hansen’s classes and the set of all unimodular matrices is that Hansen’s classes need a square and triangular shape, but the set of all unimodular matrices does not. Although inversion of an integer matrix is critical, there are just a few excellent publications in the literature that are not Hanson’s. Most of the discussion on the inversion of an integer matrix directly relates to unimodular matrices [
9,
10,
11,
12].
This paper proposes a new integer matrix that is referred to as an almost-unimodular matrix and is denoted as . Compared to the unimodular matrix, the determinant of the almost-unimodular matrix is not equal to  (i.e., ). The inverse of the almost-unimodular matrix is proven to consist of only a single non-integer entry, regardless of how large the dimension n is. With this property, the almost-unimodular matrix  might be useful in any method or technique where the inversion operation of a large integer matrix is necessary, especially when the determinant of the matrix is required not to equal .
  2. Mathematical Foundation
This section provides some mathematical foundations related to the inversion of the integer matrix. In further discussions, let . Now, consider the following definitions regarding the matrix inversion operation.
Definition 1. [13] For , let  with entries  and  denoting the sub-matrix of G that is obtained by deleting the i-th row and j-th column of G. The determinant of G, denoted as , is .  Using the determinant of the sub-matrices , the -minor of G, denoted as , can be obtained. Then, the -cofactor of G, denoted as , and the -adjoint of G, denoted as , can be determined for all .
Definition 2. [13] Let ; then,  denotes the minor matrix of G with entries ,  denotes the cofactor matrix of G with entries , and  denotes the adjoint matrix of G with entries , where . Since , then  for all .  Consider the following definition regarding a diagonal matrix.
Definition 3. Let  and .  with  is a diagonal matrix with entries  and  for all  and  with  is a diagonal matrix with entry  for all  and . Moreover,  is a diagonal matrix with entry  in a random position and  is a diagonal matrix with entry  in a random position for all . For the matrix , at least one of the entries (α or β) appears in its diagonal. In contrast, for the matrix , at least one of the entries (, or γ) appears in its diagonal.
 For any matrix 
, the inverse of this matrix, 
, is not necessarily an integer matrix. It may contain various non-integer entries. However, there are integer matrices with the property that the inverses of these matrices are guaranteed integer matrices. Such matrices are referred to as unimodular matrices, 
, where 
. According to Uhlmann and Wang [
14], it is precious in the case of 
 matrices to be able to demonstrate that the result of a given matrix function or transformation has a particular property, such as being unitary or unimodular. These special types of matrices can be used for analysis or to obtain solutions more efficiently compared to general matrices. The importance of unimodular matrices is also discussed in [
15,
16], where they constitute vital components of lattices in lattice-based cryptography. This is due to their practicality in computations; thus, they have given rise to many studies related to unimodular matrices. The following section explains a method for constructing integer matrices that have some of these desirable properties.
  3. Construction of the Almost-Unimodular Matrix
This section discusses the construction of the proposed matrix , which we call an almost-unimodular matrix . To ensure that the almost-unimodular matrix is a non-singular and non-unimodular matrix, it is designed in such a way that . The almost-unimodular matrix  is formed through a multiplication of two triangular matrices . In the following discussion, let  denote an -identity matrix,  denote a strictly upper-triangular matrix with upper-triangular entries ,  denote a strictly lower-triangular matrix with lower-triangular entries , and  for all  and . Before we present the construction of the matrix , consider the following theorem.
Theorem 1. For  with , let , where , , and . Then, the minor matrix of  is  and the minor matrix of  is , where .
 Proof.  Consider the matrix 
. For all 
, we have
        
        where 
. Since 
 is an upper-triangular matrix with 1s as diagonal entries, then 
. Hence,
        
Then, for all 
 where 
, we have
        
        where 
, with at least one diagonal entry that is 0. Since 
 is an upper-triangular matrix with a diagonal entry containing 0, then 
. Hence,
        
Finally, for all 
 where 
, we have
        
        where 
 for all 
. This implies that 
, where 
 for all 
 and 
. Therefore,
        
        where 
 contains 
 as lower-triangular entries for all 
 where 
. For the minor matrix of 
, the proof can be carried out by using a similar approach. □
 For the construction of the upper-triangular matrix , consider the following.
Definition 4. For  with , let . Then,  is defined as , where .
 Lemma 1. Let  with . The minor matrix of  is , where  and .
 Proof.  For 
, we have
        
        where 
. Since 
 is an upper-triangular matrix with diagonal entries 1, then 
. Hence,
        
Then, for all 
 and 
, we have
        
        where 
. Since 
 is an upper-triangular matrix with diagonal entries containing 1s and a 
, then 
. Hence,
        
Next, for all 
 where 
, we have
        
        where 
 with at least one diagonal entry of 0. Since 
 is an upper-triangular matrix with diagonal entries containing 0, then
        
Finally, for all 
 where 
, we have
        
        where 
 for all 
. This implies that
        
Therefore,
        
        where 
 contains lower-triangular entries 
 for all 
 where 
. □
 Remark 1. Since the matrix  is an upper-triangular matrix with a δ and 1s as its diagonal entries, then . By setting , then . This implies that the matrix  is a non-singular and non-unimodular matrix.
 Consider the following example:
Example 1. For , let , where , , and . Thus, Therefore, .
 For the construction of the lower-triangular matrix , consider the following.
Definition 5. Let  with . Then,  is defined as a unimodular matrix , where .
 Lemma 2. Let  with . The minor matrix of  is , where .
 Proof.  Note that , where . Based on Theorem 1, we have . □
 Consider the following example.
Example 2. For , let , where  and . Thus, Therefore, .
 The almost-unimodular matrix  is constructed as follows.
Definition 6. Let  with . Then,  is defined as an almost-unimodular matrix .
 Lemma 3. For  with , let  be an almost-unimodular matrix. Then, .
 Proof.  Note that both 
 are triangular matrices where 
 and 
. Therefore,
        
 □
 Since , where , then the almost-unimodular matrix  is a non-singular and non-unimodular matrix.
Lemma 4. For  with , let  be an almost-unimodular matrix. Then, , where  and .
 Proof.  Note that, 
 and 
. Thus,
        
Since 
, then
        
Note that
        
        where 
 for all 
. Thus,
        
Hence, the matrix 
 has the following entries:
        
Since 
, then 
 for all 
. Thus,
        
 □
 Theorem 2. For  with , let  be an almost-unimodular matrix. Then, the cofactor matrix of  is , where  with .
 Proof.  Lemmas 1 and 2 stated that 
 and 
, respectively. Since minors are multiplicative,
        
Note that
        
        where 
 for 
 or 
. Since 
, then 
 for all 
 and 
. Thus, 
, where 
 with entries 
. Furthermore,
        
        where 
 for all 
. Thus,
        
Hence, the matrix 
 has the following entries:
        
        where 
 for all 
. Therefore,
        
Therefore, , where . □
 Note that the cofactor matrix  consists of integer entries with a common factor , except for the entry .
  4. Inversion of the Almost-Unimodular Matrix
This section provides the proof that the inverse of the almost-unimodular matrix , denoted as , contains only a single non-integer entry. Consider the following theorem:
Theorem 3. For  with , let  be an almost-unimodular matrix. Then, the inverse matrix  is , where .
 Proof.  From Theorem 2, we have 
, and from Lemma 3, we have 
. Therefore,
        
        where 
. □
 Example 3. For  and , let Then, the almost-unimodular matrix  is as follows: The inverse of the almost-unimodular matrix  is On the other hand, let an ordinary non-singular matrix  be the following: The inverse of the matrix G with entries rounded to four significant figures places is Without being rounded, the matrix  has longer entries. For instance, let  denote the entries of  for . Then, a few entries of the matrix  that are rounded to 30 significant figures are given as follows:  Observe that all entries in the matrix  are long floating-point numbers. On the other hand, the inverse of  has only a single non-integer entry, which is . Clearly, there is a significant difference between the inverse of the integer matrix G and the inverse of the almost-unimodular matrix .