Injective envelopes of transition systems and Ferrers languages

We consider reflexive and involutive transition systems over an ordered alphabet $A$ equipped with an involution. We give a description of the injective envelope of any two-element set in terms of Galois lattice, from which we derive a test of its finiteness. Our description leads to the notion of Ferrers language.


Introduction and presentation of the main results
This paper is about involutive and reflexive transition sytems from a metric point of view. This point of view, inspired from the work of Quilliot (1983), and applied first to posets and graphs, was initiated by the second author [29] and developped throught the theses of Jawhari (1983), Misane (1984) and several papers [17] (1986), [30] (1994), [33] (1992), [23] (1998), [24] (2018). It consists to view arbitrary transition systems as metric spaces. The distance between two states is a language instead of a non-negative real. To a transition system M ∶= (Q, T ), with set of states Q and set of transitions T over an alphabet A we associate a map d M from Q × Q into the set (A * ) of languages over A. The value d M (x, y) is the language accepted by the automaton A ∶= (M, {x}, {y}) having x as an initial state and y as a final state. The set (A * ) is an ordered monoid, the monoid operation being the concatenation of languages (with neutral element {◻}, the language reduced to the empty word ◻) and the order the reverse of inclusion. The map d M has similar properties of an ordinary distance (e.g. it satisfies the triangular inequality). Hence, we may use concepts and techniques of the theory of metric spaces in the study of transition systems as well as classes of transition systems. Concepts of balls, hyperconvex metric space and non-expansive maps between metric spaces extend to transition systems and more generally to metric spaces over (A * ). Due to the fact that joins exist in the set of values, the category of metric spaces with the non-expansive maps as morphisms has products. Then, one may also define retractions and coretractions, and by considering isometries as approximations of coretractions, injective metric spaces and absolute retracts. In ordinary metric spaces, the distance is symmetric. To be closer to this situation, it is convenient to suppose that the value of d M (x, y) determines the value of d M (y, x); for that, we suppose that the alphabet is equipped with an involution − and our transition systems M are involutive, in the sense that (x, α, y) ∈ T if and only if (y, α, x) ∈ T . Once the involution is extended to A * and then to (A * ), we have d M (x, y) = d M (y, x). Then, one can extend the definion of metric spaces to transition systems in a natural way, see [30].
This work is a continuation of the work published in [22,23,24]. We require that transition systems M are reflexive, that is every letter occurs to every vertex: (x, α, x) ∈ T for every x ∈ Q and α ∈ A. In this case, distances values are final segments of A * equipped with the subword ordering, that is subsets F of A * such that u ∈ F and u ≤ v for the subword ordering imply v ∈ F . It turns out that several properties of involutive and reflexive systems and more generally metric spaces over the set F(A * ) of final segments of A * rely almost uniquely on the structure of F(A * ). According to the terminology of Kaarli and Radeleczki [19], this structure is the dual of an integral involutive quantale (I 2 Q for short); here we stick to the name of Heyting algebra that we used in a series of papers. This is a complete lattice H with a monoid operation (not necessarily commutative) and an involution − which is isotone and reverses the operation. In order to be closer to the operation of concatenation of languages we denote by ⋅ the monoid operation. We suppose that the neutral element of the monoid, that we denote 1, is the least element of the ordering and we suppose that the distributivity law below holds (1) ⋀{pα ⋅ q ∶ α ∈ I} = ⋀{pα ∶ α ∈ I} ⋅ q. As shown in [17], the notions of injective, absolute retract and hyperconvex spaces over a Heyting algebra coincide, this being essentially due to the fact that the set of the values of the distance, being an Heyting algebra, can be equipped with a distance and that every metric space can be embedded into a power of that metric space. Furthermore, every space has an injective envelope.
In particular, every metric space over the Heyting algebra F(A * ) has an injective envelope. The study of such injective envelope was initiated in [23]. It is based on the properties of the injective envelope of two-element metric spaces. A large account of its properties was given in [22] and [24]. In this paper, we look at the many facets of this object which have not been published yet.
If F is a final segment of A * , the injective envelope S F of the two-element space {x, y} such that d(x, y) = F is associated to an involutive and reflexive transition system. Let M F be this transition system and A F be the automaton (M F , {x} , {y}).
We characterize first this injective envelope in terms of reflexive and involutive transition systems.
Theorem 1. Let A ∶= (M, {x} , {y}) be a reflexive and involutive automaton accepting a final segment F of A * . Then A is isomorphic to A F iff for every reflexive and involutive automaton A ′ ∶= (M ′ , {x ′ } , {y ′ }) which accepts F , the following properties hold: (i) Every automata morphism f ∶ A → A ′ , if any, is an isometric embedding; (ii) The map g ∶ {x ′ , y ′ } → M such that g(x ′ ) = x and g(y ′ ) = y extends to a morphism of automata from A ′ to A.
We will obtain this result as a consequence of a characterization of the injective envelope among generalized metric spaces (Theorem 4) given in Section 2.
Then, we develop an approach in terms of Galois correspondence. To a final segment F of A * we associate the incidence structure R ∶= (A * , ρ F , A * ) where ρ is the binary relation on A * defined by uρ F v if the concatenation uv of u and v belongs to . The collection of all R −1 ∧ (V ) for V ⊆ A * , once ordered by inclusion, forms a complete lattice Gal(R), called the Galois lattice associated to the incidence structure R. As a subset of H ∶= F(A * ), it inherits the metric structure d H of H. Containing x ∶= A * and y ∶= F , two elements which verify d H (x, y) = F , this metric space is the injective envelope of {x, y}.
For concrete examples, suppose that F is a finite union of final segments F 0 , . . . F i , . . . F k−1 and that each F i is generated by X i , a set of words u i of the same length n i , all of the from Let n 0 ⊗⋯⊗n k−1 be the direct product of k chains n 0 , ... n k−1 where n i ∶= {0, ..., n i − 1} is equipped with the natural ordering, and let F(n 0 ⊗⋯⊗n k−1 ) be the collection of final segments of n 0 ⊗ ⋯ ⊗ n k−1 ordered by inclusion.
We prove (see Section 5): Theorem 2. As a lattice, the injective envelope S F can be identified with an intersection closed subset of the set F(n 0 ⊗ ⋯ ⊗ n k−1 ). Moreover if ↓ u i ∩ ↓ u j = {◻} whenever u i ∈ X i , u j ∈ X j , and i ≠ j, then S F identifies to the full set F(n 0 ⊗ ⋯ ⊗ n k−1 ).
We recall that a poset P is well-quasi-ordered, in brief w.q.o., if it well-founded (every non empty subset contains a minimal element) and contains no infinite antichain. A fundamental result of G.Higman [14] asserts that the free ordered monoid A * is w.q.o. whenever the alphabet A is w.q.o.. The set of final segments of a w.q.o. set, once ordered by reverse of the inclusion, is well-founded [14]. Hence, if our alphabet A is w.q.o., every final segment F of A * is generated by finitely many words u 0 , ..., u k−1 , hence has the form mentioned above. Consequently, the corresponding injective envelope is finite. Concerning its size, let us mention that if k = 2, then F(n 0 ⊗ n 1 ) has size , the free distributive lattice with k generators. It is a famous problem, raised by Dedekind, to give an explicit and workable formula for F D(k). The largest exact value known is F D(8) [38]. An asymptotic formula was given by Korshunov in 1981 [25].
For an example, on the two-letter alphabet A = {a, b}, the words u 0 ∶= aa and u 1 ∶= bb give the lattice (ordered by reverse of inclusion) and graph represented on Figure 1.  The graphic structure of S F s Figure 1 Structural properties of transition systems rely upon algebraic properties of languages and conversely. In fact, transition systems can be viewed as geometric objects interpretating these algebraic properties. An illustration of this claim is given by the following result (see Corollary 4.9 [23]).
Theorem 3. Let F be a nonempty final segment of A * . If F is the concatenation of final segments F 1 , . . . , F n then the automaton A F ∶= (M F , {x}, {y}) associated to the injective envelope S F is the concatenation A F1 ⋅ ⋅A Fn of automata A Fi ∶= (M Fi , {x i }, {y i }) associated to the injective envelope S Fi , this concatenation being obtained by identifying each y i with x i+1 .
The fact that an automaton decomposes into such a concatenation can be viewed directly by looking at states which disconnect the underlying graph. From this follows the uniqueness of such a decomposition. This uniqueness amounts to the fact that the monoid F(A * ) ∖ {∅} is free. A purely algebraic proof of this result is given in [24].
We discuss then the relationship between the minimal deterministic automaton accepting a final segment F , say M in F , and the automaton A F associated to the injective envelope S F . This minimal automaton is part of A F , but not in an isometric way (M in F being deterministic cannot be reflexive, in general it is not involutive). Among involutive and reflexive transition systems accepting a given final segment F , we consider those with a minimum number of states and among those, the ones with a maximal number of transitions, that we call Minmax automata. Exemples given by Mike Main and communicated by Maurice Nivat [27] show that contrarily to the case of deterministic automata, these automata are not unique.
We introduce Ferrers languages. A language L over A * is Ferrers if We prove that a final segment F of A * is Ferrers if and only if the injective envelope S F is totally orderable, that is there is a linear order ⪯ on S F such that d(x, z) ⪯ d(x, y) and d(z, y) ⪯ d(x, y) for all x ⪯ z ⪯ y. (Theorem 23).
Over a finite alphabet A * , Boolean combinations of final segments of A * are called piecewise testable languages. They have been characterized by Simon [35] by the fact that their syntactical monoid is J -trivial. The Boolean algebra of piecewise testable languages is included into the Boolean algebra generated by rational Ferrers languages. Indeed, over a finite alphabet, every final segment is a finite union of rational Ferrers languages. But, on an alphabet with at least two letters, there are rational Ferrers languages which are not piecewise testable (e.g., L ∶= A * b on A ∶= {a, b}). We do not know if they are dot-depth one.
This paper is organized as follows. Properties of metric spaces over a Heyting algebra and their injective envelopes are summarized in section 2. In section 3, we introduce the Heyting algebra F(A * ). In section 4 we consider transition systems as metric spaces. In section 5 we describe the injective envelope of a two-element metric spaces over F(A * ); we prove Theorem 1 and 2 and conclude the section by a counterexample about Minmax automata due to M.Main. Ferrers languages are introduced in section 6.
The results developped here have been presented at the International Conference on Discrete Mathematics and Computer Science (DIMACOS'11) organized by A. Boussaïri, M. Kabil, and A. Taik in Mohammedia (Morocco) May, [5][6][7][8]2011. They were never published; a part of it was included into the Thèse d'État defended by the first author [22].

2.
Metric spaces over a Heyting algebra 2.1. Basic facts. The following is extracted from [24] (for more details, see [23]). Let H be a Heyting algebra and let E be a set. A H-distance on E is a map d ∶ E 2 → H satisfying the following properties for all x, y, z ∈ E: The pair (E, d) is called a H-metric space. If there is no danger of confusion we will denote it E. A H-distance can be defined on H. This fact relies on the classical notion of residuation.
Let v ∈ H. Given β ∈ H, each of the sets {r ∈ H ∶ v ≤ r ⋅ β} and {r ∈ H ∶ v ≤ β ⋅ r} has a least element, that we denote respectively ⌈v ⋅ β −1 ⌉ and ⌈β −1 ⋅ v⌉ (note that ⌈β −1 ⋅ v⌉ = ⌈v ⋅ (β) −1 ⌉). It follows that for all p, q ∈ H, the set D(p, q) ∶= {r ∈ H ∶ p ≤ q ⋅r and q ≤ p ⋅ r} has a least element, namely ⌈p ⋅ (q) −1 ⌉ ∨ ⌈p −1 ⋅ q⌉, that we denote d H (p, q). As shown in [17], For a H-metric space E, x ∈ E and r ∈ H, we define the ball B E (x, r) as the set {y ∈ E ∶ d (x, y) ≤ r}. We say that E is convex if the intersection of two balls B E (x 1 , r 1 ) and B E (x 2 , r 2 ) is non-empty provided that d(x 1 , x 2 ) ≤ r 1 ⋅ r 2 . We say that E is hyperconvex if the intersection of every family of balls (B E (x i , r i )) i∈I is non-empty whenever d(x i , x j ) ≤ r i ⋅ r j for all i, j ∈ I. For an example, (H, d H ) is a hyperconvex H-metric space and every H-metric space embeds isometrically into a power of (H, d H ) [17]. This is due to the fact that for every H-metric space (E, d) and for all x, y ∈ E the following equality holds: The space E is a retract of E ′ , in symbols E ⊲ E ′ , if there are two contractions f ∶ E → E ′ and g ∶ E ′ → E such that g ○f = id E (where id E is the identity map on E). In this case, f is a coretraction and g a retraction. If E is a subspace of E ′ , then clearly E is a retract of E ′ if there is a contraction from E ′ to E such g(x) = x for all x ∈ E. We can easily see that every coretraction is an isometry. A metric space is an absolute retract if it is a retract of every isometric extension. The space E is said to be injective if for all H-metric space E ′ and We recall that for a metric space over a Heyting algebra H, the notions of absolute retract, injective, hyperconvex and retract of a power of (H, d H ) coincide [17].
2.2. Injective envelope. A contraction f ∶ E → E ′ is essential it for every contraction g ∶ E ′ → E ′′ , the map g ○ f is an isometry if and only if g is isometry (note that, in particular, f is an isometry). An essential contraction f from E into an injective H-metric space E ′ is called an injective envelope of E. We will rather say that E ′ is an injective envelope of E. We can view an injective envelope of a metric space E as a minimal injective H-metric space containing (isometrically) E. Two injective envelopes of E are isomorphic via an isomorphism which is the identity over E. This allows to talk about "the" injective envelope of E; we will denote it by N (E). A particular injective envelope of E will be called a representation of N (E). The construction of injective envelope is based upon the notion of minimal metric form. A weak metric form is every map for all x ∈ E). Since every weak metric form majorizes a metric form, the two notions of minimality coincide. As shown in [17] every H-metric space has an injective envelope; the space of minimal metric forms is a representation of it, (cf.
We give below a new characterization of the injective envelope.
This proves that (ii) holds. The proof that (i) holds relies on the properties of metric forms. To prove that f is an isometry embedding amounts to prove the equality: Since E is the injective envelope of X, h x is a minimal metric form; since f is non-expansive and induces an isometry from X onto X ′′ , the map g x is a metric form below h x , hence h x = g x . It follows that for every z ∈ X. Let x, y ∈ E. By construction of the injective envelope, its elements identify to minimal metric forms over X, hence x and y identify respectively to h x and h y and Conversely, suppose that (i) and (ii) hold. Let (E ′ , d ′ ) be the injective envelope of (X, d ↾X ) and f be the identity map from (X, d ↾X ) onto itself. Applying (ii), the map f −1 extends to a non-expansive map g from . The map f ○ g is nonexpansive and is the identity on X. Since (E ′ , d ′ ) is the injective envelope of (X, d ↾X ), f ○ g is the identity on E ′ (note that elements of E ′ identify to minimal metric forms over X), hence g is injective and f is surjective. Now by (i), f is an isometry on its image. Hence f is an isometry of (E, d) onto (E ′ , d ′ ). Thus (E, d) is the injectyive envelope of (X, d ↾X ) as claimed.
Up to Theorem 6, we include the few facts we need about injective envelopes of twoelement metric spaces ( see [23] for proofs).
Let H be a Heyting algebra and v ∈ H. Let E ∶= {x, y} be a two-element H-metric space such that d(x, y) = v. We denote by N v the injective envelope of E. We give three representations of it. For the fist one, we consider the set of minimal metric forms over E. That is, in this case, the set of minimal pairs h ∶= (h x , h y ) ∈ H 2 such that h x ⋅ h y ≥ v, the set H 2 being equipped with the product ordering. Each element z ∈ N v identifies to the pair (d Nv (x, z), d Nv (y, z)); in particular, x and y identify to (1, v) and to (v, 1) respectively. We equip H 2 with the supremum distance: x ⋅r for some r ∈ H, then h ′ y ≤ h y ⋅r. This and the corresponding inequality with y replacing x will leads to (6).
Due to the fact that in a minimal metric form (h x , h y ) each component determines the other, we may prefer an other presentation of N v as a subset of H. Set S v ∶= ⌈v ⋅ β −1 ⌉ ∶ β ∈ H ; equipped with the ordering induced by the ordering over H this is a complete lattice.
This yields a correspondence between N v and S v . Now, in several instances, e.g. in the case of the sum of two metric spaces (see subsection Once equipped with the ordering induced by the product ordering on H 2 , we can consider the set N ′ v of its minimal elements. Each minimal element (u 1 , u 2 ) yields the minimal metric form (u 1 , u 2 ) (and conversely). The distance over H 2 is different from the previous case. We have to equip H 2 with the product of the distance (i) The injective envelope of any finite metric space is finite; (ii) The injective envelope of any two-element metric space is finite.
The space S u is linearly orderable if and only if the ordering is induced by the order on H or by its reverse.
We say that a metric space is finitely indecomposable if for every finite family (E i ) i∈I of metric spaces, E ⊲ ∏ i∈I E i implies E ⊲ E i for some i ∈ I. This notion was used by E. Corominas for posets [7]. Theorem 6. (Theorem 3.8 [23]) Let E be a finite absolute retract. The following properties are equivalent: . In particular, we can identify x 1 and x 2 which amounts to set d ′ (x 1 , x 2 ) = 0 in the above formula.
If E 1 and E 2 are not disjoint, we replace it by two disjoint copies . Alternatively, we may suppose that E 1 and E 2 have only one element in common, say z 1,2 , and we define the distance d on We consider now objects consisting of a H-metric space and two distinguished elements. Given two such objects, say and (E 2 , d 2 ),respectively, and by identifying the corresponding elements y ′ 1 and x ′ 2 and setting x ∶= x ′ 1 and y ∶= y ′ 2 .
Definition 8. Let H ′ be an initial segment of H which is also a submonoid. We say that H ′ has the decomposition property if every pair Several examples of metric spaces over a Heyting algebra are given in [17]. We briefly examine some of these examples w.r.t. to their injective envelopes and the sum operation. Ordinary metric spaces enter in his frame. Add a largest element +∞ to the set R + of non-negative reals, extend the + operation in the natural way, take the identity for the involution. Then R + ∪ {+∞} becomes a Heyting algebra and the metric spaces over it are just direct sums of ordinary metric spaces. The injective envelope of such a space is the direct sum of the injective envelope of its factors. The injective envelope of a two-element metric spaces E ∶= {x, y} with r ∶= d(x, y) is isometric to the segment [0, r] si r < +∞ and to E if r = +∞. Trivially, R + has the decomposition property. The sum of two convex (resp. injective) metric spaces with a common vertex is convex (resp. injective). The reader will find in [9] a description of injective envelopes of finite ordinary metric spaces and interesting combinatorial properties as well (see also [10]). Now, let H ∶= {a, b, 0, 1} ordered by 0 < a, b < 1 and a incomparable to b. The operation is the join, the involution exchange a and b. Metric spaces over H correspond to ordered sets. As shown by Banaschewski and Bruns, every poset P has an injective envelope, namely its MacNeille completion [1]. Hence, if P has two elements, its injective envelope is P whenever these two elements are comparable, otherwise this is P augmented of a smallest and a largest element. Convexity property does not hold for H, hence the sum of two injective with a common element does not need to be injective.
Next, suppose that H is a complete meet-distributive lattice, the operation is the join and the involution is the identity. For example, if H ∶= R ∪ {+∞}, metric spaces over H are direct sums of ultrametric spaces. Metric spaces over Boolean algebras have been introduced by Blumenthal [3]. Let B be a Boolean algebra, let the operation be the supremum and the involution be the identity. Although B is not necessary complete, residuation allows to define a distance on B setting d B (p, q) ∶= p∆q where ∆ denotes the symmetric difference. From this follows that the interval [0, u] ∶= {v ∈ B ∶ 0 ≤ v ≤ u} with the distance induced by d B is the injective envelope of every pair {p, q} of vertices of B such that p ∧ q = 0 and p ∨ q = u. Hence if B is finite, the number of elements of the injective envelope of a 2-element metric space is a power of 2 hence the decomposition property does not hold. In Section 3, we give an example for which this decomposition property holds, namely the algebra F ○ (A * )(for more examples of generalisations of metric spaces, see [4], [5]).

The Heyting algebra F (A * )
Let A be a set. Considering A as an alphabet whose members are letters, we write a word α with a mere juxtaposition of its letters as α = a 0 a 1 ...a n−1 where a i are letters from A for 0 ≤ i ≤ i − 1. The integer n is the length of the word α and we denote it α . Hence we identify letters with words of length 1. We denote by ◻ the empty word, which is the unique word of length zero. The concatenation of two word α ∶= a 0 ⋯a n−1 and β ∶= b 0 ⋯b m−1 is the word αβ ∶= a 0 ⋯a n−1 b 0 ⋯b m−1 . We denote by A * the set of all words on the alphabet A. Once equipped with the concatenation of words, A * is a monoid, whose neutral element is the empty word, in fact A * is the free monoid on A. A language is any subset X of A * . We denote by (A * ) the set of languages. We will use capital letters for languages. If X, Y ∈ (A * ) we may set XY ∶= {αβ ∶ α ∈ X, β ∈ Y } (and use Xy and xY instead of X{y} and {x}Y ). With this operation, which extends the concatenation operation on A * , the set (A * ) is a monoid (the set {◻} is the neutral element). Ordered by inclusion, this is a (join) lattice ordered monoid. Indeed, concatenation distributes over arbitrary union, namely: This monoid is residuated. Let X, Y, F ∈ (A * ). As it is customary, we set Thus, Gal(R), the Galois lattice of R, is the set {F Y −1 ∶ Y ⊆ A * } ordered by inclusion. This is a complete lattice. The meet is the intersection, the largest element is A * .
In the sequel, we study the metric structure of Gal(R) when F is a final segment of the monoid A * , this monoid being equipped with the Higman ordering.
We suppose from now that the alphabet A is ordered and equipped with an involution − preserving the order. The involution extends to A * : we set for every α ∶= a 0 ⋯a n−1 , α ∶= a n−1 ⋯a 0 . Note that αβ = βα for all α, β ∈ A * . We order A * with the Higman ordering: if α and β are two elements in A * such α ∶= a 0 ⋯a n−1 and β ∶= b 0 ⋯b m−1 then α ≤ β if there is an injective and increasing map h from {0, ..., n − 1} to {0, ..., m − 1} such that for each i, 0 ≤ i ≤ n − 1, we have a i ≤ b h(i) . Then A * becomes an ordered monoid with respect to the concatenation of words. Let F (A * ) be the collection of final segments of A * (that is the concatenation of languages: if X, Y ∈ F (A * ), then XY ∈ F(A * ). Clearly, the neutral element is A * . The set F (A * ) ordered by inclusion is a complete lattice (the join is the union, the meet is the intersection). Concatenation distributes over union. Order F (A * ) by reverse of the inclusion, denote X ≤ Y instead of X ⊇ Y , extend the involution − to F(A * ), set X = {α ∶ α ∈ X}, denote by X ⋅ Y the concatenation XY and set 1 ∶= A * then: We may then define metric spaces over F (A * ) and study injective objects and particularly injective envelopes.
Among metric spaces over F(A * ) are those coming from reflexive and involutive transition sytems. They are introduced in the next section.

Transition systems as metric spaces
Let A be a set. A transition system on the alphabet A is a pair M ∶= (Q, T ) where T ⊆ Q×A×Q. The elements of Q are called states and those of T transitions. Let M ∶= (Q, T ) and M ′ ∶= (Q ′ , T ′ ) be two transition systems on the alphabet A. A map f ∶ Q → Q ′ is a morphism of transition systems if for every transition (p, a, q) ∈ T , we have (f (p), a, f (q)) ∈ T ′ . When f is bijective and f −1 is a morphism from M ′ to M , we say that f is an isomorphism. The collection of transition systems over A, equipped with these morphisms, form a category. This category has products. If (M i ) i∈I is a family of transition systems, M i ∶= (Q i , T i ) , then their product M is the transition system (Q, T ) where Q is the direct product ∏ i∈I Q i and T is defined as follows: if x ∶= (x i ) i∈I and y ∶= (y i ) i∈I are two elements of Q and a is a letter, then (x, a, y) ∈ T if and only if (x i , a, y i ) ∈ T for every i ∈ I.
An automaton A on the alphabet A is given by a transition system M ∶= (Q, T ) and two subsets I, F of Q called the set of initial and final states. We denote the automaton as a triple (M, I, F ). A path in the automaton A ∶= (M, I, F ) is a sequence c ∶= (e i ) i<n of consecutive transitions, that is of transitions e i ∶= (q i , a i , q i⋅1 ). The word α ∶= a 0 ⋯a n−1 is the label of the path, the state q 0 is its origin and the state q n its end. One agrees to define for each state q in Q a unique null path of length 0 with origin and end q. Its label is the empty word ◻. A path is successful if its origin is in I and its end is in F . Finally, a word α on the alphabet A is accepted by the automaton A if it is the label of some successful path. The language accepted by the automaton A, denoted by L A , is the set of all words accepted by A. Let A ∶= (M, I, F ) and A ′ ∶= (M ′ , I ′ , F ′ ) be two automata. A morphism from A to A ′ is a map f ∶ Q → Q ′ satisfying the two conditions: (1) f is morphism from M to M ′ ; (2) f (I) ⊆ I ′ and f (F ) ⊆ F ′ .
If, moreover, f is bijective, f (I) = I ′ , f (F ) = F ′ and f −1 is also a morphism from A ′ to A, we say that f is an isomorphism and that the two automata A and A ′ are isomorphic.
To a metric space (E, d) over F (A * ), we may associate the transition system M ∶= (E, T ) having E as set of states and T ∶= {(x, a, y) ∶ a ∈ d (x, y) ∩ A} as set of transitions. Notice that such a transition system has the following properties: for all x, y ∈ E and every a, b ∈ A with b ≥ a: 1) (x, a, x) ∈ T ; 2) (x, a, y) ∈ T implies (y, a, x) ∈ T ; 3) (x, a, y) ∈ T implies (x, b, y) ∈ T. We say that a transition system satisfying these properties is reflexive and involutive (cf. [33,23]  (ii) For all α, β ∈ A * and x, y ∈ E, if α ⋅ β ∈ d (x, y), then there is some z ∈ E such that α ∈ d (x, z) and β ∈ d (z, y).
The category of reflexive and involutive transition systems with the morphisms defined above identify to a subcategory of the category having as objects the metric spaces and morphisms the contractions. Indeed: From this fact, we can observe that if (M i ) i∈I is a family of transition systems M i ∶= (Q i , T i ) then the metric space (Q, d) associated to the transition system ∏ i∈I M i , product of the M i 's, is the product of metric spaces (Q i , d i ) associated to the transition systems (Q i , T i ).
Injective objects satisfy the convexity property stated in (ii) of Lemma 2. Hence, if F is a final segment of A * , the distance d on the injective envelope S F coincide with the distance d F associated with the transition system M F ∶= (S F , T F ) where We denote by A F the automaton (M F , {x} , {y}), where x ∶= A * and y ∶= F .
From the existence of the injective envelope, we get: Theorem 11. For every F ∈ F(A * ) there is an involutive and reflexive transition system M ∶= (Q, T ), an initial state x and a final state y such that the language accepted by the automaton A = (M, {x}, {y}) is F. Moreover, if A is well-quasi-ordered then we may choose Q to be finite.
Proof. Take M ∶= M F , x ∶= A * and y ∶= F . If A is well-quasi-ordered then A * is also wellquasi-ordered (Higman [14]), hence the final segment F has a finite basis, that is, there are finitely many words α 0 , ..., α n−1 such that F = {α ∶ α i ≤ α for some i < n}.
Since injective objects in the category of metric spaces satisfy the convexity property stated in (ii) of Lemma 2, their distance is the distance associated with a transition system. Thus we may reproduce Theorem 4 almost verbatim. We get: Theorem 12. Let M ∶= (Q, T ) be a transition system, X ⊆ Q. Then (M, d M ) is isomorphic to the injective envelope of (X, d M ↾X ) iff for every reflexive and involutive transition system Taking for X a 2-element subset {x, y} of Q, Theorem 4 translates to Theorem 1 stated in the introduction.

Minimal automaton and Minmax automata.
We suppose now that the alphabet A is finite. We refer to [34] Subsection 3.3 p. 111-118 for the construction of the minimal state deterministic automaton. If F ∈ F(A * ) and u ∈ A * , the left residual is u −1 F ∶= {v ∈ A * ∶ uv ∈ F }. The minimal automaton M in F recognizing F has Q F ∶= {u −1 F ∶ u ∈ A * } as set of states. Its initial state is x ∶= F , its final state is y ∶= A * and the transition function δ F associate to the pair (u −1 F, a) ∈ Q F × A the state (ua) −1 F . One can check that: Proof. Suppose that (u −1 F, a, (ua) −1 F ) is a transtion in the automaton M in F . We prove that (i(u −1 F ), a, i((ua) −1 F )) is a transition in the automaton A F . This is equivalent to a ∈ d(i(u −1 F ), i((ua) −1 F ). The last condition amounts to 1) i(u −1 F )a ⊆ i((ua) −1 F ) and 2) i((ua) −1 F a ⊆ i(u −1 F ). For 1), let v ∈ i(u −1 F ), we claim that va ∈ i((ua) −1 F ), that is for each word w, if uaw ∈ F , then vaw ∈ F . Since v ∈ i(u −1 F ), from uaw ∈ F , we have vaw ∈ F , as required. The inclusion 2) follows directly from the fact that F is a final segment. The equalities i(F ) = A * and i(A * ) = F are obvious.
In general, the transition system associated to M in F is neither reflexive nor involutive. Among all involutive and reflexive transition systems M ∶= (Q, T ) with initial state x and final state y such that the language accepted by the automaton (M, {x}, {y}) is F , we select those with the least number of states and among those transition systems, we select those with a maximum number of transitions; we call minmax transition systems these transition systems. The automaton corresponding to a minmax transition system is a minmax automaton. In other terms, an automaton A ∶= (M, {x}, {y}) is minmax if (a) it is reflexive and involutive, (b) for every reflexive and involutive automaton This is a partial non-expansive mapping from (Q, d M ) into S F . Since S F is injective, this partial map extends to a non-expansive mapping f defined on Q. Since f is non-expansive, this map is an automata morphism. Let Q ′ ∶= f (Q) and consider the transition system Let M 1 ∶= (Q 1 , T 1 ) and M 2 ∶= (Q 2 , T 2 ) be two transition systems such that Q 1 and Q 2 have only the element y in common. Let Theorem 13. Let F be a non-empty final segment of A * . If F = F 1 F 2 ,with F 1 and F 2 final segments of A * , then an automaton A with initial state x and final state y accepting F is minmax if and only if it decomposes into A 1 ⋅ A 2 where A 1 and A 2 are two minmax automata accepting respectively F 1 between x and z and F 2 between z and y.
Proof. From Theorem 10, we have S F1 ⋅ S F2 ≅ S F1F2 . According to Proposition 3, a minmax automaton A accepting F is a subautomaton of A F = A F1 ⋅ A F2 . Thus A decomposes into A 1 ⋅ A 2 where A 1 is a subautomaton of A F1 and A 2 is a subautomaton of A F2 . Since A is minmax, both A 1 and A 2 are minmax. Conversely, assume that A 1 and A 2 are minmax. Let A be a minmax automaton accepting and A ′ 2 are minmax. The automaton A 1 and A ′ 1 (resp. A 2 and A ′ 2 ) have the same number of states and transitions. That is A 1 ⋅ A 2 is minmax. Example 14. (Mike Main,1989, communicated by Maurice Nivat [27]). We give an example of two non-isomorphic minmax automata accepting the same language L ∈ F (A * ). Let Consider the automata represented on Figure 2. To each of these automata, we associate the involutive and reflexive automata obtained by replacing each transition (p, α, q) by (p, α, q) and (q, α, p) and adding a loop at every vertex.The language accepted by each of these automata between x and y is L =↑ {ab, ac, ba, bc, ca, cb} . As it is easy to check, these automata are minmax but not isomorphic.

