1 Introduction
Note added, January 2018: This paper was written in 2011, submitted to a conference, and rejected. I made no further effort to publish it, since although the extension of Tilson’s theory to the forest algebra setting is formally correct, I was never persuaded of the usefulness of the method, and not happy with the rather complicated application given here. Recently, Michael Hahn and Andreas Krebs dusted off this old work of mine and applied to a quite different problem, so I thought it was a good time to make it publicly available. I have made no improvements or modifications—aside from this note—in the past seven years. Like an old house that needs a lot of work, I offer the paper ‘as is’.
While it might not appear so at first, this paper is part of an ongoing research effort to understand the expressive power of various predicate and temporal logics on trees. Analogous problems for words, rather than trees, have been studied for well over forty years, and much of this research has relied on algebraic methods. Typically, the set of words that satisfies a formula in one of the logics under consideration is a regular language, and expressibility in the logic is reflected in properties of the syntactic monoid or the syntactic morphism of A large compendium of results in this vein (up to 1994) is presented in Straubing [17] for various predicate logics. Additional results, mostly oriented around temporal logic are in Thérien and Wilke [18] and Wilke [20].
Recently this approach has been extended, with some success, to languages of trees, especially unranked trees. Here, the syntactic forest algebra, introduced by Bojanczyk and Walukiewicz [2] plays the role of the syntactic monoid. A number of papers have appeared that use this construct either explicitly (Bojanczyk, et.al. [6, 5, 4, 3]) or implicitly (Benedikt and Segoufin [1], Place and Segoufin [14]) to characterize the languages definable in certain tree logics. A related approach for trees of bounded rank is described in Esik and Weil [8, 9].
It was recognized early on in the development of the theory for words that wreath product decompositions play an important role . Thus McNaughton and Papert [10] turned to the KrohnRhodes decomposition for the characterization of properties definable in firstorder logic, and Brzozowski and Simon [7] studied decompositions with an idempotent and commutative factor in their work on locally testable languages. A close reading of this latter work, along with related papers, led to a more general understanding of the role played by graph congruences in obtaining these decompositions, initially in Straubing [16] and Thérien and Weiss [18]. This reached its definitive form in Tilson’s work [19] on the algebra of finite categories. An uptodate account appears in the book by Rhodes and Steinberg [15]. Categories have emerged as an important tool in the study of finite semigroups and the languages they accept, one that has found applications well beyond the problems that originally inspired it. (See, e.g., Pin, et. al. [13, 12].)
It is now known that wreath products of forest algebras also figure importantly in the study of logics on trees. This is seen in the many examples studied in Bojanczyk, et. al. [6], which include firstorder logic with the ancestor relation, and the temporal logics and It also underlies much of what is done in [14]. So the time is ripe for developing new algebraic tools for producing such decompositions.
In the present paper we extend the algebra of finite categories from monoids to forest algebras. After reviewing the basics of forest algebras in Section 2, we give the definition of forest categories and of the derived category of a pair of morphisms. The tricky part here is in getting the definitions just right. Once that is done, it is a simple matter to establish an analogue to the Derived Category Theorem of Tilson [19], which connects categories to wreath products. In the sections that follow, we endeavor to show that this is more than just abstract nonsense. In Section 5 we establish efficient necessary and sufficient conditions for determining if a given forest category divides an idempotent and commutative forest algebra—an analogue to the result of Simon [7] that started it all. We then show how this underlies the very recent work on locally testable forest languages by Place and Segoufin [14]. It is this paper that provided much of the inspiration for the present work. However we cannot stress enough that what we propose here is more than just a new proof of the results in [14], or, worse yet, the same proof couched in an obscure new language. Rather, we are introducing a new mathematical tool, which like its precursor for monoids, promises to have many more applications than the one we have chosen as a proof of concept. We discuss the prospects for these in the last section.
2 Forest Algebras
For more background on forest algebras, see Bojanczyk, et. al. [2, 6]. A forest algebra is little more than a pair of monoids, where one of the monoids (the vertical monoid) acts on the underlying set of the other (the horizontal monoid). In this paper we depart from the tradition that has begun to be established in the articles that have appeared on forest algebras—and return to the much longerestablished traditions of semigroup theory—by writing the action as a right action. We do this precisely because we are generalizing the algebra of finite categories, and we would be forced to reverse the normal lefttoright direction of arrows in categories in order to accommodate left actions in forest algebras.
Here is the precise definition: A forest algebra is a pair of monoids with some additional properties, which we will specify shortly. The operation in is written additively and the identity written 0. In this paper we will also suppose that
is commutative. This is not usually a requirement in discussions of forest algebras, and our theory of forest categories will probably work just fine without it, but it does simplify the presentation and will serve for our purposes. The operation in
is written multiplicatively, and its identity is denoted 1. acts on on the right, so that given there is an element of The properties that make this an action are (i) if and and (ii) for all We require this action to be faithful, which means that if for all then There is just one additional property in the definition: If and then there is an element of such that for all We usually write the more naturallooking instead of Observe that the map embeds the monoid intoA homomorphism of forest algebras is actually a pair of monoid homomorphisms with the additional property that for all We usually drop the subscript and write for both components. Notice that a homomorphism in this sense automatically preserves the operation, and thanks to our various notational conventions we very conveniently have for any We say a forest algebra divides a forest algebra and write if is a homomorphic image of a subalgebra of Given two forest algebras we define the wreath product
exactly as one defines the wreath product of transformation monoids: The action is given by
The monoid structure on is simply the direct product. The multiplication in the vertical monoid is defined by
where for all It is straightforward to show the wreath product is a forest algebra. The pair of maps projecting onto the righthand coordinates is a forest algebra homomorphism
Let be a finite alphabet. We describe the free forest algebra as follows: consists of expressions built starting with 0 and closing under adjunction of a letter on the right and under An example of such an expression, with is
We will usually drop the 0’s that appear in such an expression, as well as the parentheses whenever the action axioms make these redundant, so we will write this more simply as
and depict it in the obvious fashion as a forest with two trees, both with at the root and with four leaves altogether, two labeled and two labeled Since we are assuming is commutative, we identify many different forests: For instance, the one above is identical to
consists of contexts: These are forests in which one of the leaves has been removed and replaced by a hole: For example
Contexts act on forests by substituting a forest for the hole in a context to form a forest Contexts are composed by substituting for the hole in to form a context As a result is indeed a forest algebra. What makes it the ‘free’ forest algebra is this universal property: If is a forest algebra, then any map extends to a unique forest algebra homomorphism such that for all
A subset of is called a forest language. A forest language is recognized by a forest algebra if there is a homomorphism such that for some A forest language is regular if it is recognized by a finite forest algebra—this is equivalent to recognition by a bottomup deterministic automaton. For every regular forest language there is a unique minimal algebra recognizing in the sense that for every forest algebra recognizing is called the syntactic forest algebra of and the homomorphism that recognizes is called the syntactic morphism of Both the syntactic monoid and syntactic morphism are effectively computable from any automaton that recognizes
3 Forest Categories and Division
A forest category is a triple of sets with the following properties:

is a finite set, called the set of objects of

For all there is a set called the set of arrows from to such that is the disjoint union
We denote an arrow from to as We write for the object and for the object

For all there is a set called the set of halfarrows to such that is the disjoint union
We denote a halfarrow to as and we write for

is a commutative monoid whose operation is written and whose identity is written 0. As was the case with our treatment of forest algebras, commutativity is not really a requirement, but it makes the presentation somewhat simpler, and all the applications we discuss here will result in forest categories that are commutative in this sense.

is also a commutative monoid, with operation similarly denoted and so that the map is a monoid homomorphism from onto We will often depict the halfarrow as
but will always bear in mind that this is equivalent to a halfarrow

For all there is a binary operation
We denote this operation multiplicatively:
or sometimes simply as
This operation is associative in the following sense: for all
Further, for each there exists such that for all

For all there is a binary operation
We denote this operation multiplicatively:
or sometimes simply as
This operation is an action in the following sense: for all
Further, for all
We require this action to be faithful in the sense that if
for all then

For each and each there exists
such that for all
and for all
These axioms are more readable, and look more natural, if we write as and depict it as
Remarks on the Definition

If we leave out everything having to do with halfarrows, this is simply the standard definition of a category with a finite set of objects.

A category with a single object is a monoid. Similarly, in a forest category with only one object, the operations described in parts (f),(g),(h) of the definition are always defined, and their properties reduce to the axioms for a forest algebra. Thus a forest category with one object is a forest algebra.

