A Lower Bound of the Number of Rewrite Rules Obtained by Homological Methods
Abstract
It is well-known that some equational theories such as groups or boolean algebras can be defined by fewer equational axioms than the original axioms. However, it is not easy to determine if a given set of axioms is the smallest or not. Malbos and Mimram investigated a general method to find a lower bound of the cardinality of the set of equational axioms (or rewrite rules) that is equivalent to a given equational theory (or term rewriting systems), using homological algebra. Their method is an analog of Squier’s homology theory on string rewriting systems. In this paper, we develop the homology theory for term rewriting systems more and provide a better lower bound under a stronger notion of equivalence than their equivalence. The author also implemented a program to compute the lower bounds.
1 Introduction
The purpose of this paper is to find a lower bound of the number of axioms that are equivalent to a given equational theory. For example, the theory of groups is given by the following axioms:
(1.1) |
It is well-known that and can be derived from only . Moreover, the theory of groups can be given by two axioms: the axiom
together with is equivalent to the group axioms [n81]. If we use the new symbol for division instead of multiplication, a single axiom,
is equivalent to the group axioms [hn52]. However, no single axiom written in symbols is equivalent to the group axioms. This is stated without proof by Tarski [t68] and published proofs are given by Neumann [n81] and Kunen [k92]. Malbos and Mimram developed a general method to calculate a lower bound of the number of axioms that are “Tietze-equivalent” to a given complete term rewriting system (TRS) [mm16, Proposition 23]. We state the definition of Tietze equivalence later (Definition 4), but roughly speaking, it is an equivalence between equational theories (or TRSs) , where signatures and are not necessarily equal to each other, while the usual equivalence between TRSs is defined for two TRSs , over the same signature (specifically, by ). For string rewriting systems (SRSs), a work was given earlier by Squier [s87], and Malbos and Mimram’s work is an extension of Squier’s work. Squier provided a rewriting view for “homology groups of monoids”, and proved the existence of an SRS that does not have any equivalent SRSs that are finite and complete.
In this paper, we will develop Malbos and Mimram’s theory more, and show an inequality which gives a better lower bound of the number of axioms with respect to the usual equivalence between TRSs over the same signature. For the theory of groups, our inequality gives that the number of axioms equivalent to the group axioms is greater than or equal to 2, so we have another proof of Tarski’s theorem above as a special case. Our lower bound is algorithmically computable if a complete TRS is given.
We will first give the statement of our main theorem and some examples in Section 2. Then, we will see Malbos-Mimram’s work briefly. The idea of their work is to provide an algebraic structure to TRSs and extract information of the TRSs, called homology groups, which are invariant under Tietze equivalence. The basics of such algebraic tools are given in Section 3. We will explain how resolutions of modules, a notion from abstract algebra, is related to rewriting systems, which is not written in usual textbooks. and we will see the idea of the construction of the homology groups of TRSs in Section 4. After that, in Section 5, we will prove our main theorem. In Section LABEL:section:prime, we show prime critical pairs are enough for our computation at the matrix operation level and also at the abstract algebra level. In Section LABEL:section:impossible, we study the number of rewrite rules in a different perspective: the minimum of over all equivalent TRSs is called the deficiency in group theory and we show that deciding whether the deficiency is less than a given integer or not is computationally impossible.
2 Main Theorem
In this section, we will see our main theorem and some examples. Throughout this paper, we assume that terms are over the set of variables and all signatures we consider are unsorted. For a signature , let denote the set of terms over the signature and the set of variables . {defi} Let be a TRS. The degree of , denoted by , is defined by
where is the number of occurrences of in for and we define for convenience. For example, . Let be a TRS and be the set of the critical pairs of . For any , let be the numbers in such that the critical pair is obtained by and , that is, for some substitution and single-hole context . Suppose is complete. We fix an arbitrary rewriting strategy and for a term , let be the number of times is used to reduce into its -normal form with respect to the strategy. To state our main theorem, we introduce a matrix and a number : {defi} Suppose is prime or . If , let be , and if is prime, let be (integers modulo ). For , , let be the integer where is the Kronecker delta. The matrix is defined by . {defi} Let be or for any prime . If an matrix over is of the form
and divides for every , we say is in Smith normal form. We call s the elementary divisors. It is known that every matrix over can be transformed into Smith normal form by elementary row/column operations, that is, (1) switching a row/column with another row/column, (2) multiplying each entry in a row/column by an invertible element in , and (3) adding a multiple of a row/column to another row/column [r10, 9.4]. (If , the invertible elements in are and , and if is prime, any nonzero element in is invertible. So, is equal to the rank of if is prime.) In general, the same fact holds for any principal ideal domain . {defi} We define as the number of invertible elements in the Smith normal form of the matrix over . We state the main theorem. {thm} Let be a complete TRS and suppose is 0 or prime. For any set of rules equivalent to , i.e., , we have
(2.1) |
We shall see some examples. {exa} Consider the signature and the set of rules
satisfies and has one critical pair :
![[Uncaptioned image]](https://cdn.awesomepapers.org/papers/ce5d5e98-f7b6-4181-a72e-fbdf31a3150e/cp_ave.png)
We can see the matrix is the zero matrix. The zero matrix is already in Smith normal form and . Thus, for any equivalent to , . This means there is no smaller TRS equivalent to . Also, Malbos-Mimram’s lower bound, denoted by , is equal to 3, though we do not explain how to compute it in this paper. (We will roughly describe in Section 4.) As a generalization of this example, we have an interesting corollary of our main theorem: {cor} Let be a complete TRS. If for any critical pair , two rewriting paths and contain the same number of for each , then there is no equivalent to which satisfies . {exa} We compute the lower bound for the theory of groups, (1.1). A complete TRS for the theory of groups is given by
Since , we set . has 48 critical pairs and we get the matrix given in Appendix A. The author implemented a program which takes a complete TRS as input and computes its critical pairs, the matrix , and . The program is available at https://github.com/mir-ikbch/homtrs. The author checked by the program, and also by MATLAB’s gfrank function (https://www.mathworks.com/help/comm/ref/gfrank.html). Therefore we have . This provides a new proof that there is no single axiom equivalent to the theory of groups.
Malbos-Mimram’s lower bound is given by . {exa} Let and be

We have and has four critical pairs (Figure 1). The corresponding matrix and its Smith normal form are computed as
Thus, . This tells does not have any equivalent TRS with 2 or fewer rules, and it is not difficult to see has an equivalent TRS with 3 rules, .
Malbos-Mimram’s lower bound for this TRS is given by . Although the equality of (2.1) is attained for the above three examples, it is not guaranteed the equality is attained by some TRS in general. For example, the TRS with only the associative rule satisfies and it is obvious that no TRSs with zero rule is equivalent. Also, in Appendix B, Malbos-Mimram’s and our lower bounds for various examples are given.
3 Preliminaries on Algebra
In this section, we give a brief introduction to module theory, homological algebra, and Squier’s theory of homological algebra for string rewriting systems (SRSs) [s87]. Even though Squier’s theory is not directly needed to prove our theorem, it is helpful to understand the homology theory for TRSs, which is more complicated than SRSs’ case.
3.1 Modules and Homological Algebra
We give basic definitions and theorems on module theory and homological algebra without proofs. For more details, readers are referred to [r10, r09] for example.
Modules are the generalization of vector spaces in which the set of scalars form a ring, not necessarily a field. {defi} Let be a ring and be an abelian group. For a map , is a left -module if for all and , we have
where denotes the multiplication of and in . We call the map scalar multiplication.
For a map , is a right -module if for any and ,
If ring is commutative, we do not distinguish between left -modules and right -modules and simply call them -modules.
Linear maps and isomorphisms of modules are also defined in the same way as for vector spaces. {defi} For two left -modules , a group homomorphism is an -linear map if it satisfies for any and . An -linear map is an isomorphism if it is bijective, and two modules are called isomorphic if there exists an isomorphism between them.
Any abelian group is a -module under the scalar multiplication . {exa} For any ring , the direct product forms a left -module under the scalar multiplication . {exa} Let be a ring and be a set. denotes the set of formal linear combinations
where except for finitely many s. The underline is added to emphasize a distinction between and . forms a left -module under the addition and the scalar multiplication defined by
If is the empty set, is the left -module consisting of only the identity element. We simply write for . is called the free left -module generated by . If , can be identified with .
A left -module is said to be free if is isomorphic to for some . Free modules have some similar properties to vector spaces. If a left -module is free, then there exists a basis (i.e., a subset that is linearly independent and generating) of . If a free left -module has a basis , any -linear map is uniquely determined if the values are specified. Suppose , are free left -modules and is an -linear map. If has a basis and has a basis , the matrix where s satisfy for any is called a matrix representation of . We define submodules and quotient modules, as in linear algebra. {defi} Let be a left (resp. right) -module. A subgroup of is a submodule if for any and , the scalar multiplication (resp. ) is in .
For any submodule , the quotient group is also an -module. is called the quotient module of by . For submodules and quotient modules, the following basic theorem is known: {thm}[First isomorphism theorem [r10, Theorem 8.8]] Let be left (or right) -modules, and be an -linear map.
-
1.
The inverse image of by , , is a submodule of .
-
2.
The image of by , , is a submodule of .
-
3.
The image is isomorphic to .
[Third isomorphism theorem [r10, Theorem 7.10]] Let be a left (or right) -module, be a submodule of , and be a submodule of . Then is isomorphic to . {thmC}[[r10, Theorem 9.8]] Let be or for some prime . Every submodule of a free -module is free. Moreover, if an -module is isomorphic to , then every submodule of is isomorphic to for some . (In general, this holds for any principal ideal domain .)
Let be a left -module. For , the set of all elements in of the form is a submodule of . If , is called a generating set of and the elements of are called generators of . Let be a generating set of for some indexing set . For a set , the linear map is a surjection from the free module . The elements of , that is, elements satisfying , are called relations of .
Now, we introduce one of the most important notions to develop the homology theory of rewriting systems, free resolutions. We first start from the following example. {exa} Let be the -module defined by
We consider the -linear map between free -modules defined by
We can see that the image of is the set of relations of . In other words, for the linear map which maps each element to its equivalence class. Then, we consider the “relations between relations”, that is, triples which satisfy , or equivalently, elements of . We can check . This fact can be explained in terms of rewriting systems. If we write relations in the form of rewrite rules
we see is a complete rewriting system (over the signature ) with two joinable critical pairs
![[Uncaptioned image]](https://cdn.awesomepapers.org/papers/ce5d5e98-f7b6-4181-a72e-fbdf31a3150e/resolution.png)
We associate these critical pairs with an equality between formal sums , and it corresponds to
In fact, this correspondence between critical pairs and “relations between relations” is a key to the homology theory of TRSs.
We define a linear map by and then satisfies . We can go further, that is, we can consider , but it clearly turns out that .
We encode the above information in the following diagram:
(3.1) |
where and is surjective. Sequences of modules and linear maps with these conditions are called free resolutions: {defi} A sequence of left -modules and -linear maps
is called an exact sequence if holds for any .
Let be a left -module. For infinite sequence of free modules and linear maps , , if the sequence
is exact and is surjective, the sequence above is called a free resolution of . If the sequence is finite, it is called a partial free resolution.
(Exact sequences and free resolutions are defined for right -modules in the same way.) Notice that the exact sequence (3.1) can be extended to the infinite exact sequence
since . Thus, the sequence (3.1) is a free resolution of .
As there are generally several rewriting systems equivalent to a given equational theory, free resolutions of are not unique. However, we can construct some information of from a (partial) free resolution which does not depend on the choice of the free resolution. The information is called homology groups. To define the homology groups, we introduce the tensor product of modules. {defi} Let be a right -module and be a left -module. Let be the free abelian group generated by . The tensor product of and , denoted by , is the quotient group of by the subgroup generated by the elements of the form
where , , . The equivalence class of in is written as .
For a right -module and a -linear map between left -modules , we write for the map . is known to be well-defined and be a group homomorphism. Let be a free resolution of a left -module . For a right -module , we consider the sequence
(3.2) |
Then, it can be shown that for any . In general, a sequence of left/right -modules satisfying for any is called a chain complex. The homology groups of a chain complex are defined to be the quotient group of by : {defi} Let denote the pair . For a chain complex , the abelian group defined by
is called the -th homology groups of the chain complex . The homology groups of the chain complex (3.2) depend only on , , and : {thmC}[[r09, Corollary 6.21]] Let be a left -module and be a right -module. For any two resolutions , , we have a group isomorphism
We end this subsection by giving some basic facts on exact sequences. {propC}[[r10, Proposition 7.20 and 7.21]]
-
1.
is exact if and only if .
-
2.
is exact if and only if .
-
3.
If is a submodule of , the sequence is exact where is the inclusion map and is the projection .
Suppose we have an exact sequence of -modules . If is free, then is isomorphic to . The proof is given by using [r10, Proposition 7.22].
3.2 String Rewriting Systems and Homology Groups of Monoids
For an alphabet , denotes the set of all strings of symbols over . The set forms a monoid under the operation of concatenation with the empty string serving as the identity, and we call the free monoid generated by . For a string rewriting system (SRS) , we write for the set defined by . We can see is a monoid under the operations where denotes the equivalence class of with respect to .
We say that two SRSs are Tietze equivalent if the monoids , are isomorphic. It is not difficult to show that for any two SRSs with the same signature, if and are equivalent (i.e., ), then and are isomorphic. Roughly speaking, the notion that two SRSs are isomorphic means that the SRSs are equivalent but their alphabets can be different. For example, let be and be . Then, is isomorphic to where and . Intuitively, since is equivalent to with respect to the congruence , is redundant as long as we consider strings modulo and is the SRS made by removing from .
If a monoid is isomorphic to for an SRS , we call a presentation of the monoid .
Let be a monoid and consider the free -module . The module can be equipped with a ring structure under the multiplication where is the usual multiplication of integers and is the multiplication of the monoid . as a ring is called the integral monoid ring of . When we think of as a ring, we write instead of .
We consider -modules. The group of integers forms a left (resp. right) -module under the scalar multiplication (resp. ). Let be a free resolution of over the ring . The abelian group is defined as the -th homology group of the chain complex , i.e.,
If is isomorphic to for some SRS , it is known that there is a free resolution in the form of
for some set . Squier [s87] showed that if the SRS is complete and reduced111An SRS is reduced if for each , is normal w.r.t. and there does not exist such that for some , there is for so that we can compute explicitly. This is an analog of Example 3.1, but we omit the details here. For an abelian group , let denote the minimum number of generators of (i.e., the minimum cardinality of the subset such that any element can be written by for ). Then, we have the following theorem: {thmC}[[u95]] Let be an SRS and . Then , . To prove this theorem, we use the following lemma: {lem} Let be a set. The group homomorphism , is an isomorphism. This lemma is proved in a straightforward way.
Proof of Theorem 1.
Since by the above lemma, . For any set and group homomorphism , since is a subgroup of , we have . For any subgroup of , is generated by if is generated by . Thus , . ∎
4 An Overview of the Homology Theory of TRSs
In this section, we will briefly see the homology theory of algebraic theories, which is the main tool to obtain our lower bounds.
We fix a signature . Let be a -tuple of terms and suppose that for each , the set of variables in is included in . For an -tuple of term , we define the composition of and by
where denotes the term obtained by substituting for in for each in parallel. (For example, .) By this definition, we can think of any -tuple of terms as a (parallel) substitution . Recall that, for a TRS , the reduction relation between terms is defined as for some single-hole context , -tuple of terms, and rewrite rule whose variables are included in . This definition suggests that the pair of a context and an -tuple of terms (or equivalently, substitution) is useful to think about rewrite relations. Malbos and Mimram [mm16] called the pair of a context and an -tuple of terms a bicontext. For a bicontext and a rewrite rule , we call the triple a rewriting step. The pair of two rewriting steps is called a critical pair if the pair of terms is a critical pair in the usual sense given by , .
The composition of two bicontexts (, ) is defined by
where and note that the order of composition is reversed in the second component. We write () for the set of bicontexts where and each and have variables in (except in ).
To apply homological algebra to TRSs, we construct an algebraic structure from bicontexts. For two natural numbers , we define to be the free abelian group generated by (i.e., any element in is written in the form of formal sum where each is in and is equal to except for finitely many s.) Then, the composition can be extended to by
This family of free abelian groups forms a structure called ringoid. {defi} Suppose an abelian group is defined for each . If for each , a map is defined and satisfies the following conditions, is called a ringoid (also called a small -enriched category).
-
1.
For each , there exists an element such that , (, , ),
-
2.
(, , ),
-
3.
(, ),
-
4.
(, ),
-
5.
(, ).
We will omit subscripts of if there is no confusion. The notion of modules over a ring is extended to modules over a ringoid. {defi} Let be a ringoid. Suppose that for each , an abelian group is defined. If there is a map satisfying the following conditions, is called a left -module.
-
1.
(, , ),
-
2.
(),
-
3.
(, ),
-
4.
(, ),
-
5.
().
A right -module is also defined with a map in the same manner with right modules over a ring.
An -linear map between left -modules is a collection of group homomorphisms () that satisfy
Ringoids and modules over ringoids are originally defined in a category theoretic way (\cf [m72, mm16]). (A ringoid is a small Ab-enriched category, and a module over a ringoid is an additive functor.) Our definitions here are obtained by unfolding the category theoretic terminology in the original definitions so that those who are not familiar with category theory can understand them more easily. {defi} Let be a ringoid and be a family of sets (). The free left -module generated by , denoted by is defined as follows. For each , is the abelian group of formal finite sums
and for each ,
If a left -module is isomorphic to for some , we say that is free. For , we write for elements of instead of , and for .
The tensor product of two modules over a ringoid is also defined. {defiC}[[mm16]] Let be a ringoid, be a right -module, and be a left -module. For a family of groups for some indexing set , its direct sum, denoted by , is the subset of the direct product defined by . The direct sum of groups also forms a group.
The tensor product is the quotient abelian group of by relations for all , .
We define an equivalence between two TRSs , , called Tietze equivalence. {defi} Two TRSs are Tietze equivalent if one is obtained from the other by applying a series of Tietze transformations defined as follows:
-
1.
If is a symbol not in and has variables in , then can be transformed into .
-
2.
If , , and does not occur in any rule in , then can be transformed into .
-
3.
If , then can be transformed into .
-
4.
If and for , then can be transformed into .
We can see that any two TRSs , are Tietze equivalent if they are equivalent in the usual sense, . Tietze equivalence is originally introduced in group theory [t1908, §11] and is also defined for monoids [bo93, 7.2]. {exa} Consider the signature and the set of four rules
We can see is Tietze equivalent to where
as follows:
Now, we outline Malbos-Mimram’s construction of the homology groups of TRSs. Let .
-
1.
We begin by defining a new ringoid from . That ringoid, denoted by , depends only on the Tietze equivalence class of . corresponds to in the case is an SRS.
-
2.
From this step, we write for . It can be shown that we have a partial free resolution
(4.1) where every is a family of sets given by , (), , , .
-
3.
By taking the tensor product , we have the chain complex
(4.2) where above is the -module defined by (the abelian group of integers) for each object , and the scalar multiplication is given by .
-
4.
The homology groups can be defined by
It is shown that the homology groups of TRS depend only on the Tietze equivalence class of . Thus, we have the following:
For the step 1, we define the relations of . We identify elements in as follows. (a) For two -tuples of terms, we identify and if . (b) Similarly, for two single-hole contexts , we identify and if . For the last identification, we introduce operator which takes a term and returns the formal sum of single-hole contexts where is obtained by replacing the -th occurrence of with in , and is the number of the occurrences of in . For example, we have
The definition of can be stated inductively as follows:
Then, (c) we identify formal sums of bicontexts and if , for some positive integer and terms such that . is defined as the quotient of by the equivalence class generated by the identifications (a), (b), and (c).
We omit the definitions of the -linear maps () in the step 2, but we describe the group homomorphisms . Let denote for simplicity. For the step 2, we define the -linear maps (). For , the homomorphism is given by
For a term , we define as the linear combinaton of symbols where is the number of occurrences of in . Using this, for , the homomorphism is given by
For a critical pair , let , () be rewriting steps such that , , . Then the map is defined by
Malbos-Mimram’s lower bound for the number of rewrite rules is given by . (Recall that denotes the minimum number of generators of an abelian group .) More precisely, and hold for any TRS that is Tietze equivalent to . These inequalities are shown in a similar way to the proof of Theorem 1.
5 Proof of Main Theorem
Let be a complete TRS. We first simplify the tensor product in (4.2). {lem} Let and be a family of sets . Then, we have . Especially, if , .
Proof.
We define a group homomorphism by where is defined by for . Since each is an isomorphism, is also an isomorphism. ∎
As special cases of this lemma, we have , , and . Additionally, we can see each group homomorphism () is a -linear map.
To prove Theorem 2, we show the following lemma. {lem} Let . If or is prime, . (Recall that is the minimum number of generators of a group .)
Proof.
By definition, defined in Section 2 is a matrix representation of . Suppose is prime. In this case, is equal to the dimension of as a -vector space. By the rank-nullity theorem, we have
Suppose . We show where , , and are the elementary divisors of . Let
be the group homomorphism defined by . is well-defined since , and is isomorphic to . By taking the basis of such that is the matrix representation of under the basis and some basis of , we can see . Suppose for some and . Since is a homomorphism, holds. Since is free, we have . Therefore, is included in the subset of isomorphic to . Thus, .
Since if is invertible, . The group is generated by , , , , , , , so we have . Let be a prime number which divides . We can see . It is not hard to see , and since is a -vector space, . Thus, . ∎
By Lemma 5, Theorem 2 is implied by the following theorem: {thm} Let be a TRS and . If or is prime,
(5.1) |
Proof.
By the first isomorphism theorem, we have an isomorphism between -modules
and by the third isomorphism theorem, the right hand side is isomorphic to
Thus, we obtain the following exact sequence by Proposition 3.1:
By Theorem 3.1, since and is a free -module, is also free and by Proposition 3.1, we have . Therefore, . Since is generated by if , we obtain
Thus, we get (5.1). ∎
Now, we prove our main theorem, Theorem 2.
Proof of Theorem 2.
As we stated, depends only on the Tietze equivalence class of and particularly, is isomorphic to if is equivalent to (in the sense ). Let us show depends only on the equivalence class of . For a left -module , denotes the cardinality of a minimal linearly independent generating set of , that is, a minimal generating set of such that any element , and for any , . It can be shown that if is free. Especially, since if . Also, is obtained by a general theorem [r10, Ch 10, Lemma 10.1]. By definition, does not depend on . Since depends only on the Tietze quivalence class of , two sets of rules with give the same .
In conclusion, for any TRS equivalent to , we obtain . ∎
6 Inefficient TRS
We construct and prove that there exists an inefficient TRS.
Let us consider the signature and the set of rewrite rules
Let be a TRS.
-
1.
is a groupoid if for any bicontext
-
2.
A sub-TRS of is a TRS satisfying for any .
-
3.
a subgroupoid of if is a sub-TRS of and for any
Suppose is a sub-TRS of . Let be a coset of bicontext. We write for the set
and for
Note that and can be the same set for different and . Therefore, even if each contains infinitely many cosets of bicontext, can be a finite set. {defi} Suppose is a sub-TRS of . The -index of in is the cardinality of the set , denoted by . The set is an analog of the “right coset” in group theory and the -index corresponds to the index of a subgroup.
Let be a sub-TRS of a TRS , be a finite set for each , and be . For each , we choose such that . We define and . Since any is equal to for a unique , the following -linear map is well-defined:
We can check has its inverse
In the setting of the above paragraph, if the sequence of free left -modules
is exact, then
is also exact where for and .
Proof.
By definition, , follows from , . If , then , so we have , or equivalently, . Therefore , \ie, there exists such that .
∎
Let be a TRS. Suppose is a partial resolution
of over .