1. Introduction

In [1], Avgustinovich and Frid proved that each factorial language can be presented as the catenation of irreducible factorial languages; moreover, this representation is unique and optimal in a sense (the decompositions were called in [1] canonical; see [1, p. 151] and cf. Definition 7 of this article). Later, these authors established in [2] that all the irreducible components of the canonical decomposition of a regular factorial language are regular themselves. We also refer to the paper by Frid [3] on the related matters.

In this paper, we present an algebraic point of view at the matter. Namely, we show that each element of an ordered semiring with certain properties has the canonical decomposition (see Theorem 1). Furthermore, we find the two conditions, either of them expressed by a first-order sentence, that guarantee the uniqueness of canonical decompositions in ordered semirings (see Theorem 2). Then we demonstrate in Section 5 that the set of factorial languages over a fixed finite alphabet forms an ordered semiring with all required properties. This yields the above-mentioned theorem by Avgustinovich and Frid (see Corollary 2).

Our lattice-theoretic terminology is in accordance with [4, 5]. Our semiring terminology is in accordance with [4, 6].

2. The Basic Notions

We present in this section the necessary definitions and auxiliary results that will be used later.

2.1. \( l \)-Semirings.

Definition 1

An algebra \( {\mathcal{M}}=\langle{}M;\cdot,1\rangle{} \) is a monoid if the following are satisfied:

(i) \( a(bc)=(ab)c \) for all \( a,b,c\in M \);

(ii) \( a\cdot 1=1\cdot a=a \) for all \( a\in M \).

The monoid \( {\mathcal{M}} \) is commutative if \( ab=ba \) for all \( a,b\in M \).

Definition 2 [6, p. 1]

An algebra \( {\mathcal{R}}=\langle{}R;+,\cdot,0,1\rangle{} \) is a semiring if the following are satisfied:

(i) \( \langle{}R;+,0\rangle{} \) is a commutative monoid;

(ii) \( \langle{}R;\cdot,1\rangle{} \) is a monoid;

(iii) \( a(b+c)d=abd+acd \) for all \( a,b,c,d\in R \);

(iv) \( a0=0a=0 \) for all \( a\in R \).

If \( \langle{}R;\cdot,1\rangle{} \) is a monoid, \( X\subseteq R \), and \( r\in R \) then we put \( rX=\{rx\mid x\in X\} \) and \( Xr=\{xr\mid x\in X\} \).

Definition 3 [6, p. 217]

A semiring \( {\mathcal{R}}=\langle{}R;+,\cdot,0,1\rangle{} \) is a lattice-ordered semiring or just an \( l \)-semiring if we can define the lattice operations of join \( \vee \) and meet \( \wedge \) on \( R \) with the properties:

(i) \( a+b=a\vee b \) for all \( a,b\in R \);

(ii) \( ab\leq a\wedge b \) for all \( a,b\in R \).

Here \( a\leq b \) means that \( a\vee b=b \) or, equivalently, \( a+b=b \). If the lattice \( \langle{}R;+,\wedge\rangle{} \) is distributive then so we call the \( l \)-semiring \( {\mathcal{R}} \).

In what follows, we consider lattice-ordered semirings in the signature \( \{+,\cdot,\wedge,0,1\} \).

Definition 4

We say that an \( l \)-semiring \( \langle{}R;+,\cdot,\wedge,0,1\rangle{} \) is complete if \( \langle{}R;+,\wedge\rangle{} \) is a complete lattice with the following properties:

(i) \( p\bigl{(}\Sigma X)r=\Sigma pXr \) for all \( p,r\in R \) and \( X\subseteq R \);

(ii) \( p\bigl{(}\bigwedge X\bigr{)}r=\bigwedge pXr \) for all \( p,r\in R \) and all \( X\subseteq R \).

We note that our definition of complete \( l \)-semiring differs from the definition of complete lattice-ordered semiring given in [6, p. 227].

Lemma 1

If \( {\mathcal{R}}=\langle{}R;+,\cdot,\wedge,0,1\rangle{} \) is an \( l \)-semiring then the operation \( \cdot \) respects the ordering \( \leq \). Moreover, \( a\leq 1 \) for all \( a\in R \).

Proof

Suppose that \( a_{i}\leq b_{i} \) in \( {\mathcal{R}} \) where \( i<2 \). This means that \( a_{0}a_{1}\leq a_{0}a_{1}+a_{0}b_{1}=a_{0}(a_{1}+b_{1})=a_{0}b_{1}\leq a_{0}b_{1}+b_{0}b_{1}=(a_{0}+b_{0})b_{1}=b_{0}b_{1} \); i.e., the operation \( \cdot \) indeed respects \( \leq \).

Given \( a\in R \), we have \( a=a\cdot 1\leq a\wedge 1\leq 1 \).  ☐

An element \( r \) of an ordered semiring \( \langle{}R;+,\cdot,0,1,\leq\rangle{} \) is prime if \( ab\leq r \) implies that \( a\leq r \) or \( b\leq r \) for all \( a,b\in R \); and \( r \) is \( \wedge \)-prime if \( a\wedge b\leq r \) implies that \( a\leq r \) or \( b\leq r \) for all \( a,b\in R \). Moreover, \( r\in R{\setminus}\{1\} \) is irreducible if \( ab=r \) implies that \( a=r \) or \( b=r \) for all \( a,b\in R \). It is clear that each prime element is irreducible. An element \( r\in R{\setminus}\{1\} \) is completely irreducible if \( ab=r \) implies that \( \{a,b\}=\{r,1\} \) for all \( a,b\in R \).

Given a semiring \( \langle{}R;+,\cdot,0,1\rangle{} \) and a set \( X\subseteq R \), let \( [X] \) denote the submonoid of \( \langle{}R;\cdot,1\rangle{} \) generated by \( X \).

Definition 5

Let \( {\mathcal{R}}=\langle{}R;+,\cdot,\wedge,0,1\rangle{} \) be a complete \( l \)-semiring. Then \( {\mathcal{R}} \) is atomic if there is a subset \( A\subseteq R{\setminus}\{1\} \) consisting of the prime elements satisfying the condition

$$ \text{for each $r\in R$, there is $X\subseteq[A]$ such that $\bigwedge X=r$}. $$

The elements of \( A \) are called atoms of the \( l \)-semiring \( {\mathcal{R}} \) in this case.


Clearly, \( \bigwedge[A]=0 \) in terms of Definition 5. Also each complete distributive algebraic lattice turns to a complete atomic \( l \)-semiring under the assumption that the operations \( \cdot \) and \( \wedge \) agree. Some more involved example of a complete atomic \( l \)-semiring appears in Section 5.

Lemma 2

If \( r=\bigwedge X \) and \( \varnothing\neq X\subseteq[A] \) then \( r\neq 1 \).

Proof

As \( X\neq\varnothing \), there are \( n<\omega \) and \( a_{0},\dots,a_{n}\in A \) such that \( a_{0}\cdots a_{n}\in X \). We see in this case that \( r\leq a_{0}\cdots a_{n}\leq a_{0}\wedge\dots\wedge a_{n}\leq a_{0}<1 \) by Lemma 1.  ☐

The following is a generalization of Lemma 6 of [1] for semirings:

Lemma 3

