EUROPEAN JOURNAL OF PURE AND APPLIED MATHEMATICS 2025, Vol. 18, Issue 3, Article Number 6472 ISSN 1307-5543 – ejpam.com Published by New York Business Global An Inductive Product of Terms Pongsaphat Prachumdang1, Bundit Pibaljommee1,∗ 1 Department of Mathematics, Faculty of Science, Khon Kaen University, Khon Kaen 40002, Thailand Abstract. Over the years, many binary operations on the set of all n-ary terms of type τ have been defined, derived from superpositions and forming semigroups. Later, an inductive composition of terms was introduced as a generalization of a superposition, extending its scope from variable replacement to subterm replacement. From this, a binary operation called an r-inductive product was introduced by fixing a specific subterm to be replaced. In this study, we define a new binary operation, called an rs-inductive product, which generalizes the r-inductive product by allowing the simultaneous replacement of two specific subterms. We construct a semigroup equipped with the new operation and investigate its algebraic properties, including regular elements, idempotent elements, and Green’s relations. 2020 Mathematics Subject Classifications: 08A40, 08A70, 20M10 Key Words and Phrases: Terms, inductive composition of terms, inductive product of terms, semigroups, regular elements, idempotent elements, Green’s relations 1. Introduction In universal algebra, the concept of terms plays a crucial role as formal representations in equations and identities within algebraic structures. In addition to their foundational role in algebra, terms have found applications in other areas, particularly in computer science and formal languages. For further background and applications, the readers are referred to [1]. In the study of terms, various operations on the set of terms have been introduced over the past decades. Among these, superpositions have been extensively studied due to their satisfaction of the superassociative law, a generalization of associativity (see, e.g., [1]). One of the earliest forms is the superposition Sn m, which maps an n-ary term and an n-tuple of m-ary terms to an m-ary term by substituting each variable in the n-ary term with the corresponding m-ary term. In 2001, Denecke and Leeratanavalee [2] extended this operation to a more general form, denoted by Sn g , which is an (n + 1)-ary operation defined on terms of arbitrary arity. A special case where n = m, denoted Sn, was later ∗Corresponding author. DOI: https://doi.org/10.29020/nybg.ejpam.v18i3.6472 Email addresses: pong sa phat@kkumail.com (P. Prachumdang), banpib@kku.ac.th (B. Pibaljommee) https://www.ejpam.com 1 Copyright: © 2025 The Author(s). (CC BY-NC 4.0) P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 2 of 16 mentioned in [3]. Moreover, the idea of superpositions has also been extended to sets of terms, known as tree languages. This extension, denoted by Ŝn m, was introduced in [4]. Superpositions, which satisfy the superassociative law, have inspired many researchers to transform them into binary operations and study the semigroups equipped with these operations. Following this approach, Denecke and Jampachon [5] introduced four bi- nary operations, denoted by +, ∗,+g, and ∗g, derived from the superposition Sn, and investigated idempotent and regular elements as well as Green’s relations in the resulting semigroups. Similarly, in the context of tree languages, Denecke and Sarasit [6] defined a product of tree languages, denoted by ·xi , which is a binary operation induced from the superposition Ŝn m. The binary operation ·xi can also be restricted to the set of terms, as shown by Kumd- uang and Leeratanavalee in [7]. This restricted operation corresponds to substituting every occurrence of the variable xi in a term with another term. In a more general approach, which is not limited to variable replacement but also extends to subterm replacement, Shtrakov [8] introduced an inductive composition, a ternary operation that maps a triple (t, r, q) to a term obtained by simultaneously replacing every occurrence of the subterm r in t with q. Building on this, Kritpratyakul and Pibaljommee [9] defined a binary opera- tion, called the r-inductive product and denoted by ·r, by fixing a specific term r in the inductive composition. Unlike other binary operations derived from superpositions, the r-inductive product is not associative on the entire set of terms, as demonstrated by Kritpratyakul and Pibaljom- mee [9]. However, they showed that the operation ·r becomes associative and closed on a certain subset of the set of terms. They further investigated the algebraic structure of the resulting semigroup, examining properties such as idempotent and regular elements, Green’s relations, ideals, and special substructures (see [9–11]). In this paper, we extend the concept of the r-inductive product by allowing two specific subterms to be replaced simultaneously. The resulting binary operation is called the rs- inductive product and is denoted by ·rs, where r and s are the two fixed terms. This operation generalizes the binary operation ·ij , introduced by Boonsol et al. [12] on the set of tree languages, when restricted to the set of terms. We construct a semigroup of terms under this new operation and investigate its algebraic structure, focusing on the characterization of idempotent and regular elements, as well as all five types of Green’s relations. 2. Preliminaries We begin by recalling the definition of terms. Let Xn = {x1, . . . , xn} be a finite set of n elements, called the alphabet, whose elements are called variables. Let {fi | i ∈ I} be a set of operation symbols, where I is a non-empty index set, and assume that {fi | i ∈ I} and Xn are disjoint. For each fi, we assign a positive integer ni, called the arity of fi. The sequence τ = (ni)i∈I is called the type. The n-ary terms of type τ are inductively defined as follows. (i) Every variable xi is an n-ary term of type τ . P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 3 of 16 (ii) If t1, . . . , tni are n-ary terms of type τ and fi is an operation symbol of arity ni, then fi(t1, . . . , tni) is an n-ary term of type τ . (iii) The set Wτ (Xn) of all n-ary terms is the smallest set containing x1, . . . , xn, and closed under finite applications of (ii). As subterm replacement plays a crucial role in our study, we now recall the formal definition of subterms. This notion appears in several works (see, e.g., [8, 9]). Let t ∈ Wτ (Xn). The set of subterms of t, denoted by sub(t), is defined inductively as follows: (i) if t ∈ Xn, then sub(t) = {t}; (ii) if t = fi(t1, . . . , tni), then sub(t) = {t} ∪ sub(t1) ∪ · · · ∪ sub(tni). For r, t ∈ Wτ (Xn), let nr(t) denote the number of occurrences of r in t. This notion was introduced in [9]. It is defined inductively as follows: (i) nr(t) = 0 if r /∈ sub(t); (ii) nr(t) = 1 if r = t; (iii) nr(t) = ∑ni j=1 nr(tj) if t = fi(t1, . . . , tni) and r ∈ sub(t) \ {t}. To investigate the structure of terms, various measures have been introduced, one of which is the operation-symbol count. For t ∈ Wτ (Xn), the operation-symbol count of t, denoted by op(t), is defined inductively as follows: (i) op(t) = 0 if t ∈ Xn; (ii) op(t) = 1 + ni∑ j=1 op(tj) if t = fi(t1, . . . , tni). We refer the readers to [13] for further discussion on term complexity measures. It is easy to see that if a term t ∈ sub(q), then op(t) ≤ op(q). Moreover, if t ̸= q, then op(t) < op(q). 3. The rs-Inductive Product We define a binary operation, called rs-inductive product on the set of terms Wτ (Xn), which extends the r-inductive product by allowing the simultaneous replacement of two fixed subterms within a given term. Definition 1. Let r, s ∈ Wτ (Xn) be fixed terms and let t, q ∈ Wτ (Xn). The binary operation rs-inductive product, denoted by ·rs, is inductively defined as follows: (i) t ·rs q = t if {r, s} ∩ sub(t) = ∅; (ii) t ·rs q = q if t ∈ {r, s}; (iii) t ·rs q = fi(t1 ·rs q, . . . , tni ·rs q) if t = fi(t1, . . . , tni), {r, s}∩sub(t) ̸= ∅, and t ̸∈ {r, s}. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 4 of 16 Example 1. Let τ = (1, 2, 3) with a unary operation symbol g, a binary operation f , and a ternary operation symbol h. Fix the terms r = g(x2) and s = f(x2, x1). Consider 3-ary terms of type τ given by t = h(f(x2, x1), x3, g(x2)) and q = g(x3). Then we have t ·rs q = h(f(x2, x1), x3, g(x2)) ·rs g(x3) = h(f(x2, x1) ·rs g(x3), x3 ·rs g(x3), g(x2) ·rs g(x3)) = h(g(x3), x3, g(x3)). Unlike the operation ·r, which has r as an identity element, the operation ·rs does not possess an identity element in general. In fact, when r ̸= s, the operation has no identity element at all. Typically, the terms r and s serve only as left identities of ·rs. The next result establishes a formula for computing the operation-symbol count of a term under the binary operation ·rs. This formula reduces to the one given for the r- inductive product ·r in [9] when r = s. Note that for any two terms r and s, at least one of them is not a proper subterm of the other. Theorem 1. Let r, s ∈ Wτ (Xn) be fixed terms such that r /∈ sub(s) \ {s}, and let t, q ∈ Wτ (Xn). Then, the operation-symbol count of t ·rs q is given by op(t ·rs q) = op(t) + nr(t)(op(q)− op(r)) + (ns(t)− ns(r)nr(t))(op(q)− op(s)). Proof. We proceed by induction on the structure of t. If {r, s} ∩ sub(t) = ∅, then t ·rs q = t, and we have nr(t) = ns(t) = 0. The formula holds trivially. If t = r, then t ·rs q = q, and we observe that nr(t) = 1 and ns(t) = ns(r). The formula follows by substituting these values. If t = s, then t ·rs q = q and ns(t) = 1. By the assumption that r ̸∈ sub(s) \ {s}, we have t = r or r ̸∈ sub(t). The first case implies the formula by the argument discussed above. In the second case, we have nr(t) = 0, and the formula follows immediately from the known values. For t = fi(t1, . . . , tni) with {r, s} ∩ sub(t) ̸= ∅ and t ̸∈ {r, s}, we inductively assume that op(tj ·rs q) = op(tj) + nr(tj)(op(q)− op(r)) + (ns(tj)− ns(r)nr(tj))(op(q)− op(s)) for all 1 ≤ j ≤ ni. Then op(t ·rs q) = op(fi(t1 ·rs q, . . . , tni ·rs q)) = 1 + ni∑ j=1 op(tj ·rs q) = 1 + ni∑ j=1 [ op(tj) + nr(tj)(op(q)− op(r)) + (ns(tj)− ns(r)nr(tj))(op(q)− op(s)) ] = 1 + ni∑ j=1 op(tj) + (op(q)− op(r)) ni∑ j=1 nr(tj) P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 5 of 16 + (op(q)− op(s)) ( ni∑ j=1 ns(tj)− ns(r) ni∑ j=1 nr(tj) ) = op(t) + nr(t)(op(q)− op(r)) + (ns(t)− ns(r)nr(t))(op(q)− op(s)). This completes the proof. As a direct consequence of Theorem 1 , we obtain the following corollary. Corollary 1. Let r, s ∈ Wτ (Xn) be fixed terms such that r ̸∈ sub(s) \ {s} and s ̸∈ sub(r){r}. For each t, q ∈ Wτ (Xn), the following statements hold true. (i) If r = s, then op(t ·rs q) = op(t) + nr(t)(op(q)− op(r)). (ii) If r ̸= s, then op(t ·rs q) = op(t) + nr(t)(op(q)− op(r)) + ns(t)(op(q)− op(s)). We now establish some fundamental properties of the operation ·rs. Lemma 1. Let r, s ∈ Wτ (Xn) be fixed terms and t, q ∈ Wτ (Xn). If {r, s} ∩ sub(t) ̸= ∅, then q ∈ sub(t ·rs q). If, in addition, t ̸∈ {r, s}, then q ∈ sub(t ·rs q) \ {t ·rs q}. Proof. We proceed by induction on the structure of t. If t ∈ {r, s}, then t ·rs q = q, so q ∈ sub(t ·rs q). For t = fi(t1, . . . , tni) with {r, s} ∩ sub(t) ̸= ∅ and t ̸∈ {r, s}, we assume that {r, s}∩sub(tj) ̸= ∅ implies q ∈ sub(tj ·rs q) for all 1 ≤ j ≤ ni. Since {r, s}∩sub(t) ̸= ∅ and t ̸= {r, s}, there exists 1 ≤ j ≤ ni such that {r, s} ∩ sub(tj) ̸= ∅. By inductive hypothesis, it follows that q ∈ sub(tj ·rs q). This completes the first part. For the second part, assume that {r, s} ∩ sub(t) ̸= ∅ and t ̸= {r, s}. Then t cannot be a variable, so let t = fi(t1, . . . , tni). We have t ·rs q = fi(t1 ·rs q, . . . , tni ·rs q), and as above, there is 1 ≤ j ≤ such that {r, s} ∩ sub(tj) ̸= ∅. By the first part, q ∈ sub(tj ·rs q). Thus, q ∈ sub(t ·rs q) \ {t ·rs q}. Lemma 2. Let r, s ∈ Wτ (Xn) be fixed terms and t, q ∈ Wτ (Xn). If {r, s}∩sub(t ·rs q) ̸= ∅, then {r, s} ∩ sub(t) ̸= ∅. Proof. Assume that {r, s}∩ sub(t) = ∅. Then t ·rs q = t. Thus, {r, s}∩ sub(t ·rs q) = ∅. Lemma 3. Let r, s ∈ Wτ (Xn) be fixed terms and t, q ∈ Wτ (Xn). Then the following statements hold. (i) If {r, s} ∩ sub(t) ̸= ∅ and r ∈ sub(q), then r ∈ sub(t ·rs q). (ii) If {r, s} ∩ sub(t) ̸= ∅ and s ∈ sub(q), then s ∈ sub(t ·rs q). Proof. The second part follows by a similar argument, so we prove only the first part. Assume {r, s} ∩ sub(t) ̸= ∅ and r ∈ sub(q). By Lemma 1, we have q ∈ sub(t ·rs q). Thus, r ∈ sub(t ·rs q). P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 6 of 16 Lemma 4. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ Wτ (Xn). Then the following statements hold. (i) If t ·rs q = r, then {r, s} ∩ sub(t) ̸= ∅ and q ∈ sub(r). (ii) If t ·rs q = s, then {r, s} ∩ sub(t) ̸= ∅ and q ∈ sub(s). Proof. We prove only the first part, as the second follows by a similar argument. Assume that t ·rs q = r. Then r ∈ sub(t ·rs q). By Lemma 2, we obtain {r, s} ∩ sub(t) ̸= ∅. Applying Lemma 1, it follows that q ∈ sub(t ·rs q) = sub(r). As in the case of ·r, the operation ·rs is not necessarily associative over Wτ (Xn). The following example illustrates this fact. Example 2. Let τ = (1, 2) with a unary operation symbol g and a binary operation symbol f . Fix the terms r = f(x1, x1) and s = g(x2). Let t = f(g(x2), f(x1, x1)), q = x1, and h = g(f(x1, x2)) be 2-ary terms of type τ . We have (t ·rs q) ·rs h = (f(g(x2), f(x1, x1)) ·rs x1) ·rs g(f(x1, x2)) = f(x1, x1) ·rs g(f(x1, x2)) = g(f(x1, x2)). On the other hand, t ·rs (q ·rs h) = f(g(x2), f(x1, x1)) ·rs (x1 ·rs g(f(x1, x2))) = f(g(x2), f(x1, x1)) ·rs x1 = f(x1, x1). Thus, (t ·rs q) ·rs h ̸= t ·rs (q ·rs h), and the operation ·rs is not associative on Wτ (X2). Next, we investigate the associativity of the operation ·rs. A necessary and sufficient condition is first established to characterize when associativity holds on a given subset of Wτ (Xn). Using this criterion, we construct a subset of Wτ (Xn) on which ·rs is both associative and closed, which leads to a semigroup under the operation. Theorem 2. Let r, s ∈ Wτ (Xn) be fixed terms and A a non-empty subset of Wτ (Xn). The following statements are equivalent: (i) For all t, q ∈ A, if t ̸∈ {r, s}, then t ·rs q ̸∈ {r, s}. (ii) For all t, q, u ∈ A, (t ·rs q) ·rs u = t ·rs (q ·rs u). Proof. Assume (i) and let t, q, u ∈ A. We prove by induction on the structure of t. If {r, s} ∩ sub(t) = ∅, then (t ·rs q) ·rs u = t ·rs u = t = t ·rs (q ·rs u). P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 7 of 16 If t ∈ {r, s}, then (t ·rs q) ·rs u = q ·rs u = t ·rs (q ·rs u). For t = fi(t1, . . . , tni) with {r, s} ∩ sub(t) ̸= ∅ and t ̸∈ {r, s}, assume inductively that (tj ·rs q) ·rs u = tj ·rs (q ·rs u) for all j. We consider the following two cases: Case 1: {r, s} ∩ sub(t ·rs q) = ∅. Then (t ·rs q) ·rs u = t ·rs q. Since {r, s} ∩ sub(t) ̸= ∅, Lemma 1 implies that q ∈ sub(t ·rs q). Consequently, {r, s} ∩ sub(q) = ∅. It follows that t ·rs (q ·rs u) = t ·rs q. Thus, (t ·rs q) ·rs u = t ·rs (q ·rs u). Case 2: {r, s} ∩ sub(t ·rs q) ̸= ∅. By (i) and the fact that t ̸∈ {r, s}, we obtain t ·rs q ̸∈ {r, s}. From the definition of ·rs and the inductive hypothesis, it follows that (t ·rs q) ·rs u = (fi(t1, . . . , tni) ·rs q) ·rs u = fi(t1 ·rs q, . . . , tni ·rs q) ·rs u = fi((t1 ·rs q) ·rs u, . . . , (tni ·rs q) ·rs u) = fi(t1 ·rs (q ·rs u), . . . , tni ·rs (q ·rs u)) = fi(t1, . . . , tni) ·rs (q ·rs u) = t ·rs (q ·rs u). Conversely, assume (ii) and let t, q ∈ A be such that t ̸∈ {r, s}. Suppose t ·rs q ∈ {r, s}, say t ·rs q = r. By Lemma 4, we get q ∈ sub(r) and {r, s} ∩ sub(t) ̸= ∅. We consider the following two cases: Case 1: q ∈ {r, s}. By the associativity of ·rs, we have t ·rs t = t ·rs (q ·rs t) = (t ·rs q) ·rs t = r ·rs t = t. Since {r, s}∩sub(t) ̸= ∅ and t ̸∈ {r, s}, Lemma 1 gives t ∈ sub(t·rs t)\{t·rs t} = sub(t)\{t}, a contradiction. Case 2: q ̸∈ {r, s}. This implies q ∈ sub(r)\{r}, so op(q) < op(r). Hence, r ̸∈ sub(q). If s ∈ sub(q), then Lemma 1 provides that t ∈ sub(q ·rs t) \ {q ·rs t} and q ·rs t ∈ sub(t ·rs (q ·rs t)). Thus op(t) < op(q ·rs t) ≤ op(t ·rs (q ·rs t)) = op((t ·rs q) ·rs t) = op(r ·rs t) = op(t), which is impossible. It follows that {r, s} ∩ sub(q) = ∅, so q ·rs t = q. As a result, r = t ·rs q = t ·rs (q ·rs t) = (t ·rs q) ·rs t = r ·rs t = t, contradicting t ̸∈ {r, s}. Theorem 3. Let r, s ∈ Wτ (Xn) be fixed terms, and define W r,s τ (Xn) = Wτ (Xn) \ [ (sub(r) \ {r}) ∪ (sub(s) \ {s}) ] . Then (W r,s τ (Xn), ·rs) is a semigroup. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 8 of 16 Proof. To show closure, let t, q ∈ W r,s τ (Xn). If {r, s} ∩ sub(t) = ∅, then t ·rs q = t ∈ W r,s τ (Xn). Now, assume {r, s} ∩ sub(t) ̸= ∅. By Lemma 1, we obtain q ∈ sub(t ·rs q). Since q is not a proper subterm of either r or s, the same must hold for t ·rs q. Thus, t ·rs q ∈ W r,s τ (Xn). Next, we establish associativity using Theorem 2. Let t, q ∈ W r,s τ (Xn) with t ̸∈ {r, s}. Suppose that t ·rs q ∈ {r, s}, say t ·rs q = r. By Lemma 4, we have {r, s} ∩ sub(t) ̸= ∅ and q ∈ sub(r). Since q is not a proper subterm of r, it follows that q = r. Applying Lemma 1, we deduce r = q ∈ sub(t ·rs q) \ {t ·rs q} = sub(r) \ {r}, a contradiction. Therefore, t ·rs q ̸∈ {r, s}. We further show that W r,s τ (Xn) is a maximal semigroup in Wτ (Xn) with respect to the operation ·rs, assuming that neither r nor s is a proper subterm of the other. Theorem 4. Let r, s ∈ Wτ (Xn) be fixed terms such that r ̸∈ sub(s) \ {s} and s ̸∈ sub(r) \ {r}. Then W r,s τ (Xn) is a maximal subset of Wτ (Xn) that forms a semigroup under the operation ·rs. Proof. By Theorem 3, we know thatW r,s τ (Xn) is a semigroup. We now proceed to show its maximality. Note that when r, s ∈ Xn, the set W r,s τ (Xn) becomes equal to Wτ (Xn), so the maximality clearly holds in this case. Now, assume that at least one of r or s is a compound term. In this case, we have W r,s τ (Xn) ⊊ Wτ (Xn). Let Q be a subset of Wτ (Xn) such that W r,s τ (Xn) ⊊ Q. This implies that there exists an element a ∈ Q such that a ∈ (sub(r)\{r})∪ (sub(s)\{s}). Without loss of generality, assume that a ∈ sub(r)\{r}. Let r = fi(t1, . . . , tni), and let 1 ≤ l ≤ ni be such that a ∈ sub(tl). We will demonstrate that Q does not satisfy associativity under ·rs by applying Theorem 2. We proceed with the following two steps. Step 1. We show that there is b ∈ W r,s τ (Xn) such that r ∈ sub(b) and b ·rs a = tl. We prove by induction on the complexity of tl. If tl ∈ Xn, then a ∈ sub(tl) = {tl}, which implies a = tl. In this case, we set b = r. For tl = fj(q1, . . . , qnj ), assume that for each 1 ≤ m ≤ nj , if a ∈ sub(qm), then there exists bm ∈ W r,s τ (Xn) such that r ∈ sub(bm) and bm ·rs a = qm. If a = tl, then we set b = r as in the base case. Next, consider the case where a ∈ sub(tl) \ {tl}. We obtain that a ∈ sub(qm) for some 1 ≤ m ≤ nj . By inductive hypothesis, there exists bm ∈ W r,s τ (Xn) such that r ∈ sub(bm) and bm ·rs a = qm. We define b = fj(q1, . . . , qm−1, bm, qm+1, . . . , qnj ). Since r ∈ sub(bm) ⊆ sub(b) \ {b}, b ̸∈ sub(r). Additionally, since r ̸∈ sub(s) \ {s}, b ̸∈ sub(s). Thus, b ∈ W r,s τ (Xn) and b ̸∈ {r, s}. Note that {r, s} ∩ sub(qk) = ∅ for all 1 ≤ qk ≤ nj because each qk is a proper subterm of r and s ̸∈ sub(r) \ {r}. It follows that b ·rs a = fj(q1, . . . , qm−1, bm, qm+1, . . . , qnj ) ·rs a = fj(q1 ·rs a, . . . , qm−1 ·rs a, bm ·rs a, qm+1 ·rs a, . . . , qnj ·rs a) = fj(q1, . . . , qm−1, qm, qm+1, . . . , qnj ) P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 9 of 16 = tl. Step 2. We establish the existence of c ∈ W r,s τ (Xn) such that c ̸∈ {r, s} and c ·rs a = r. Let b be the term constructed in Step 1. We define c = fi(t1, . . . , tl−1, b, tl+1, . . . , tni). Since r ∈ sub(b) ⊆ sub(c)\{c}, c ̸∈ sub(r). Furthermore, since r ̸∈ sub(s)\{s}, c ̸∈ sub(s). Thus, c ∈ W r,s τ (Xn) and c ̸∈ {r, s}. Observe that {r, s} ∩ sub(tk) = ∅ for all 1 ≤ k ≤ ni as each tk is a proper subterm of r and s ̸∈ sub(r) \ {r}. Hence, c ·rs a = fi(t1, . . . , tl−1, b, tl+1, . . . , tni) ·rs a = fi(t1 ·rs a, . . . , tl−1 ·rs a, b ·rs a, tl+1 ·rs a, . . . , tni ·rs a) = fi(t1, . . . , tl−1, tl, tl+1, . . . , tni) = r. By Theorem 2, Q is not associative under ·rs. We conclude this section with two lemmas, which show that the converses of Lemma 3 and Lemma 4 hold when restricted to the subset W r,s τ (Xn). These properties will play a key role in establishing the algebraic properties of the semigroup in the next two sections. Lemma 5. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ W r,s τ (Xn). Then the following statements hold true: (i) r ∈ sub(t ·rs q) if and only if {r, s} ∩ sub(t) ̸= ∅ and r ∈ sub(q). (ii) s ∈ sub(t ·rs q) if and only if {r, s} ∩ sub(t) ̸= ∅ and s ∈ sub(q). Proof. (i) The reverse direction follows directly from Lemma 3. Additionally, Lemma 2 shows that r ∈ sub(t ·rs q) implies {r, s} ∩ sub(t) ̸= ∅. It remains to demonstrate that r ∈ sub(t ·rs q) implies r ∈ sub(q). We prove this by induction on the structure of t. If {r, s} ∩ sub(t) = ∅, then t ·rs q = t, which implies r ̸∈ sub(t ·rs q). Thus, the claim holds trivially. If t ∈ {r, s}, then t ·rs q = q, and therefore, r ∈ sub(t ·rs q) implies r ∈ sub(q). For t = fi(t1, . . . , tni) with {r, s} ∩ sub(t) ̸= ∅ and t ̸= {r, s}, assume that for each 1 ≤ j ≤ ni, if r ∈ sub(tj ·rs q), then r ∈ sub(q). In this case, we have t ·rs q = fi(t1 ·rs q, . . . , tni ·rs q). Now, assume r ∈ sub(t ·rs q). In the case where r = t ·rs q, Lemma 4 and the fact that q ∈ W r,s τ (Xn) provides that q = r, and thus r ∈ sub(q). On the other hand, if r ∈ sub(tj ·rs q) for some 1 ≤ j ≤ ni, then the desired result follows directly from the inductive hypothesis. This complete the proof for part (i). (ii) This follows by a similar reasoning. Lemma 6. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ W r,s τ (Xn). Then the following statements hold: (i) t ·rs q = r if and only if t ∈ {r, s} and q = r. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 10 of 16 (ii) t ·rs q = s if and only if t ∈ {r, s} and q = s. Proof. We will prove only (i), as (ii) follows by a similar argument. Assume t ·rs q = r. By Lemma 4, it follows that {r, s} ∩ sub(t) ̸= ∅ and q ∈ sub(r). Since q is not a proper subterm of r, q = r. Now, suppose t ̸∈ {r, s}. By Lemma 1, r = q ∈ sub(t ·rs q) \ {t ·rs q} = sub(r) \ {r}, which is a contradiction. Hence, t ∈ {r, s}. The converse is straightforward. 4. Idempotent and Regular Elements in the Semigroup (W r,s τ (Xn), ·rs) In this section, we investigate the idempotent and regular elements with respect to ·rs in W r,s τ (Xn). Recall that an element t in a semigroup S is called idempotent if t = tt, and is called regular if there exists q ∈ S such that t = tqt. It is straightforward that every idempotent element is also regular. Theorem 5. Let r, s ∈ Wτ (Xn) be fixed terms and t ∈ W r,s τ (Xn). Then t is idempotent with respect to ·rs if and only if {r, s} ∩ sub(t) = ∅ or t ∈ {r, s}. Proof. Assume that {r, s} ∩ sub(t) ̸= ∅ and t ̸∈ {r, s}. By Lemma 1, t ∈ sub(t ·rs t) \ {t ·rs t}. Thus, t ̸= t ·rs t, which implies that t is not idempotent. The converse follows directly from the definition of ·rs. Theorem 6. Let r, s ∈ Wτ (Xn) be fixed terms and t ∈ W r,s τ (Xn). Then t is regular with respect to ·rs if and only if t is idempotent. Proof. Assume that t is regular but not idempotent. Then t = t ·rs q ·rs t for some q ∈ W r,s τ (Xn). By Theorem 5, we obtain {r, s} ∩ sub(t) ̸= ∅ and t ̸∈ {r, s}. Now we have {r, s} ∩ sub((t ·rs q) ·rs t) ̸= ∅. By Lemma 5, it follows that {r, s} ∩ sub(t ·rs q) ̸= ∅. By using Lemma 5 again, we have {r, s} ∩ sub(q) ̸= ∅. Lemma 1 provides that t ∈ sub(q ·rs t) and q ·rs t ∈ sub(t ·rs q ·rs t) \ {t ·rs q ·rs t} = sub(t) \ {t}. Hence, t ∈ sub(t) \ {t}, a contradiction. Theorem 5 and Theorem 6 show that idempotent elements and regular elements are coincide in the semigroup (W r,s τ (Xn), ·rs). We now give an example of a term that is both regular and idempotent with respect to ·rs in order to better demonstrate this result. Example 3. Let τ = (1, 2) with a unary operation symbol g and a binary operation symbol f . Fix the terms r = f(x1, x1) and s = g(x2). Let t = g(f(x2, x1)) and q = g(x1) be 2-ary terms of type τ . We see that t and q are not subterms of r and s, so t, q ∈ W r,s τ (X2). Moreover, {r, s} ∩ sub(t) = ∅. By the definition of ·rs, we obtain t = t ·rs (q ·rs t) and t = t ·rs t. Thus, t is both regular and idempotent under ·rs. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 11 of 16 As in the case of ·r, where it was shown that any term expressible as a product of several terms, with at least two of them equal to the term itself, is idempotent (see [9]), we find that a similar behavior holds in the ·rs setting. The next lemma plays a key role in verifying this implication. Lemma 7. Let r, s ∈ Wτ (Xn) be fixed terms. For each t, q, u ∈ W r,s τ (Xn), if t = u ·rs t ·rs q and {r, s} ∩ sub(t) ̸= ∅, then t = u ·rs t and q ∈ {r, s}. Proof. Assume that t = u ·rs t ·rs q and {r, s} ∩ sub(t) ̸= ∅. By Lemma 5, we have {r, s} ∩ sub(u ·rs t) ̸= ∅ and {r, s} ∩ sub(u) ̸= ∅. By Lemma 1, we obtain q ∈ sub((u ·rs t) ·rs q) = sub(t) and t ∈ sub(u ·rs t). We claim the following statement: r ∈ sub(t) ⇔ r ∈ sub(u ·rs t) ⇔ r ∈ sub(q). (1) To prove this, it suffices to show both r ∈ sub(t) ⇔ r ∈ sub(u ·rs t) and r ∈ sub(t) ⇔ r ∈ sub(q). Assume r ∈ sub(t). Since t ∈ sub(u ·rs t), r ∈ sub(u ·rs t). Moreover, by Lemma 5 and condition t = (u ·rs t) ·rs q, we conclude that r ∈ sub(q). Conversely, assume that r ∈ sub(u ·rs t). Lemma 5 provides that r ∈ sub(t). Finally, we assume r ∈ sub(q). Since q ∈ sub(t), r ∈ sub(t). This establishes the statement (1). A similar reasoning shows the corresponding statement for s. Next, we show that nr(u ·rs t)(op(q)− op(r)) ≥ 0, and (2) (ns(u ·rs t)− ns(r)nr(u ·rs t))(op(q)− op(s)) ≥ 0. (3) Note that nr(u ·rs t) ≥ 0 and ns(u ·rs t)− ns(r)nr(u ·rs t) ≥ 0. If r ∈ sub(t), then by (1), we have r ∈ sub(q). Therefore, op(q) − op(r) ≥ 0, and inequality (2) follows. On the other hand, if r /∈ sub(t), then by (1), we also have r /∈ sub(u ·rs t). In this case, we have nr(u ·rs t) = 0, which implies inequality (2). Thus, inequality (2) always holds. A similar argument shows that inequality (3) also holds. By applying operation-symbol count formula from Theorem 1, we have op(t) = op(u ·rs t ·rs q) = op(u ·rs t) + nr(u ·rs t)(op(q)− op(r)) + (ns(u ·rs t)− ns(r)nr(u ·rs t))(op(q)− op(s)) ≥ op(u ·rs t) Since t ∈ sub(u ·rs t), we have op(t) ≤ op(u ·rs t). Therefore, op(t) = op(u ·rs t), which implies t = u ·rs t. Substituting this into the equation above shows that nr(u ·rs t)(op(q)− op(r)) = 0, and (ns(u ·rs t)− ns(r)nr(u ·rs t))(op(q)− op(s)) = 0. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 12 of 16 If r ∈ sub(t), then by (1), we have nr(u ·rs t) = 1 and r ∈ sub(q). Thus, op(q) = op(r), which implies q = r. If r ̸∈ sub(t), then by the assumption that {r, s} ∩ sub(t) ̸= ∅, we have s ∈ sub(t). By a similar reasoning, we conclude q = s. This completes the proof. The next theorem establishes that any term in (W r,s τ (Xn), ·rs) that can be written as a product of several terms, where the term itself appears at least twice, is necessarily idempotent. Theorem 7. Let r, s ∈ Wτ (Xn) be fixed terms and t ∈ W r,s τ (Xn). Then t is idempotent with respect to ·rs if and only if there exist t1, . . . , tm ∈ W r,s τ (Xn) with at least two of them equal to t such that t = t1 ·rs t2 ·rs · · · ·rs tm. Proof. Assume that t = t1 ·rs t2 ·rs · · · ·rs tm for some t1, . . . , tm ∈ W r,s τ (Xn) with at least two of them equal to t. Suppose that t is not idempotent. By Theorem 5, we obtain {r, s} ∩ sub(t) ̸= ∅ and t ̸∈ {r, s}. We first consider the case where tm = t. Then we write t = a ·rs t ·rs b ·rs t, where each of a and b is either a product of tj ’s or the element r, which is the left identity in W r,s τ (Xn). By Lemma 5, we obtain {r, s} ∩ sub(a) ̸= ∅ and {r, s} ∩ sub(b) ̸= ∅. Applying Lemma 1, it follows that t ∈ sub(b ·rs t), b ·rs t ∈ sub(t ·rs b ·rs t) \ {t ·rs b ·rs t}, and t ·rs b ·rs t ∈ sub(a ·rs t ·rs b ·rs t). Hence, op(t) ≤ op(b ·rs t) < op(t ·rs b ·rs t) ≤ op(a ·rs t ·rs b ·rs t) = op(t), a contradiction. Now, assume tm ̸= t. Then t can be written as t = a ·rs t ·rs b ·rs t ·rs c, where c is a product of tj ’s. By Lemma 7, we have t = a ·rs t ·rs b ·rs t, and the same contradiction follows as in the previous case. 5. Green’s Relations on the Semigroup (W r,s τ (Xn), ·rs) In this section, we provide explicit characterizations for all five types of Green’s rela- tions on the semigroup (W r,s τ (Xn), ·rs). Let S be a semigroup and S1 denote the monoid obtained by adjoining an identity element 1 to S, if necessary. For elements x, y ∈ S, we say that xL y if and only if there exist u, v ∈ S1 such that ux = y and vy = x. Similarly, xR y if and only if there exist u, v ∈ S1 such that xu = y and yv = x. The relation H is defined as the intersection of L and R. The relation D is defined as the composition L ◦R = R ◦ L, where ◦ denotes the composition of binary relations. Finally, xJ y if and only if there exist u, v, a, b ∈ S1 such that uxv = y and ayb = x. For further background on Green’s relations, we refer the reader to [14]. Theorem 8. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ W r,s τ (Xn). Then tL q if and only if {r, s} ∩ (sub(t) ∪ sub(q)) = ∅ or t = q. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 13 of 16 Proof. Assume that tL q and {r, s}∩ (sub(t)∪ sub(q)) ̸= ∅. Without loss of generality, assume {r, s} ∩ sub(t) ̸= ∅. Since tL q, there exist u, v ∈ (W r,s τ (Xn)) 1 such that u ·rs t = q and v ·rs q = t. If u = 1 or v = 1, then t = q, and we are done. Next, assume u, v ∈ W r,s τ (Xn). By Lemma 5, we have {r, s} ∩ sub(v) ̸= ∅ and {r, s} ∩ sub(u) ̸= ∅. Then, by Lemma 1, it follows that t ∈ sub(u ·rs t) = sub(q) and q ∈ sub(v ·rs q) = sub(t). Hence, t = q. The converse is clear. Theorem 9. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ W r,s τ (Xn). Then tR q if and only if t = q or there exists u, v ∈ {r, s} such that t ·rs u = q and q ·rs v = t. Proof. Assume that tR q. Then there exists u, v ∈ (W r,s τ (Xn)) 1 such that t ·rs u = q and q ·rs v = t. If u = 1 or v = 1, then t = q, and the result follows. Now, we assume that u, v ∈ W r,s τ (Xn). If {r, s} ∩ sub(t) = ∅, then t = t ·rs u = q. If {r, s} ∩ sub(t) ̸= ∅, we consider t = q ·rs v = t ·rs u ·rs v = r ·rs t ·rs u ·rs v. By Lemma 7, we obtain that u·rsv ∈ {r, s}. Then, by Lemma 6, it follows that u, v ∈ {r, s}. The converse is straightforward. Theorem 10. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ W r,s τ (Xn). Then tH q if and only if t = q. Proof. Assume tH q and suppose t ̸= q. Then tL q and tR q. Therefore, there is u ∈ W r,s τ (Xn) such that t ·rs u = q. By Theorem 8, it follows that {r, s} ∩ sub(t) = ∅. Thus, t = t ·rs u = q, a contradiction. The reverse implication holds by the reflexivity of H. Theorem 11. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ W r,s τ (Xn). Then the following statements hold: (i) If {r, s} ∩ sub(t) = ∅, then tD q if and only if tL q. (ii) If {r, s} ∩ sub(t) ̸= ∅, then tD q if and only if tR q. Proof. (i) Assume that {r, s} ∩ sub(t) = ∅ and tD q. Then there exists u ∈ W r,s τ (Xn) such that tLu and uR q. By Lemma 5, it follows that {r, s} ∩ sub(u) = ∅, and hence {r, s}∩ sub(q) = ∅. Applying Theorem 8, we conclude that tL q. The converse is obvious. (ii) Assume that {r, s} ∩ sub(t) ̸= ∅ and tD q. Then there is u ∈ W r,s τ (Xn) such that tLu and uR q. By Theorem 8, we have t = u, and thus tR q. The converse is clear. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 14 of 16 Theorem 12. Let r, s ∈ Wτ (Xn) be fixed terms, and let t, q ∈ W r,s τ (Xn). Then the following statements hold: (i) If {r, s} ∩ sub(t) = ∅, then tJ q if and only if tL q. (ii) If {r, s} ∩ sub(t) ̸= ∅, then tJ q if and only if tR q. Proof. Part (i) follows from the same reasoning as in part (i) of Theorem 11. For part (ii), assume {r, s}∩ sub(t) ̸= ∅ and tJ q. Then there are u, v, a, b ∈ (W r,s τ (Xn)) 1 such that u ·rs t ·rs v = q and a ·rs q ·rs b = t. (4) Then t = (a ·rs u) ·rs t ·rs (v ·rs b). We consider the following cases. Case 1: v = b = 1. In this case, we have tL q. By Theorem 8, it follows that t = q, which clearly implies tR q. Case 2: One of v or b belong to W r,s τ (Xn). Then v ·rs b ∈ W r,s τ (Xn). If u = 1 or a = 1, we may substitute it with r, which is a left identity in W r,s τ (Xn), without affecting the equality in (4). Thus, we may assume u, a ∈ W r,s τ (Xn). By Lemma 7, we obtain t = (a·rsu)·rs t. Applying Lemma 5 with the condition {r, s}∩sub((a·rsu)·rs(t·rs(v ·rsb))) ̸= ∅, we have {r, s} ∩ sub(a ·rs u) ̸= ∅. If a ·rs u /∈ {r, s}, then Lemma 1 yields t ∈ sub((a ·rs u) ·rs t) \ {(a ·rs u) ·rs t} = sub(t) \ {t}, a contradiction. Consequently, a ·rs u ∈ {r, s}, and then Lemma 6 implies a, u ∈ {r, s}. As both r and s act as left identities, we conclude that t ·rs v = q and q ·rs b = t, which implies tR q, as desired. The characterizations of Green’s relations for (W r,s τ (Xn), ·rs) exhibit notable differences from those in the case of ·r. For the operation ·r, the relations satisfy L = D = J and R = H (see [9]). However, under ·rs, we generally have only D = J , while L ̸= J and R ̸= H may occur. For instance, let r = x1, s = g(x2), t = f(x1, x1), and q = f(g(x2), g(x2)). It can be verified that t ·rs s = q and q ·rs r = t, so tR q. However, since t ̸= q, it follows from Theorem 10 that (t, q) /∈ H. In the same example, we also have r ·rs t ·rs s = q and r ·rs q ·rs r = t, which implies tJ q. Nevertheless, (t, q) /∈ L by Theorem 8, as t ̸= q and both terms contain either r or s as subterms. 6. Conclusion In this paper, we introduced a binary operation ·rs on terms, extending the r-inductive product by simultaneously replacing two fixed subterms. Since ·rs is not associative on the entire set of terms, we constructed the subsetW r,s τ (Xn) by excluding all proper subterms of r and s, and showed that this set forms a semigroup under ·rs. However, we were only able to prove that this semigroup is maximal under the condition that r and s are not proper P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 15 of 16 subterms of each other, while the general case remains open. We showed that idempotent and regular elements coincide in this semigroup, and that any term expressible as a product in which it occurs at least twice is necessarily idempotent. Moreover, we provided complete characterizations for all five types of Green’s relations on this semigroup, highlighting that D = J still holds, whereas R ≠ H and L ≠ J can occur, unlike in the case of r- inductive product. Future research could further explore other algebraic properties of this semigroup, such as ideals and special subsemigroups. Additionally, one might investigate the behavior of semigroups under more general forms of subterm replacement or define new operations inspired by inductive compositions. Acknowledgements This research is supported by the Development and Promotion of Science and Tech- nology Talents Project (DPST), Thai government scholarship. References [1] K Denecke and S L Wismath. Universal Algebra and Applications in Theoretical Computer Science. Chapman & Hall/CRC, Boca Raton, FL, 2002. [2] K Denecke and S Leeratanavalee. Kernels of generalized hypersubstitutions. In Dis- crete mathematics and applications (Bansko, 2001), volume 6 of Res. Math. Comput. Sci., pages 87–96. South-West Univ., Blagoevgrad, 2002. [3] K Denecke. Menger algebras and clones of terms. East-West J. Math., 5(2):179–193, 2003. [4] K Denecke, P Glubudom, and J Koppitz. Power clones and non-deterministic hyper- substitutions. Asian-Eur. J. Math., 1(2):177–188, 2008. [5] K Denecke and P Jampachon. Regular elements and Green’s relations in Menger algebras of terms. Discuss. Math. Gen. Algebra Appl., 26(1):85–109, 2006. [6] K Denecke and N Sarasit. Products of tree languages. Bull. Sect. Logic Univ. Lódź, 40(1-2):13–36, 2011. [7] T Kumduang and S Leeratanavalee. Semigroups of terms, tree languages, menger algebra of n-ary functions and their embedding theorems. Symmetry, 13:558, 2021. [8] S Shtrakov. Multi-solid varieties and mh-transducers. Algebra Discrete Math., (3):113–131, 2007. [9] P Kitpratyakul and B Pibaljommee. Semigroups of an inductive composition of terms. Asian-Eur. J. Math., 15(2):Paper No. 2250038, 16, 2022. [10] P Kitpratyakul and B Pibaljommee. Ideal characterizations of semigroups of inductive terms. International Journal of Innovative Computing, Information and Control, 18:801–813, 2022. [11] P Kitpratyakul and B Pibaljommee. On substructures of semigroups of inductive terms. AIMS Math., 7(6):9835–9845, 2022. [12] J Boonsol, P Kitpratyakul, T Changphas, and B Pibaljommee. A product of tree languages. Int. J. Math. Comput. Sci., 19(2):279–288, 2024. P. Prachumdang, B. Pibaljommee / Eur. J. Pure Appl. Math, 18 (3) (2025), 6472 16 of 16 [13] K Denecke and S L Wismath. Complexity of terms, composition, and hypersubstitu- tion. Int. J. Math. Math. Sci., (15):959–969, 2003. [14] J M Howie. Fundamentals of Semigroup Theory, volume 12 of London Mathematical Society Monographs. New Series. The Clarendon Press, Oxford University Press, New York, 1995. Oxford Science Publications.