A Ramsey Theorem for Finite Monoids
aa r X i v : . [ c s . F L ] J a n A Ramsey Theorem for Finite Monoids
Ismaël Jecker
Institute of Science and Technology, [email protected]
Abstract
Repeated idempotent elements are commonly used to characterise iterable behaviours in abstractmodels of computation. Therefore, given a monoid M , it is natural to ask how long a sequence ofelements of M needs to be to ensure the presence of consecutive idempotent factors. This questionis formalised through the notion of the Ramsey function R M of a finite monoid M , obtained bymapping every k ∈ N to the minimal integer R M ( k ) such that every word u ∈ M ∗ of length R M ( k )contains k consecutive non-empty factors that correspond to the same idempotent element of M .In this work, we study the behaviour of the Ramsey function R M by investigating the regular D -length of M , defined as the largest size L ( M ) of a submonoid of M isomorphic to the set ofnatural numbers { , , . . . , L ( M ) } equipped with the max operation. We show that the regular D -length of M determines the degree of R M , by proving that k L ( M ) ≤ R M ( k ) ≤ ( k | M | ) L ( M ) .To allow applications of this result, we provide the value of the regular D -length of diversemonoids. In particular, we prove that the full monoid of n × n Boolean matrices, which is used toexpress transition monoids of non-deterministic automata, has a regular D -length of n + n +22 . CCS → Theory of computation → Formal languages and auto-mata theory → Formalisms → Algebraic language theory
Keywords and phrases
Semigroup, monoid, idempotent, automaton
Funding
This project has received funding from the European Union’s Horizon 2020 research andinnovation programme under the Marie Skłodowska-Curie Grant Agreement No. 754411.
Acknowledgements
I wish to thank Michaël Cadilhac, Emmanuel Filiot and Charles Paperman fortheir valuable insights concerning Green’s relations.
The algebraic approach to language theory was initiated by Schützenberger with the defini-tion of the syntactic monoid associated to a formal language [18]. This led to several parallelsbeing drawn between classes of languages and varieties of monoids, the most famous beingthat rational languages are characterised by finite syntactic monoids [16], and that star-freelanguages are characterised by finite aperiodic syntactic monoids [19]. These characterisa-tions motivate the study of finite monoids as a way to gain some insight about automata.In this work, we focus on the following problem:
Given a finite monoid M and k ∈ N , what is the minimal integer R M ( k ) such that everyword u ∈ M ∗ of length R M ( k ) contains k consecutive factors corresponding to the sameidempotent element of M ? The interest of this problem lies in the fact that when we model the behaviours of anabstract machine as elements of a monoid, repeated idempotent factors often characterisethe behaviours that have good properties with respect to iteration. This can be used, forinstance, to obtain pumping lemmas, as seen in [12] for weighted automata.A partial answer to this problem is obtained by using Ramsey’s Theorem [17] or Simon’sFactorisation Forest Theorem [20] (these techniques are detailed in Appendix A), as bothapproaches provide upper bounds for R M ( k ). However, neither approximation is precise:Ramsey’s theorem disregards the monoid structure, and the Factorisation Forest Theoremguarantees much more than what is required here. We prove a version of Ramsey’s Theorem A Ramsey Theorem for Finite Monoids adapted to monoids, or, equivalently, a weaker version of the Forest Factorisation Theorem,that yields an improved bound relying on a parameter of monoids called the regular D -length.We now present some examples, followed with an overview of the main concepts studied inthis paper: the Ramsey function associated to a monoid and the regular D -length. We describe three families of monoids, along with the corresponding idempotent elements.
Max monoid
The max monoid H n is the set { , , . . . , n } , equipped with the max operation.In this monoid, every element i is idempotent since max( i, i ) = i . Transformation monoid
The (full) transformation monoid T n is the set of all (partial)functions from a set of n elements into itself, equipped with the composition. See [5] for adetailed definition of T n and its properties. Transformation monoids contain a wide rangeof idempotent elements. For instance, the identity function, mapping each element to itself,or the constant function f i , mapping all elements to one fixed element i , are idempotent. Ingeneral, a function f is idempotent if and only if each element i of its range satisfies f ( i ) = i .Transformations are commonly used to express transition monoids of deterministic finitestate automata, as in this setting each input letter acts as a function over the set of states. Relation monoid
For non-deterministic automata, transition monoids are more complex:functions fail to model the behaviour of the input letters since a single state can transitiontowards several distinct states. We use the (full) relation monoid B n of all n × n Booleanmatrices (matrices with values in { , } ), equipped with the usual matrix composition (con-sidering that 1+1 = 1). There are plenty of idempotent matrices, for instance every diagonalmatrix, or the full upper triangular matrix. Idempotent Boolean matrices are characterisedin [13], they correspond to specific orders over the subsets of { , , . . . , n } . Given a finite monoid M , the Ramsey function R M associated to M maps each k ∈ N to theminimal integer R M ( k ) such that every sequence of elements of M of length R M ( k ) contains k non-empty consecutive factors that all correspond to the same idempotent element of M . Related work
There are several known methods to approximate the Ramsey function R M ofa monoid M . Ramsey’s Theorem and Simon’s Factorisation Forest Theorem are commonlyused, however, as stated before, these approaches are too general to obtain a precise bound.The value of R M ( k ) is studied in [6] in the particular case k = 1. The authors prove that fora monoid M that contains N non-idempotent elements, R M (1) ≤ N −
1. No general relatedlower bound is proved, but they show that for every N ∈ N , there exists a monoid M N with N non-idempotent elements that actually reaches the upper bound: R M N (1) = 2 N − Our contributions
We prove new bounds for R M by following a different approach: insteadof focusing on the non-idempotent elements of M , we study its idempotent elements, andthe way in which they interact. In Section 3, we start by considering two specific cases wherethe exact value of the Ramsey function is easily obtained. First, for a group G , the Ramseyfunction is polynomial with respect to the size of G : R G ( k ) = k |G| . Second, we call maxmonoid H n the set { , , . . . , n } equipped with the max operation, and we show that here . Jecker 3 the Ramsey function is exponential with respect to the size of H n : R H n ( k ) = k n . The laterresult implies that k n is a lower bound for the Ramsey function of every monoid M thathas H n as a submonoid. Motivated by this observation, we show how to get a related upperbound: We define the regular D -length L ( M ) of M as the size of the largest max monoid H L ( M ) embedded in M , and prove the following result. ◮ Theorem 1.
Every monoid M of regular D -length L satisfies k L ≤ R M ( k ) ≤ ( k | M | ) L . Stated differently: every word u ∈ M ∗ of length ( k | M | ) L contains k consecutive non-emptyfactors corresponding to the same idempotent element of M , and, conversely, there existsa word u M ∈ M ∗ of length k L − k consecutive non-empty factorscorresponding to the same idempotent element. Note that while the gap between the lowerand upper bound is still wide, this shows that the degree of the Ramsey function R M isdetermined by the regular D -length of M . D -length Theorem 1 states that the degree of the Ramsey function of a monoid M is determined bythe regular D -length of M , which is the size of the largest max monoid embedded in M .We now show that for transformation monoids and relation monoids, the regular D -lengthis exponentially shorter than the size. Let us begin by mentioning an equivalent definitionof the regular D -length in terms of Green’s relations. While this alternative definition is notused in the proofs presented in this paper, it allows us to immediately obtain the regular D -length of monoids whose Green’s relations are known. Alternative definition
The regular D -length of a monoid M is the size of its largest chainof regular D -classes. A D -class of M is an equivalence class of the preorder ≤ D defined by m ≤ D m ′ if m = s · m ′ · t for some s, t ∈ M , and it is called regular if it contains at least oneidempotent element (see [15] for more details). The equivalence between both definitions isproved in Appendix B. Computing the regular D -length The following table compares the size and the regular D -length of the monoids mentioned earlier. The entries corresponding to the sizes areconsidered to be general knowledge. We detail below the row listing the regular D -lengths. Monoid
G H n T n B n Size | G | n ( n + 1) n ( n ) Regular D -length 1 n n + 1 n + n +22 First, every group G contains a single idempotent element (the neutral element), henceits regular D -length is 1. Then, using the definition of the regular D -length in terms ofembedded max monoid, we immediately obtain that L ( H n ) is equal to n . We get thenext entry using the definition of the regular D -length in terms of chain of D -classes: Thetransformation monoid T n is composed of a single chain of n + 1 D -classes that are allregular [5], hence its regular D -length is n + 1.Finally, for the relation monoid B n , the situation is not as clear: the D -classes do not forma single chain, and some of them are not regular. Determining the exact size of the largestchain of D -classes (note the absence of “regular”) is still an open question, yet it is known A Ramsey Theorem for Finite Monoids to grow exponentially with respect to n : a chain of D -classes whose size is the Fibonaccinumber F n +3 − n − + n − regular D -classes, we can obtain the precise value of the maximallength, and, somewhat surprisingly, it is only quadratic in n : ◮ Theorem 2.
The regular D -length of the monoid of n × n Boolean matrices is n + n +22 . Therefore, the regular D -length of a transformation monoid is exponentially smaller thanits size, and the regular D -length of a relation monoid is even exponentially smaller thanits largest chain of D -classes. For such kind of monoids, Theorem 1 performs considerablybetter than previously known methods to find idempotent factors. For instance, it was usedin [14] to close the complexity gap left in [1] for the problem of deciding whether the functiondefined by a given two-way word transducer is definable by a one-way transducer. We define in this section the notions that are used throughout the paper. We denote by N the set { , , , . . . } , and for all i ≤ j ∈ N we denote by [ i, j ] the interval { i, i + 1 , . . . , j } . Monoids
A (finite) semigroup ( S, · ) is a finite set S equipped with a binary operation · : S × S → S that is associative : ( s · s ) · s = s · ( s · s ) for every s , s , s ∈ S. A monoid isa semigroup ( M, · ) that contains a neutral element M : m · M = m = 1 M · m for all m ∈ M. A group is a monoid ( G , · ) in which every element g ∈ G has an inverse element g − ∈ G : g · g − = 1 G = g − · g. We always denote the semigroup operation with the symbol · . As aconsequence, we identify a semigroup ( S, · ) with its set of elements S .An element e of a semigroup S is called idempotent if it satisfies e · e = e . Note thatwhereas a finite semigroup does not necessarily contain a neutral element, it always containsat least one idempotent element: iterating any element s ∈ S eventually yields an idempotentelement, called the idempotent power of s , and denoted s ∈ S .A homomorphism between two monoids M and M ′ is a function ϕ : M → M ′ preservingthe monoid structure: ϕ ( m · m ) = ϕ ( m ) · ϕ ( m ) for all m , m ∈ M and ϕ (1 M ) = ϕ (1 M ′ ). A monomorphism is an injective homomorphism, an isomorphism is a bijectivehomomorphism. Ramsey decomposition
Let M be a monoid. A word over M is a finite sequence u = m m . . . m n ∈ M ∗ of elements of M . The length of u is its number of symbols | u | = n ∈ N .We enumerate the positions between the letters of u starting from 0 before the first letter,until | u | after the last letter. A factor of u is a subsequence of u composed of the lettersbetween two such positions i and j : u [ i, j ] = m i +1 m i +2 . . . m j ∈ M ∗ for some 0 ≤ i ≤ j ≤ | u | (where u [ i, j ] = ε if i = j ). We denote by π ( u ) the element 1 M · m · m · . . . · m n ∈ M ,and we say that u reduces to π ( u ). For every integer k ∈ N , a k -decomposition of u is adecomposition of u in k + 2 factors such that the k middle ones are non-empty: u = xy y . . . y k z, where x, z ∈ M ∗ , and y i ∈ M + for every 1 ≤ i ≤ k .A k -decomposition is called Ramsey if all the middle factors y , y , . . . , y k reduce to thesame idempotent element e ∈ M . For instance, a word has a Ramsey 1-decomposition ifand only if it contains a factor that reduces to an idempotent element. The Ramsey function R M : N → N associated to M is the function mapping each k ∈ N to the minimal R M ( k ) ∈ N such that every word u ∈ M ∗ of length R M ( k ) has a Ramsey k -decomposition. . Jecker 5 In this section, we bound the Ramsey function R M associated to a monoid M . As a first stepwe consider two basic cases for which the exact value of the Ramsey function is obtained: inSubsection 3.1 we show that every group G satisfies R G ( k ) = k |G| , and in Subsection 3.2 weshow that every max monoid H n (obtained by equipping the first n positive integers withthe max operation) satisfies R H n ( k ) = k n . Finally, in Subsection 3.3, we prove bounds inthe general case by studying the submonoids of M isomorphic to a max monoid. We show that in a group, the Ramsey function is polynomial with respect to the size. ◮ Proposition 3.
For every group G , R G ( k ) = k |G| for all k ∈ N . We fix for this subsection a group G and k ∈ N . We begin by proving an auxiliary lemma,which we then apply to prove matching bounds for R G ( k ): First, we define an algorithm thatextracts a Ramsey k -decomposition out of every word of length k |G| . Then, we present theconstruction of a witness u G ∈ G ∗ of length k |G| − k -decompositions. Key lemma
In a group, the presence of inverse elements allows us to establish a corres-pondence between the factors of a word u ∈ G ∗ that reduce to the neutral element, and thepairs of prefixes of u that both reduce to the same element. ◮ Lemma 4.
Two prefixes u [0 , i ] and u [0 , j ] of a word u ∈ G ∗ reduce to the same element ifand only if u [ i, j ] reduces to the neutral element of G . Proof.
Let u ∈ G ∗ be a word. The statement is a direct consequence of the fact that forevery 0 ≤ i ≤ j ≤ | u | , π ( u [0 , i ]) · π ( u [ i, j ]) = π ( u [0 , j ]): If π ( u [0 , i ]) = π ( u [0 , j ]), then π ( u [ i, j ]) = π ( u [0 , i ]) − · π ( u [0 , j ]) = π ( u [0 , i ]) − · π ( u [0 , i ]) = 1 G . Conversely, if π ( u [ i, j ]) = 1 G , then π ( u [0 , i ]) = π ( u [0 , i ]) · G = π ( u [0 , i ]) · π ( u [ i, j ]) = π ( u [0 , j ]) . ◭ Algorithm
We define an algorithm constructing Ramsey k -decompositions. Alg : Start with u ∈ G ∗ of length k |G| ; a. Compute the k |G| + 1 prefixes π ( u [0 , π ( u [0 , π ( u [0 , | u | ]) of u ; b. Find k + 1 indices i , i , . . . , i k such that all the π ( u [0 , i j ]) are equal; c. Return the Ramsey k -decomposition u = u [ i , i ] u [ i , i ] . . . u [ i k − , i k ].Since Lemma 4 ensures that every pair of elements i j , i j +1 identified at step 2 satisfies π ( u [ i j , i j +1 ]) = 1 G , we are guaranteed that the returned k -decomposition is Ramsey. Witness
We build a word u G ∈ G ∗ of length k |G| − k -decompositions.Let v = a a . . . a k |G| ∈ G ∗ be a word of length k |G| , starting with the letter 1 G , and contain-ing exactly k times each element of G . For instance, given an enumeration g , g , . . . , g |G| of the elements of G starting with g = 1 G , we can simply pick v = g k g k . . . g k |G| . Nowlet u G = b b . . . b k |G|− be the word whose sequence of reduced prefixes is v : for every1 ≤ i ≤ k |G| −
1, the letter b i is equal to a − i · a i +1 . Then for every k -decomposition of u G , at least one of the factors do not reduce to the neutral element of G , since otherwiseLemma 4 would imply the existence of k + 1 identical letters in v , which is not possible byconstruction. As a consequence, u G has no Ramsey k -decompositions. A Ramsey Theorem for Finite Monoids
Given an integer n ∈ N , the max monoid , denoted H n , is the monoid over the set { , , . . . , n } with the associative operation i · j = max( i, j ). Whereas in a group only the neutral elementis idempotent, each element i of the max monoid H n is idempotent since max( i, i ) = i . As aresult of this abundance of idempotent elements, an exponential bound is required to ensurethe presence of consecutive factors reducing to the same idempotent element. ◮ Proposition 5.
For every max monoid H n , R H n ( k ) = k n for all k ∈ N . The proof is done in two steps: we first define an algorithm that extracts a Ramsey k -decomposition out of every word of length k n , and then we present the construction of awitness u n of length k n − k -decompositions. Algorithm
We define an algorithm that extracts a Ramsey k -decompositions out of eachword u ∈ H ∗ n of length k n . It is a basic divide and conquer algorithm: we divide the initialword u into k equal parts. If each of the k parts reduces to n , they form a Ramsey k -decomposition since n is an idempotent element. Otherwise, one part does not contain themaximal element n ∈ H n , and we start over with it. Formally, Alg : Start with u ∈ H ∗ n of length k n , initialize j to n . While j >
0, repeat the following: a. Split u into k factors u , u , . . . , u k of length k j − ; b. If every u i contains the letter j , return the Ramsey k -decomposition u = u u . . . u k ; c. If u i does not contain j for some 1 ≤ i ≤ j , decrement j by 1 and set u := u i ∈ H ∗ j − .The algorithm is guaranteed to eventually return a Ramsey k -decomposition: if the n th cycleof the algorithm is reached, it starts with a word of length k whose letters are in the monoid H , which only contains the letter 1, hence the algorithm will go to step b. Witness
We construct an infinite sequence of words u , u , . . . ∈ N ∗ such that for all n ∈ N ,(a) u n ∈ H n satisfies | u n | = k n − u n has no Ramsey k -decompositions. Let u = 1 k − ∈ H ∗ ,u n = ( u n − n ) k − u n − ∈ H ∗ n for every n > . For every n >
1, the word u n is defined as k copies of u n − separated by the letter n .We prove by induction that the two conditions are satisfied by each word of the sequence.The base case is immediate: the word u has length k −
1, and as a consequence has nodecomposition into k nonempty factors. Now suppose that n >
1, and that u n − satisfiesthe two properties. Then u n has the required length: | u n | = ( k − | u n − | + 1) + | u n − | = ( k − k n − + k n − − k n − . To conclude, we show that every k -decomposition u n = xy y . . . y k z, with y i ∈ H + n for all 1 ≤ i ≤ k (1)is not Ramsey. Let y be the factor y y . . . y k of u n , and consider the two following cases:If π ( y ) = n , none of the y i contains the letter n , hence y is factor of one of the factors u n − of u n . Therefore, by the induction hypothesis, Decomposition (1) is not Ramsey.If π ( y ) = n , since u n contains only k − n , one of the factors y i doesnot contain n for 1 ≤ i ≤ k . Then π ( y ) = π ( y i ), hence Decomposition (1) is not Ramsey. ◮ Example 6.
Here are the first three words of the sequence in the cases k = 2 and k = 3: k = 2 : u = 1 u = 121 u = 1213121 ,k = 3 : u = 11 u = 11211211 u = 11211211311211211311211211 . . Jecker 7 We saw in the previous subsection that for the max monoid H n , words of length exponentialwith respect to n are required to guarantee the presence of Ramsey decompositions (Propos-ition 5). Note that the same lower bound applies to every monoid M that contains a copyof H n as submonoid. We now show that we can also obtain an upper bound for R M ( k ) bystudying the submonoids of M isomorphic to a max monoid. We formalise this idea throughthe notion of regular D -length of a monoid. Regular D -length The regular D -length of a monoid M , denoted L ( M ), is the size of thelargest max monoid embedded in M . Formally, it is the largest ℓ ∈ N such that there existsa monomorphism (i.e. injective monoid homomorphism) ϕ : H ℓ → M . We now present themain theorem of this section, which states that for every monoid M , the degree of R M ( k ) isdetermined by the regular D -length of M . ◮ Theorem 1.
Every monoid M of regular D -length L satisfies k L ≤ R M ( k ) ≤ ( k | M | ) L . Let us fix for the whole subsection a monoid M of regular D -length L ( M ) and an integer k ∈ N . The lower bound is a corollary of Proposition 5: the max monoid H L ( M ) has awitness u L ( M ) of length k L ( M ) − k -decompositions (its constructionis presented in the previous subsection). Then, by definition of the regular D -length, thereexists a monomorphism ϕ : H L ( M ) → M , and applying ϕ to u L ( M ) letter by letter yields awitness u ′ L ( M ) ∈ M ∗ of length k L ( M ) − k -decompositions.The rest of the subsection is devoted to the proof of the upper bound. We begin bydefining an auxiliary algorithm that extracts from each long enough word a decompositionwhere the prefix and suffix absorb the middle factors. Then, we define our main algorithmwhich, on input u ∈ M ∗ of length ( k | M | ) n for some n ∈ N , either returns a Ramsey k -decomposition of u , or a copy of the max monoid H n +1 embedded in M . In particular,if n is equal to the regular D -length L ( M ) of M , we are guaranteed to obtain a Ramsey k -decomposition. Auxiliary algorithm
We define an algorithm which, on input u ∈ M ∗ of length k | M | ,returns a k -decomposition u = xy y . . . y k z, where x, z ∈ M ∗ , and y i ∈ S + for every 1 ≤ i ≤ k such that for every 1 ≤ i ≤ k , both x and z are able to absorb the factor y i : π ( xy i ) = π ( x )and π ( y i z ) = π ( z ). This is done as follows: since u is a word of length k | M | , it can be splitinto k | M | + 1 distinct prefix-suffix pairs. Then k + 1 of these pairs reduce to the same pairof elements of M , which immediately yields the desired decomposition. Formally, Alg : Start with u ∈ M ∗ of length k | M | ;
1. a.
Compute the k | M | + 1 prefixes π ( u [0 , π ( u [0 , π ( u [0 , | u | ]) ∈ M of u , b. Compute the k | M | + 1 suffixes π ( u [0 , | u | ]), π ( u [1 , | u | ]), . . . , π ( u [ | u | , | u | ]) ∈ M of u , c. Identify k + 1 indices s , s , . . . , s k such that (1) all the π ( u [0 , s i ]) are equal, (2) allthe π ( u [ s i , | u | ]) are equal; Set x = u [0 , s ], z = u [ s k , | u | ], and y i = u [ s i − , s i ] for every 1 ≤ i ≤ k ; Return the k -decomposition xy y . . . y k z of u . A Ramsey Theorem for Finite Monoids
Main algorithm
We define an algorithm extracting Ramsey k -decompositions. Over aninput u ∈ M ∗ of length ( k | M | ) n for n ∈ N , the algorithm works by defining graduallyshorter words u n , u n − , . . . ∈ M ∗ , where each u j has length ( k | M | ) j , along with a sequenceof idempotent elements e n +1 , e n , . . . ∈ M . Starting with u n = u , we define e n +1 as theidempotent power of some well chosen factors of u n . We then consider k consecutive factorsof u n . If all of them reduce to e n +1 , they form a Ramsey k -decomposition, and we are done.Otherwise, we pick a factor u n − that does not reduce to e n +1 , and we start over. Thiscontinues until either a Ramsey k -decomposition is found, or n cycles are completed. In thelater case, we show that the function ϕ : H n +1 → M mapping i to e i is a monomorphism. Alg : Start with u ∈ M ∗ of length ( k | M | ) n . Initialize u n to u and j to n .While j >
0, repeat the following:
1. a.
Call
Alg to get an m -decomposition u j = xy y . . . y m z , where m = k j | M | j − ; b. Set v := π ( y ) π ( y ) . . . π ( y m ) ∈ M ∗ ;
2. a.
Call
Alg to get an m ′ -decomposition v = x ′ y ′ y ′ . . . y ′ m ′ z ′ , where m ′ = k j | M | j − ; b. Set w := π ( y ′ ) π ( y ′ ) . . . π ( y ′ m ′ ) ∈ M ∗ , and set e j +1 := ( π ( z ′ x ′ )) ;
3. a.
Split w into k factors y ′′ , y ′′ , . . . , y ′′ k of length ( k | M | ) j − ; b. If every y ′′ i satisfies π ( y i ) = e j +1 , then w = y ′′ y ′′ . . . y ′′ k is a Ramsey decomposition.Return the corresponding Ramsey k -decomposition of u ; c. If π ( y ′′ i ) = e j +1 for some 1 ≤ i ≤ n , set u j − := y ′′ i , and decrement j by 1.Set e = 1 M , and return the idempotent elements e , e , . . . , e n +1 ∈ M . Step 1.
We use the auxiliary algorithm to obtain a decomposition u j = xy y . . . y m z , andwe build v by concatenating the reductions of the y i . Since both x and z absorb each y i ,and in step 2b we define e j +1 as the idempotent power of reduced factors of v :The word u j , its prefix x and its suffix z satisfy π ( u j ) = π ( xz ) = π ( x ) · e j +1 · π ( z ) . (1) Step 2.
We use the auxiliary algorithm to get a decomposition u ′ = x ′ y ′ y ′ . . . y ′ m ′ z ′ , webuild w by concatenating the reductions of the y ′ i , and we set e j +1 as the idempotent powerof π ( z ′ x ′ ). As both x ′ and z ′ absorb each y ′ i , and in step 3c we define u j − as a factor of w :For every factor y of u j − , e j +1 · π ( y ) = e j +1 = π ( y ) · e j +1 . (2) Step 3.
We divide w into k factors of equal length. If each of them reduces to e j +1 , theyform a Ramsey k -decomposition of w . As w is obtained form u by iteratively reducingfactors and dropping prefixes and suffixes, this decomposition can be transferred back to aRamsey k -decomposition of u = u n . If one factor does not reduce to e j +1 , we assign itsvalue to u j − . Therefore:The word u j − does not reduce to e j +1 . (3) Proof of correctness
To prove that the algorithm behaves as intended, we show thatif it completes n cycles without returning a Ramsey k -decomposition, then the function ϕ : H n +1 → M defined by ϕ ( j ) = e j is a monomorphism. Since e j is the idempotent powerof reduced factors of u j − for all 1 ≤ j ≤ n , Equation (2) yield that e j +1 · e j = e j +1 = e j · e j +1 .Therefore ϕ is a homomorphism. We conclude by showing that it is injective. Suppose,towards building a contradiction, that ϕ ( j ) = e j = e i = ϕ ( i ) for some 1 ≤ j < i ≤ n . Since ϕ is a homomorphism, all the intermediate elements collapse: in particular e j = e j +1 . Then π ( u j − ) = ( ) π ( x ) · e j · π ( z ) = π ( x ) · e j +1 · π ( z ) = ( ) e j +1 , which cannot hold by Equation (3). . Jecker 9 D -length of the monoid of Boolean matrices A Boolean matrix is a matrix A whose components are Boolean elements: A ij ∈ { , } . The(full) Boolean matrix monoid B n is the set of all n × n Boolean matrices, equipped with thematrix composition defined as follows: ( A · B ) ik = 1 if and only if there exists j ∈ [1 , n ]satisfying A ij = B jk = 1. This fits the standard matrix multiplication if we consider that1 + 1 = 1: addition of Boolean elements is the OR operation, and multiplication is the ANDoperation. The main contribution of this section is the following theorem. ◮ Theorem 2.
The regular D -length of the monoid of n × n Boolean matrices is n + n +22 . The proof is split in two parts. We prove the upper bound by studying the structureof the idempotent elements of B n (Subsection 4.1). Then, we prove the lower bound byconstructing a monomorphism from the max monoid of size n + n +22 into B n (Subsection4.2). We begin by introducing definitions tailored to help us in the following demonstrations. Stable matrix
A Boolean matrix A ∈ B n is called stable if for each component A ik equalto 1, there exists j ∈ [1 , n ] satisfying A ij = A jj = A jk = 1. Idempotent matrices are stable(Appendix C). Positive set
A (maximal) positive set of an idempotent matrix A ∈ B n is a maximal set I ⊆ [1 , n ] such that all the corresponding components of A are 1: A ij = 1 for all i, j ∈ I ,and for every k ∈ [1 , n ] \ I , there exists i ∈ I such that A ik = 0 or A ki = 0. The positive setsof an idempotent matrix are disjoint (Appendix C), hence A has at most n positive sets. Free pair
For each idempotent matrix A ∈ B n we define the relation (cid:1) A on [1 , n ] as follows:given i, j ∈ [1 , n ], we have i (cid:1) A j if for all i , j ∈ [1 , n ], A i i = 1 = A jj implies A i j = 1.A free pair of A is a set of two distinct elements i, j ∈ [1 , n ] incomparable by (cid:1) A : i (cid:1) A j and j (cid:1) A i . Note that A has at most n ( n − free pairs (all sets of two distinct elements in [1 , n ]).Let us state some observations concerning (cid:1) A that follow immediately from the definition.First, as A is idempotent, (cid:1) A is reflexive (Appendix C). However, it might not be transitive.Moreover, for every component A ij of A equal to 1, we have that i (cid:1) A j (Appendix C).The converse implication is not true, as shown by the following example. Finally, for every i ∈ [1 , n ], if the i th row contains no 1, i.e., A ik = 0 for all k ∈ [1 , n ], then i (cid:1) A j for every j ∈ [1 , n ]. Conversely, if the i th column contains no 1, then j (cid:1) A i for every j ∈ [1 , n ]. Example
We depict below a submonoid of B generated by two matrices A and B . Thesix elements of this submonoid, including the identity matrix D ∈ B n , are all idempotent.Under each matrix, we list its positive sets. We then compute the corresponding free pairs. D { } , { } , { } , { } A { , } , { , } B { } , { } A · B { , } , { } B · A { } , { , } A · B · A { , } , { , } Every pair is free in D since the relation (cid:1) D is the identity: given two distinct elements i, j ∈ [1 , n ], we have D ii = 1 = D jj , yet D ij = 0, hence i (cid:1) D j . On the contrary, the fourmatrices B , A · B , B · A and A · B · A has no free pairs: the relation (cid:1) B only lacks (4 , (cid:1) A · B only lacks (4 ,
1) and (4 , (cid:1) B · A only lacks (2 ,
1) and (4 , (cid:1) A · B · A only lacks (2 , ,
1) and (4 , A , the relation (cid:1) A is the union of the identity and the fourpairs { (1 , , (3 , , (2 , , (4 , } , which yields the free pairs { , } , { , } , { , } and { , } . To prove the upper bound of Theorem 2, we show that every monomorphism ϕ : H m → B n satisfies m ≤ n + n +22 . To this end, we study the sequence of matrices s ϕ = A , A , . . . , A m obtained by listing the elements ϕ ( i ) = A i of the image of ϕ . Note that all the elements of s ϕ are distinct as ϕ is injective, and A i · A i +1 = A i +1 = A i +1 · A i for all 1 ≤ i < m as ϕ is a homomorphism. We introduce three lemmas that imply interesting properties of everypair A i , A i +1 of successive matrices of s ϕ . First, Lemma 7 shows that every positive set of A i +1 contains a positive set of A i . Therefore, since positive sets are disjoint, the number ofpositive sets can never increase along s ϕ . Second, Lemma 8 shows that every free pair of A i +1 is also a free pair of A i . As a consequence, the number of free pairs can never increasealong s ϕ . Finally, Lemma 9 shows that either the number of positive sets or free pairs differsbetween A i and A i +1 , as otherwise these two matrices would be equal.Combining the three lemmas yields that between each pair of successive matrices of s ϕ ,neither the number of positive sets nor the number of free pairs increases, and at least onedecreases. This immediately implies the desired upper bound: as the number of positive setsof matrices of B n ranges from 0 to n and the number of free pairs ranges from 0 to n ( n − , s ϕ contains at most n + n ( n − + 1 = n + n +22 matrices. To conclude, we now proceed withthe formal statements and the proofs of the three lemmas. ◮ Lemma 7.
Let A and B be two idempotent matrices of B n satisfying A · B = B = B · A .Then every positive set of B contains a positive set of A . Proof.
Let us pick two idempotent matrices
A, B ∈ B n satisfying A · B = B = B · A . If B has no positive sets, the statement is trivially satisfied. Now let us suppose that B has atleast one positive set I ⊆ [1 , n ]. We show the existence of a positive set J ⊆ I of A .Since I is not empty by definition, it contains an element i , and B ii = 1. Then, as B = B · A , there exists k ∈ [1 , n ] satisfying B ik = A ki = 1. Moreover, as A is stable, thereexists j ∈ [1 , n ] satisfying A kj = A jj = A ji = 1. In particular, A jj = 1, hence A has apositive set J containing j . Then, for every i ∈ I and every j , j ∈ J , we obtain B j i = ( A · A · B ) j i = 1 since A j j = A ji = B ii = 1 ,B i j = ( B · B · A · A ) i j = 1 since B i i = B ik = A kj = A jj = 1 ,B j j = ( B · B ) j j = 1 since B j i = B i j = 1 . As a consequence, J is a subset of I since positive sets are maximal by definition. ◭◮ Lemma 8.
Let A and B be two idempotent matrices of B n satisfying A · B = B = B · A .Then every free pair of B is a free pair of A . Proof.
Let us pick two idempotent matrices
A, B ∈ B n satisfying A · B = B = B · A . Weprove the lemma by contraposition: we show that for every pair of elements i, j ∈ [1 , n ], i (cid:1) A j implies i (cid:1) B j (hence if i and j are incomparable by (cid:1) B , so are they by (cid:1) A ).Let us pick i, j ∈ [1 , n ] satisfying i (cid:1) A j , and i , j ∈ [1 , n ] satisfying B i i = 1 = B jj . Toconclude, we show that B i j = 1. To this end, we introduce two new elements i , j ∈ [1 , n ]:First, as ( B · A ) i i = B i i = 1, there exists i ∈ [1 , n ] such that B i i = 1 and A i i = 1;Second, as ( A · B ) jj = B jj = 1, there exists j ∈ [1 , n ] such that A jj = 1 and B j j = 1.Then, as i (cid:1) A j by supposition, we get that A i j = 1, which implies B i j = ( B · A · B ) i j = 1 , since B i i = A i j = B j j = 1 . Since this holds for every i , j ∈ [1 , n ] satisfying B i i = 1 = B jj , we obtain that i (cid:1) B j . ◭ . Jecker 11 ◮ Lemma 9.
Let A and B be two idempotent matrices of B n satisfying A · B = B = B · A .If A and B have the same number of positive sets and free pairs, then they are equal. Proof.
Let us pick two idempotent elements
A, B ∈ B n such that A · B = B = B · A .Suppose that A and B have the same number of positive sets. By Lemma 7, each positiveset of B contains at least one positive set of A . Since the positive sets of B are disjoint, thepigeonhole principle yields the two following claims. ⊲ Claim 1.
Each positive set of A is contained in a positive set of B . ⊲ Claim 2.
Each positive set of B contains exactly one positive set of A .Moreover, suppose that A and B have the same number of free pairs. By Lemma 8 everyfree pair of B is a free pair of A . This yields the following claim. ⊲ Claim 3.
The free pairs of A and B are identical.We now prove that A = B . First, we show that for every component A ik equal to 1, thecorresponding component B ik is also equal to 1. Since A is stable, there exists j ∈ [1 , n ]satisfying A ij = A jj = A jk = 1. Then j is contained in a positive set of A , which is itselfcontained in a positive set of B by Claim 1. Therefore we obtain that B jj = 1, which yields B ik = ( A · B · A ) ik = 1 , since A ij = B jj = A jk = 1 . To conclude, we show that for every component B ij equal to 1, the corresponding com-ponent A ij is also equal to 1. To this end, we introduce four new elements i , i , j , j in [1 , n ]:First, as ( A · B · A ) ij = B ij = 1, there exist i , j ∈ [1 , n ] such that A ii = B i j = A j j = 1.Second, as A is stable, there exist i , j ∈ [1 , n ] such that A ii = A i i = A i i = 1 and A j j = A j j = A j j = 1. These definitions ensure that B i j = ( A · B · A ) i j = 1 , since A i i = B i j = A j j = 1 . Note that, as observed after the definition of the relation induced by an idempotent matrix,this implies that i (cid:1) B j . We derive from this that either i (cid:1) A j or j (cid:1) A i : if i = j this follows from the fact that (cid:1) A is reflexive, and if i = j this follows from Claim 3. Weshow that both possibilities lead to A ij = 1.If i (cid:1) A j , then we obtain A i j = 1 as A i i = 1 = A j j . Therefore, A ij = ( A · A · A ) ij = 1 since A ii = A i j = A j j = 1 . If j (cid:1) A i , then we obtain A j i = 1 as A j j = 1 = A i i . Therefore, B j i = ( A · B · A ) j i = 1 since A j i = B i j = A j i = 1 . As a consequence, i and j are in the same positive set of B . Moreover, as A i i = A j j = 1, both i and j are elements of positive sets of A . Combining these twostatements with Claim 2 yields that i and j are in the same positive set of A . Therefore A i j = 1, which implies that i (cid:1) A j , and we can conclude as in the previous point.Since we successfully showed that every 1 of A corresponds to a 1 of B , and reciprocally, weobtain that A = B , which proves the statement. ◭ We construct a monomorphism ϕ between the max monoid H f ( n ) , where f ( n ) = n + n +22 ,and the monoid of Boolean matrices B n . The construction is split in two steps. First, wedefine ϕ over the domain [1 , g ( n )+1], where g ( n ) = n ( n − is the number of pairs of elements i < j in [1 , n ]. Then, we complete the definition over the domain [ g ( n ) + 1 , f ( n )]. Diagonal to triangular
Let us define ϕ over [1 , g ( n ) + 1]. We map the neutral element 1 ∈ H f ( n ) to the neutral element D n ∈ B n : the identity matrix. Then, we map g ( n ) + 1 ∈ H f ( n ) to the full upper triangular matrix U n ∈ B n . Note that U n contains g ( n ) more 1’s than D n does. We define the images of the elements between 1 and g ( n ) + 1 by gradually adding to D n the 1’s of U n it lacks. Formally, we order the indices corresponding to the componentsabove the diagonal p < p < . . . < p g ( n ) ∈ [1 , n ] × [1 , n ] according to the lexicographicorder: ( i, j ) comes before ( i ′ , j ′ ) if either i < i ′ , or i = i ′ and j < j ′ . Then, for every m ∈ [1 , g ( n ) + 1], we construct the image ϕ ( m ) ∈ B n as follows:Every component ( ϕ ( m )) ii of the diagonal is 1;Every component ( ϕ ( m )) ij below the diagonal is 0;Every component ( ϕ ( m )) ij above the diagonal is 1 if ( i, j ) < p m , and 0 otherwise. Triangular to empty
Let us define ϕ over [ g ( n ) + 1 , f ( n )]. To fit the first part of thedefinition, we map g ( n ) + 1 ∈ H f ( n ) to the upper diagonal matrix U n ∈ B n . Then, we mapthe absorbing element f ( n ) = g ( n ) + 1 + n ∈ H f ( n ) to the absorbing element 0 n ∈ B n : thenull matrix. Finally, for m ∈ [0 , n ], we construct ϕ ( g ( n ) + 1 + m ) by replacing the last m rows of U n with 0’s. Formally, we have:Every component ( ϕ ( g ( n ) + 1 + m )) ij is 1 if i ≤ j and i ≤ n − m , and 0 otherwise. Proof of correctness
We prove that the function ϕ just defined is a monomorphism.We show that ϕ is a homomorphism: ϕ ( m ) · ϕ ( m ′ ) = ϕ ( m ′ ) = ϕ ( m ′ ) · ϕ ( m ) for all 1 ≤ m ≤ m ′ ≤ f ( n ). First, note that if ( ϕ ( m ′ )) ij = 1, then ( ϕ ( m ) · ϕ ( m ′ )) ij = ( ϕ ( m ′ ) · ϕ ( m )) ij = 1:if m ≤ g ( n ) + 1, this follows from the fact that the diagonal of ϕ ( m ) is filled with 1’s, and if m > g ( n )+1, since m ≤ m ′ we obtain that ( ϕ ( m )) ii = ( ϕ ( m ′ )) ij = 1 = ( ϕ ( m ′ )) ii = ( ϕ ( m )) ij .It remains to show that if ( ϕ ( m ) · ϕ ( m ′ )) ik = 1 or ( ϕ ( m ′ ) · ϕ ( m )) ik = 1, then ( ϕ ( m ′ )) ik = 1.If m ′ ≤ g ( n ) + 1, this holds since for every triple i ≤ j ≤ k ∈ [1 , n ], the pair ( i, k ) islexicographically smaller than or equal to ( j, k ). If m ′ > g ( n ) + 1, this holds since for everytriple i ≤ j ≤ k ∈ [1 , n ], trivially i is smaller than or equal to both i and j .We conclude by showing that ϕ is injective: between ϕ (1) and ϕ ( g ( n ) + 1) a new 1 isadded at each step, and between ϕ ( g ( n ) + 1) and ϕ ( f ( n )) we remove at each step a 1 of thediagonal that was present in all the previous images. Example
We depict the monomorphism ϕ : H f ( n ) → B n in the case n = 4 by listing the f (4) = 11 elements of its image in B . Under each element, we state its number of positivesets followed by its number of free pairs. (4 ,
6) (4 ,
5) (4 ,
4) (4 ,
3) (4 ,
2) (4 ,
1) (4 ,
0) (3 ,
0) (2 ,
0) (1 ,
0) (0 , Starting with the identity matrix D , we gradually add 1’s, reaching the triangular matrix U in g (4) = 6 steps. Then, we erase line after line, reaching the null matrix 0 in 4 steps. . Jecker 13 References Félix Baschenis, Olivier Gauwin, Anca Muscholl, and Gabriele Puppis. One-way defin-ability of two-way word transducers.
Logical Methods in Computer Science , 14, 2018. doi:10.23638/LMCS-14(4:22)2018 . Michael Breen. A maximal chain of principal ideals in the semigroup of binary relations on afinite set. In
Semigroup Forum , volume 43, pages 63–76. Springer, 1991. Jérémie Chalopin and Hing Leung. On factorization forests of finite height.
Theor. Comput.Sci. , 310:489–499, 2004. doi:10.1016/S0304-3975(03)00344-X . Thomas Colcombet. The factorisation forest theorem. handbook “Automata: from Mathem-atics to Applications , 2019. Olexandr Ganyushkin and Volodymyr Mazorchuk.
Classical finite transformation semigroups:an introduction , volume 9. Springer Science & Business Media, 2008. T. E. Hall and Mark V. Sapir. Idempotents, regular elements and sequences from finitesemigroups.
Discrete Mathematics , 161:151–160, 1996. doi:10.1016/0012-365X(95)00223-J . Shaofang Hong. Distribution of cardinalities of row spaces of boolean matrices of order n.
Southeast Asian Bulletin of Mathematics , 24:51–64, 2000. Janusz Konieczny. On cardinalities of row spaces of boolean matrices. In
Semigroup Forum ,volume 44, pages 393–402. Springer, 1992. Manfred Kufleitner. The height of factorization forests. In Edward Ochmanski and JerzyTyszkiewicz, editors,
Mathematical Foundations of Computer Science 2008, 33rd Interna-tional Symposium, MFCS 2008 , volume 5162 of
Lecture Notes in Computer Science , pages443–454. Springer, 2008. doi:10.1007/978-3-540-85238-4\_36 . Hanno Lefmann. A note on ramsey numbers.
Studia Sci. Math. Hungar , 22(1-4):445–446,1987. Wen Li and Mou-Cheng Zhang. On konieczny’s conjecture of boolean matrices. In
SemigroupForum , volume 50, pages 37–58. Springer, 1995. Filip Mazowiecki and Cristian Riveros. Pumping lemmas for weighted automata. In RolfNiedermeier and Brigitte Vallée, editors, , volume 96 of
LIPIcs , pages 50:1–50:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018. doi:10.4230/LIPIcs.STACS.2018.50 . A. Mukherjea and R. Chaudhuri. Idempotent boolean matrices.
Semigroup forum , 21:273–282,1980. URL: http://eudml.org/doc/134452 . Anca Muscholl and Gabriele Puppis. The many facets of string transducers (invited talk). InRolf Niedermeier and Christophe Paul, editors, , volume 126 of
LIPIcs , pages 2:1–2:21. SchlossDagstuhl - Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.STACS.2019.2 . Jean-Éric Pin. Mathematical foundations of automata theory.
Lecture notes LIAFA, Uni-versité Paris , 7, 2010. Michael O. Rabin and Dana S. Scott. Finite automata and their decision problems.
IBMJournal of Research and Development , 3:114–125, 1959. doi:10.1147/rd.32.0114 . F. P. Ramsey. On a problem of formal logic. volume s2-30, pages 264–286. 1930. doi:10.1112/plms/s2-30.1.264 . Marcel-Paul Schützenberger. Une théorie algébrique du codage.
Séminaire Dubreil. Algebreet théorie des nombres , 9:1–24, 1955. Marcel Paul Schützenberger. On finite monoids having only trivial subgroups.
Informationand Control , 8:190–194, 1965. doi:10.1016/S0019-9958(65)90108-7 . Imre Simon. Factorization forests of finite height.
Theor. Comput. Sci. , 72:65–94, 1990. doi:10.1016/0304-3975(90)90047-L . M-C Zhang, S-F Hong, and H-B Kan. On the cardinalities of the row spaces of non-full rankboolean matrices. In
Semigroup Forum , volume 59, pages 152–154. Springer, 1999.
A Known upper bounds for the Ramsey function
We detail the two main methods used to bound the Ramsey function of a monoid prior tothis work, and we show some cases in which the bounds obtained are unnecessarily large.
Ramsey’s Theorem
Given two integers c and k , the multicolour Ramsey number N c ( k ) isthe smallest integer such that every colouring of a complete graph on N c ( k ) vertices with c colours contains a monochromatic clique of size k . Ramsey’s Theorem [17] proves theexistence of the Ramsey number N c ( k ) for every c, k ∈ N .These numbers can be used to bound the Ramsey function associated to a monoid M : R M ( k ) ≤ N | M | ( k + 1) − k ≥ . (1)This is proved as follows. For every word u = m m . . . m n ∈ M ∗ of length N | M | ( k + 1) − N | M | ( k + 1) vertices, and we colour its edges with theelements of M as follows: for all 1 ≤ i < j ≤ N | M | ( k ), the edge between vertices i and j iscoloured with the element m i · m i +1 · . . . · m j − ∈ M . By definition of the Ramsey numbers, G contains a monochromatic clique of size k + 1, which corresponds exactly to a Ramsey k -decomposition of u whenever k ≥ N c ( k ) > ck for all c, k ∈ N (see [10]). Since R M ( k ) ≤ ( k | M | ) L ( M ) byTheorem 1, the bound (1) lacks precision for large k ’s, and also for every monoid M witha size | M | substantially larger than its regular D -length L ( M ). For instance, for the fulltransformation monoid T n over n elements (see Section 1.3), it is exponentially too large: R T n ( k ) ≤ ( k | T n | ) L ( T n ) = k n +1 ( n + 1) n ( n +1) ; N | T n | ( k + 1) − ≥ ( k +1) | Tn | = 2 ( k +1)( n +1) n . Factorisation Forest Theorem A Ramsey factorisation tree of a word u = m . . . m n ∈ M ∗ is a directed tree T whose vertices are labelled with non-empty words of M + such that:the root is labelled with u ;the leaves are labelled with the letters m , m , . . . , m n composing u ;each branching is a Ramsey decomposition of the parent’s label in the children’s labels.The Factorisation Forest Theorem states that for every finite monoid M there is a bound F ( M ) such that each sequence u ∈ M ∗ has a Ramsey factorisation tree of height at most F ( M ). The theorem was initially proved in [20], and the bound has been improved after-wards [3, 9, 4]. This result can be used to bound the Ramsey function associated to M : R M ( k ) ≤ ( k + 1) F ( M ) + 1 for all k ∈ N . (2)This is proved as follows. Given a word u ∈ M ∗ of length ( k + 1) F ( M ) + 1, we considerits Ramsey factorisation tree of height at most F ( M ). Since this tree has more than ( k +1) F ( M ) + 1 leaves, it necessarily contains a branching of size at least k + 2. This yields aRamsey k -decomposition of a factor of u , that can be transferred back to u .It is known that F ( G ) = |G| for every group G (see [9, 4], note that in [9] this result isproved for 3 |G| instead of |G| : the factor 3 stems from a slightly different definition of F ( G )).As a consequence, since R M ( k ) ≤ ( k | M | ) L ( M ) by Theorem 1, the bound (2) lacks precisionfor every monoid M containing a group G substantially larger than its regular D -length L ( M ). For instance, as the full permutation group P n over n elements is embedded into thefull transformation monoid T n (see Section 1.3), the bound (2) is exponentially too large: R T n ( k ) ≤ ( k | T n | ) L ( T n ) = k n +1 ( n + 1) n ( n +1) ;( k + 1) F ( T n ) + 1 ≥ ( k + 1) F ( P n ) + 1 ≥ ( k + 1) | P n | + 1 = ( k + 1) n ! + 1 . . Jecker 15 B Defining the regular D -length using Green’s relations We state basic definitions and lemmas concerning Green’s relations of finite monoids. Moredetails can be found in [15] (note that here we write D instead of J ).The preorders ≤ H and ≤ D over a finite monoid M are defined as follows: m ≤ H m ′ if s · m ′ = m = m ′ · t for some s, t ∈ M ; m ≤ D m ′ if m = s · m ′ · t for some s, t ∈ M. An H -class of M is an equivalence class of the equivalence relation ∼ H generated by ≤ H .Similarly, a D -class is an equivalence class of the equivalence relation ∼ D generated by ≤ D .A D -class is called regular if it contains at least one idempotent element of D . We denoteby D ( m ) the D -class of an element m ∈ M . We use the two following lemmas. ◮ Lemma 10.
Let m, m ′ ∈ M be two elements of the same D -class. If s · m ′ = m = m ′ · t for some s, t ∈ M , then m ∼ H m ′ . ◮ Lemma 11.
Each H -class of M contains at most one idempotent element. We prove the equivalence of both definitions of the regular D -length stated in the introduc-tion. ◮ Proposition 12.
The two following definitions are equivalent L ( M ) is the size of the largest max monoid H L ( M ) embedded in M ; L ( M ) is the size of the largest chain of regular D -classes of M . Proof.
Transforming a monomorphism ϕ : H n → M into a chain of regular D -classes is easy.Remark that, by definition, the order < D over H n is the inverse of the usual order: we have n < D n − < D . . . < D
1. We show that D ( ϕ ( n )) < D D ( ϕ ( n − < D . . . < D D ( ϕ (1)). First,for every 1 ≤ i < j ≤ n , ϕ ( j ) ≤ D ϕ ( i ) since ϕ ( i ) · ϕ ( j ) = ϕ ( j ). Moreover, ϕ ( i ) and ϕ ( j )are not in the same D -class, as the fact that ϕ ( i ) ϕ ( j ) = ϕ ( j ) = ϕ ( j ) ϕ ( i ) would imply that ϕ ( i ) and ϕ ( j ) are in the same H -class by Lemma 10. Then ϕ ( i ) and ϕ ( j ) would be equalby Lemma 11, which contradicts the fact that ϕ is injective.Transforming a chain of n regular D -classes into a monomorphism ϕ : H n → M requiresa bit of work: let D n < D D n − < D . . . < D D be a chain of regular D -classes. For every1 ≤ i ≤ n , as the D -class D i is regular, it contains at least one idempotent element f i .Unfortunately, there is no guarantee that the elements f i form a submonoid of M . We nowshow how to transform each f i into an idempotent element e i satisfying e i ∼ D f i such thatthe function ϕ : H n → M mapping i to e i is a monomorphism. First, we set e = f . Thenfor every 1 < i ≤ n we construct e i +1 based on e i . Since f i +1 < D f i ∼ D e i , there exists s, t ∈ M such that f i +1 = s · e i · t . We prove that setting e i +1 = e i · t · f i +1 · s · e i satisfiesthe desired properties. First, e i +1 is an idempotent element of M since e i +1 · e i +1 = e i · t · f i +1 · s · e i · e i · t · f i +1 · s · e i = e i · t · f i +1 · s · e i = e i +1 . (1)Moreover, e i +1 ∼ D f i +1 since e i +1 ≤ D f i +1 by definition, and s · e i +1 · t = s · e i · t · f i +1 · s · e i · t = f i +1 · f i +1 · f i +1 = f i +1 . (2)Finally, e i +1 · e i = e i +1 = e i · e i +1 as e i +1 · e i = e i · t · f i +1 · s · e i · e i = e i +1 = e i · e i · t · f i +1 · s · e i = e i · e i +1 . (3)As a consequence, the function ϕ : H n → M mapping each 1 ≤ i ≤ n to e i is a monomorph-ism: it is a homomorphism by Equations 1 and 3, and it is injective since the elements ofits image are all in distinct D -classes by Equation 2. ◭ C Properties of idempotent Boolean matrices
We prove the technical properties of idempotent Boolean matrices stated in Section 4. ◮ Lemma 13.
Every idempotent matrix is stable.
Proof.
Let A ∈ B n be an idempotent matrix, and let A ik be a component of A equal to 1.We begin by defining inductively a sequence of n + 1 elements j , j , . . . , j n ∈ [1 , n ] suchthat (a) A ij s = 1 for all 0 ≤ s ≤ n , (b) A j s j t = 1 for all 0 ≤ t < s ≤ n . First, setting j = k ensures that A ij = 1. Now, let 0 ≤ s < n , and suppose that j s satisfies the desiredproperties. Since ( A · A ) ij s = A ij s = 1, there exists j s +1 ∈ [1 , n ] satisfying A ij s +1 = A j s +1 j s =1. We immediately obtain that A ij s +1 = 1. Moreover, for every t < s + 1, either t = s and A j s +1 j s = 1, or t < s and A j s +1 j t = ( A · A ) j s +1 j t = 1 since A j s +1 j s = A j s j t = 1.As all the j s are in [1 , n ], there exist two indices 0 ≤ s < t ≤ n satisfying j s = j t . Then,setting j = j s = j t yields A ij = A ij t = 1, A jj = A j t j s = 1, and A jk = A j s j = 1. Thisproves that the matrix A is stable. ◭◮ Lemma 14.
The positive sets of an idempotent Boolean matrix are disjoint.
Proof.
Let A ∈ B n be a Boolean matrix, and let I and J be two positive sets of A . Toprove the statement, we show that if the intersection of I and J is not empty, then they areequal.Suppose that there exists k ∈ I ∩ J . Then for every i ∈ I , for every j ∈ J , A ij = ( A · A ) ij = 1 since A ik = A kj = 1; A ji = ( A · A ) ji = 1 since A jk = A ki = 1 . Since positive sets are maximal by definition, this proves that I = J . ◭◮ Lemma 15.
For every idempotent matrix A ∈ B n , the relation (cid:1) A is reflexive. Proof.
Let A ∈ B n be an idempotent matrix. For every j ∈ [1 , n ], for every i, k ∈ [1 , n ]satisfying A ij = 1 = A jk , A ik = ( A · A ) ik = 1 since A ij = A jk = 1 . Therefore j (cid:1) A j , which proves that (cid:1) A is reflexive. ◭◮ Lemma 16.
For every idempotent matrix A ∈ B n , A ij = 1 implies i (cid:1) A j . Proof.
Let A ∈ B n be an idempotent matrix, and let us pick a component A ij equal to 1.Then for every i , j ∈ [1 , n ] satisfying A i i = 1 = A jj , A i j = ( A · A · A ) i j = 1 since A i i = A ij = A jj = 1 . Therefore i (cid:1) A j , which concludes the proof., which concludes the proof.