Let \( \langle{}R;+,\cdot,\wedge,0,1\rangle{} \) be a complete atomic \( l \)-semiring with a finite set \( A\subseteq R \) of atoms and let \( \{r_{i}\mid i<\omega\}\subseteq R{\setminus}\{1\} \). Then there are \( n_{0}<\omega \) and a nonempty set \( B\subseteq A \) such that

$$ \bigwedge\limits_{m<\omega}{r_{n+m}\cdots r_{n}}=\bigwedge[B] $$

for all \( n\geq n_{0} \).

Proof

Put

$$ B=\{a\in A\mid\text{the set}\ \{n<\omega\mid r_{n}\leq a\}\ \text{is infinite}\}. $$

It follows from the definition of \( A \) that \( B\neq\varnothing \). We choose the least \( n_{0}<\omega \) which satisfies the condition

$$ \text{if}\ r_{n}\leq a\ \text{for some}\ n\geq n_{0}\ \text{then}\ a\in B. $$

Such \( n_{0} \) exists by the definition of the set \( B \) and the finiteness of \( A \). Furthermore, for all \( b_{0},\dots,b_{k}\in B \) and \( n\geq n_{0} \), there are \( m_{0},\dots,m_{k}<\omega \) such that \( n\leq m_{k}<\dots<m_{0}<\omega \) and \( r_{m_{i}}\leq b_{i} \) for all \( i\leq k \). Therefore, \( r_{m_{0}}\cdots r_{m_{k}}\leq b_{0}\cdots b_{k} \) by Lemma 1. Thus, by Definition 3(ii)\( r_{n+m}\cdots r_{n}\leq b_{0}\cdots b_{k} \), where \( m<\omega \) is such that \( n\leq m_{k}<\dots<m_{0}\leq n+m \). This implies that

$$ \bigwedge\limits_{m<\omega}{r_{n+m}\cdots r_{n}}\leq\bigwedge[B]. $$

Further, according to Definition 5, for all \( n\geq n_{0} \) and \( m<\omega \), there is \( X_{mn}\subseteq[A] \) such that \( r_{n+m}\cdots r_{n}=\bigwedge X_{mn} \). It is clear that if \( x\leq a\in A \) for some \( x\in X_{mn} \) then \( r_{n+m}\cdots r_{n}\leq x\leq a \), whence \( r_{n+k}\leq a \) for some \( k\leq m \) in view of the primality of \( a \). The definition of \( n_{0} \) yields \( a\in B \). We conclude therefore that \( X_{mn}\subseteq[B] \); i.e.,

$$ \bigwedge[B]\leq\bigwedge\Bigl{\{}\bigwedge X_{mn}\mid m<\omega\Bigr{\}}=\bigwedge\limits_{m<\omega}{r_{n+m}\cdots r_{n}}. $$

Thus, the desired equality

$$ \bigwedge[B]=\bigwedge\limits_{m<\omega}{r_{n+m}\cdots r_{n}} $$

holds.  ☐

The next statement is a generalization of Lemma 7 of [1] for semirings.

Lemma 4

Let \( \langle{}R;+,\cdot,\wedge,0,1\rangle{} \) be a complete atomic \( l \)-semiring with finitely many atoms and let \( \{p_{i},r_{i+1}\mid i<\omega\}\subseteq R \).

(i) If \( p_{i}=p_{i+1}r_{i+1} \) for all \( i<\omega \) then there is \( n<\omega \) such that \( p_{n}=p_{n+k} \) for all \( k<\omega \).

(ii) If \( p_{i}=r_{i+1}p_{i+1} \) for all \( i<\omega \) then there is \( n<\omega \) such that \( p_{n}=p_{n+k} \) for all \( k<\omega \).

Proof

We will demonstrate (i), as (ii) has some symmetric proof that uses a claim symmetric to the claim of Lemma 3.

If there is \( n<\omega \) such that \( r_{n+k}=1 \) for all \( k<\omega \) then the desired statement is obvious. Therefore, it suffices to consider the case when \( \{r_{i+1}\mid i<\omega\}\subseteq R{\setminus}\{1\} \). Indeed, \( p_{i}=p_{i+1}r_{i+1}\leq p_{i+1} \) for all \( i<\omega \). According to Lemma 3, there are a finite set of atoms \( B\subseteq R \) and \( n_{0}<\omega \) such that

$$ \bigwedge\limits_{m<\omega}{r_{n+m}\cdots r_{n}}=\bigwedge[B] $$

for each \( n\geq n_{0} \). We fix a particular integer \( n\geq n_{0} \) and put \( a=\sum\nolimits_{i<\omega}p_{i} \) and \( b=\bigwedge[B] \) (we recall that we consider a complete \( l \)-semiring). Given \( k<\omega \), we see by Lemma 1 that

$$ p_{n}=p_{n+k+1}r_{n+k+1}\cdots r_{n+1}\leq\Bigl{(}\sum\limits_{i<\omega}p_{i}\Bigr{)}r_{n+k+1}\cdots r_{n+1}=ar_{n+k+1}\cdots r_{n+1}, $$

whence

$$ \begin{gathered}\displaystyle p_{n}\leq\bigwedge\limits_{k<\omega}(ar_{n+k+1}\cdots r_{n+1})=a\Bigl{(}\bigwedge\limits_{k<\omega}r_{n+k+1}\cdots r_{n+1}\Bigr{)}=ab=\Bigl{(}\sum\limits_{i<\omega}p_{i}\Bigr{)}b\\ \displaystyle=\Bigl{(}\sum\limits_{i<\omega}p_{n+i+1}\Bigr{)}b=\sum\limits_{i<\omega}p_{n+i+1}b\leq\sum\limits_{i<\omega}p_{n+i+1}r_{n+i}\cdots r_{n+1}=p_{n}.\end{gathered} $$

Therefore, \( p_{n}=ab \) for all \( n\geq n_{0} \) and the desired statement follows.  ☐

2.2. Factorial languages. Given arbitrary languages \( K \), \( L \), and \( L_{i} \), with \( i\in I \), over an alphabet \( \Sigma \), we consider the operations

$$ \bigcap\limits_{i\in I}L_{i}=\bigl{\{}\alpha\in\Sigma^{\ast}\mid\alpha\in L_{i}\ \text{for all}\ i\in I\bigr{\}}; $$
$$ \bigcup\limits_{i\in I}L_{i}=\bigl{\{}\alpha\in\Sigma^{\ast}\mid\alpha\in L_{i}\ \text{for some}\ i\in I\bigr{\}}; $$
$$ KL=\{\alpha\beta\mid\alpha\in K,\beta\in L\};\quad L^{\ast}=\bigcup\bigl{\{}L^{n}\mid n<\omega\bigr{\}}. $$

Let \( \lambda \) denote the empty word and let \( |\alpha| \) denote the length of \( \alpha\in\Sigma^{\ast} \); in particular, \( |\lambda|=0 \).

Definition 6

A language \( L\subseteq\Sigma^{\ast} \) over an alphabet \( \Sigma \) is factorial if \( \alpha\beta\gamma\in L \) implies that \( \beta\in L \) for all \( \alpha,\gamma\in\Sigma^{\ast} \).