Suppose we have a multiset of arrows and halfarrows in a forest category We can compose these in any fashion that makes the endpoints match up correctly, and obtain a forest diagram, as illustrated in Figure 1. Such a diagram is simply a forest in which the leaf nodes are labeled by halfarrows and the internal nodes by arrows, with the constraint that the start object of each internal node must equal the sum of the end objects of its children.
In the figure, the arrow labeled belongs to and the arrow labeled to We can view the diagram as a graphical representation of the expression
There are other ways to parse the diagram, but thanks to the forest category axioms, all the resulting expressions have the same value in That is, any forest diagram over unambiguously determines an element of where is the sum of the rightmost objects in the diagram. If the underlying forest of such a diagram has just one component, we will call it a tree diagram.
Similarly, if we eliminate one of the halfarrows from the diagram, leaving a single object exposed at a leaf, we obtain a diagram that unambiguously determines an element of We call such a diagram a context diagram, and denote the exposed object by In this setting, the action of an arrow on a halfarrow corresponds to the action of a forest on a context. We just have to make sure that the endpoints match up: that is, we can plug a forest diagram into a context diagram and obtain a forest diagram so long as In a like manner, the composition of two arrows corresponds to plugging one context diagram into another.
Division
In the theory for monoids, the notion of a category dividing a monoid plays a crucial role. The idea is this: Suppose we want to evaluate the composition of a sequence of arrows
in a category We associate to each arrow an element of in such a manner that knowledge of the terminal objects and and of the product in is enough to determine the value in There is no problem in this scheme if several different elements of are associated to the same arrow, or the same element of to different arrows, so long as no element of is associated to two distinct arrows with the same endpoints (coterminal arrows).
For forest categories, the idea is much the same: We want to associate to each halfarrow and arrow of horizontal and vertical elements, respectively, of a forest algebra If we associate such a ‘covering element’ to every halfarrow and arrow of a forest diagram and evaluate the corresponding forest in then this value, together with is enough to determine and similarly for context diagrams.
Here is the formal definition: If is a forest category and a forest algebra, then we write and say divides if for each there exists a nonempty set and for each there exists a nonempty set satisfying the following properties:

(Preservation of Operations) For all


(Injectivity)

If and are distinct arrows, then

If and are distinct halfarrows, then

If is either an arrow or a halfarrow, then we say covers
4 The Derived Forest Category
Let be a finite alphabet, and consider a pair of forest algebra homomorphisms
mapping onto finite forest algebras It is a common practice, when dealing with monoids, to view this pair as defining a relational morphism and work directly with the relation (note that is in general multivalued and therefore not a homomorphism in the usual sense), however we find it simpler to refer directly to the maps and
We define a category as follows:


We set, for
In other words, is the graph of the relation We will depict the halfarrow as

To define we first introduce an equivalence relation on the set
We define if for all with we have We then set to be the set of equivalence classes of We will still depict an arrow as
where but with the understanding that the same arrow has many distinct representations in this form.

Note that and are commutative monoids, and that the projection of a halfarrow onto its end object is a homomorphism, as required in the definition. We must now define the other operations in the category and show that they have the desired properties. We set
Observe that so the righthand side of the above equation is indeed the representation of an arrow. We still need to show that this is welldefined; in other words, that
implies
To this end, let and Then the two equivalences imply
and, since
so the two together give
as required. Associativity follows at once from associativity in and the arrow is the identity at

