Gröbner–Shirshov Bases Theory for Trialgebras

: We establish a method of Gröbner–Shirshov bases for trialgebras and show that there is a unique reduced Gröbner–Shirshov basis for every ideal of a free trialgebra. As applications, we give a method for the construction of normal forms of elements of an arbitrary trisemigroup, in particular, A.V. Zhuchok’s (2019) normal forms of the free commutative trisemigroups are rediscovered and some normal forms of the free abelian trisemigroups are ﬁrst constructed. Moreover, the Gelfand– Kirillov dimension of ﬁnitely generated free commutative trialgebra and free abelian trialgebra are calculated, respectively.

The key in establishing Gröbner-Shirshov bases theory for certain algebras is to establish the "Composition-Diamond lemma (CD lemma)" for such algebras. The name "CD lemma" combines the Neuman Diamond Lemma [28], the Shirshov Composition Lemma [17], and the Bergman Diamond Lemma [29].
Trialgebras are generalizations of dialgebras and associative algebras, so it is natural to ask what kind of properties of associative algebras and dialgebras remain valid for trialgebras. For instance, CD lemma for dialgebras has been established by Bokut, Chen, and Liu in 2010 [12] and by Zhang and Chen in 2017 [13]. Thus, we shall establish the CD lemma for trialgebras and thus offer a way of constructing normal forms of elements of an arbitrary trisemigroup. Moreover, we prove that every ideal of a free trialgebra has a unique reduced Gröbner-Shirshov basis. The method we used is similar to what was done for dialgebras in [12,13]. However, the extension is not obvious because more operations are involved and the difficulty increases. First, we must ensure that a well ordering on monomials is more or less compatible with trialgebraic operations. Second, a trialgebra has one more operation than dialgebra, so difficulty in the proof of some critical lemmas increases naturally. These reasons make us encounter more difficulties in the process of proving CD lemma for the trialgebra case.
The paper is organized as follows: in Section 2, we first recall the linear basis constructed by Loday and Ronco [1] of the free trialgebra. In Section 3, we elaborate the method of Gröbner-Shirshov bases for trialgebras. We show that, for an arbitrary monomial-centers ordering on the linear basis, there is a unique reduced Gröbner-Shirshov basis for every ideal of free trialgebra. In Section 4, we give a detailed method to construct a set of normal form for an arbitrary trisemigroup; in particular, we give another approach to normal forms of elements of a free commutative trisemigroup that is constructed by [2]. Moreover, we apply the method of Gröbner-Shirshov bases for certain trialgebras and trisemigroups to obtain normal forms and their Gelfand-Kirillov dimensions.

Preliminaries
Throughout the paper, we fix a field k. For a nonempty set X, we denote by X + the free semigroup generated by X, which consists of all associative words on X. Then, we denote by X * = X + ∪ {ε} the free monoid generated by X, where ε is the empty word. For every u = x 1 x 2 ...x n ∈ X + , where x 1 , ..., x n ∈ X, we define the length (u) of u to be n. For convenience, we define (ε) = 0. Definition 1 ([1]). An associative trialgebra (resp. trisemigroup), trialgebra for short, is a k-module T (resp. a set T) equipped with three binary associative operations: called left, called right, and ⊥ called middle, satisfying the following eight identities: for all a, b, c ∈ T.

Definition 2.
For an arbitrary set X, the triwords over X are defined inductively as follows: (i) For every x ∈ X, the expression (x) is a triword over X of length 1; (ii) For all triwords (v) and (w) of lengths n and m, respectively, all monomials ((v) (w)), ((v) (w)) and ((v) ⊥ (w)) are triwords over X of length n + m.
Recall that, for every trialgebra T, for all b 1 , ..., b m ∈ T, every parenthesizing of gives the same element in T [1], and we denote such an element by [b 1 ...b m ] U , where U is defined to be the set {m i | 1 ≤ i ≤ r}. In particular, assume that T is the free trialgebra generated by X. Then, the triword (with an arbitrary bracketing way) over X can be determined by the sequence u := x i 1 . . . x i mr +tr and the set of index Therefore, we call such a triword a normal triword over X and denote it by [u] U , and call x m 1 , x m 2 , ..., x m r the middle entries of [u] U . In case we would like to emphasize the middle entries, we also denote We call u the associative word of the triword [u] U . Let P (N) be the power set of the positive integers N. We define to be the set of all normal triwords on X.
In [1], Loday and Ronco constructed a linear basis for a one-generated free trialgebra, which can be easily generalized for the construction of a linear basis for an arbitrary free trialgebra, see also [3].