A language \( L\subseteq\Sigma^{\ast} \) is prefixal if \( L \) contains all nonempty prefixes of each of its words; in other words, \( \alpha\beta\in L \) implies that \( \alpha\in L \) for each nonempty \( \alpha\in\Sigma^{\ast} \) and \( \beta\in\Sigma^{\ast} \). A language \( L\subseteq\Sigma^{\ast} \) is suffixal if \( L \) contains all nonempty suffices of each of its words; in other words, \( \beta\alpha\in L \) implies that \( \alpha\in L \) for all nonempty \( \alpha\in\Sigma^{\ast} \) and \( \beta\in\Sigma^{\ast} \).


The set of all factorial languages over an alphabet \( \Sigma \) we will denote by \( {\mathcal{F}}_{\Sigma} \) or just by \( {\mathcal{F}} \) when there is no confusion. The following has a straightforward proof:

Lemma 5

Let \( n>0 \) and let \( A,B,A_{i}\subseteq\Sigma^{\ast} \), with \( i\in I \), be factorial languages. Then so are \( \bigcup\nolimits_{i\in I}A_{i} \), \( \bigcap\nolimits_{i\in I}A_{i} \), and \( AB \).


Given a language \( A\subseteq\Sigma^{\ast} \), put

$$ F(A)=\{\xi\in\Sigma^{\ast}\mid\xi\neq\lambda,\ \alpha\xi\beta\in A\ \text{for some}\ \alpha,\beta\in\Sigma^{\ast}\}; $$
$$ P(A)=\{\xi\in\Sigma^{\ast}\mid\xi\neq\lambda,\ \alpha\xi\in A\ \text{for all}\ \alpha\in A\}; $$
$$ S(A)=\{\xi\in\Sigma^{\ast}\mid\xi\neq\lambda,\ \xi\alpha\in A\ \text{for all}\ \alpha\in A\}. $$

It is clear that \( F(A) \) is the least factorial language containing \( A \). Moreover, if \( A \) is a factorial language, then \( P(A) \) is a prefixal language and \( S(A) \) is a suffixal language.

Lemma 6 [1, Lemmas \( 5 \) and \( 5^{\prime} \)]

Let \( A,B\subseteq\Sigma^{\ast} \) be factorial languages.

(i) \( F(A{\setminus}XA)B=F(AB{\setminus}XAB) \) for every prefixal language \( X\subseteq\Sigma^{\ast} \).

(ii) \( AF(B{\setminus}BX)=F(AB{\setminus}ABX) \) for every suffixal language \( X\subseteq\Sigma^{\ast} \).

3. Existence of Decompositions in \( l \)-Semirings

Definition 7

A representation \( r=r_{0}\cdots r_{n} \), where \( n<\omega \), of an element \( r \) of an ordered semiring \( \langle{}R;+,\cdot,\leq,0,1\rangle{} \) as a product of elements of \( R \) is a canonical decomposition for \( r \) if the following are satisfied:

(i) \( r_{i} \) is irreducible for each \( i\leq n \);

(ii) \( r=r_{0}\cdots r_{i-1}xr_{i+1}\cdots r_{n} \) implies that \( x\leq r_{i} \) for all \( i\leq n \).


From Definition 7 we obtain

Lemma 7

Let \( \langle{}R;+,\cdot,\wedge,0,1\rangle{} \) be an ordered semiring. If \( r=p_{0}\cdots p_{n} \) is a canonical decomposition of \( r\in R \) then \( r^{\prime}=p_{k}\cdots p_{m} \) for all \( k \) and \( m \) such that \( 1\leq k\leq m\leq n \).

Lemma 8

Let \( \langle{}R;+,\cdot,\wedge,0,1\rangle{} \) be a complete \( l \)-semiring and let \( r\in R{\setminus}\{1\} \). Then either \( r \) is an irreducible element or there is a decomposition \( r=r_{0}r_{1} \) which satisfies condition (ii) of Definition 7.

Proof

If \( r \) is not irreducible then there are \( x,y\in R{\setminus}\{r\} \) such that \( r=xy \). According to Definition 4(i), the set

$$ A=\{z\in R\mid r=zy\} $$

contains the greatest element \( r_{0} \) with respect to \( \leq \) and

$$ B=\{z\in R\mid r=r_{0}z\} $$

contains the greatest element \( r_{1} \) with respect to \( \leq \). Therefore, \( r=r_{0}r_{1} \) and \( r\notin\{r_{0},r_{1}\} \) as \( r<x\leq r_{0} \) and \( r<y\leq r_{1} \). Thus, \( 1\notin\{r_{0},r_{1}\} \). If \( r=r_{0}z \) then \( z\leq r_{1} \) by the choice of \( r_{1} \). If \( r=zr_{1} \) then \( r=r+r=zr_{1}+r_{0}r_{1}=(z+r_{0})r_{1} \). Using the choice of \( r_{0} \) and \( r_{1} \) together with Lemma 1, we have

$$ r=r_{0}y\leq(z+r_{0})y\leq(z+r_{0})r_{1}=r; $$

i.e., \( r=(z+r_{0})y \). We conclude that \( z\leq z+r_{0}\leq r_{0} \). Thus, condition (ii) of Definition 7 is satisfied too.  ☐

In the proof of the following theorem, we use some idea of the proof of the existence of canonical decompositions of factorial languages from Avgustinovich and Frid (cf. [1, p. 156]).

Theorem 1

Let \( {\mathcal{R}}=\langle{}R;+,\cdot,\wedge,0,1\rangle{} \) be a complete atomic \( l \)-semiring with finitely many atoms. Then each \( p\in R{\setminus}\{1\} \) has a canonical decomposition.

Proof

If \( p \) is an irreducible element then \( p=p \) is a canonical decomposition of \( p \). Otherwise by Lemma 8, there are nonunit \( p_{1},r_{1}\in R{\setminus}\{p\} \) such that the decomposition \( p=p^{0}=p_{0}=p_{1}r_{1} \) satisfies condition (ii) of Definition 7. If \( p_{1} \) is an irreducible element then \( p_{1}=p_{1} \) is a canonical decomposition of \( p_{1} \). Otherwise by Lemma 8, there are nonunit \( p_{2} \), \( r_{2}\in R{\setminus}\{p_{1}\} \) such that the decomposition \( p_{1}=p_{2}r_{2} \) satisfies condition (ii) of Definition 7. Repeating this argument, we obtain some set \( \{p_{i},r_{i+1}\mid i<\omega\}\subseteq R{\setminus}\{1\} \) such that, for all \( i<\omega \), the decomposition \( p_{i}=p_{i+1}r_{i+1} \) satisfies condition (ii) of Definition 7. By Lemma 4(i), there is a least natural \( n<\omega \) such that \( p_{n}=p_{n+1} \). This means that \( p_{n} \) is irreducible; moreover, \( n>0 \) as \( p \) is reducible.

Let \( p_{n}=a_{1} \) and let \( p^{1} \) denote the least element of

$$ \{z\in R\mid p^{0}=a_{1}z\}. $$

Then \( r_{n}\cdots r_{1}\leq p^{1} \) and the decomposition \( p=p^{0}=a_{1}p^{1} \) satisfies condition (ii) of Definition 7. Indeed, if \( p^{1}=1 \) then \( p^{0}=a_{1}=p_{n} \) is an irreducible element; a contradiction. If \( p^{0}=ap^{1} \) for some \( a\in R \) then

