A Complexity Approach to Tree Algebras: the Bounded Case

In this paper, we initiate a study of the expressive power of tree algebras, and more generally infinitely sorted algebras, based on their asymptotic complexity. We provide a characterization of the expressiveness of tree algebras of bounded complexity. Tree algebras in many of their forms, such as clones, hyperclones, operads, etc, as well as other kind of algebras, are infinitely sorted: the carrier is a multi sorted set indexed by a parameter that can be interpreted as the number of variables or hole types. Finite such algebras—meaning when all sorts are finite—can be classified depending on the asymptotic size of the carrier sets as a function of the parameter, that we call the complexity of the algebra. This naturally defines the notions of algebras of bounded, linear, polynomial, exponential or doubly exponential complexity. . . We initiate in this work a program of analysis of the complexity of infinitely sorted algebras. Our main result precisely characterizes the tree algebras of bounded complexity based on the languages that they recognize as Boolean closures of simple languages. Along the way, we prove that such algebras that are syntactic (minimal for a language) are exactly those in which, as soon as there are sufficiently many variables, the elements are invariant under permutation of the variables.


Introduction
Infinitely sorted algebras occur naturally in many contexts of language theory, graph theory or logic.A typical example is the case of tree algebras (such as clones, hyperclones, operads): plugging a subtree into another one requires a mechanism for identifying the leaf/leaves in which the substitution has to be performed.Notions such as variables, hole types, or colors are used for that.Another example is the one of graphs (HR-and VR-algebras [?]) in which basic operations (a) glue graphs together using a set of colors (sometimes called ports) for identifying the glue-points, or (b) add all possible edges between vertices of fixed given colors.
In these examples, the algebras are naturally sliced into infinitely many sorts based on the number of variables/hole types/colors that are used simultaneously.However, a technical difficulty arises immediately when using such algebras.Even when all sorts are finite (what we call a finite algebra), these algebras are not really finite due to the infinite number of sorts.This forbids, for instance, to entirely and explicitly describe the whole algebra in a finite way.And this is of course a problem for describing and using these algebras in an algorithm.Indeed, a concrete algorithm can only maintain a subset of the Finite algebras can naturally be classified using this map c.Simple classes are then algebras of bounded complexity if c A is bounded, of polynomial complexity if c A is bounded from above by some polynomial in n, etc.
Other interesting complexity classes can be defined using orbits.Indeed, in all of the mentioned examples, there is a natural operation that performs a renaming of the variables/hole types/colors.This renaming is parameterized by a bijection over variables/hole types/colors, and this permutation acts on the corresponding sort.Said differently, in all examples, there is an action of the symmetric group over n elements, Sym(n), over A n .It is thus natural to consider the orbit complexity map c • A as follows and define accordingly what are finite algebras of bounded orbit complexity, or polynomial orbit complexity, etc.

Related works
As mentioned above, there is a long history of understanding the expressive power of regular languages of words based on algebraic properties.The first work in this direction [10], characterizing star-free languages, intiated a long list of deep results.It was natural to extend this approach to trees.Here, the notion of algebra was less obvious, and several definitions have been used.Some algebras for trees are one sorted, such as deterministic bottom up automata (that can be seen as algebras).Some are two sorted, such as forest algebras [7].Some others, such as preclones [8], have infinitely many sorts.Characterizations of classes have been obtained using these approaches [5,9,6], but remain very limited due to difficulties inherent to the tree case.The study of algebras for infinite

126:3
trees renewed the interest in these questions [1,2,3].This line of works also highlights the difficulty to work with tree algebras, and the poor understanding we have so far of the mechanism of recognition for infinite objects.