Proposition 1 ([1]
). The set [X + ] P (N) of all normal triwords over X forms a linear basis of the free trialgebra generated by X.
For every integer k ∈ Z and ∅ = U ∈ P (N), we define and define [ε] ∅ = ε. For convenience, when we write a set U = {m 1 , m 2 , ..., m r } ∈ P (N), we always assume m 1 < m 2 < ... < m r . Moreover, the cardinality of the set U is denoted by |U|, and we simply denote Let Tri X be the free trialgebra generated by X. Then, by [1], Tri X is the free k-module with a k-basis [X + ] P (N) and for all [u] Moreover, with the above products, ([X + ] P (N) , , , ⊥) forms the free trisemigroup generated by X [3]. Though [ε] ∅ is not an element in [X + ] P (N) , we still extend the operations and involving [ε] ∅ to make formulas in the sequel simplified. More precisely, we extend them with the following convention: The following lemma shows that every triword can be written as a leftnormed product of triwords.

Composition-Diamond Lemma for Trialgebras
In this section, we establish a method of Gröbner-Shirshov bases for trialgebras. By Proposition 1, [X + ] P (N) forms a linear basis of the free trialgebra Tri X generated by X.
We first introduce a good ordering on X + . Let X be a well-ordered set. We define the deg-lex ordering on X + as the following: for A well ordering > on X + is called monomial if, for all u, v, w ∈ X + , we have Clearly, the above deg-lex ordering on X + is monomial. We proceed to define a well ordering on P (N)\{∅}. For all U = {m 1 , ..., m r } and V = {n 1 , ..., n t } ∈ P (N)\{∅}, we define U > V if (r, m 1 , ..., m r ) > (t, n 1 , ..., n t ) lexicographically.
Fix a monomial ordering > on X + . Then, we define an order on [X + ] P (N) as follows.
where we compare u and v by the fixed ordering on X + . This order is called the monomial-centers ordering.
Though we use the same notation > for orderings on X + , P (N)\{∅} and [X + ] P (N) , no confusion will arise because the monomials under consideration are always clear. It is clear that a monomial-centers ordering is a well ordering on [X + ] P (N) . Finally, if > is the deg-lex ordering on X + , then we call the ordering defined by (2) the deg-lex-centers ordering on [X + ] P (N) . For From now on, we always assume that > is a monomial-centers ordering > on [X + ] P (N) . We observe that the monomial-centers ordering > on [X + ] P (N) is monomial in the following sense: For  Now, we begin to study elements of an ideal generated by a subset of Tri X . We begin with the following notation. For every [u] U = [x i 1 ...x i t ...x i n ] U ∈ [X + ] P (N) such that x i 1 , . . . , x i n lie in X, by Lemma 1, we may assume that for every polynomial f ∈ Tri X , we define for some δ 1 , δ 2 ∈ { , , ⊥} and a, b ∈ X * . In (4), by convention, we always assume B be a normal S-polynomial and assume that s is not strong. Then, both are normal S-polynomials if and only if δ 3 ∈ { , ⊥} and δ 4 ∈ { , ⊥}.
The following lemma follows from the definition of normal S-polynomials.
In particular, we have P(s) = U. By Lemma 2, we immediately obtain the following lemma.
The following lemma shows that the set is a linear generating set of the quotient trialgebra Tri X|S := Tri X /Id(S), where Id(S) is the ideal of Tri X generated by S. Lemma 6. Let S be a monic subset of Tri X . Then, for every nonzero polynomial h ∈ Tri X , we have In both cases, we have h 1 < h and the result follows by induction on h. Now, we shall introduce some conditions such that the set Irr(S) is a linear basis of a Tri X|S . Our first step is to introduce the notation of composition.
Definition 5. Let S be a monic subset of Tri X . For all g, h ∈ S, g = h, we define compositions as follows: (i) If g is not strong, then, for all x ∈ X and [u] (u) ∈ [X + ] P (N) , we call x g a left multiplication composition of g and call g [u] (u) a right multiplication composition of g.
(ii) Let (chd) be a normal S-polynomial and suppose that w = g = c hd for some words c, d ∈ X * .
(a) If P(g) ∈ P([chd]), then we call ) and both g and h are strong, then, for every x ∈ X, we call a left multiplicative inclusion composition of S, and call a right multiplicative inclusion composition of S.
(iii) Let (ga) be a normal g-polynomial and let (ch) be a normal h-polynomial. Suppose that there exists a word w = ga = c h for some words a, c ∈ X * such that | g| + | h| > (w).
]) = ∅ and both g and h are strong, then, for every x ∈ X, we call a left multiplicative intersection composition of S, and call a right multiplicative intersection composition of S.
For all f , f ∈ Tri X , [w] W ∈ [X + ] P (N) , we denote by A monic set S is said to be closed under left (resp. right) multiplication compositions if every left (resp. right) multiplication composition x g (resp. g [u] (u) ) of S is trivial modulo S. A monic set S is called a Gröbner-Shirshov basis in Tri X if S is closed under left and right multiplication compositions and every composition (g, h) [u] U of S is trivial modulo S.
We shall prove that, to some extent, the ordering < is compatible with the normal Spolynomials and normal triwords. Lemma 7. Let S be a monic subset of Tri X that is closed under left multiplication compositions and assume g ∈ S. If g is not strong, then, for every If s is strong, then [u] 1 [csd] L is already a normal S-polynomial, and we are done. Now, we assume that s is not strong. If c is the empty word, then we have The proof is completed.
Let g ∈ S be a polynomial that is not strong, and assume that g x is trivial modulo S for every x ∈ X. Then, the following example shows that g [u] (u) may not be trivial modulo S for some u ∈ X + .
These three polynomials are not strong. By a direct calculation, we have g where δ ∈ { , , ⊥}.
The proof for the case of [asb] C [u] U is similar to the above case. More precisely, by Lemma 1, we have where δ 2 ∈ { , ⊥} and bu = u 1 u 2 with u 1 ∈ X + , u 2 ∈ X * . Since S is closed under right multiplication compositions, the results follow by Lemmas 5 and 2. Moreover, if a sb < w, then we have a sbu < wu and ( The following corollary is useful in the sequel, which shows that, if we replace certain "subtriword" in a triword with a "small" normal S-polynomial, then we shall obtain a linear combination of "small" normal S-polynomials.

Corollary 1. Let S be a monic subset of Tri X that is closed under left and right multiplication compositions. Let
Now, we show that, if a monic set S is closed under left and right multiplication compositions, then the elements of the ideal Id(S) of Tri X can be written as linear combinations of normal S-polynomials. Corollary 2. Let S be a monic subset of Tri X that is closed under left and right multiplication compositions. Then, every S-polynomial (asb) has an expression of the form: Then, by Corollary 1, we obtain The proof is completed.

Lemma 9. Let S be a Gröbner-Shirshov basis in Tri
We have to consider the following three cases: Case 1. Without loss of generality, we can assume b 1 = a s 2 b 2 and a 2 = a 1 s 1 a; here, a may be the empty word. Assume for some δ 1 , δ 2 , δ 3 , δ 4 ∈ { , , ⊥}. If s 1 and s 2 are both strong, then all the resulting polynomials are normal S-polynomials; if neither s 1 nor s 2 are strong, then, by Remark 1, we deduce δ 3 =⊥, δ 1 ∈ { , ⊥} and δ 2 , δ 4 ∈ { , ⊥}, which implies that the above resulting S-polynomials are normal; If only one of s 1 and s 2 is not strong, say, s 1 is not strong, then, by Remark 1, we deduce δ 1 ∈ { , ⊥} and δ 2 , δ 3 , δ 4 ∈ { , ⊥}. It follows that the resulting S-polynomials are normal. In all subcases, by Lemmas 2 and 3, the leading monomials of the resulting normal S-polynomials are less than [w] W . Case 2. Without loss of generality, we may assume that s 1 = a s 2 b, a 2 = a 1 a and b 2 = bb 1 . If P(s 1 ) ∈ P([as 2 b]), then, since S is a Gröbner-Shirshov basis, we may assume If one of s 1 and s 2 is not strong, then we deduce δ 1 ∈ { , ⊥} and δ 2 ∈ { , ⊥}; and, if s 1 and s 2 are strong, then we obtain c i s i d i < s 1 for all i. In either of these subcases, by Corollary 1, we obtain , then we deduce that s 1 , s 2 are strong and (a 1 ) + (b 1 ) ≥ 1. Thus, we have either where we have a 1 = a 1 x and b 1 = yb 1 for some words a 1 , b 1 ∈ X * and x, y ∈ X. Then, by the fact that S is a Gröbner-Shirshov basis and by Lemmas 5 and 8, we deduce Case 3. Without loss of generality, we assume a 2 = a 1 a, b 1 = bb 2 and w = s 1 b = a s 2 . If P([s 1 b]) ∩ P([as 2 ]) = ∅, then, since S is a Gröbner-Shirshov basis, we may assume If one of s 1 and s 2 is not strong, then we deduce δ 1 ∈ { , ⊥} and δ 2 ∈ { , ⊥}; and, if s 1 and s 2 are strong, then we obtain c i s i d i < w for all i. In either of these subcases, by Corollary 1, we obtain If P([s 1 b]) ∩ P([as 2 ) = ∅, then we deduce that s 1 , s 2 are strong and (a 1 ) + (b 1 ) ≥ 1. Thus, we have either where we have a 1 = a 1 x, b 2 = yb 2 for some a 1 , b 2 ∈ X * and x, y ∈ X. Then, by the fact that S is a Gröbner-Shirshov basis and by Lemmas 5 and 8, we deduce The proof is completed.

Theorem 1. (Composition-Diamond lemma for trialgebras) Let > be a monomial-center ordering on [X + ] P (N)
, and let S be a monic subset of Tri X and Id(S) the ideal of Tri X generated by S. Then, the following statements are equivalent.
(i) S is a Gröbner-Shirshov basis in Tri X .
k-basis of the quotient trialgebra Tri X|S = Tri X /Id(S).
Proof. (i) ⇒ (ii) Let 0 = h ∈ Id(S). Then, by Corollary 2, we may assume Then, we may assume without loss of generality that where each [a j s j b j ] C j is a normal S-polynomial and [a j s j b j ] C j < [u 1 ] L 1 by Lemma 9. Thus, the result follows by induction hypothesis.
(ii) ⇒ (iii) By Lemma 6, the set Irr(S) is a linear generator of the space Tri X|S .
This implies that g ∈ Id(S). Then, α i = 0 for every i. Otherwise, g = [v j ] V j for some j, which is a contradiction.
(iii) ⇒ (i) Assume that g is a composition of elements of S. We have g ∈ Id(S).
. By (iii), we obtain α i = 0 for every i, and thus we have g ≡ 0 mod (S).
Shirshov algorithm If a monic subset S ⊆ Tri X is not a Gröbner-Shirshov basis, then one can add to S all nontrivial compositions. Continuing this process repeatedly, we finally obtain a Gröbner-Shirshov basis S comp that contains S and generates the same ideal, that is, Similarly, we may introduce the Gröbner-Shirshov bases for trirings, which may be useful when one would like to construct an R-basis for some trisemigroup-trirings over an associative and commutative ring R with a unit.
Let (E, , , ⊥) be a trisemigroup, and T the free left R-module with R-basis E. Then, (T, +, , , ⊥) is a triring equipped with the following operations: for all g = ∑ i r i u i , h = ∑ j r j v j ∈ T, r i , r j ∈ R, u i , v j ∈ E. Such a triring, denoted by Tri R (E), is called a trisemigroup-triring of E over R.
Let Trisgp X be the free trisemigroup generated by X; then, we obtain a trisemigrouptriring of Trisgp X over R, denoted by Tri R X , which is also called the free triring over R generated by X. In particular, Tri k X = Tri X is the free trialgebra generated by X when k is a field.
An ideal I of Tri R X is an R-submodule of Tri R X such that g h, h g, g h, h g, g ⊥ h, h ⊥ g ∈ I for every g ∈ Tri R X and h ∈ I.
The proof of the following Theorem 2 is similar to Theorem 1.

Theorem 2.
(Composition-Diamond lemma for trirings) Let R be an associative and commutative ring with a unit. Let > be a monomial-centers ordering on [X + ] P (N) , and let S be a monic subset of Tri R X and Id(S) the ideal of Tri R X generated by S. Then, the following statements are equivalent.
(i) S is a Gröbner-Shirshov basis in Tri R X .
L for any normal S-polynomial [csd] L } is an Rbasis of the quotient triring Tri R X|S := Tri R X /Id(S), i.e., Tri R X|S is a free R-module with R-basis Irr(S).

Remark 2. The Shirshov algorithm does not work generally in Tri R X .
We now turn to the question on how to recognize whether two ideals of Tri X are the same or not. We begin with the notion of a minimal (resp. reduced) Gröbner-Shirshov basis.

Definition 7.
A Gröbner-Shirshov basis S in Tri X is minimal (resp. reduced) if, for every s ∈ S, we have s ∈ Irr(S\{s}) (resp. supp(s) ⊆ Irr(S\{s})), where N) . Suppose that I is an ideal of Tri X and I = Id(S). If S is a reduced (resp. minimal) Gröbner-Shirshov basis in Tri X , then we call S a reduced (resp. minimal) Gröbner-Shirshov basis for the ideal I or for the quotient dialgebra Tri X /I. It is known that every ideal of associative algebras (dialgebras) has a unique reduced Gröbner-Shirshov basis. Now, we show that an analogous result holds for trialgebras.