$$ p^{0}=p^{0}+p^{0}=ap^{1}+a_{1}p^{1}=(a+a_{1})p^{1}. $$

If \( a\nleq a_{1} \) then \( a+a_{1}>a_{1}=p_{n} \), whence \( (a+a_{1})r_{n}>p_{n}r_{n}=p_{n-1} \) by the choice of \( p_{n} \). Repeating the same argument, we infer that \( (a+a_{1})r_{n}\cdots r_{i}>p_{i-1} \) for all \( i\in\{1,\dots,n\} \) by the choice of \( p_{i} \). Hence, \( p^{0}=(a+a_{1})p^{1}\geq(a+a_{1})r_{n}\cdots r_{1}>p_{0}=p^{0} \) by the choice of \( p_{1} \) and Lemma 1, which is impossible. The contradiction obtained shows that \( a\leq a_{1} \). Moreover, by the choice of \( p^{1} \), we conclude that \( p^{0}\neq a_{1}z \) for all \( z\nleq p^{1} \). Therefore, the decomposition \( p^{0}=a_{1}p^{1} \) satisfies condition (ii) of Definition 7.

If \( p^{1} \) is a reducible element then we apply the above argument to \( p^{1} \) to find \( a_{2} \) and \( p^{2}\in R{\setminus}\{p^{1}\} \) such that \( a_{2} \) is an irreducible element and the decomposition \( p^{1}=a_{2}p^{2} \) satisfies condition (ii) of Definition 7. Therefore, \( p=a_{1}a_{2}p^{2} \). It is clear that \( p^{0}\neq ap^{1}=aa_{2}p^{2} \) for all \( a\nleq a_{1} \). If \( p=a_{1}ap^{2} \) for some \( a\in R \) then

$$ p^{0}=p^{0}+p^{0}=a_{1}a_{2}p^{2}+a_{1}ap^{2}=a_{1}(a+a_{2})p^{2}. $$

If \( a\nleq a_{2} \) then \( a+a_{2}>a_{2} \), whence \( (a+a_{2})p^{2}>a_{2}p^{2}=p^{1} \) by the choice of \( a_{2} \). It follows that \( p^{0}=a_{1}(a+a_{2})p^{2}>a_{1}p^{1}=p^{0} \) by the choice of \( p^{1} \), which is impossible. The contradiction obtained shows that \( a\leq a_{2} \). If \( p=a_{1}a_{2}z \) for some \( z\in R \) then

$$ p^{0}=p^{0}+p^{0}=a_{1}a_{2}p^{2}+a_{1}a_{2}z=a_{1}a_{2}(p^{2}+z). $$

If \( z\nleq p^{2} \) then \( p^{2}+z>p^{2} \), whence \( a_{2}(p^{2}+z)>a_{2}p^{2}=p^{1} \) by the choice of \( p^{2} \). It follows that \( p^{0}=a_{1}a_{2}(p^{2}+z)>a_{1}p^{1}=p^{0} \) by the choice of \( p^{1} \), which is impossible. This contradiction demonstrates that \( z\leq p^{2} \). Therefore, the decomposition \( p^{0}=a_{1}a_{2}p^{2} \) satisfies condition (ii) of Definition 7.

Repeating this argument, we obtain some set \( \{a_{i},p^{i+1}\mid i<\omega\}\subseteq R{\setminus}\{1\} \) such that \( a_{i} \) is irreducible for all \( i<\omega \), \( p^{i}=a_{i+1}p^{i+1} \), and the decomposition \( p^{0}=a_{1}\cdots a_{i}p^{i} \) satisfies condition (ii) of Definition 7. By Lemma 4(ii), there is a least natural \( m<\omega \) such that \( p^{m}=p^{m+1} \); i.e., the element \( p^{m} \) is irreducible. Therefore, each member of the decomposition \( p=a_{1}\cdots a_{m}p^{m} \) is irreducible and all conditions of Definition 7 are satisfied. Hence, \( p=a_{1}\cdots a_{m}p^{m} \) is a canonical decomposition.  ☐

4. Sufficient Conditions for the Uniqueness of Decompositions in \( l \)-Semirings

We consider the sentence \( (\mathrm{C}_{0}) \) presenting the universal closure of the following formula with free variables \( \{x_{0},x_{1},y_{0},y_{1}\} \) in the language \( \{+,\cdot\} \):

$$ \begin{gathered}\displaystyle[x_{0}x_{1}=y_{0}y_{1}]\ \rightarrow\ [x_{0}\leq y_{0}]\ \&\ [y_{1}\leq x_{1}]\ \vee\ [y_{0}\leq x_{0}]\\ \displaystyle\&\ [x_{1}\leq y_{1}]\ \vee\ [x_{0}=y_{0}]\ \vee\ [x_{1}=y_{1}].\end{gathered} $$

We also consider the sentence \( (\mathrm{C}_{1}) \) presenting the universal closure of the following formula with free variables \( \{x,x_{0},x_{1},y_{0},y_{1},z\} \) in the language \( \{+,\cdot\} \):

$$ \begin{gathered}\displaystyle[xx_{0}x_{1}=xy_{0}y_{1}]\ \&\ [xx_{0}\leq xy_{0}]\ \&\ [y_{1}\leq x_{1}]\ \longrightarrow\ \exists y\exists z[xx_{0}x_{1}=xyzx_{1}]\\ \displaystyle\&\ [y_{0}\leq y]\ \&\ [xy_{0}=xy]\ \&\ [x_{0}\leq yz]\ \&\ [y_{1}\leq zx_{1}].\end{gathered} $$

As usual, we abbreviate \( x+y=y \) as \( x\leq y \).

Theorem 2

Let \( {\mathcal{R}}=\langle{}R;+,\cdot,\wedge,0,1\rangle{} \) be an \( l \)-semiring in which \( (\mathrm{C}_{0}) \) and \( (\mathrm{C}_{1}) \) hold. Then each element in \( {\mathcal{R}} \) has at most one canonical decomposition.

Proof

Given \( r\in R{\setminus}\{1\} \) having a canonical decomposition, let \( n(r) \) denote the least number of elements in such decomposition for \( r \). We prove by induction on \( n(r) \) that each \( r\in R \) has at most one canonical decomposition. If \( n(r)=1 \) for some element \( r\in R \) then \( r \) is irreducible. Thus, if \( r=r_{0}\cdots r_{m} \) is a canonical decomposition with \( m>0 \) then \( r\in\{r_{0},\dots,r_{m}\} \). Suppose that \( r=r_{i} \) for some \( i<m \). By Lemma 7, \( r^{\prime}=rr_{i+1} \) is a canonical decomposition. We have \( r=r_{0}\cdots r_{m}\leq r_{i}r_{i+1}=rr_{i+1}=r^{\prime}\leq r \) whence \( r=r^{\prime} \) and \( r=rr_{i+1} \) is a canonical decomposition. As \( r=r\cdot 1 \), we conclude that \( 1\leq r_{i+1}\leq 1 \) whence \( r_{i+1}=1 \) which is a contradiction with the definition of canonical decomposition. If \( r=r_{m} \) then we see as above that \( r=r_{m-1}r \) is a canonical decomposition whence \( r_{m-1}=1 \), which is again impossible. Therefore, \( m=1 \) and \( r=r_{1} \). Suppose now that the statement of Theorem 2 holds for each \( r\in R{\setminus}\{1\} \) with \( n(r)\leq i \), where \( i>0 \).

