⟨ Slava's | Monoid Zoo ⟩

Look up a monoid with two generators, and one or two defining relations:
⟨a, b | ⟩
Details:
  • Spaces are ignored.
  • The empty word is denoted by "1".
  • Lowercase letters stand for generators.
  • The two sides of a defining relation are separated by "=".
  • The sides must be distinct, and at least one must have length greater than one.
  • The relations are separated by "," in the case there are two.
  • Maximum sum of sides is 10 (one relation) or 11 (two relations).
Jump directly to an enumeration:

Contents

Background

My interest in finitely-presented monoids stems from the Swift compiler's use of the Knuth-Bendix completion algorithm to implement same-type requirements. There are multiple possible formulations of the Knuth-Bendix algorithm, but in Swift's case, we're using it to solve the word problem in a finitely-presented monoid.

In the Swift compiler, the finitely-presented monoids are the generic signatures of function and type declarations, and the relations in each monoid correspond to the generic requirements imposed upon that declaration. This is all documented in Chapters 16--18 of Compiling Swift Generics, if you're curious.

The word problem

The word problem asks the yes/no question of whether two words over a finite alphabet are equivalent under a given set of bidirectional string rewriting rules, or "relations". Here is an example. Suppose you're given these two relations:
  1. 🍌🍎🍌 = 🍎🍎🍎
  2. 🍌🍌🍌 = 🍌🍌
Can you see a way to transform a string of 8 apples "🍎🍎🍎🍎🍎🍎🍎🍎" into a string of 10 apples "🍎🍎🍎🍎🍎🍎🍎🍎🍎🍎"?

It is not at all obvious that this can be done, and in fact it takes a minimum of 15 steps. (You can discover the solution for yourself by playing this simple game.) This is a concrete instance of the word problem: we have two words a8 and a10, and the monoid presentation ⟨a, b | bab=aaa, bbb=bb⟩, and we want to know if the two words are equivalent with respect to those two rules.