Lemma 10. Let I be an ideal of Tri X and S a Gröbner-Shirshov basis for I. For every E ⊆ S, if
Irr(E) = Irr(S), then E is also a Gröbner-Shirshov basis for I.

Proof.
For every g ∈ I, since Irr(E) = Irr(S) and S a Gröbner-Shirshov basis for I, by Theorem 1, we obtain g = [csd] L = [a f b] L for some s ∈ S, f ∈ E, a, b, c, d ∈ X * . Thus, we obtain g 1 = g − lc(g)[a f b] L ∈ I and g 1 < g. By induction on g, we deduce that g is a linear combination of normal E-polynomials, i.e., g ∈ Id(E). This shows that I = Id(E). Now, the result follows from Theorem 1.
Let S be a subset of Tri X and [u] U ∈ [X + ] P (N) . We set There is a unique reduced Gröbner-Shirshov basis for every ideal of the free trialgebra Tri X .
Proof. Let I be a ideal of Tri X . We first prove the existence. It is clear that S = {lc(g) −1 g | 0 = g ∈ I} is a Gröbner-Shirshov basis for I. For each [u] U ∈ S, we fix a polynomial g Then, the leading monomials of elements in S 0 are pairwise different. Since I ⊇ S ⊇ S 0 and I = S = S 0 , we have Irr(S 0 ) = Irr(S) = [X + ] P (N) \S. By Lemma 10, S 0 is a Gröbner-Shirshov basis for I.
Moreover, we may assume that, for every s ∈ S 0 , we have i.e., supp( Since > is a well ordering on [X + ] P (N) , this process will terminate. Noting that, for every [u] U ∈ S 0 , there exists a unique g ∈ S 0 such that [u] U = g. Set min{S 0 } = s 0 with s 0 ∈ S 0 . Define S s 0 := {s 0 }. Suppose that g ∈ S 0 , s 0 < g and S h has been defined for every h ∈ S 0 with h < g. Define Then, for every g ∈ S 0 , we have g ∈ S 1 ⇔ g ∈ Irr(S <ḡ ) ⇔ g ∈ S g . We first claim that Irr(S 1 ) = Irr(S 0 ). Since S 1 ⊆ S 0 , it suffices to show Irr(S 1 ) ⊆ Irr(S 0 ). Assume that there exists a normal triword [u] U ∈ [X + ] P (N) such that [u] U ∈ Irr(S 1 ) and [u] U / ∈ Irr(S 0 ). Since S 0 = I, it follows that [u] U = g for some g ∈ S 0 \S 1 . If g ∈ Irr(S <g ), then g ∈ S g ⊆ S 1 , a contradiction. If g ∈ Irr(S <g ), then g = [asb] C for some s ∈ S <g ⊆ S 1 , a, b ∈ X * . This implies that g ∈ Irr(S 1 ), a contradiction. Therefore, Irr(S 1 ) = Irr(S 0 ). By Lemma 10, S 1 is a Gröbner-Shirshov basis for I.
If g, h ∈ S 1 , g = h, g = [ahb] C , then we have h < g, h ∈ S h ⊆ S <g . Thus, we deduce g ∈ Irr(S <g ) and g ∈ S 1 , a contradiction. Thus, S 1 is a minimal Gröbner-Shirshov basis for I. By (5), for every s ∈ S 1 , we have supp(s) ⊆ Irr(S 1 \{s}), so S 1 is a reduced Gröbner-Shirshov basis for I. Now, we prove the uniqueness. Suppose that T is an arbitrary reduced Gröbner-Shirshov basis for I. Let s 0 = min S 1 and t 0 = min T, where s 0 ∈ S 1 , t 0 ∈ T. By Theorem 1, we have s 0 = [a t b ] C ≥ t ≥ t 0 for some t ∈ T, a , b ∈ X * . Similarly, t 0 ≥ s 0 . Thus, we deduce t 0 = s 0 . We claim that t 0 = s 0 . Otherwise, we have 0 = t 0 − s 0 ∈ I. By the above argument again, we obtain that t 0 > t 0 − s 0 ≥ t ≥ t 0 for some t ∈ T, a contradiction. Thus, we have S s 0 For For every s ∈ S [u] U 1 , we have s = [c td ] L ≥ t for some t ∈ T, c , d ∈ X * . Now, we claim that [u] U = s = t. Otherwise, we have and t ∈ S 1 \{s}. However, s = [c td ] L , which contradicts with the fact that S 1 is a reduced Gröbner-Shirshov basis. Now, we show for some t 1 ∈ T, s 1 ∈ S 1 , a, b, c, d ∈ X * with t 1 , s 1 ≤ s − t < s = t. Thus, we deduce s 1 ∈ S 1 \{s} and t 1 ∈ T\{t}. Noting that s − t ∈ supp(s) ∪ supp(t), we may assume that s − t ∈ supp(s). As S 1 is a reduced Gröbner-Shirshov basis, we have s − t ∈ Irr(S 1 \{s}), which contradicts with the fact that s − t = [cs 1 d] L 1 , where s 1 ∈ S 1 \{s}. Thus, s = t.
Therefore, we obtain S It follows that we have S ⊆ T. Similarly, we have T ⊆ S, which proves the uniqueness.

Remark 3.
It is known that every Gröbner-Shirshov basis for an ideal of associative (polynomial) algebras can be reduced to a reduced Gröbner-Shirshov basis. However, this is neither the case for dialgebras ([13] Example 3.24), nor the case for trialgebras. It suffices to consider the trialgebra defined by the same generators and relations as those in ([13] Example 3.24) because the relations form a Gröbner-Shirshov basis for the considered trialgebra.
By using Theorem 3, we have the following theorem.

Applications
In this section, we apply Theorem 1 to give a method to find normal forms of elements of an arbitrary trisemigroup. As applications, we reconstruct normal forms of elements of a free commutative trisemigroup which is obtained in [2] and construct normal forms of elements of a free abelian trisemigroup. We also give some characterizations of the Gelfand-Kirillov dimensions of some trialgebras.
Consider the trialgebra Tri X|S , where we identify the set S with the set By the Shirshov algorithm, we have a Gröbner-Shirshov basis S comp in Tri X and Id(S comp ) = Id(S). It is clear that each element in S comp is of the form Then, σ is obviously a trialgebra isomorphism. Noting that, by Theorem 1, Irr(S comp ) is a linear basis of Tri X|S , we have that σ(Irr(S comp )) is a linear basis of Tri k ([X + ] P (N) /ρ(S)). It follows that Irr(S comp ) is exactly a set of normal forms of elements of the trisemigroup Trisgp X|S . Therefore, we obtain the following theorem.  N) . Then, Irr(S comp ) is a set of normal forms of elements of the trisemigroup Trisgp X|S .
If we can construct a set of normal forms of certain trialgebra, then we can know how fast the trialgebra grows by the tool of Gelfand-Kirillov dimension. The Gelfand-Kirillov dimension measures the asymptotic growth rate of algebras. Since it provides important structural information, this invariant has become one of the important tools in the study of algebras. In this section, we shall calculate some interesting examples and show how we can apply Gröbner-Shirshov bases in the calculation of Gelfand-Kirillov dimensions of certain trialgebras.
Let T be a trialgebra, and let W, W 1 and W 2 be vector subspaces of T. We first define  where the supremum is taken over all finite dimensional subspaces W of T.
We have the following obvious observation, which is well-known in the context [31], for example. Lemma 11. Let T be a trialgebra generated by a finite set X and kX the subspace of T spanned by X. Then, we have GKdim(T) = lim n→∞ log n dim((kX) ≤n ).
Let X = {x}. It is well known that GKdim(k X ) = 1 and GKdim(Di X ) = 2, where k X (resp. Di X ) is the free associative algebra (resp. dialgebra) generated by X. Note that a normal triword of length n in Tri X is of the form [x...x] U , where U is a nonempty subset of {1, ..., n}. Thus, by a direct calculation, we have GKdim(Tri X ) = +∞.
We shall show in Sections 4.1 and 4.2 that the Gelfand-Kirillov dimensions of finitely generated free commutative trialgebras and those of finitely generated free abelian trialgebras are positive integers.
From now on, let X be a well-ordered set and > the deg-lex-centers ordering on [X + ] P (N) .