We define the action of an arrow on a halfarrow by
Note that the righthand side is indeed a halfarrow, since if and then and Furthermore, this operation is welldefined, since if then by definition. The associativity of the action follows directly from the associative law for the action in The definition of equivalent arrows also ensures that this action is faithful.

We can set
where is such that We have
so the righthand side of the definition represents an arrow, and it is trivial to verify that this is welldefined. The required algebraic properties follow directly from those for the insertion operation in
Our main result connects the derived category to the wreath product.
Theorem 1
(Derived Category Theorem)
Let be as above, and let be a finite forest algebra.

If then

Suppose factors as
where
and that where is the projection homomorphism from the wreath product onto its righthand factor. Then
The proof is largely a straightforward verification, but there are lot of things to verify, so we give the complete argument in the appendix.
5 Globally Idempotent and Commutative Forest Categories
Much of the work in applying categories to automata over words entails finding effective conditions for determining when a finite category divides a monoid belonging to some specified variety of finite monoids. The earliest such result (which, of course, predates Tilson’s introduction of category division, and provided much of the inspiration for the development of the subject), implicit in the work of Brzozowski and Simon [7] and McNaughton [11] on locally testable languages, establishes necessary and sufficient conditions for a finite category to divide a finite idempotent and commutative monoid.
Theorem 2
A finite category divides a finite idempotent and commutative monoid if and only if for every the monoid is idempotent and commutative.
Here we will study an analogous question for forest categories. Let be an idempotent and commutative monoid, with its operation written additively. of course, acts faithfully on itself, and the result is a forest algebra We call such a forest algebra a flat idempotent and commutative forest algebra, because when we evaluate the homomorphic image of a forest in the value does not depend on the tree structure at all, but only on the node labels. We say that a forest category is globally idempotent and commutative if it divides a flat idempotent and commutative forest algebra.
Let be either a forest diagram or a context diagram over a forest category Recall that each such diagram has a value in either (for forest diagrams) or (for context diagrams). We denote by the set of arrows and halfarrows occurring in the diagram.
Theorem 3
A forest category is globally idempotent and commutative if and only if the following condition holds: If and are forest diagrams over with and then
Proof
First suppose divides a flat idempotent and commutative forest algebra Let be a forest diagram, and let be the set of all halfarrows and arrows in Each is covered by some and it follows that is covered by Since is idempotent and commutative, this value is completely determined by Thus if then and are covered by the same element of Thus if as well, by the injectivity property of division.
Now suppose satisfies the condition in the statement of the theorem. It follows from faithfulness that satisfies an analogous condition for context diagrams: If and are context diagrams over with and then Let be the monoid consisting of all subsets of with union as the operation. Suppose is an arrow or halfarrow of We say covers if there is a context diagram or forest diagram such that and It follows readily from the conditions on forest diagrams and context diagrams that this covering relation defines a division
As corollary to the proof we obtain:
Theorem 4
It is decidable if a given finite forest category is globally idempotent and commutative.
Proof
The proof of Theorem 3 shows that is globally idempotent and commutative if and only if it divides where is the monoid of subsets of This can be effectively checked, if necessary by enumerating every possible covering relation and checking if it is a division.
When one compares the decision procedure given in Theorem 4 for globally idempotent and commutative forest categories to the one in Theorem 2 for ordinary categories, the former appears ridiculously inadequate, and scarcely deserves to be called an ‘algorithm,’ while the latter much more reasonably entails verifying identities, where is the number of arrows in the category. Of course one would like something just as reasonable for forest categories. More precisely, we wish to have a small list of identities, each involving two diagrams with a small number of objects and arrows, such that one can transform one forest diagram into another with the same support and terminal objects by repeated application of the identities. It is possible to produce such a list by going carefully through the arguments in Place and Segoufin [14] on locally testable tree languages, and noting down precisely what axioms are required to produce the analogous result there. Here is one such list:
Theorem 5
Let be a finite forest category in which is idempotent and commutative. is globally idempotent and commutative if and only if