Contributions of the paper
In this paper we establish some first results in this complexity analysis of infinitely sorted algebras, for the simplest complexity class, bounded complexity.
Our results are of two kinds: a characterization of algebras of bounded complexity; and a characterization of the languages that they recognize, meaning we give a syntactic description of the properties that can be recognized by algebras in this class.We more particularly prove: A characterization of syntactic finite tree algebras of bounded complexity as those syntactic algebras in which, as soon as there are sufficiently many variables, the elements are invariant under permutation of variables.See Theorem 5.
A characterization of languages recognized by finite tree algebras of bounded complexity as Boolean closures of simple languages.See Theorem 14.The second result actually uses the first as a building block in its proof.

Structure of the paper
In Section 2, we recall some classical definitions, and introduce our notions of algebras.In Section 3, we look at the permutations of variables in finite tree algebras, and prove Theorem 5.In Section 4, we study in more depth the bounded complexity case for finite tree algebras, and establish our main result, Theorem 14. Section 5 is our conclusion.

Definitions
We denote by N the set of all non-negative integers.Given n ∈ N, we write [n] = {0, 1, ..., n − 1}.The symmetric group (resp.alternating group) over [n] is denoted Sym(n) (resp.Alt(n)), the symmetric group of any set X is denoted Sym(X).We denote by A c the complement of a set A.
We fix a finite ranked alphabet Σ; the arity of a symbol a ∈ Σ is denoted ar(a).It is a constant if ar(a) = 0, and is unary if ar(a) = 1.For k ∈ N, we set Σ k = {a ∈ Σ | ar(a) = k}.A * is the set of finite words over A, and A + = A * \ {ε}.

Trees
In this section, we introduce notions and notations for trees.
We fix a countable set of variables.Given a finite set of variables X, a Σ, X-tree is, informally, a tree in which nodes are labelled by elements of Σ and leaves also possibly by variables.All variables have to appear at least once.Formally, a Σ, X-tree is a partial map t : N * → Σ ⊎ X such that dom(t) is non-empty and prefix-closed, and furthermore: For all u ∈ dom(t) there exists n ∈ N such that {i | ui ∈ dom(t)} = [n], and either t(u) ∈ Σ n (symbol node), or t(u) ∈ X and n = 0 (variable node).Note that a variable node is always a leaf.All variables from X appear in t, i.e. for all x ∈ X, t(u) = x for some u ∈ dom(t).The root is not a variable, i.e. t(ε) ̸ ∈ X. Σ, ∅-trees are simply called Σ-trees.The elements in dom(t) are called nodes.The prefix relation over nodes is called the ancestor relation.The node ε is called the root of the tree.The tree t is finite if it has finitely many nodes.A branch of a tree t is a maximal set of nodes ordered under the ancestor relation.Let FiniteTrees(Σ, X) bet the set of finite Σ, X-trees, for all finite set of variables X.

Building trees
We introduce now some operations on trees.See Fig. 1. a(x 0 , . . ., x n−1 ), for x 0 , . . ., x n−1 variables and a ∈ Σ n , denotes the Σ, {x 0 , . . ., x n−1 }-tree consisting of a root labelled a, and children 0, . . ., n−1 labelled with variables x 0 , . . ., x n−1 respectively.s • x t, for two trees s ∈ FiniteTrees(Σ, X), t ∈ FiniteTrees(Σ, Y ) and a variable x ∈ X, is the Σ, (X \ {x}) ∪ Y -tree s in which t is substituted for every occurrences of the variable x. σ(t), for a tree t ∈ FiniteTrees(Σ, X) and σ : X → Y a surjective map, is the Σ, Y -tree obtained as t in which variable σ(x) has been substituted to x for all x ∈ X.Note that denotes the tree of sort X \ {x 0 , . . ., x n−1 } ∪ i Y i obtained from t by simultaneously substituting the tree t i for the variable x i for all i ∈ [n], where t is a tree of sort X, x 0 , . . ., x n−1 ∈ X, and t 0 , . . ., t n−1 are trees of sort Note that this operation is equivalent to a combination of the previous ones.a(t 0 , ..., t n−1 ), for a ∈ Σ n , denotes the tree of root a and children t 0 , . . ., t n−1 at respective positions 0, . . ., n − 1.Again, this operation is equivalent to a combination of the previous ones.
▶ Lemma 1.All finite trees can be obtained from the a(x 0 , . . ., x n−1 )'s using the operation •.
Expressions denoting finite trees For X a finite set of variables, an F T Σ -expression of sort X (over the alphabet Σ) is an expression built inductively as follows: a(x 0 , . . ., x n−1 ) is an F T Σ -expression of sort {x 0 , . . ., x n−1 } for every symbol a ∈ Σ n , S • x T is an F T Σ -expression of sort X \ {x} ∪ Y for all F T Σ -expressions S of sort X, all F T Σ -expressions T of sort Y , and all variables x ∈ X (substitution), σ(T ) is an F T Σ -expression of sort Y for all F T Σ -expressions T of sort X, and surjective map σ : X → Y (renaming).For an F T Σ -expression T of sort X, [[T ]] denotes its evaluation into a finite Σ, X-tree using the operations of substitution and renaming.