Normal Forms of Free Commutative Trisemigroups
The commutative trisemigroups are introduced and the free commutative trisemigroup generated by a set is constructed by [2]. In this subsection, we give another approach to normal forms of elements of a free commutative trisemigroup.
Let T c be the subset of Tri X consisting of the following polynomials: Tri[X] := Tri X|T c is clearly the free commutative trialgebra generated by X. In particular, a linear basis of Tri[X] consisting of normal triwords over X is exactly a set of normal forms of elements of the free commutative trisemigroup generated by X.
We define For u ∈ X + , [u] U is a normal triword, while u U is called a commutative normal triword. For instance, assume u = x 2 x 1 x 2 x 1 x 2 x 1 ∈ X + and assume Proposition 2. Let X = {x i | i ∈ I} be a well-ordered set. Then, we have the following: (i) Tri[X] = Tri X|S c , where S c consists of the following polynomials: (ii) S c is a Gröbner-Shirshov basis in Tri X . (iii) The set forms a k-basis of the free commutative trialgebra Tri[X].
Proof. (i) It suffices to show S c ⊆ Id(T c ) and T c ⊆ Id(S c ), where T c consists of the elements described in (6). We first show S c ⊆ Id(T c ). Since , and ⊥ are commutative, we have where x i , x j ∈ X, u, v ∈ X + , |u|, |v| ≥ 2. It remains to prove that There are two cases to consider: Assume v (v) = ( v 1 x) y with x, y ∈ X and v ∈ X + . Then, in Tri X|T c , we obtain Then, all the compositions in S c are trivial. Thus, S c is a Gröbner-Shirshov basis in Tri X .
(iii) The claim follows immediately from Theorem 1.
From Theorem 1, Lemma 10 and Proposition 2, it follows that Corollary 3. Let X = {x i | i ∈ I} be a well-ordered set and S c ⊂ Tri X be a set consisting of the following polynomials: Then, S c is the reduced Gröbner-Shirshov basis for the free commutative trialgebra Tri[X].
Now, by using Theorem 5 and Proposition 2, we have the following corollary.
By Lemma 11 and Proposition 2, we can easily obtain the Gelfand-Kirillov dimension of Tri[X] for every finite set X.