(Loop removal.) Whenever and

(Horizontal absorption) For all and

(Horizontal idempotence.) For all
The rather involved proof, which naturally enough closely tracks the one given in [14], is given in the appendix.
6 Application to Locally Testable Forest Languages
In the present section we show how the theory developed in this paper leads to a new treatment of the recent results in [14] on locally testable tree languages. While our treatment comes wrapped in a great deal of new formalism, it has the advantage of very clearly separating the two main principles of the argument: The characterization of globally idempotent and commutative forest categories given in Theorems 4 and 5 above, and bounds on the index of definiteness given in Lemma 7 below. Each of these principles can be applied separately in other problems. While our exposition here concerns only what [14] calls ‘Idempotent Local Testability’, we have little doubt that our methods can also shed light on the other formulations of local testability given there. We discuss these briefly in the final section.
Let be a finite alphabet and let Let We will define the definite type of a node in by induction on All nodes have the same 0definite type. If then the definite type of a node is the pair where is the label of the node, and is the set of definite types of its children.
Let We define if the set of definite types of the roots of is equal to the set of definite types of the roots of It is clear that this equivalence relation is compatible with addition in and that and implies So is a forest algebra congruence of finite index, and thus there is a quotient forest algebra We denote by the projection homomorphism from onto this quotient. Note that if then can be thought of as the set of definite types of the root nodes of The congruence is an analogue for forest algebras to the congruence that identifies two words if they have the same suffix of length and the quotient algebra is an analogue to the free definite semigroup. In fact, many such analogues are possible, depending on how one defines the horizontal component of the quotient algebra; here we are just treating the case where the horizontal component is idempotent and commutative.
Again, let and let We define if and the set of types of nodes in is equal to the set of types of nodes of Once again, this is a congruence of finite index on We say that is locally testable if it is a union of classes, and locally testable if it is locally testable for some Thus, for example, membership in a 1locally testable forest language depends only on the set of node labels for a forest, while a condition like ‘there is a node labeled with a child labeled but no node labeled with children labeled and ’ defines a 2locally testable forest language.
As is the case with words, locally testable languages are recognized by a particular kind of wreath product. The proof of the theorem below is an immediate consequence of the characterization of wreath products in terms of sequential compositions (Theorem 3 of [6]), and the fact that the languages recognized by flat idempotent and commutative algebras are exactly those for which membership only depends on the set of node labels.
Theorem 6
is locally testable if and only if it is recognized by a homomorphism
where is flat idempotent and commutative, and where is the projection homomorphism from the wreath product onto its righthand factor,
The following lemma, a critical combinatorial fact in this study, is adapted from another argument in Place and Segoufin [14]. In many respects, it plays the role of the ‘Delay Theorem’ (Tilson [19]) in analogous work on languages of words.
Lemma 7
Let be a finite forest algebra, with idempotent and commutative, and let be a homomorphism. Let and let Then the following properties hold:

If with then there exist such that and

If with then there exist with and
The proof is given in the appendix.
For local testability, this implies the following:
Theorem 8
If is locally testable, then it is locally testable.
Proof
By hypothesis, is locally testable for some Let By Theorems 6 and 1, divides a flat idempotent and commutative forest algebra. This implies, by Theorem 5, that is idempotent and commutative, and consequently its homomorphic image is idempotent and commutative. Thus Lemma 7 applies. We will use this lemma to show that satisfies the three conditions in Theorem 5, and thus is locally testable by Theorems 6. We have already observed that is idempotent and commutative, and this gives us horizontal idempotence of for all values of
To establish the horizontal absorption condition, let with We need to show, for all that —this is precisely what it means for the two halfarrows on the two sides of the horizontal absorption identity to be equal in the derived category. If we take and as in the Lemma, then since the horizontal absorption identity is assumed to hold in we have Since and we obtain as required. The loop removal condition is established in the same way, using the other part of Lemma 7.
Theorem 9
It is decidable whether a given regular forest language (given, say, by an automaton that recognizes it) is locally testable.
Comments
There are no comments yet.