Even though the above presentation is very short, the word problem here is already quite difficult. A classic result is that the word problem for finitely-presented monoids is undecidable in the general case. A very short example of a monoid with an undecidable word problem appears in the paper An associative calculus with an insoluble problem of equivalence (for an English translation with commentary, see G. S. Tseytin's seven-relation semigroup with undecidable word problem):

⟨a, b, c, d, e | ac=ca, ad=da, bc=cb, bd=db, eca=ce, edb=de, cca=ccae⟩

Finite complete rewriting systems

Knuth-Bendix attempts to construct a finite complete rewriting system from the bidirectional equivalences that define the monoid. A finite complete rewriting system is a set of directed reduction rules which allows us to reduce any word into a normal form in a finite number of steps. This completely solves the word problem for the original monoid: given any pair of words, we can first reduce both words to their normal form by applying the reduction rules in our FCRS, and then we check if we get identical normal forms.

Knuth-Bendix completion will sometimes fail; the failure mode is that it runs forever, continuing to add new rules which never converge. At the very least, Knuth-Bendix must fail if the given input rules define a monoid with an undecidable word problem. Undecidable instances aside, one might then ask: if our monoid has a decidable word problem, can we still solve the word problem with an FCRS? This was answered in the negative by Craig C. Squier in the late 1980's. In a paper titled A finiteness condition for rewriting systems, Squier considered the monoid S1, with five generators and five relations:

S1 := ⟨a, b, t, x, y | ab=1, xa=atx, xt=tx, xb=bx, xy=1⟩
Squier shows that this monoid does not have finite derivation type, which is a necessary condition for the existence of an FCRS presenting the same monoid. Thus, Knuth-Bendix completion will fail with any presentation of this monoid, not just the one given above, no matter what generating set or reduction order we choose. Despite that, S1 happens to have a decidable word problem. An even shorter example, with three generators and three relations, appears in a paper titled On finite complete rewriting systems, finite derivation type, and automaticity for homogeneous monoids:
⟨a, b, c | ac=ca, bc=cb, cab=cbb⟩
The above monoid again has a decidable word problem (the relations preserve the length of the word, so we can decide if two words are equivalent by first comparing their lengths, followed by an exhaustive enumeration if both words have equal length); just not by Knuth-Bendix completion.

The goal of this investigation

The above examples serve as motivation for my investigation, which can be summarized as follows:
Goal: To find, in some subjective sense, the "smallest" or "shortest" monoid presentation(s) whose whose word problem cannot be solved by a finite complete rewriting system.
I got the idea from Bogdan Grechuk's wonderful book, Polynomial Diophantine Equations: A Systematic Approach. Much like the word problem, no general approach exists that can solve all Diophantine equations, because the general case is undecidable. Grechuk defines an ordering of all such equations, and then proceeds to work through the list, applying various techniques to solve as many instances as possible in order of increasing size.

Similarly, you can imagine enumerating all monoid presentations in a certain order, and trying to find a finite complete rewriting system for each one. To construct an FCRS, I first attempt a variation of the technique described in Morphocompletion for one-relation monoids, which adds new new generators to the presentation before performing Knuth-Bendix completion algorithm with a variety of reduction orders simultaneously:

Since Knuth-Bendix completion can struggle to produce a rewriting system for very large finite monoids due to an explosion in the number of intermediate rules, for a couple of instances I used Todd-Coxeter congruence enumeration instead of Knuth-Bendix completion. Congruence enumeration terminates iff the presented monoid is finite; the "standardization" algorithm described in Computation with Finitely Presented Groups by Charles C. Sims can then very quickly produce a finite complete rewriting system.

Besides solving the word problem, various properties of the presented monoid can be decided from an FCRS:

My side quest has been to collect and analyze this data, to better understand the "easy" cases as well. If you click through the links to the monoids below, you'll these properties summarized for each monoid, together with Cayley tables for finite monoids up to size 24, and Cayley graphs for finite monoids up to size 1083.

To answer the one final question you may have:

Why? Because it's an interesting problem.

Two generators, two relations

It is straightforward to generate an exhaustive list of all monoid presentations with two generators, two relations, and sum-of-sides ≤ 11:

⟨a, b | u1=v1, u2=v2⟩, where |u1| + |v1| + |u2| + |v2| ≤ 11
You can significantly cut down on the work by realizing that a large number of monoid presentations in this list are isomorphic or anti-isomorphic to each other, by some combination of the following:
  1. Swapping the two sides of a defining relation, so u=v becomes v=u.
  2. Swapping the two defining relations, so ⟨a, b | u1=v1, u2=v2⟩ becomes ⟨a, b | u2=v2, u1=v1⟩.
  3. Replacing a with b, and vice versa, within all defining relations.
  4. Reversing both sides of each defining relation.
If one instance in such an equivalence class has a finite complete presentation, they all do, so it suffices to only keep one instance from each such equivalence class.

I also skip instances where a defining relation is the tautology u=u, or of the form u=v with both |u| ≤ 1 and |v| ≤ 1. (Note that this discards some "legitimate" instances, namely the two-generator one-relation monoids with sum-of-sides N, which can be presented with two relations and with sum-of-sides N+1: ⟨a, b | u=v, a=a⟩. However, I enumerate one-relation monoids up to length 10 below, which are exactly the missing presentations here.)

The enumeration

After this filtering has taken place, 28,551 instances remain. I can find a finite complete rewriting system for all but 19 of these, which are listed as "hard instances" on the page below:

⟨a, b | aaa=a, abba=bb⟩

My main result from this investigation so far is that ⟨a, b | aaa=a, abba=bb⟩ is the unique two generator, two relation monoid with length 10 that cannot be presented by a finite complete rewriting system over any alphabet (this monoid is "not FCRS"). In fact, just like Squier's S1, it does not have finite derivation type.

Read the proof:

Note that the article describes an earlier enumeration of two-relation monoids up to length 10; at the time, this monoid was one of three hard instances. Since then, I've found an FCRS for the other two, and they're actually isomorphic:

⟨a, b | aba=aa, baa=aab⟩

I also have an earlier result that one of the length 11 hard instances is not FCRS. The main proof fits in two pages, and it is (relatively speaking) quite straightforward, relying only on nothing more than the preliminary definitions and the pumping lemma for regular languages. I would be very happy if this was incorporated as an example in someone's textbook on string rewriting or Knuth-Bendix completion!

Read the proof:

An interesting question (I do not know the answer) is if this monoid also fails to have finite derivation type.

Resolving the status of the 17 remaining length 11 hard instances is still an open problem. (A very observant reader might notice that the "8 apples" monoid from the introduction, ⟨a, b | bab=aaa, bbb=bb⟩, appears among them. I'm pretty sure it's not FCRS.) Let me know if you figure anything out!

Finite monoids

Every finite monoid has a decidable word problem, and one can always find a finite complete rewriting system, in principle at least. How bad do they get?

Of the 28,551 instances in the enumeration, 18,867 are presentations of finite monoids. I've classified them up to (anti-)isomorphism, and I believe there are exactly 555 essentially unique finite monoids that appear. Some are quite small:

Some nice and short presentations of various classic finite groups then appear: Finally, a "Busy Beaver"-esque problem: what is the largest finite monoid you can present with two generators, two relations, and length N? (The Busy Beaver problem asks, given a Turing machine with m states and n symbols, what is the longest possible running time among all such machines that halt?) Here are two data points:

Two generators, one relation

I've also investigated monoids with one defining relation.

The enumeration

I can find a finite complete rewriting system for every two-generated one-relation monoid with sum of sides ≤ 10, with five exceptions that are listed at the page below: It is not known if every one-relation monoid can be presented by a finite complete rewriting system. Maybe it is too much to hope for, but if the answer is "no", perhaps one of these will be the first such counterexample!

Explore:

A number of classical one-relation monoids can be found in this enumeration: There are no finite monoids in this enumeration, because it takes at least two relations to present a finite monoid with two generators.

Related work

A team led by James D. Mitchell at University of St Andrews has been looking at solving the word problem in one relation monoids using a variety of techniques, not just FCRS, with a larger enumeration than mine---they're enumerating all ⟨a, b | u=v⟩ where |u| ≤ 10 and |v| ≤ 10, not just |u|+|v| ≤ 10. Check out their publications:

Minor results

I've found finite complete rewriting systems for a handful of one relation monoids that have stumped others, which is perhaps mildly interesting. You can see the slightly absurd phenomenon in action here, where even though we're starting from a single relation, we might get a finite complete rewriting system with a large number of rules.

(1) The below monoid, due to Victor Maltcev, appears as Exercise 4.10:8 (ii) in An invitation to General Algebra and Universal Constructions by George M. Bergman:

(ii) (Victor Maltcev) Does there exist a normal form or other useful description for the monoid presented by generators a, b and the relation abbab = baabb ? (I do not know the answer.)
The monoid ⟨a, b | abbab=baabb⟩ is anti-isomorphic to ⟨a, b | abaab=aabba⟩, which admits a finite complete rewriting system.

(2) The next example appears in the fantastic survey of The Word Problem for One-Relation Monoids by C.F. Brodda, where he writes:

We note in passing that the smallest monadic one-relation monoid to which no result in the literature appears to be available to solve the word problem for is ⟨a, b | bababbbabba=a⟩. The author has not found a finite complete rewriting system for this monoid, but has solved the word problem for this monoid by other means.
The presentation ⟨a, b | bababbbabba=a⟩ does not appear in my enumeration, for it has length 12. It has the following finite complete rewriting system, once we add a letter c=bba:
  1. ca ⇒ ac
  2. b2a ⇒ c
  3. cbac ⇒ abc2
  4. cbabc2 ⇒ ba
  5. ba2 ⇒ (ab)2c3
  6. (ba)2c ⇒ aba(bc2)2
  7. b(ab)2c2 ⇒ a
  8. c(ba)2 ⇒ abcba
  9. cbabcba ⇒ a
  10. (ba)3 ⇒ (ab)2c(cb)2a
  11. b(ab)2cba ⇒ (ab)2c2
(3) In the paper On the Dehn functions of a class of monadic one-relation monoids, the same author defines this family of monoids:
ΠN := ⟨a,b | baa(ba)N=a⟩
He then asks:
Question 3. Does ΠN admit a finite complete rewriting system for all N ≥ 2?
I believe they all admit finite complete rewriting systems. Here is N=2, ⟨a, b | baababa=a⟩:
  1. cac3 ⇒ ac
  2. cac2a ⇒ a2
  3. a2c3 ⇒ c(ac)2
  4. a2c2a ⇒ caca2
  5. ad ⇒ ca
  6. dc3 ⇒ c
  7. dc2a ⇒ a
  8. dac ⇒ ac5
  9. dcac ⇒ ac3
  10. da2 ⇒ ac4a
  11. dca2 ⇒ ac2a
  12. ab ⇒ c
  13. bc ⇒ db
  14. ba ⇒ d
And N=3, ⟨a, b | baabababa=a⟩:
  1. cac5 ⇒ ac
  2. cac4a ⇒ a2
  3. a2c5 ⇒ cac3ac
  4. a2c4a ⇒ cac3a2
  5. ad ⇒ ca
  6. dc5 ⇒ c
  7. dc4a ⇒ a
  8. dac ⇒ ac17
  9. dcac ⇒ ac13
  10. dc2ac ⇒ ac9
  11. dc3ac ⇒ ac5
  12. da2 ⇒ ac16a
  13. dca2 ⇒ ac12a
  14. dc2a2 ⇒ ac8a
  15. dc3a2 ⇒ ac4a
  16. ab ⇒ c
  17. bc ⇒ db
  18. ba ⇒ d
And N=4, ⟨a, b | baababababa=a⟩:
  1. cac6 ⇒ ac
  2. cac5a ⇒ a2
  3. a2c6 ⇒ cac4ac
  4. a2c5a ⇒ cac4a2
  5. ad ⇒ ca
  6. dc6 ⇒ c
  7. dc5a ⇒ a
  8. dac ⇒ ac26
  9. dcac ⇒ ac21
  10. dc2ac ⇒ ac16
  11. dc3ac ⇒ ac11
  12. dc4ac ⇒ ac6
  13. da2 ⇒ ac25a
  14. dca2 ⇒ ac20a
  15. dc2a2 ⇒ ac15a
  16. dc3a2 ⇒ ac10a
  17. dc4a2 ⇒ ac5a
  18. ab ⇒ c
  19. bc ⇒ db
  20. ba ⇒ d
This pattern continues for N=5, 6, 7, ... as well, and you seem to always get an FCRS by adding two generators c=ab and d=ba.

(4) The next example is from a talk titled Off with the head! Termination provers and the word problem for 1-relation monoids by Reinis Cirpons:

The 1-relation Thue systems for which the decidability of the word problem is unknown to us: {baabbbaba ↔ a} {baaabaaa ↔ aba}.
The first one is anti-isomorphic to ⟨a, b | ababbbaab=a⟩, which is FCRS. The second one ⟨a, b | baaabaaa=aba⟩ has length 11 so it does not appear in my enumeration, but it can also be solved by FCRS if we add c=aaaba and d=abaaa:
  1. bc3 ⇒ dbd
  2. bc2ad ⇒ dba
  3. abd ⇒ bcad
  4. ac ⇒ cad
  5. abc ⇒ dba
  6. dbcadc ⇒ adbd
  7. cbcadc ⇒ ad2bd
  8. adbc ⇒ cba
  9. ab2cd2 ⇒ bcdbad2
  10. ab2c2 ⇒ bcdbcad
  11. ab2cdc ⇒ bcdbadc
  12. ab2cdbc ⇒ bcdbcba
  13. aba ⇒ bca2
  14. a2d ⇒ ca2
  15. dbc(ad)2 ⇒ adba
  16. cbc(ad)2 ⇒ ad2ba
  17. ab2cad ⇒ bcdbca2
  18. ab2cdad ⇒ bcdb(ad)2
  19. adbad2 ⇒ cbda2
  20. ab2cdbad2 ⇒ bcdbcbda2
  21. adbadc ⇒ cbd(ad)2
  22. ab2cdbadc ⇒ bcdbcbd(ad)2
  23. ab2ca2 ⇒ bcdba3
  24. adb(ad)2 ⇒ cbdada2
  25. ab2cdb(ad)2 ⇒ bcdbcbdada2
  26. bca4 ⇒ d
  27. adba3 ⇒ c
  28. ab2cdba3 ⇒ bcdbc
  29. dba5 ⇒ ad
  30. cba5 ⇒ ad2