Let \( r=p_{1}\cdots p_{n}=r_{1}\cdots r_{m} \) be canonical decompositions of \( r\in R{\setminus}\{1\} \), where \( n=n(r)=i+1 \) and \( m<\omega \). Then \( 1<i+1=n\leq m \) whence \( m>1 \). We put \( p_{0}=r_{0}=1 \).

Claim 1

\( p_{j}=r_{j} \) for all \( j\leq n \).

Proof

Induct on \( j\leq n \). As \( p_{0}=r_{0}=1 \), the desired statement is true for \( j=0 \). Suppose that \( p_{j}=r_{j} \) for all \( j\leq k<n \) and show that \( p_{k+1}=r_{k+1} \). We put

$$ \delta(x_{0})=p_{1}\cdots p_{k}p_{k+1},\quad\delta(x_{1})=p_{k+2}\cdots p_{n}; $$
$$ \delta(y_{0})=p_{1}\cdots p_{k}r_{k+1},\quad\delta(y_{1})=r_{k+2}\cdots r_{m}. $$

As \( \delta(x_{0})\delta(x_{1})=r=\delta(y_{0})\delta(y_{1}) \) by the induction hypothesis, the premise of \( (\mathrm{C}_{0}) \) holds in \( {\mathcal{R}} \) under the interpretation \( \delta \). By assumption, the conclusion of \( (\mathrm{C}_{0}) \) also holds in \( {\mathcal{R}} \) under this interpretation. Therefore, the following four cases are possible:

Case 1: \( \delta(x_{1})=\delta(y_{1})=r^{\prime} \). The two subcases are possible:

Case 1.1: \( r^{\prime}=1 \). In this case, \( r=\delta(x_{0})=\delta(y_{0}) \) whence \( n=k+1=m \) and \( r=p_{1}\cdots p_{k}p_{k+1}=r_{1}\cdots r_{k}r_{k+1} \) is a canonical decomposition of \( r \). By the definition of canonical decomposition, \( p_{k+1}\leq r_{k+1}\leq p_{k+1} \); i.e., \( p_{k+1}=r_{k+1} \) which is our desired conclusion.

Case 1.2: \( r^{\prime}\neq 1 \). In this case, \( r^{\prime}=p_{k+2}\cdots p_{n}=r_{k+2}\cdots r_{m} \) is a canonical decomposition of \( r^{\prime} \) by Lemma 7. As \( n(r^{\prime})\leq n-(k+1)<n \), we conclude by our induction hypothesis made in the beginning of the proof of Theorem 2 that \( n=m \) and \( p_{j}=r_{j} \) for all \( j\in\{k+2,\dots,n\} \). Therefore, \( r=p_{1}\cdots p_{k}p_{k+1}p_{k+2}\cdots p_{n}=p_{1}\cdots p_{k}r_{k+1}p_{k+2}\cdots p_{n} \) are canonical decompositions of \( r \). By the definition of canonical decomposition, we obtain \( p_{k+1}\leq r_{k+1}\leq p_{k+1} \); i.e., \( p_{k+1}=r_{k+1} \), which is our desired conclusion.

Case 2: \( \delta(x_{0})=\delta(y_{0})=r^{\prime} \). By Lemma 7, \( r^{\prime}=p_{1}\cdots p_{k}p_{k+1}=p_{1}\cdots p_{k}r_{k+1} \) is a canonical decomposition of \( r^{\prime} \). By the definition of canonical decomposition, we conclude that \( p_{k+1}\leq r_{k+1}\leq p_{k+1} \); i.e., \( p_{k+1}=r_{k+1} \), which is our desired conclusion.

Case 3: \( \delta(x_{0})\leq\delta(y_{0}) \) and \( \delta(y_{1})\leq\delta(x_{1}) \). We put

$$ \gamma(x)=p_{1}\cdots p_{k},\quad\gamma(x_{0})=p_{k+1},\quad\gamma(x_{1})=\delta(x_{1})=p_{k+2}\cdots p_{n}, $$
$$ \gamma(y_{0})=r_{k+1},\quad\gamma(y_{1})=\delta(y_{1})=r_{k+2}\cdots r_{m}. $$

In this case

$$ \gamma(x)\gamma(x_{0})\gamma(x_{1})=\gamma(x)\gamma(y_{0})\gamma(y_{1}), $$
$$ \gamma(x)\gamma(x_{0})=\delta(x_{0})\leq\delta(y_{0})=\gamma(x)\gamma(y_{0}), $$
$$ \gamma(y_{1})=\delta(y_{1})\leq\delta(x_{1})=\gamma(x_{1}); $$

i.e., the premise of \( (\mathrm{C}_{1}) \) holds in \( {\mathcal{R}} \) under the interpretation \( \gamma \). By assumption, the conclusion of \( (\mathrm{C}_{1}) \) also holds in \( {\mathcal{R}} \) under this interpretation. Therefore, there are \( b,c\in R \) such that

$$ \gamma(y_{0})\leq b,\quad\gamma(x)\gamma(y_{0})=\gamma(x)b,\quad r=\gamma(x)bc\gamma(x_{1})=p_{1}\cdots p_{k}bcp_{k+2}\cdots p_{n}, $$
$$ \gamma(x_{0})\leq bc,\quad\gamma(y_{1})\leq c\gamma(x_{1}). $$

By Lemma 7 and our induction hypothesis, \( \gamma(x)\gamma(y_{0})=p_{1}\cdots p_{k}r_{k+1} \) is a canonical decomposition. Thus, the first two conditions above imply \( b\leq r_{k+1}=\gamma(y_{0})\leq b \); i.e., \( b=r_{k+1}=\gamma(y_{0}) \). Furthermore, \( r=p_{1}\cdots p_{n} \) is a canonical decomposition. Hence, \( r=\gamma(x)bc\gamma(x_{1})=p_{1}\cdots p_{k}bcp_{k+2}\cdots p_{n} \) and \( p_{k+1}=\gamma(x_{0})\leq bc \) imply that \( p_{k+1}=bc=r_{k+1}c \). As \( p_{k+1} \) is irreducible, we conclude that \( p_{k+1}\in\{r_{k+1},c\} \). The following two subcases are therefore possible:

Case 3.1: \( p_{k+1}=r_{k+1} \). This is our desired conclusion.

Case 3.2: \( \gamma(x_{0})=p_{k+1}=c \). In this case

$$ \gamma(x)\gamma(y_{1})\geq\gamma(x)\gamma(y_{0})\gamma(y_{1})=r=\gamma(x)\gamma(x_{0})\gamma(x_{1})=\gamma(x)c\gamma(x_{1})\geq\gamma(x)\gamma(y_{1}), $$

whence \( r=\gamma(x)\gamma(y_{1})=r_{1}\cdots r_{k}r_{k+2}\cdots r_{m} \), which contradicts the canonicity of decomposition \( r=r_{1}\cdots r_{m} \). Thus, this subcase is impossible.

Case 4: \( \delta(y_{0})\leq\delta(x_{0}) \) and \( \delta(x_{1})\leq\delta(y_{1}) \). This case is symmetric to Case 3.

The proof of Claim 2 is complete.  ☐