A description of the injective envelope
We describe the injective envelope S F in Galois lattice terms. We derive a test of its finiteness which leads to the notion of Ferrers language. 5.1. Incidence structures. We recall first some basic facts about incidence structures, Galois lattices and Ferrers relations. We follow the exposition given in [31].
An incidence structure R is a triple (V, ρ, W ) where ρ is a subset of the product V × W. We set ρ −1 ∶= {(x, y) ∶ (y, x) ∈ ρ} and R −1 ∶= (W, ρ −1 , V ), that we call the dual of R. We denote by ¬ρ the relation V × W ∖ ρ and ¬R the resulting incidence structure. A subset of V × W of the form X × Y is a rectangle. Let (X, Y ) ∈ (V ) × (W ). We set R ∧ (X) ∶= {y ∈ W ∶ xρy for all x ∈ X}, R −1 ∧ (Y ) ∶= {x ∈ V ∶ xρy for all y ∈ Y }. We recall that the set X × Y is a maximal rectangle included into ρ if and only if X = R −1 ∧ (Y ) and Y = R ∧ (X). The Galois lattice Gal(R) of R is the collection, ordered by inclusion, of subsets of V of the form R −1 ∧ (Y ) for Y ∈ (W ). This is a complete lattice; the largest element is V (= R −1 ∧ (∅)). Then, Gal(R −1 ) is the collection, ordered by inclusion, of subsets of W of the form R ∧ (X) for X ∈ (V ). We recall the important fact that Gal(R) and Gal(R −1 ) are dually isomorphic. Since Gal(R) consists of intersections of sets of the form R −1 (y) for y ∈ W , Gal(R) is finite if and only if the set of R −1 (y) for y ∈ W is finite; since Gal(R) is dually isomorphic to Gal(R −1 ), it is finite if and only if the set of R(x) for x ∈ V is finite.
We give two examples from the theory of ordered sets.
Fact 2. If R ∶= (P, ≤, P ) is an ordered set, then Gal(R), the MacNeille completion of P , is a complete lattice in which every member is a join and a meet of elements of P . And Gal(¬R) is the set of final segments of P ordered by inclusion.
Now, we mention the facts we need. Let R := (V, ρ, W ) and R ′ ∶= (V ′ , ρ ′ , W ′ ) be two incidence structures. According to Bouchet [2], a coding from R into R ′ is a pair of maps f ∶ V → V ′ , g ∶ W → W ′ such that Bouchet's Coding Theorem [2] below is a striking illustration of the links between coding and embedding.
Theorem 15. Let (T, ≤) be a complete lattice and R be an incidence structure. Then R has a coding into (T, ≤, T ) if and only if Gal(R) is embeddable in T .
The basic facts about coding we need are the following: (c) If f is surjective, then Gal(R) identifies with an intersection closed subset of Gal(R ′ ).
Proof. (a) Immediate consequence of the definition.
is an embedding from Gal(R) into Gal(R ′ ) which preserves non-empty intersections. If f is surjective, then the least element of the Galois lattice is preserved, hence Gal(R) identifies with an intersection closed subset of Gal(R ′ ).
Corollary 16. If for every i, V i = W i and θ i is of the form ¬ ≤ i for some ordering ≤ i on V i , then there is a coding from (V, Proof. For each y ∈ V , (¬R) −1 (y) = V ∖ R −1 (y). Since Gal(R) is made of intersections of sets of the form R −1 (y), if Gal(R) is finite, the collection of such sets is finite, hence the collection of sets of the form (¬R) −1 (y) is finite too. Since Gal(¬R) is made of intersections of these sets, it is finite.
This defines an embedding, proving our claim. If each member X of Gal(Π i R i ) is non-empty, then this embedding is an isomorphism.

Languages and their Galois lattices.
Galois lattices arose from group theory and geometry. We show here how they interact with language theory.
We represent subsets of the free monoid by incidence structures as follows.
Let A be an alphabet and L be a subset of A * . Denoting by xy the concatenation of the words x, y ∈ A * , define a binary relation ρ L on A * by: xρ L y ⇐⇒ xy ∈ L and set R L ∶= (A * , ρ L , A * ). We mention without proof some properties of this association. It preserves Boolean operations, that is: Not every binary relation ρ on A * can be of the form ρ L . For an example, if ρ contains a pair (u, v) with u, v ∈ A * , then ρ contains ρ {w} where w ∶= uv. In fact, if ρ is a binary relation on A * , set π ρ ∶= {uv ∶ (u, v) ∈ ρ}; then ρ πρ is the least binary relation of the form ρ L containing ρ. In particular, ρ {w} is the least relation of the form ρ L containing a pair (u, v) such that w = uv.
In the Boolean lattice made of relations of the form ρ L , the atoms are of the form ρ {w} where w is any word in A * . They form a partition of A * × A * . Every binary relation of the form ρ L is an union of some blocks of this partition.
We will say more about this association in Section 6. We conclude this subsection by the following property. If B is a subset of A * , we set R L ↾ B ∶= (B, ρ L ∩ B × B, B).
Fact 9. The Galois lattices of R L and and R L ↾ A * ∖ L are isomorphic provided that L is a final segment of A * .

5.3.
Proof of the first part of Theorem 2. From Corollary 16, and c) of Fact 3, in order to prove the first part of Theorem 2, namely that S F can be identified to an intersection closed subset of the set F(n 0 ⊗ ⋯ ⊗ n k−1 ), all that we need is to prove that for each i, there is a coding But, this is false. From Fact 9, a coding from (A * ∖ F, ρ F i , A * ∖ F ) into (n i , ¬ ≤, n i ) suffices. Let X 0 , ..., X n−1 be non-empty subsets of A and let X ∶= X 0 ⋅ ⋅ ⋅ X n−1 (that is the set of words x 0 ⋯x n−1 with x i ∈ X i ) and let F ∶=↑ X. Let n ∶= {0, ..., n − 1} be equipped with the natural ordering. Let f ∶ A * ∖ F → n and g ∶ A * ∖ F → n defined as follows: is the least p having this property, otherwise g(v) = n − 1. By a straightforward verification, we have the following: This proves the first part of Theorem 2.