Normal Forms of Free Abelian Trisemigroups
In this subsection, we first introduce a notion of abelian trisemigroups which is an analogy of abelian disemigroups introduced in [11]. Then, we construct a set of normal forms of elements of the free abelian trisemigroups. Let X be an arbitrary set and T ab the subset of [X + ] P (N) × [X + ] P (N) consisting of the following: . Let T ab be the set consisting of elements of the form N) . Then, Trisgp X|T ab is clearly the free abelian trisemigroup generated by X, and Tri X|T ab is the free abelian trialgebra generated by X. By Theorem 5, a linear basis of Tri X|T ab consisting of normal triwords is a set of normal forms of elements of Trisgp X|T ab . Now, we shall try to construct a linear basis of Tri X|T ab by the method of Gröbner-Shirshov bases. We introduce a method of writing down a new normal triword from a given one. Let X = {x i | i ∈ I} be a well-ordered set, and letẊ = {ẋ | x ∈ X} be a copy of X, where byẋ we mean a new symbol. We extend the ordering on X to a well-ordering on X ∪Ẋ in the following way: We note that [X + ] P (N) has a one-to-one correspondence with (X ∪Ẋ) + , and we denote this correspondence by ϕ. More precisely, ϕ maps an arbitrary normal triword [x i 1 ...x i m ] U to a word in y 1 ...y m in (X ∪Ẋ) + , such that, if i t ∈ U, then y t =ẋ i t , and if i t / ∈ U, then, y t = x i t for every t ≤ m. For instance, ϕ([x 1 x 2 x 2 x 1 x 3 ] {2,4} ) = x 1ẋ2 x 2ẋ1 x 3 . Thus, we can identity elements in [X + ] P (N) with those in (X ∪Ẋ) + .
For instance, Roughly speaking, τ reorders the letters in [u] U such that the middle entries are preserved. Therefore, we immediately deduce that such a map τ satisfies some useful properties, the proof of which is quite easy and thus is omitted. Proposition 3. Let X = {x i | i ∈ I} be a well-ordered set, T ab the subset of Tri X consisting of the elements described in (7). Then, we have Proof. (i) It suffices to show T ab ⊆ Id(S ab ) and S ab ⊆ Id(T ab ). We first show T ab ⊆ Id(S ab ). Now, we show S ab ⊆ Id(T ab ). Note that, for an arbitrary normal triword, say [u] U = [x i 1 ...x i n ] U for some letters x i 1 , ..., x i n ∈ X such that n ≥ 2, the normal triword τ([u] U ) contains the same letters (with repetitions) as those of [u] m ; moreover, the middle entries are preserved. Thus, it suffices to show that we can reorder x i t and x i t+1 with middle entries preserved. By Lemma 1, we may assume Thus, all the compositions in S ab are trivial, and thus S ab is a Gröbner-Shirshov basis in Tri X .
(iii) By Theorem 1, we get the result.
From Theorem 1, Lemma 10, and Proposition 3, it follows that Corollary 6. Let X = {x i | i ∈ I} be a well-ordered set and W ab ⊂ Tri X be a set consisting of the following polynomials: Then, W ab is the reduced Gröbner-Shirshov basis for the free abelian trialgebra Tri X|T ab .
From Lemma 11 and Proposition 3, it follows that Corollary 7. Let X = {x 1 , ..., x r } and let Tri X|T ab be the free abelian trialgebra generated by X. Then, we have GKdim(Tri X|T ab ) = 2r.
Proof. LetẊ = {ẋ | x ∈ X} be a copy of X, and let k[X ∪Ẋ] be the commutative ploynomial algebra generated by X ∪Ẋ. It is obvious that k[X ∪Ẋ] is isomorphism to Tri X|T ab as a vector space. Thus, we obtain GKdim(Tri X|T ab ) = GKdim(k[X ∪Ẋ]) = 2r.
The proof is completed.