By Claim 1, \( r=p_{1}\cdots p_{n}=p_{1}\cdots p_{n}r_{n+1}\cdots r_{m} \) are canonical decompositions. If \( n<m \) then

$$ r=p_{1}\cdots p_{n}\geq p_{1}\cdots p_{n}r_{n+1}\geq p_{1}\cdots p_{n}r_{n+1}\cdots r_{m}=r $$

whence \( r=p_{1}\cdots p_{n}r_{n+1} \) is a canonical decomposition by Lemma 7. As \( r=p_{1}\cdots p_{n}\cdot 1 \), we conclude that \( 1\leq r_{n+1}\leq 1 \) whence \( r_{n+1}=1 \), which is a contradiction with the definition of canonical decomposition. This contradiction shows that \( n=m \). The proof is complete.  ☐

We can now present the main result of this article:

Theorem 3

Each nonunit element of a complete atomic \( l \)-semiring \( {\mathcal{R}} \) with finitely many atoms which satisfies \( (\mathrm{C}_{0}) \) and \( (\mathrm{C}_{1}) \) has the unique canonical decomposition.

Proof

Follows from Theorems 1 and 2.  ☐

5. An Application

In this section, we present an application of Theorem 3 to the semiring of factorial languages over a fixed finite alphabet.

Proposition 1

The structure \( \langle{}{\mathcal{F}}_{\Sigma};\cap,\cdot,\cup,\Sigma^{\ast},\{\lambda\}\rangle{} \) is a complete distributive \( l \)-semiring for an arbitrary alphabet \( \Sigma \).

Proof

As the operation \( \cap \) of intersection of languages is obviously associative and commutative and \( X\cap\Sigma^{\ast}=X \) for all \( X\subseteq\Sigma \), the algebraic structure \( \langle{}{\mathcal{F}}_{\Sigma};\cap,\Sigma^{\ast}\rangle{} \) is a commutative monoid. Furthermore, as the operation \( \cdot \) of catenation is associative and \( L\{\lambda\}=\{\lambda\}L=L \) for all \( L\subseteq\Sigma^{\ast} \), the algebraic structure \( \big{\langle{}}{\mathcal{F}}_{\Sigma};\cdot,\{\lambda\}\big{\rangle{}} \) is a monoid. Therefore, conditions (i)–(ii) of Definition 2 are satisfied. Moreover, in view of the equality \( L\Sigma^{\ast}=\Sigma^{\ast}L=\Sigma^{\ast} \), where \( L\subseteq\Sigma^{\ast} \) is an arbitrary language, condition (iv) of Definition 2 is also satisfied.

We note that the partial order \( \leq \) on \( {\mathcal{F}}_{\Sigma} \) is the reverse set-theoretic inclusion. The lattice \( \langle{}{\mathcal{F}}_{\Sigma};\cap,\cup,\Sigma^{\ast},\{\lambda\}\rangle{} \) is obviously complete and distributive. Condition (i) of Definition 3 is obviously satisfied. As \( A\cup B\subseteq AB \) for factorial languages \( A \) and \( B \), condition (ii) of Definition 3 is satisfied. Moreover, it is not hard to see that condition (ii) of Definition 4 is also satisfied.

We show that condition (i) of Definition 4 (in particular, condition (iii) of Definition 2) is satisfied. Indeed, let \( R,S\in{\mathcal{F}}_{\Sigma} \) and \( {\mathcal{X}}\subseteq{\mathcal{F}}_{\Sigma} \). It suffices to show that

$$ \bigcap R{\mathcal{X}}S=\bigcap\{RXS\mid X\in{\mathcal{X}}\}\subseteq R\Bigl{(}\bigcap{\mathcal{X}}\Bigr{)}S. $$

To this end, take \( \alpha\in\bigcap\{RXS\mid X\in{\mathcal{X}}\} \). This means that, for each \( X\in{\mathcal{X}} \), there are words \( \beta_{X}\in R \), \( \gamma_{X}\in X \), and \( \delta_{X}\in S \) such that \( \alpha=\beta_{X}\gamma_{X}\delta_{X} \). Let \( \beta \) be the longest prefix of \( \alpha \) which belongs to \( R \). Similarly, let \( \delta \) be the longest suffix of \( \alpha \) belonging to \( S \). The two cases are possible:

Case 1: \( |\beta|+|\delta|>|\alpha| \). In this case, \( \alpha=\beta\delta^{\prime} \), where \( \delta^{\prime} \) is a suffix of \( \delta \). We have in particular that \( \delta^{\prime}\in S \). As \( \lambda\in\bigcap{\mathcal{X}} \), we conclude that \( \alpha\in R\bigl{(}\bigcap{\mathcal{X}}\bigr{)}S \).

Case 2: \( |\beta|+|\delta|\leq|\alpha| \). In this case, \( \alpha=\alpha\gamma\delta \), where \( \gamma \) is a subword of \( \gamma_{X} \) for all \( X\in{\mathcal{X}} \). This means that \( \gamma\in X \) for all \( X\in{\mathcal{X}} \). Thus, \( \gamma\in\bigcap{\mathcal{X}} \) whence \( \alpha\in R\bigl{(}\bigcap{\mathcal{X}}\bigr{)}S \).

Therefore, the algebraic structure \( \langle{}{\mathcal{F}}_{\Sigma};\cap,\cdot,\cup,\Sigma^{\ast},\{\lambda\}\rangle{} \) is a complete distributive \( l \)-semiring.  ☐

Proposition 2

The complete \( l \)-semiring \( \langle{}{\mathcal{F}}_{\Sigma};\cap,\cdot,\cup,\Sigma^{\ast},\{\lambda\}\rangle{} \) is atomic with finitely many atoms for an arbitrary finite alphabet \( \Sigma \).

Proof

We put \( A=\bigl{\{}\{a,\lambda\}\mid a\in\Sigma\bigr{\}} \). It is straightforward to see that \( A \) is a finite set of atoms in \( {\mathcal{F}}_{\Sigma} \) and all conditions of Definition 5 are satisfied for the set \( A \).  ☐

From Propositions 1, 2, and Theorem 1, we obtain

Corollary 1

Each nontrivial factorial language \( L\subseteq\Sigma^{\ast} \) has a canonical decomposition for an arbitrary finite alphabet \( \Sigma \).


In the proof of Proposition 3 below, we use an argument by Avgustinovich and Frid (see [1, p. 157, Case 1]).

Proposition 3

The sentence \( (\mathrm{C}_{0}) \) holds in the algebraic structure \( \langle{}{\mathcal{F}}_{\Sigma};\cap,\cdot,\cup,\Sigma^{\ast},\{\lambda\}\rangle{} \) for an arbitrary alphabet \( \Sigma \).

Proof

Suppose that \( A_{0}A_{1}=B_{0}B_{1} \) for some factorial languages \( A_{0},A_{1},B_{0},B_{1}\in{\mathcal{F}}_{\Sigma} \); i.e., the premise of \( (\mathrm{C}_{0}) \) holds. The following cases are possible:

Case 1: \( A_{0}\subseteq B_{0} \) and \( B_{1}\nsubseteq A_{1} \). In this case, there is a word \( \alpha\in B_{1}{\setminus}A_{1} \). Let \( \beta \) denote the longest suffix of \( \alpha \) which belongs to \( A_{1} \). In this case, \( \alpha=\gamma\beta \) for some nonempty word \( \gamma\in\Sigma^{\ast} \). As \( \alpha\in B_{1} \), we conclude that \( \delta\gamma\beta=\delta\alpha\in B_{0}B_{1}=A_{0}A_{1} \) for each \( \delta\in B_{0} \). As \( \gamma\neq\lambda \), the word \( \beta \) is the longest suffix of \( \delta\gamma\beta \) which belongs to \( A_{1} \). This means that \( \delta\gamma\in A_{0} \) whence \( \delta\in A_{0} \), since \( A_{0} \) is a factorial language. Consequently, we proved that \( B_{0}\subseteq A_{0} \). Therefore, \( A_{0}=B_{0} \).

Case 2: \( A_{0}\subseteq B_{0} \) and \( B_{1}\subseteq A_{1} \). Hence, \( B_{0}\leq A_{0} \) and \( A_{1}\leq B_{1} \).

Case 3: \( A_{0}\nsubseteq B_{0} \) and \( B_{1}\subseteq A_{1} \). In this case, there is a word \( \alpha\in A_{0}{\setminus}B_{0} \). Let \( \beta \) denote the longest prefix of \( \alpha \) which belongs to \( B_{0} \). In this case, \( \alpha=\beta\gamma \) for some nonempty \( \gamma\in\Sigma^{\ast} \). As \( \alpha\in A_{0} \), we conclude that \( \beta\gamma\delta=\alpha\delta\in A_{0}A_{1}=B_{0}B_{1} \) for each \( \delta\in A_{1} \). Since \( \gamma\neq\lambda \), the word \( \beta \) is the longest prefix of \( \beta\gamma\delta \) belonging to \( B_{0} \). This implies that \( \gamma\delta\in B_{1} \) whence \( \delta\in B_{1} \) as \( B_{1} \) is a factorial language. Hence, we proved that \( A_{1}\subseteq B_{1} \). Therefore, \( A_{1}=B_{1} \).

Case 4: \( A_{0}\nsubseteq B_{0} \) and \( B_{1}\nsubseteq A_{1} \). In this case, there are words \( \alpha\in A_{0}{\setminus}B_{0} \) and \( \beta\in A_{1}\nsubseteq B_{1} \). Arguing as in Case 1, we prove that \( B_{0}\subseteq A_{0} \). Arguing as in Case 3, we show that \( A_{1}\subseteq B_{1} \). Thus, \( A_{0}\leq B_{0} \) and \( B_{1}\leq A_{1} \).

We established therefore that the conclusion of \( (\mathrm{C}_{0}) \) also holds for \( A_{0} \), \( A_{1} \), \( B_{0} \), and \( B_{1} \).  ☐

Proposition 4

The sentence \( (\mathrm{C}_{1}) \) holds in the algebraic structure \( \langle{}{\mathcal{F}}_{\Sigma};\cap,\cdot,\cup,\Sigma^{\ast},\{\lambda\}\rangle{} \) for an arbitrary alphabet \( \Sigma \).

Proof

Suppose that \( AA_{0}A_{1}=AB_{0}B_{1} \), \( AA_{0}\leq AB_{0} \), and \( B_{1}\leq A_{1} \) for some factorial languages \( A \), \( A_{0} \), \( A_{1} \), \( B_{0} \), \( B_{1}\in{\mathcal{F}}_{\Sigma} \); i.e., the premise of \( (\mathrm{C}_{1}) \) holds. The last two inequalities mean that \( AB_{0}\subseteq AA_{0} \) and \( A_{1}\subseteq B_{1} \). We choose an arbitrary word \( \mu\in AA_{0}A_{1}=AB_{0}B_{1} \). Let \( \delta(\mu) \) denote the longest prefix of \( \mu \) belonging to \( AB_{0} \) and let \( \alpha_{1}(\mu) \) denote the longest suffix of \( \mu \) belonging to \( A_{1} \).

The following cases are possible:

Case 1: \( |\delta(\mu)|+|\alpha_{1}(\mu)|\geq|\mu| \). We put \( \gamma(\mu)=\lambda \) in this case.

Case 2: \( |\delta(\mu)|+|\alpha_{1}(\mu)|<|\mu| \). In this case, \( \mu=\delta(\mu)\gamma(\mu)\alpha_{1}(\mu) \) for some nonempty word \( \gamma(\mu) \).

We put \( B=F(B_{0}{\setminus}P(A)B_{0}) \) and \( C=F(\gamma(\mu)\mid\mu\in AA_{0}A_{1}) \). It is obvious that \( B,C\in{\mathcal{F}}_{\Sigma} \).

Claim 1

\( B\subseteq B_{0} \) and \( AB_{0}=AB \).

Proof

The first inclusion is obvious. We have therefore that \( AB\subseteq AB_{0} \). In order to prove the reverse inclusion, we choose arbitrary words \( \alpha\in A \) and \( \beta\in B_{0} \) and show that \( \alpha\beta\in AB \). Let \( \alpha^{\prime} \) denote the longest prefix of \( \alpha\beta \) which belongs to \( A \). As \( \alpha\in A \), we conclude that \( \alpha\beta=\alpha^{\prime}\gamma \) where \( \gamma \) is a suffix of \( \beta \). Thus, \( \gamma\in B_{0} \).

Suppose that \( \gamma=\delta\gamma^{\prime} \) for some word \( \delta\in P(A) \). In this case, \( \gamma^{\prime}\in B_{0} \) and \( \alpha\beta=\alpha^{\prime}\gamma=\alpha^{\prime}\delta\gamma^{\prime} \). Moreover, \( \alpha^{\prime} \) is a proper prefix of \( \alpha^{\prime}\delta\in A \). In view of the maximality of \( \alpha^{\prime} \), this is impossible, whence \( \gamma\notin P(A)B_{0} \) and \( \gamma\in B_{0}{\setminus}P(A)B_{0}\subseteq B \). This means that \( \alpha\beta=\alpha^{\prime}\gamma\in AB \).  ☐

Claim 2

\( AA_{0}A_{1}=ABCA_{1} \).

Proof

In view of Claim 1, it suffices to show that \( AA_{0}A_{1}=AB_{0}CA_{1} \). By definition, for each word \( \mu\in AA_{0}A_{1} \), we have \( \mu=\delta(\mu)\gamma(\mu)\alpha^{\prime}(\mu) \) where \( \alpha^{\prime}(\mu) \) is a suffix of \( \alpha_{1}(\mu) \). As \( \alpha_{1}(\mu)\in A_{1} \) and \( A_{1} \) is a factorial language; therefore, \( \alpha^{\prime}(\mu)\in A_{1} \). Moreover, by construction and Claim 1, \( \delta(\mu)\in AB_{0} \) and \( \gamma(\mu)\in C \). Thus, \( \mu\in AB_{0}CA_{1} \) whence \( AA_{0}A_{1}\subseteq AB_{0}CA_{1} \). In order to prove the reverse inclusion, we consider arbitrary words \( \alpha\in A \), \( \beta\in B_{0} \), \( \gamma\in C \), and \( \xi\in A_{1} \). We have to show that \( \alpha\beta\gamma\xi\in AA_{0}A_{1} \). The two cases are possible:

Case 1: \( \gamma=\lambda \). In this case, we have by assumption that

$$ \alpha\beta\gamma\xi=\alpha\beta\xi\in AB_{0}A_{1}\subseteq AA_{0}A_{1}. $$

Case 2: \( \gamma\neq\lambda \). In this case, there are words \( \mu\in AA_{0}A_{1} \) and \( \gamma_{0},\gamma_{1}\in\Sigma^{\ast} \) such that \( \gamma_{0}\gamma\gamma_{1}=\gamma(\mu) \). Then \( \delta(\mu)\gamma_{0}\gamma\gamma_{1}\alpha_{1}(\mu)=\mu\in AA_{0}A_{1} \). As \( \alpha_{1}(\mu) \) is the longest suffix of \( \mu \) belonging to \( A_{1} \); therefore, \( \delta(\mu)\gamma_{0}\gamma\gamma_{1}\in AA_{0} \). But then \( \delta(\mu)\gamma_{0}\gamma\in AA_{0} \) as \( AA_{0} \) is a factorial language. Thus, \( \eta=\delta(\mu)\gamma_{0}\gamma\xi\in AA_{0}A_{1}=AB_{0}B_{1} \). As \( \delta(\mu) \) is the longest prefix of \( \eta \) belonging to \( AB_{0} \), we conclude that \( \gamma_{0}\gamma\xi\in B_{1} \) and \( \gamma\xi\in B_{1} \), since \( B_{1} \) is a factorial language. Hence, \( \alpha\beta\gamma\xi\in AB_{0}B_{1}=AA_{0}A_{1} \).  ☐

Claim 3

\( BC\subseteq A_{0} \).

Proof

By Lemma 6, the language \( BC \) coincides with \( F\bigl{(}B_{0}C{\setminus}P(A)B_{0}C\bigr{)} \). As \( A_{0} \) is a factorial language, it suffices to verify that

$$ B_{0}C{\setminus}P(A)B_{0}C\subseteq A_{0}. $$

Indeed, we choose arbitrary words \( \beta\in B_{0} \) and \( \gamma\in C \) such that \( \beta\gamma\notin P(A)B_{0}C \). We have to show that \( \beta\gamma\in A_{0} \). The following cases are possible:

Case 1: \( \gamma=\lambda \). In this case, \( \beta\gamma=\beta\notin P(A)B_{0} \) whence \( \beta\in B \). Given an arbitrary word \( \alpha\in A \), we have \( \alpha\beta\in AB\subseteq AB_{0}\subseteq AA_{0} \). Let \( \alpha^{\prime} \) denote the longest prefix of the word \( \alpha\beta \) which belongs to \( A \). Since \( \alpha\in A \), we conclude that \( \alpha^{\prime}=\alpha\delta(\alpha) \) where \( \delta(\alpha) \) is a prefix of \( \beta \); i.e., \( \beta=\delta(\alpha)\beta^{\prime}(\alpha) \) and \( \beta^{\prime}(\alpha)\in B_{0} \). We choose \( \alpha_{0} \) so that the word \( \delta(\alpha_{0}) \) is of least length among the words in \( X=\{\delta(\alpha)\mid\alpha\in A\} \).

Suppose that \( \delta(\alpha_{0})\neq\lambda \) and prove that \( \delta(\alpha_{0})\in P(A) \) in this case. Indeed, consider an arbitrary word \( \alpha\in A \). Then \( \alpha\beta=\alpha\delta(\alpha)\beta^{\prime}(\alpha) \). As \( \delta(\alpha_{0}) \) is of least length in \( X \), we conclude that \( \delta(\alpha_{0}) \) is a prefix \( \delta(\alpha) \) whence \( \alpha\delta(\alpha_{0}) \) is a prefix of \( \alpha\delta(\alpha)\in A \). Therefore, \( \alpha\delta(\alpha_{0})\in A \) and \( \delta(\alpha_{0})\in P(A) \). Furthermore, as \( \beta=\delta(\alpha_{0})\beta^{\prime}(\alpha_{0})\in P(A)B_{0} \), we obtain a contradiction. This contradiction shows that \( \delta(\alpha_{0})=\lambda \); i.e., \( \alpha_{0} \) is the longest prefix of \( \alpha_{0}\beta\in AA_{0} \) which belongs to \( A \). Hence, \( \beta\gamma=\beta\in A_{0} \).

Case 2: \( \gamma\neq\lambda \). In this case, there are words \( \mu\in AA_{0}A_{1} \) and \( \gamma_{0} \), \( \gamma_{1}\in\Sigma^{\ast} \) such that \( \gamma_{0}\gamma\gamma_{1}=\gamma(\mu)\in C \). Then by Claims 1 and 2, for each word \( \alpha\in A \), we have

$$ \eta=\alpha\beta\gamma\gamma_{1}\alpha_{1}(\mu)\in AB_{0}CA_{1}=ABCA_{1}=AA_{0}A_{1}. $$

Since \( \alpha_{1}(\mu) \) is the longest suffix of \( \eta \) belonging to \( A_{1} \), we conclude that \( \alpha\beta\gamma\gamma_{1}\in AA_{0} \) whence \( \alpha\beta\gamma\in AA_{0} \) for all \( \alpha\in A \). Using the same argument as in Case 1, we can show that there is \( \alpha_{0}\in A \) such that \( \alpha_{0} \) is the longest prefix of \( \alpha_{0}\beta\gamma \) which belongs to \( A \). As \( \alpha_{0}\beta\gamma\in AA_{0} \), this yields \( \beta\gamma\in A_{0} \).  ☐

Claim 4

\( CA_{1}\subseteq B_{1} \).

Proof

Let \( \gamma\in C \) and \( \alpha\in A_{1} \). We have to show that \( \gamma\alpha\in B_{1} \). The following cases are possible:

Case 1: \( \gamma=\lambda \). In this case, \( \gamma\alpha=\alpha\in A_{1}\subseteq B_{1} \) by assumption.

Case 2: \( \gamma\neq\lambda \). In this case, there are words \( \mu\in AA_{0}A_{1} \) and \( \gamma_{0},\gamma_{1}\in\Sigma^{\ast} \) such that \( \gamma_{0}\gamma\gamma_{1}=\gamma(\mu)\in C \). Then

$$ \eta=\delta(\mu)\gamma_{0}\gamma\alpha\in AB_{0}CA_{1}=ABCA_{1}=AA_{0}A_{1}=AB_{0}B_{1} $$

by Claims 1 and 2. Since \( \gamma_{0}\gamma\neq\lambda \), the word \( \delta(\mu) \) is the longest prefix of \( \eta \) which belongs to \( AB_{0} \). Therefore, \( \gamma_{0}\gamma\alpha\in B_{1} \) whence \( \gamma\alpha\in B_{1} \) as \( B_{1} \) is a factorial language.  ☐

It follows from Claims 1–4 that the conclusion of \( (\mathrm{C}_{1}) \) also holds for \( A \), \( A_{0} \), \( A_{1} \), \( B_{0} \), and \( B_{1} \).  ☐

From Propositions 3, 4, and Corollary 1 we obtain the following

Corollary 2 [1, Theorem 1]

Each nontrivial factorial language \( L\subseteq\Sigma^{\ast} \) has the unique canonical decomposition for an arbitrary finite alphabet \( \Sigma \).