Proof of the second part of Theorem 2. Let
The restrictions of f i and g i to A * ∖ F give a coding that we still denote where ≤ is the natural ordering on the direct product n 0 ⊗ ... ⊗ n k−1 . Since for each i, f i is surjective, Π f i is surjective and from (c) of Fact 3, Gal (R F ) is identified with an intersection closed subsets of Gal (R ′ ) which is F (n 0 ⊗ ... ⊗ n k−1 ) by Fact 2. ◻ 5.5. An explicit isomorphism. For reader's convenience, let us describe explicitly the isomorphism between S F and an intersection closed subset of F (n 0 ⊗ ... ⊗ n k−1 ) . For sake of simplicity, let us suppose that F is finitely generated (which is the case if A is w.q.o.).
For w ∶= w 0 ...w m ∈ A * and < w , let w = w 0 ...w −1 be the restriction of w to the first letters. Let x ∶= (x 0 , ..., Proof. (i) ⇒ (ii). Let us suppose that S F is finite. Let A F be the corresponding reflexive and involutive automaton with an initial state x ∶= A * and a final state y ∶= F . Let Q * F be the set of finite sequences s ∶= (s 0 , ..., s n ) such that all s i are distinct states, s 0 ∶= x, s n ∶= y, (s i , a i , s i+1 ) ∈ T F for some letter a i . Since S F is finite this set is finite too. For each s = (s 0 , ..., s n ) let X sj ∶= {a ∈ A ∶ (s j , a, s j+1 ) ∈ T F } and let X s ∶= {a 0 ...a n−1 ∶ a j ∈ X sj } and let F s ∶=↑ X s . It is easy to check that F = ⋃ s∈Q F F s , hence has the form mentioned above. (i) A is well-quasi-ordered; (ii) The injective envelope N (E) of every finite metric space E is finite.
Proof. ¬(i) ⇒ ¬(ii). Let F be a final segment of A * . According to Proposition 4, the injective envelope S F is infinite whenever for each decomposition F = ∪F i , some F i cannot be generated by a set of words having a bounded length. This is the case if F is generated by an infinite antichain X made of words of unbounded length. If A is not w.q.o., then there is an infinite bad sequence of letters, say a 0 , ..., a n , .... The set X = {a 0 , a 1 a 2 , a 3 a 4 a 5 , a 6 a 7 a 8 a 9 , ...} is such an example. The equivalences from (i) to (iv) is Myhill-Nerode Theorem. The equivalence with (v) is Ehrenfeucht-Haussler-Rozenberg Theorem.
According to Higman's Theorem, if the alphabet A is w.q.o., A * equipped with the Higman ordering is w.q.o. Since this ordering is compatible with concatenation, we may apply (v) to every final segment F of A * , obtaining that the Galois lattice Gal(R) is finite. Since the domain of this lattice is S F , implication (i) ⇒ (ii) of Theorem 17 follows.

Interval orders, Ferrers relations and injective envelope
We record the characterization of interval orders and Ferrers relations. These two notions are intertwined. Interval orders are those orderings for which the irreflexive part is a Ferrers relation. Ferrers relations have been introduced by J.Riguet [32]. Interval orders are studied by Fishburn in [13]. Part of the characterization of these relations given below is due to Wiener [39]. Let C be a chain; an interval of C is any subset of I such that x ∈ I, y ∈ I and x ≤ z ≤ y imply z ∈ I.
(1) The collection Int C of non-empty intervals of C is ordered as follows: Let P be a poset. The ordering on P, or P itself, is an interval order if P is order isomorphic to a collection of non-empty intervals of some chain C, ordered by condition (2) . To each incidence structure R ∶= (V, ρ, W ) we associate a poset B(R) ∶= (P, ≤) defined as follows: The domain of P is V × {0} ∪ W × {1} , for u = (x, i) , v = (y, j) ∈ P, the order relation is defined by: Let R ∶= (V, ρ, W ) be an incidence structure. We say that R is Ferrers or ρ is a Ferrers relation if R satisfies one of the following conditions (see [13]): Proposition 5. Let R ∶= (V, ρ, W ) be an incidence structure. The following conditions are equivalent: (i) The set {R(x) ∶ x ∈ V } is totally ordered by inclusion; (ii) The set R −1 (y) ∶ y ∈ W is totally ordered by inclusion; (iii) The Galois lattice Gal (R) is totally ordered by inclusion; (iv) R has a coding into a chain; (v) The poset B(R) does not embed the direct sum 2 ⊕ 2 of two copies of the 2-element chain 2; (vi) The ordering on B(R) is an interval order; (vii) xρy and x ′ ρy ′ imply xρy ′ or x ′ ρy for all x, x ′ ∈ V , y, y ′ ∈ W.
We say that a language L is Ferrers if the relation ρ L is Ferrers. According to condition (vii) of Proposition 5, this amounts to the following condition: xx ′ ∈ L and yy ′ ∈ L imply xy ′ ∈ L or yx ′ ∈ L for all x, x ′ , y, y ′ ∈ A * .
The study of Ferrers relations leads to the notion of Ferrers dimension of a binary relation: the least number of Ferrers relations whose intersection is this relation. The study of this notion, initiated by Bouchet in his thesis [2], yields numerous interesting results (e.g., see [6,8]). This suggest to look at the same direction in the theory of languages. But, we may notice that contrarily to the case of relations, not every language is Ferrers, or is an intersection of Ferrers languages. In fact, if w is any word, ρ {w} is a Ferrers relation only if w = ◻ ( indeed, let R ∶= (A * , ρ {w} , A * ), then Gal(R) = {{u} ∶ u prefix of w} ∪ {∅, A * }, thus if w = ◻, the Galois lattice has at least two incomparable elements, namely {w} and {◻} plus a top and a bottom, thus it is not a chain). Thus, if w = ◻, {w} is not a Ferrers language and since it is a singleton, it is not a union of Ferrers languages, hence its complement A * ∖ {w} is not an intersection of Ferrers languages.
Since the complement of a Ferrers relation is Ferrers, the complement of a Ferrers language is Ferrers (apply (1) of Fact 8). The concatenation of two Ferrers languages is not Ferrers in general. For a simple minded example, let A ∶= {a, b}, let U ∶= {a n ∶ n ≥ 2}, U ′ ∶= {b n ∶ n ≥ 2}. Each of these languages is Ferrers, but the concatenation U U ′ is not: let x ∶= a 2 b,y ∶= b and x ′ ∶= a,y ′ ∶= ab 2 . Then xy = x ′ y ′ = a 2 b 2 ∈ U U ′ but neither xy ′ = a 2 bab 2 nor x ′ y = ab belong to U U ′ .
Recall that for two words u and v, u is a prefix of v if v = uw for some word w; similarly, u is a suffix of v if v = wu for some word w.
Fact 11. Let U and U ′ be two subsets of A * . If U, U ′ are Ferrers and U is a final segment for the prefix ordering or U ′ is a final segment for the suffix ordering then the concatenation U U ′ is Ferrers.
Proof. Let L ∶= U U ′ , let xx ′ ∈ L and yy ′ ∈ L. We prove that either xy ′ or x ′ y belong to L. There are four cases to consider; we only consider two, the others being similar. Case 1. x = x 1 x 2 , y = y 1 y 2 with x 1 , y 1 ∈ U and x 2 x ′ ∈ U ′ and y 2 y ′ ∈ U ′ . Since U ′ is Ferrers, either x 2 y ′ ∈ U ′ or y 2 x ′ ∈ U ′ . In the former case xy ′ ∈ U U ′ whereas in the latter yx ′ ∈ U U ′ . Case 2. x = x 1 x 2 , y ′ = y ′ 1 y ′ 2 with x 1 ∈ U, yy ′ 1 ∈ U, x 2 x ′ ∈ U ′ and y ′ 2 ∈ U ′ . If U is a final segment for the prefix ordering, then x 1 x 2 y ′ 1 ∈ U since x 1 belongs to U and is a prefix of x 1 x 2 y ′ 1 . Thus xy ′ = x 1 x 2 y ′ 1 y ′ 2 ∈ U U ′ . If U ′ is a final segment for the suffix ordering, then x 2 y ′ 1 y ′ 2 ∈ U ′ since y ′ 2 belongs to U ′ and is a suffix of y ′ 2 . Thus xy ′ = x 1 x 2 y ′ 1 y ′ 2 ∈ U U ′ . Corollary 19. The concatenation of finitely many Ferrers final segments of A * is a Ferrers final segment.
We recall that an ideal of an ordered set P is any non-empty initial segment I which is up-directed (that is any two elements x and y of I have an upper bound z in I). Filters are defined dually. Ideals of P are the join-irreducible elements of the lattice I(P ) of initial segments of P . Ideals of the poset A * equipped with the Higman ordering have been described when A is finite by Jullien [18] and by us [20] when A is an ordered alphabet possibly infinite. According to Jullien, an elementary ideal of A * is any set of the form J ∪ {◻} for some non empty ideal J of A, a star-ideal is any set of the form I * for some initial segment I of A. Products of ideals are ideals. It is proved in [20] that every ideal is a finite product of elementary and star-ideals if and only if the alphabet is well-quasi-ordered. Proof. Let I be an ideal of A * . Suppose xx ′ , yy ′ ∈ I. We prove that xy ′ or yx ′ ∈ I. Let z ∈ I such that xx ′ , yy ′ ≤ z. Let z 1 be the least prefix of z such that x, y ≤ z 1 and z 2 the corresponding suffix, i.e., z = z 1 z 2 . If x ′ ≤ z 2 or y ′ ≤ z 2 , then since x, y ≤ z 1 then xy ′ or yx ′ ∈ I. If not, then since xx ′ ≤ z and yy ′ ≤ z, we have x, y ≤ z − 1 , where z − 1 is obtained from z 1 by deleting its last letter. This contradicts the choice of z 1 . Hence, I is Ferrers. Let F be a filter of A * . Let xx ′ , yy ′ ∈ F. Let z ∈ F such that z ≤ xx ′ and z ≤ yy ′ . Write z = z x z x ′ with z x ≤ x, z x ′ ≤ x ′ and z = z y z y ′ with z y ≤ y, z y ′ ≤ y ′ . Either z y ′ ≤ z x ′ or z x ′ ≤ z y ′ . In the first case, since z y ≤ y and z y ′ ≤ z x ′ ≤ x ′ we have z = z y z y ′ ≤ yx ′ , hence yx ′ ∈ F. In the second case we obtain similarly xy ′ ∈ F. Hence F is Ferrers.
For every u ∈ A * , the initial segment ↓ u of A * is an ideal and the final segment ↑ u of A * is a filter, hence: Corollary 20. For every u ∈ A * , the initial segment ↓ u of A * and the final segment ↑ u of A * are Ferrers.
Since {u} =↓ u ⋂ ↑ u, we have: Corollary 21. For every u ∈ A * , {u} is an intersection of two Ferrers languages and A * ∖ {u} is an union of two Ferrers languages.
If A is w.q.o., every final segment is finitely generated and every ideal is a finite union of ideals, hence from the second part of Corollary 20 and from the first part of Fact 12, we obtain. According to Corollary 21, for every u ∈ A * , A * ∖{u} is an union of two Ferrers languages, hence: Proposition 7. Every language is a union, possibly infinite, of a family of intersections of two Ferrers languages.
According to Corollary 22, if the alphabet is w.q.o. (and particularly, if it is finite), Boolean combinations of final segments, alias piecewise testable languages, are Boolean combination of rational Ferrers languages.
• If the alphabet A consists of one letter, say a, these two Boolean algebras coincide. Indeed, if L is Ferrers then with respect to the natural order on A * ∶= {a n ∶ n ∈ N}, it is convex. Otherwise, there are n < p < m ∈ N such that a n , a m ∈ L, a p ∈ L. Choosing n, m with the difference m − n minimum, we have a q ∈ L for n < p < m. Let X ∶= (a n ) −1 L and Y ∶= (a m−1 ) −1 L. Then ◻ and a m−n ∈ X but ◻ ∈ X, whereas a ∈ Y but ◻ ∈ Y . Hence, X and Y are incomparable with respect to inclusion, contradicting the fact that L is Ferrers. Being convex, L is the intersection of an initial segment segment with a final segment, thus it is piecewise testable.
•If A ∶= {a, b}, with a = b, then L ∶= A * b is rational and Ferrers and not piecewise testable. Indeed, let Q L ∶= {u −1 L ∶ u ∈ A * }, then Q L has two elements, namely L and L ′ ∶= {◻} ∪ L (in fact a −1 L = L, b −1 L = L ′ , a −1 L ′ = L, b −1 L ′ = L ′ . The fact that L is not piecewise testable follows from Stern'criterium ([36] Theorem 1.2): the sequence (u n ) n∈N defined by u 2n ∶= (ba) n b and u 2n+1 ∶= (ba) n+1 is increasing for the subword ordering while a 2n ∈ L and a 2n+1 ∈ L for all n ∈ N.
The language L above has dot-depth one. Is this general? That is: Question. Do rational Ferrers languages have dot-depth one?
We relate Ferrers piecewise testable languages and structural properties of transition systems.
Theorem 23. Let F be a final segment of A * . The following conditions are equivalent: (1) F is Ferrers; (2) The space S F is linearly orderable.
Proof. Let E be a finitely indecomposable absolute retract. From Theorem 6, E is isomorphic to S F where F is join-irreducible in the lattice F(A * ) ordered by reverse of inclusion. The fact that F is join-irreducible amounts to the fact that A * ∖ F is an ideal of A * . According to Fact 12, A * ∖ F is Ferrers. Hence, its complement F is Ferrers. The result follows from Theorem 23.