Contexts
We define now contexts, which are terms with a specific leaf called the hole.Since we work in a multi-sorted algebra, the hole itself has a sort.Essentially, to a hole of sort X will be substituted a term of sort X. Formally, for fixed finite set of variables Y , an context of sort X with hole of sort Y (or simply a F T Σ -context) is defined inductively as an expression of sort X, using the extra construction □ Y (the hole of sort Y ) which is a context of sort Y with hole of sort Y .This new construction may appear multiple times in a context but has to appear at least once.
For C a context of sort X with hole of sort Y , [[C]] : FiniteTrees(Σ, Y ) → FiniteTrees(Σ, X) is the function which to a tree of sort Y t associates the tree of sort X obtained by evaluating the operations as above, interpreting □ Y as t.

Finite tree algebras
Our notion of tree algebra is the natural notion associated to finite trees equipped with the above operations.We give here a more formal definition, though the detail of identities is 126:5 more for reference.What matters is that it is defined such that the free algebra coincides with finite trees.
An F T Σ -algebra A consists of an infinite collection of carrier sets A X indexed by finite sets of variables X, together with operations: for all finite sets of variables X, Y and x ∈ X, that satisfy the expected identities, i.e. the ones guaranteeing that several ways to describe the same tree yield the same evaluation in the algebra.Formally, for all s, t, u that belong to In practice, we shall not explicitly use these identities, and simply write two elements of the algebra equal as soon as they obviously come from expressions denoting the same trees.
A morphism of F T Σ -algebras from A to B is a family of maps α X : A X → B X for all finite sets of variables X which preserves all operations, i.e. α Y (σ The FiniteTrees(Σ, X) sets equipped with the operations of substitution and renaming form an F T Σ -algebra (it is the free F T Σ -algebra generated by ∅).For A a F T Σ -algebra, its associated evaluation morphism is the unique morphism from FiniteTrees(Σ) to A.
A congruence ∼ over a F T Σ -algebra A is a family ∼ of equivalence relations over the A X 's (each denoted ∼) such that, for any a From such a congruence, one can define the quotient algebra A/ ∼ in the natural way.

Compact presentation, and complexity
Our definition of algebras does not so far match the one used in the introduction.In the introduction, algebras were considered as using natural numbers as sorts, while here, our sorts are indexed by finite sets.What would be these algebras should be pretty clear.The presentation used here is simpler to present and to use.It is an exercise to show the equivalence.
What matters is that in what follows, a F T Σ -algebra is of bounded complexity if there exists a bound K such that |A X | ⩽ K for all finite sets of variables X.

Languages and syntactic algebras
A language of finite Σ-trees L is a set of Σ-trees.It is recognized by an F T Σ -algebra A if there is a set P ⊆ A ∅ such that L = α −1 (P ) in which α is the evaluation morphism of A.
The syntactic congruence ∼ L of a language L of finite Σ-trees is defined in the following way s ∼ L t for s, t finite Σ-trees if, for all The language of all finite trees in which the symbol a appears has for syntactic F T Σ -algebra the algebra with sorts A X = {0, 1}, for all finite set of variables X, and whose evaluation morphism is such that α(t) = 1 if and only if t is a tree in which a appears.

Tree automata
A tree automaton B = (Q, I, (δ a ) a∈Σ ) over Σ has a finite set Q of states, a set of accepting states I ⊆ Q and a transition relation δ a ⊆ Q × Q ar(a) for every symbol a ∈ Σ.A run of B over a finite tree t is a mapping ρ : dom(t) → Q such that, for any vertex u ∈ dom(t) with t(u) = a ∈ Σ, (ρ(u), (ρ(u0), ..., ρ(u(ar(a) − 1)))) ∈ δ a .A run is accepting if ρ(ε) ∈ I.A language L of finite trees is called regular if it is recognized by a tree automaton B, meaning the trees in L are exactly those for which there is an accepting run in B.
Ex. 3 shows the translation from tree automata to tree algebra.
▶ Example 3 (Automaton algebra).Consider a regular language L of finite trees recognized by the tree automaton B = (Q, q 0 , (δ a ) a∈Σ ).Consider some finite set of variables X.An X-run profile is a tuple τ ∈ Q × P(Q) X .For a Σ, X-tree t, τ = (p, (U x ) x∈X ) is a run profile over t if there exists a run ρ of the automaton over Q such that ρ(ε) = p and for all variables x ∈ X, U x is the set of states assumed by ρ at leaves labelled x.We define a tree algebra A that has as elements of sort X sets of X-run profiles.The definition of the operations is natural, and is such that the image of a Σ, X-tree t under the evaluation morphism yields the set of run profiles over t.It naturally recognizes the language L.
Note that this definition yields an algebra of doubly exponential complexity (and hence, this is an upper bound for regular languages).Of course, in practice, one can restrict the algebra to the reachable elements, and this may dramatically reduce the complexity.
The converse translation is also true, yielding the following classical result (it is for instance proved for preclones in [8]).

▶ Proposition 4.
A finite tree language is regular if and only if it is recognized by a finite F T Σ -algebra.

Fundamental results on permutations in tree algebras
This section studies some fundamental phenomena concerning the effect of variable permutations on tree algebras.Its main objective is to prove Theorem 5.It is a characterization of syntactic F T Σ -algebras of bounded complexity which turns out to be key in the subsequent developments.Beyond that, several intermediate results in this section may also be relevant in the analysis of algebras of unbounded complexity.In this section, given an F T Σ -algebra A, φ A X : Sym(X) → Sym(A X ) (or simply φ X when there is no ambiguity) denotes the group morphism σ → σ A , for all finite sets of variables X.

▶ Theorem 5. A finite syntactic F T Σ -algebra A is of bounded complexity if and only for all sufficiently large finite set of variables X, ker(φ
The meaning of ker(φ X ) = Sym(X) is that permuting the variables has no effect on A X (i.e.σ A = Id A X for every σ ∈ Sym(X)).We fix from now the F T Σ -algebra A.
Our first step is to define a relation ≡ A which we show to be a congruence equivalent to the syntactic one (Proposition 6).We set for all a ∈ A X : in which X = {x 0 , ..., x n−1 }.Define now a ≡ A a ′ , for a, a ′ ∈ A X to hold if ⟨a⟩ = ⟨a ′ ⟩ (note that it does not depend on the numbering of variables).
By a simple counting argument, we obtain the following corollary.
Using Propositions 6 and 8, we prove that, whenever X is large enough, ker(φ X ) may only be Sym(X) or {Id X }.

▶ Proposition 9.
Let A be a finite syntactic F T Σ -algebra.There is an integer M such that, for all X of cardinal at least M , either ker(φ X ) = Sym(X) or ker(φ X ) = {Id X }.
Proof.Let M = max(5, |A ∅ | + 1).Let X be a finite set of variables such that |X| ≥ M .By Prop.8, ker(φ X ) is either Sym(X), Alt(X) or {Id X }.Assume, for the sake of contradiction, that ker(φ X ) = Alt(X).This implies that the image of φ X has exactly 2 elements: permutations of signature +1 are sent to Id A X , and those of signature −1 are sent to another (distinct) element.Let us call τ this permutation of A X .
Let t ∈ Sym(X) be a transposition, let us show that t A = Id A X .According to Proposition 6, we only need to prove that ⟨t A (a)⟩ = ⟨a⟩ for all a Since this holds for all a ∈ A X , t A = Id A X .This is a contradiction.◀ According to Proposition 9, for X large enough, ker(φ X ) may only be Sym(X) or {Id X }.The next result shows that one of these two cases in fact holds for all sufficiently large X. ▶ Proposition 10.Let A be a finite syntactic F T Σ -algebra.There is an integer M such that, either ker(φ X ) = Sym(X) for all X with |X| ≥ M , or ker(φ X ) = {Id X } for all X with |X| ≥ M .By simple counting, if ker(φ X ) = {Id X }, then |Sym(A X )| ≥ |Sym(X)| and hence |A X | ≥ |X|.This yields the following corollary, which is one direction of Theorem 5.

▶ Corollary 11. Let A be a syntactic F T Σ -algebra of bounded complexity. There is an integer
M such that, for every X with |X| ≥ M , ker(φ X ) = Sym(X).
Heading toward the converse implication, we now show that when ker(φ X ) = Sym(X), then ⟨a⟩ can only take very simple forms.Indeed, for σ that maps y to z and leaves all other variables unchanged, we have in which d, d ′ ∈ A ∅ and h ∈ (A ∅ ) X\{x,y,z} , from which the claim (⋆⋆) follows.At this point, (⋆⋆) allows to change the value b(z) to another providing that its values before and after the change appear elsewhere in b, and (⋆) allows to permute all the b(x)'s.Hence, by iterative applications of them, we obtain of (⋆) and (⋆⋆), ⟨a⟩(b) = ⟨a⟩(b ′ ) providing that b and b ′ have same image.◀ As a consequence of the above lemma, assuming that ker(φ X ) = Sym(X) for all sufficiently large X, we can bound the number of possible elements in A X .This yields Corollary 13 below, which is the second direction of Theorem 5.

▶ Corollary 13.
A finite syntactic F T Σ -algebra such that ker(φ X ) = Sym(X) for all sufficiently large set of variables X, has bounded complexity.
Proof.By Lemma 12, we know that, for a ∈ A X , ⟨a⟩ must be chosen in a set of at most this is an upper bound on the number of elements of A X that does not depend on |X| for X sufficiently large.◀

Finite tree algebras of bounded complexity
The main theorem of this section, Theorem 14, provides a characterization of the languages recognized by F T Σ -algebras of bounded complexity as Boolean combinations of simple languages.We proceed as follows.We state Theorem 14 and establish its easier parts in Section 4.1.In Section 4.2, we establish Lemma 22 which essentially amounts to the result for trees with 'sufficiently many branches', which is the hardest part of the proof of Theorem 14.

Statement of the result
The main theorem of this section, Theorem 14, requires some preliminary definitions.
For a given finite tree t, we associate to it some data (see Figure 2 for an illustration).Let n, be the depth of the first node labelled with a non unary symbol; formally, n is the least natural number such that ar(t(0 n )) ̸ = 1.The unary prefix of t, denoted upref(t) is the word t(01 )...t(0 n−1 ) ∈ Σ * 1 .The first non-unary symbol of t is t(0 n ), which we denote by fnu(t).The set of symbols in t is symb(t) = {t(u) | u ∈ dom(t)} and its set of post-branching symbols is, if it exists, pbsymb(t ▶ Theorem 14.For a language of finite trees, the following properties are equivalent: 1. being recognized by a F T Σ -algebra of bounded complexity, 2. having its syntactic F T Σ -algebra of bounded complexity,

being equal to a Boolean combination of languages of the following kinds:
a.The language of finite trees with unary prefix in a given regular language of words L ⊆ Σ * 1 .b.The language of finite trees with first non-unary symbol a for a fixed non-unary symbol a. c.The language of finite trees with post-branching symbols B, for B ⊆ Σ. d.A regular language K of bounded branching, meaning that there exists a natural number k such that all trees t ∈ K have at most k branches.Let us establish the easiest parts of this statement.To start with, it is a generic factgeneric meaning independent of the type of algebras under consideration-that the syntactic F T Σ -algebra of a language divides 1 any F T Σ -algebra that recognizes the same language.Hence, each sort of the syntactic F T Σ -algebra has a lesser size than the same sort in any other F T Σ -algebra recognizing the same language.Thus 1 implies 2.
We now prove the second easiest implication, 3 implies 1.For this, it is sufficient to prove that the languages of kind 3a to 3d are recognized by F T Σ -algebras of bounded complexity, and that F T Σ -algebras of bounded complexity are closed under all the Boolean connectives.This is stated in Lemmas 15 to 17 below.All are straightforward.
Given a regular language of words L ⊆ Σ * 1 , a non unary symbol a and a set B ⊆ Σ of symbols, let us denote by UPref(L), FNU(a) and PBSymb(B), respectively the language of trees with unary prefix in L, the language of trees with first non-unary symbol c, and the language of trees t with pbsymb(t) = B. Lemma 15 shows that these languages are recognized by algebras of bounded complexity, i.e. it treats Cases 3a to 3c.
▶ Lemma 15.Given a regular language of words L, a non unary symbol a ∈ Σ ̸ =1 and a set of symbols B ⊆ Σ, the languages UPref(L), FNU(a) and PBSymb(B) are recognized by F T Σ -algebras of bounded complexity.
Proof.For space considerations, we only detail the case of UPref(L), which is arguably the hardest one.Let φ : Σ * 1 → M be a monoid morphism that recognizes L, meaning there exists P ⊆ M such that φ −1 (P ) = L. Define on FiniteTrees(Σ) the relation ∼ by s ∼ t if φ(upref(s)) = φ(upref(t)), this relation is easily seen to be a congruence, and UPref(L) is obviously recognized by the quotient algebra FiniteTrees(Σ)/ ∼.Because ∼ only has |M | equivalence classes in every sort, we just described a F T Σ -algebra recognizing UPref(L) of bounded complexity.◀ Next we deal with the languages that have bounded branching, i.e.Case 3d.It is done with a modification of the automaton algebra of Example 3 so that it is also able to count the number of branches of a tree up to the bound k.The key observation is that a tree with k different variables must have at least k branches.This means that the sort A X where X is a finite set of variables such that |X| > k can be collapsed to one element only.Note that this is tightly related to our assumption that every variable from X must occur in all Σ, X-trees.We do not give any further detail here.
▶ Lemma 16.The regular languages of finite trees of bounded branching are recognized by F T Σ -algebras of bounded complexity.
Finally, using standard constructions, we can provide the last ingredient of the proof that 3 implies 1 in Theorem 14: ▶ Lemma 17.The languages recognized by F T Σ -algebras of bounded complexity are closed under Boolean operations.

Trees with many branches
In this section, we fill the missing gap in the proof of Theorem 14, namely the implication from 2 to 3.
Given two finite trees s and t and a F T Σ -algebra A with evaluation morphism α, let s ≃ A t hold if α(s) = α(t).We omit the sub-and superscript A when it is clear from the context.Our goal is to prove Lemma 22 which states that if A is of bounded complexity, then for all trees s and t with sufficiently many branches, if upref(s) = upref(t), fnu(s) = fnu(t) and pbsymb(s) = pbsymb(t), then s ≃ A t Given an Σ, X ⊎ {γ 1 , . . ., γ n }-tree t in which the γ i 's only appear once, and given trees t 1 ,. . ., t n , we denote t(t 1 , . . ., t n ) the tree t[γ 1 ← t 1 , . . ., γ n ← t n ].We will use these distinguished variables γ i 's in this section.
The results we prove throughout this section are consequences of the properties of permutations in F T Σ -algebras of bounded complexity and, more particularly, consequences of Corollary 11.Our first objective is to show that if there are sufficiently many branches in a tree, it is possible to exchange any two subtrees which are not related by the ancestor relationwithout changing evaluation in the algebra (see Lemma 20).Lemma 18 is a first step towards this goal: it says that, in a syntactic algebra, whenever a tree has many branches, it is possible to exchange some of its subtrees.More precisely: ▶ Lemma 18.For every syntactic F T Σ -algebras A of bounded complexity, there exists an integer N 0 such that, for all finite trees t(t 1 , t 2 ) such that t has at least N 0 branches, Proof.Let N 0 be the integer introduced in Corollary 11.Assume that t is a Σ, X ⊎ {γ 1 , γ 2 }tree that has at least N 0 branches.Let s be a Σ, X ⊎ {γ 1 , γ 2 } ⊎ {x 1 , ..., x N0−2 }-tree and let 126:11 s 0 , ..., s N0−2 be trees such that s[x 1 ← s 1 , ..., x N0−2 ← s N0−2 ] = t.As such, s has at least N 0 variables.Hence by Corollary 11, t ′ ≃ A σ A (t ′ ) in which σ is the transposition of γ 1 and γ 2 .We now compute: Here, notice the similarity between this proof and the observations we made in the proof of Lemma 12: this is the exact same argument, we just used the fact that a tree with many branches can always be obtained from some tree with many variables.Taking this similarity further, we may apply the other arguments we used in the proof of Lemma 12 to prove Lemma 19, and change the number of occurrences of plugged subtrees.
▶ Lemma 19.For every syntactic F T Σ -algebras A of bounded complexity, there exists an integer N 1 such that, for any finite tree t(t 1 , t 2 , t 2 ) such that t has at least N 1 branches, The next step is to establish Lemma 20, which is very similar to the previous Lemma 18 but for the fact that it is sufficient to have many branches in t(t 1 , t 2 ) instead of many branches in t to be allowed to swap t 1 and t 2 .It is obtained by repeated and careful applications of Lemma 18.
▶ Lemma 20.For all syntactic F T Σ -algebras A of bounded complexity, there is an integer N 3 such that, for any finite tree t(t 1 , t 2 ) where t(t 1 , t 2 ) has at least N 3 branches, t(t 1 , t 2 ) ≃ A t(t 2 , t 1 ) .
As such, we may exchange two subtrees of a tree with many branches without changing evaluation in the algebra.We will use this result to prove that two trees with the same unary prefix, first non-unary symbol and set of post-branching symbols are not distinguished by the algebra (Lemma 22).
Using Lemmas 19 and 20, we first establish Lemma 21 that allows in some situation to make a symbol 'appear' or 'disappear'.
▶ Lemma 21.For all syntactic F T Σ -algebras A of bounded complexity, there exists an integer N 4 that has the following property.For all finite trees s(γ 1 , γ 2 ), all finite trees t with at least N 4 branches, and all symbols c, d ∈ symb(t), c constant, In combination with Lemmas 19 and 20, it means that under the same assumptions, s(t, c) ≃ A s(t, t ′ ) for all finite trees t ′ that use only symbols appearing in t.This building block, used iteratively, allows to shuffle and change the number of occurrences of all symbols that appear below a first non-unary symbol as soon as there are sufficiently many branches.This is our key Lemma 22.
▶ Lemma 22.Let A be a syntactic F T Σ -algebra of bounded complexity.There is an integer N , such that, for all finite trees s and t, both of which have at least N branches, if upref(s) = upref(t), fnu(s) = fnu(t) and pbsymb(t) = pbsymb(t), then t ≃ A s.
Putting everything together we establish the last implication in Theorem 14: I C A L P 2 0 2 1 126:12 A Complexity Approach to Tree Algebras: the Bounded Case ▶ Lemma 23.A language of finite trees L recognized by a F T Σ -algebra of bounded complexity can be written as a Boolean combination of languages of kinds 3a-3d in Theorem 14.
The idea behind this last proof is as follows.Given a regular word language K ⊆ Σ * 1 , a non-unary symbol a, and a set of symbols B, let L K,a,B be the set of trees t such that upref(t) ∈ K, fnu(t) = a and pbsymb(t) = B.Such languages can be written as the intersection of UPref(K), FNU(a) and PBSymb(B) which are of the kinds 3a-3d in Theorem 14.Let N be the value from Lemma 22.
In a first step, we construct finitely many tuples (K i , a i , B i ), such that L and i L Ki,ai,Bi coincide over all trees with sufficiently many branches.For this, for all t ∈ L with at least N branches, consider the least language K t ⊆ Σ * 1 recognized by A {x} such that upref(t) ∈ K t (in which upref(t) is recognized by A {x} when seen as a tree made of unary symbols and the variable x).The language K t is regular and has the property that exchanging the unary prefix of t for any other word in K t leaves the tree in L. We use as the (K i , a i , B i )'s all the tuples (K t , fnu(t), pbsymb(t)) for t ranging over the trees in L with at least N branches (note that since all the K t 's are recognized by A {x} , there are finitely many of them).One can show using Lemma 22 that, as claimed, L and i L Ki,ai,Bi coincide over all trees with at least N branches.In a second step one defines L i to be the set of trees in L Ki,ai,Bi that have at least N branches.Let also L ′ be L restricted to trees with less than N branches.One gets and this is by construction a Boolean combination of languages of the kinds 3a-3d.
This concludes our proof of Lemma 23, and hence Theorem 14.

Conclusion
In this paper, we initiated a complexity analysis of the expressiveness of infinitely sorted algebras.Our main result gives a descriptive characterization of the languages of finite trees recognized by algebras of bounded complexity, Theorem 14.In this work, we made a design choice in the definition of tree algebras.Indeed, we require that in a tree of sort X, every variable occurs at least once.Removing this assumption would change our bounded complexity characterization result, yielding only Boolean combinations of languages of the form "the root symbol is a".Another possible variant is to allow trees restricted to a single variable: in this case our results remain unchanged.

Extensions to infinite trees
We also obtained a similar characterization for algebras for infinite trees.We did not include it in this short abstract for space considerations (this was in fact our original question).In this case, the algebras have to include an extra iterating construct that allows to build all infinite regular trees (i.e.unfolding of finite graphs).By Rabin's lemma, regular languages of infinite trees are entirely characterized by the regular trees they contain, and as a consequence such algebras describe regular languages of infinite trees.Our result characterizes such algebras of bounded complexity along the same line as Theorem 14.We show that over infinite trees, such algebras can express two extra things (1) the existence of subtrees of unary shape that belong to a prescribed prefix-invariant regular language of infinite words, and (2) the existence of subtrees in which a set of letters C appears densely, i.e. every letter in C appears in every subtree.

Future work
The next simplest cases seem to be the algebras of polynomial complexity and of bounded orbit complexity.An example in this case is the language of Σ-trees such

1 126: 6 A
The quotient algebra FiniteTrees(Σ)/ ∼ L is called the syntactic algebra of L. I C A L P 2 0 2 Complexity Approach to Tree Algebras: the Bounded Case ▶ Example 2.

Figure 2 A
Figure 2 A finite tree t and its associated data.