I would like to thank the reviewers of this thesis for their careful proofreading and precious comment. You brought to my attention several flaws, and solving them helped me improving many parts, and gave me a deeper understanding of my results. In particular, this made me found some connections I was not aware of, which gave me a great guideline for my defense.

I also thank members of the jury for doing me the honor of attending to my PhD defense. In particular, special thanks for my PhD advisors for taking me on this three years long journey throughout the world of research. They have always been available for my questions and valued my work. It has been a pleasure working with you two: thank you a million.

I would also like to thank the co-author (and main author) of my first paper: Christoph Haase. You taught me a lot as we were writing this article, and your advice became ground rules for writing this thesis and other papers. It has been a pleasure working with you. It has also been a pleasure working with Dmitry Chistikov who joined us on the journal version of this article, as he had solved our main open problem. I also thank all the people with whom I had the chance to share a publication: Piotr, thank you for inviting me to help you solve your problem. Stefan, and Piotr, thank you for all your precious comments on my talks. Georg: it was a pleasure working with you. I admire your efficiency at solving the problems we were working on, and your efficiency to write a very good paper in a rush (although for you, it was your "most relaxed LICS submission").

Most generally, thank you to all members of LSV, you all contribute in making this lab a terrific place, and it has truly been a pleasure being around you for the past three years. I remember Alain telling us at a MPRI lecture that LSV has the policy of only hiring nice people: "we would not hire the next Einstein if he was not a friendly person". Well I have to believe you now Alain. And of all LSV members, I especially thank those that take care of us everyday, and take care of our silly mistakes: Catherine, Virginie, Thida, Imane, Francis, Hugues. Whenever one of us (no name) booked a flight for NYC when the conference only was in the state of New York, tried to print without being connected to the network, deleted files accidentely, came back from conferences without the receipts, or went to summer schools without train tickets: thank you for helping us then.

More generally, I have met a lot of kind and fascinating people during my three-year journey in the world of research. There is a general feeling of being part of the same family, because we are inhabited of the same passion in mathematics and computer science, and it is quite an enjoyable feeling. I particularly remember the joy I felt being part of event as the 20th anniversary of LSV, the Dagstuhl Seminar on WQOs (thanks to Jean and the organizers for their invitation on such a short notice), or the Bravas kickoff meeting. There were great experiences during which I have learned a lot, and have enjoyed discussion with talented people. This feeling of being part of a worldwide family will be one the aspect I will miss the most as I begin my career as a teacher.

Speaking of teaching, my PhD offered me wonderful opportunities to teach at the ENS Cachan, under the direction of Jean Goubault-Larrecq. Thank you Jean for sharing your teaching experience with me and helping me provide relevant exercises to illustrate your lectures. Thank you to Claudine Picarrony for allowing me to intervene in her lectures for preparation to Agregation, and most of all for her many pieces of advice on what to do after my PhD.

I would also like to thank all my fellow PhD students from LSV, from lunch to gouter, through coffe break and sometimes dinners, for their support throughout the difficult moments of a PhD. Jeremy: thank you for the introductionnary classes in category theory on the way home. Nathan thank you for the circuit complexity class walk through during lunches. Samy, thank you for bringing timed and robust systems to my attention. No I'm kiding, you know very well what I thank you for ;-) Many thanks to Antoine Dallon, whom I shared an office with, and that probably is the most quiet neighbour one could wish for. Now that I am done writing this manuscript, I can help you dig those moats you wanted ! Thanks to Anthony, my other neighbour, for your active participation to this manuscript: first the magnificient symbol (1 brownie point to whoever finds its occurence in the thesis), and later for brining to me a whole new view of the -WQOs. And I thank our older brothers: Marie, Guillaume, Rémi, Lucca: thank you for bringing to my attention that our diet is not healthy. I am writing this line at 9:30 pm at LSV (thank god this is not a ZRR !), just after a dinner out with other Cachannais, and we had a long discussion on where to get dinner, and had the drastic conclusion that there are no ways of eating healthy around that campus, hence the reputation of students from Cachan. I wish to all future students of the resplendent ENS Paris-Saclay that the landscape will be more diverse in Saclay. And finally I thank the youngsters: Adrien, for being my successor in the high concil, Charlie for being my heir to the Advenced Complexity course. Keep the traditions going.

To all the Nadines I did not thank yet, and to those I thanked already, Nadine ! I nadine you with all my nadine: Presidente, Davy, Romaing, Samy, Sarah, Joris, Skippy, Seya, Jeremy, Sushi, Nala, Wasa, ... Thank you for your support during the B-weeks, thank you for keeping me from starvation, thank you for all your help around the house.

Many thanks to my writing companions: Miette, after two bachelors and two masters, you will soon be twice doctor in science ! Any typo in this manuscript can be attributed to Aloha, mistaking my keyboard for a DDR Pad (#Skippy). Thanks to Alpha for sharing his deep understanding of -WQOs, and to Coquillette for biting my power plug. Thanks to Miss and Yang for their discrete presence once in a while.

And of course, I want to thank my family, for always being there for me. There is a running joke in my family that each of my life's "important" moment were shadowed by my older sisters greater achievment. My first day in middle school was my sister's first day in medical studies. I graduated highschool the same year she became "Interne des Hopitaux" (Christian's prounonciation). Some days before my oral exam for ENS, I was driving my three-days-old niece from the hospital where she were born back to her home. Allison, maybe your constant crying at night is the reason I wasn't accepted at Centrale Paris, hence in a sense, this thesis wouldn't have happened without you ! Thank you ! And most recently, my sister was 8-months pregnant for my wedding, and almost couldn't attend it. So sisters, what did you plan for June 2018 ? Or maybe this defense does not count as important: "So, as you know, me and Dad are in Paris on the 9th and 10th of June, could you maybe schedule your defense on the 8th so that your father can be there ?".

And of course, thank YOU, for being there and showing me how to write acknoledgements: thank you, for being you and making me whole.

Chapter 1 Introduction

Well Quasi-Ordering (WQO) is a notion from order theory that lies between wellorders (ordinals) and well-founded quasi-orderings: a well-order is WQO, and a WQO is well-founded. It enjoys several equivalent definitions (see Section 2.3), and has therefore been introduced several times independently, as people were interested in one of the characterization. Higman [START_REF] Higman | Ordering by divisibility in abstract algebras[END_REF] studied orderings having the finite basis property: every subset has a non-empty but finite set of minimal elements (see (WQO4) in Section 2.3), as a generalization of well-orderings (every subset has exactly one minimal element). In the 1940's, Vazsonyi and Erdös were interested in conjectures of the form of (WQO1), and thus naturally introduced WQOs with this definition. The concept of WQOs has also been introduced as a strengthening of well-founded quasiorderings: for instance, the powerset of a well-founded order (ordered with the domination ordering, see Section 7.3) may not be well-founded. But it is if the QO one started with is WQO (see (WQO7) in Section 2.3). More generally, WQOs enjoy many more closure properties than well-founded orderings, letting them be easier to work with. This is I think the reason of the success of this notion in many areas of mathematics and computer science: Combinatorics, Topology, Automata Theory and Formal Languages, Proof Theory, Term Rewriting, Graph Theory, Program Verification, and more. See [2] for an early history of the concept and [3] for a recent survey on the use of WQOs in many areas of mathematics and computer science, written as a report of a Dagstuhl seminar bringing together researchers from many different communities of mathematics and computer science around the central notion of WQOs. Note that even though WQOs enjoy closure properties under many natural operations, a better notion has been introduced by Nash-Williams in the late 1960's, which enjoys even more closure properties. This notion, Better Quasi-Orderings is defined in Section 9.2.

Although WQO have proved their strength in many areas of computer science, our motivations will mainly come from Program Verification. Nonetheless, the results of this thesis are general and may be of interest for any computer scientist working with WQOs.

WQOs in Program Verification

The efficiency of well-founded orderings to prove program termination, already suggested by Turing [START_REF] Turing | Checking a large routine[END_REF], is widely known. It is thus not a surprise that WQOs may be used to show program termination. More generally, several alternative definitions of WQOs (see Section 2.3) contain a flavor of finiteness, which is what makes WQOs powerful objects in computer science.

In the 1990's, Finkel, Schnoebelen, Abdullah and Jonsson introduced a large class of infinite state systems, Well Structured Transition Systems (WSTS), which can be verified using generic methods conceptually similar to the ones used to verify finite state systems (see [START_REF] Finkel | Well-structured transition systems everywhere![END_REF][START_REF] Schmitz | The power of well-structured systems[END_REF] for surveys). The key ingredient in the notion of WSTS is the presence of a WQO compatible with the structure of the transition system. The finite basis property (cf. above) ensures that some infinite sets of states enjoy finite representations, and under mild effectiveness assumptions, we may perform computations with those sets, ultimately proving verification properties of the system (coverability, termination, boundedness, ...). Last year, the main contributors to this generic framework which has flourished during the last 20 years, have received the CAV award.

Outline. In the first part of this thesis, we define a notion of effectiveness for WQOs, and proceed to prove that a large class of WQOs is effective in this sense. Our notion of effectiveness includes most of the requirements needed for generic algorithms. In the second part, we study some logical aspect of WQOs.

Chapter 2

Basics of Order Theory and Well Quasi-Orderings

This chapter is devoted to defining the terminology we use throughout this manuscript. We also recall well-known facts from order-theory, along with the main ideas for their proofs, which are voluntarily kept concise. For a deeper presentation of these notions, we invite the reader to refer to [START_REF] Schmitz | Algorithmic aspects of WQO theory[END_REF]2] for instance.

Preliminaries

Natural Numbers. The set of all natural numbers is denoted N. When used on natural numbers, ≤ denotes the usual ordering on N. The finite set {1, . . . , n} will be denoted [n]. A permutation is a bijection from [n] to [n]. The set of all permutations, denoted S n , is a group, sometimes called the symmetric group. It has n! elements, which is asymptotically exponential in n (by Stirling formula: n! ∼ √ 2πn n e n ).

Sets. We use standard set-theoretic operations on sets: membership x ∈ S, inclusion S ⊆ T , union S ∪ T , intersection S ∩ T , set difference S T . Given a set X, the set of all subsets of X is denoted P(X). When S ∈ P(X) and X is clear from the context, the set difference X S, called the complement of S and will be denoted ∁S. If A is a set of sets, A denotes the set S∈A S (a notation coming from set-theory).

Relations. A relation R on a set X is a subset of X×X. As such, we use set-theoretic operations on relations, e.g. R ⊆ S means ∀x, y ∈ X. xRy ⇒ xSy, where xRy denotes membership (x, y) ∈ R. Given a relation R on a set X and a function f : X → Y , we also refer to the image of R by f to denote the relation S def = {(f (x), f (y)) | x, y ∈ X and xRy}.

We sometimes use the functional point of view, for instance the composition of two relations R 1 and R 2 is the relation R = R 1 • R 2 defined by xRy def ⇔ ∃z. xR 1 z ∧ zR 2 y. A relation is:

• reflexive if ∀x ∈ X. xRx,
• transitive if ∀x, y, z ∈ X. xRy ∧ yRz ⇒ xRz,

• symmetric if ∀x, y ∈ X. xRy ⇒ yRx,

• antisymmetric if ∀x, y ∈ X. (xRy ∧ yRx) ⇒ x = y.

An equivalence relation is a reflexive, transitive and symmetric relation. Let E be such a relation on X. Elements x and y in X such that xEy are called equivalent. For every x ∈ X, [x] E , or [x] when E is understood, denotes the equivalence class of X: [x] = {y ∈ X | xEy}. We say that x is a representant of [x]. Observe that [x] = [y] ⇐⇒ xEy. As a consequence, two equivalence classes are either equal or disjoint. It follows that equivalence classes form a partition of X (conversely, any partition of X defines an equivalence relation).

The quotient of X by E, denoted X/E, is the set of equivalence classes of E.

A relation which is reflexive and transitive is called a quasi-ordering.

We will often use the abbreviations xRy, z and x, yRz to express xRy ∧ xRz and xRz ∧ yRz, respectively.

Sequences. We assume some familiarity with ordinals. Given an ordinal α, we denote by α the set of strictly smaller ordinals, i.e. α def = {β | β < α}. A sequence over X is a function s : α → X for some ordinal α. The length of a sequence s, denoted |s|, is the ordinal α, if α is its domain. The only sequence of length 0, denoted ǫ, is also called the empty sequence. The set (or class) of sequences of length α is denoted X α , and X <α = β<α X β . The concatenation of two sequences s and t over the same set X of length α and β respectively is the sequence of length (α + β) denoted s • t and defined by (s • t)(γ) = s(γ) if γ < α, and (s • t)(α + γ) = t(γ) if γ < β. This operation is associative.

When (X, ≤) is a quasi-ordered set (see below), sequences are quasi-ordered with the embedding quasi-ordering: if s and t are sequences of length α and β respectively, then s ≤ t def ⇔ ∃f : α → β strictly increasing . ∀γ < α. s(γ) ≤ t(f (γ))

When s ≤ t, the function f is called a witness of the embedding of s in t. A subsequence of a sequence t is a sequence s that embeds into t when the order considered on X is the equality. A sequence is finite if its length is a natural number. The set of finite sequences over X is denoted X * instead of X <ω , and the embedding quasi-ordering between finite sequences will be denoted ≤ * . Finite sequences are often described by the ordered list of their images: u = x 1 x 2 • • • x n • • • where x i = u(i-1). When X is a finite alphabet (i.e. a finite set ordered with equality), finite sequences over X are often called finite words. In Section 11.1, we freely use regular expressions like (ab) * + (ba) * to denote regular languages. Given a letter a ∈ X, |u| a denotes the number of occurrences of a in u. A word v is a factor of u if there exist words u 1 and u 2 such that u = u 1 vu 2 . If furthermore u 1 = ǫ then v is a prefix of u, while if u 2 = ǫ then v is a suffix of u.

Order Theory

Orderings. Let X be a set. A quasi-ordering (abbreviated QO) on X is a reflexive and transitive relation, often denoted ≤, on X. If x ≤ y, we say that x is smaller than y, or y is greater than x, which is also denoted y ≥ x. If ≤ is also anti-symmetric, then it is called a partial-ordering, or often simply an ordering. Every quasi-order (X, ≤) defines a partial-ordering on X/ ≡, where ≡ is the equivalence relation defined by ≡ = ≤ ∩ ≥.

A quasi-ordering (X, ≤) is said to be total, or linear, if every pair of elements is comparable: ≤ ∪ ≥ = X 2 . If (X, ≤) is not linear, there are some incomparable elements. We define for this cases the relation ⊥: x ⊥ y def ⇔ x ≤ y ∧ y ≤ x. A chain Y of (X, ≤) is a subset of X which is totally ordered, that is (Y, ≤ Y ) where ≤ Y is the restriction of ≤ to Y , is a total (partial-) order. An antichain of X is a subset S ⊆ X such that elements of S are pairwise incomparable: ∀x, y ∈ S. x = y ⇒ x ⊥ y. A QO (X, ≤) is FAC (for finite antichain condition) if it has no infinite antichains.

Given a QO (X, ≤), we define its associated strict ordering, denoted <, by < = ≤ ≡. The QO is well-founded if there are no infinite strictly decreasing sequences x 1 > x 2 > x 3 > . . . in (X, ≤). If it is also antisymmetric and linear, then we say it is a well-order. Note that ordinals are exactly equivalence classes of well-orderings for order-isomorphism equivalence relation (cf. next paragraph).

An extension of a quasi-ordering ≤ on X is a quasi-ordering ≤ ′ also on X such that ≤ ⊆ ≤ ′ .

An element x ∈ X is said to be minimal in S ⊆ X if for every y ∈ S, y ≤ x ⇒ x ≤ y. Equivalently, x is minimal if there are no y ∈ S such that y < x. Maximal elements are defined dually.

Mappings between Quasi-Ordered Sets. A mapping f : X → Y between two quasi-ordered sets (X, ≤ X ), (Y, ≤ Y ) is:

• monotone if for every x, y ∈ X, x ≤ X y ⇒ f (x) ≤ Y f (y).

• a reflection if for every x, y ∈ X, f (x) ≤ Y f (y) ⇒ x ≤ X y

• an embedding of X into Y if it is a monotone reflection, that is for every x, y ∈ X, x ≤ X y ⇐⇒ f (x) ≤ Y f (y).

• An isomorphism if it is a bijective embedding.

As long as we are only interested in the properties of the quasi-ordering, two isomorphic QOs can be considered identical.

Closed Subsets. Given a subset S ⊆ X of a QO (X, ≤), we define:

• its downward-closure ↓ S def = {x ∈ X | ∃y ∈ S. x ≤ y} • its upward-closure ↑ S def = {y ∈ X | ∃x ∈ S. x ≤ y} • its strict-downward-closure ↓ < S def = {x ∈ X | ∃y ∈ S. x < y} • its strict-upward-closure ↑ > S def = {y ∈ X | ∃x ∈ S. x < y}
When (X, ≤) is not clear from the context, we use the more explicit notation ↑ X S (resp. ↓ X S), or ↑ ≤ S. Sometimes, we only subscript by a symbol that clearly refers to some specific QO, e.g. if the QO is ≤ st , we write ↓ st instead of ↓ ≤st .

In the case S is a singleton, we write ↑ x for ↑{x} and ↓ x for ↓{x}, when it causes no confusion (e.g. not when x is itself a set). With this abbreviation, ↑ S = x∈S ↑ x and ↓ S = x∈S ↓ x. These relations are particularly interesting when S is a finite set.

A subset U of X is said to be upward-closed when U = ↑ U . A subset D of X is said to be downward-closed when U = ↓ U . We denote the set of all upwardclosed sets of X by Up(X) ⊆ P(X) and the set of all downward-closed sets of X by Down(X) ⊆ P(X). The sets Up(X) and Down(X) are closed under union and intersection. Besides, upward-and downward-closed sets are dual in the following sense: the complement function from P(X) to itself is an isomorphism between (Up(X), ⊇) and (Down(X), ⊆), and it is an involution. As such, upward-and downward-closed sets will share many property, and we will often talk about closed subsets to denote upward-and (respectively) downward-closed sets.

Irreducible Subsets. A subset S ⊆ X is said to be (up)-directed if for every x, y ∈ S, there exists z ∈ S such that x ≤ z and y ≤ z. Similarly, S is said to be (down)directed if for every x, y ∈ S, there exists z ∈ S such that x ≥ z and y ≥ z. When the adjective directed is used alone, it will always mean (up)-directed. A filter of X is a non-empty upward-closed (down)-directed subset of X. The set of filters of X is denoted Fil (X). An ideal of X is a non-empty downward-closed (up)-directed subset of X. The set of ideals of X is denoted Idl (X). Filters are not complements of ideals, and vice versa. Observe that for every x ∈ X, ↑ x ∈ Fil (X) and ↓ x ∈ Idl (X). Such subsets are respectively called principal filters and principal ideals.

The main property of filters and ideals is their irreducibility in Up(X) and Down(X) respectively. Formally, an upward-closed set U ∈ Up(X) is irreducible if it is non-empty, and for every U 1 , U 2 ∈ Up(X), U ⊆ U 1 ∪ U 2 implies that U ⊆ U 1 or U ⊆ U 2 . Similarly, a downward-closed set D is irreducible if it is non-empty, and for every D 1 , D 2 ∈ Down(X), D ⊆ D 1 ∪ D 2 implies D ⊆ D 1 or D ⊆ D 2 . Irreducible sets are those that cannot be written as a finite union of the others: D ∈ Down(X) is irreducible if and only if for every D 1 , . . . , D n ∈ Down(X), D = D 1 ∪ • • • ∪ D n implies D = D i for some i. The statement also holds for irreducible sets of Up(X).

The following proposition relates irreducibility and directedness:

Proposition 2.2.1. Filters are exactly the irreducible sets of Up(X) and ideals are exactly the irreducible sets of Down(X).

Proof. We provide a proof that a downward-closed set of X is an ideal if and only if it is irreducible. The proof for upward-closed sets is dual.

(⇒) Let I be an ideal of X and D 1 , D 2 ∈ Down(X) such that I ⊆ D 1 ∪ D 2 . We show that if I ⊆ D 1 , then I ⊆ D 2 . Let x ∈ I D 1 ⊆ D 2 D 1 . For any y ∈ I, there exists z ∈ I such that z ≥ x, y. Since D 1 is downward-closed and x inD 1 , z / ∈ D 1 . Therefore z ∈ D 2 , and thus y ∈ D 2 , since D 2 is downward-closed.

(⇐) By contraposition, let D ∈ Down(X) which is not an ideal, that is there exist x, y ∈ D such that ↑ x ∩ ↑ y ∩ D = ∅, or equivalently D ⊆ ∁(↑ x ∩ ↑ y). Define D 1 = ∁ ↑ x and D 2 = ∁ ↑ y. Then D 1 ∪ D 2 = ∁(↑ x ∩ ↑ y) and thus D ⊆ D 1 ∪ D 2 . Besides, x and y are incomparable, since otherwise max(x, y) would belong to D ∩ ↑ x ∩ ↑ y. Therefore, x ∈ D D 2 and y ∈ D D 1 .

Well Quasi Orderings

A QO (X, ≤) is a well-quasi ordering (WQO for short) if and only if one of the following equivalent statements holds:

Every infinite sequence x 0 , x 1 , x 2 , . . . has an increasing pair, that is a pair x i ≤ x j for i < j. A sequence will be called good if it has an increasing pair, and bad otherwise. Thus in a WQO, all bad sequences are finite.

(WQO1)

Every infinite sequence x 0 , x 1 , x 2 , . . . has an infinite increasing subsequence: ∃i 0 < i 1 < . . . such that x i0 ≤ x i1 ≤ . . . (WQO2) (X, ≤) is FAC and well-founded. (WQO3)

Every non-empty subset S ⊆ X has a finite basis, that is a finite set B such that ↑ B = ↑ S. Intuitively, this can be thought of as "S has finitely many minimal elements", which is formally wrong because there might be infinitely many equivalent elements. We will denote by min(S) any finite basis of S which is minimal for inclusion. Given any two such finite basis B 1 and B 2 , there exist a bijection that maps elements B 1 to equivalent elements (for ≤) of B 2 .

(WQO4) Every upward-closed set U ∈ Up(X) is a finite union of principal filters. (WQO5) (Up(X), ⊇) is well-founded. (WQO6) (Down(X), ⊆) is well-founded. (WQO7)

Proof. Of equivalence (WQO2) ⇒ (WQO1): trivial. (WQO1) ⇒ (WQO3): An antichain is a bad sequence, hence cannot be infinite. Similarly, a strictly decreasing sequence is a bad sequence, hence cannot be infinite.

(WQO3) ⇒ (WQO2): This is the difficult implication. It relies on the Infinite Ramsey Theorem. Let (x n ) n∈N be an infinite sequence of elements of X. We color the infinite complete graph G = (N, {{i, j} | i, j ∈ N, i = j}) with the three colors {≤, >, ⊥}. As expected, a two-element subset {i, j} with i < j ∈ N is colored with ≤ if x i ≤ x j , with > if x i > x j , and with ⊥ otherwise. Now, the Infinite Ramsey Theorem states that G has an infinite monochromatic clique. An infinite clique of G colored with > induces a strictly decreasing infinite subsequence of (x n ) n∈N , which is impossible since (X, ≤) is well-founded. An infinite clique of G colored with ⊥ induces an infinite antichain in X, which is also impossible. Therefore, there is in G an infinite clique colored with ≤, i.e. an infinite increasing subsequence of (x n ) n∈N .

(WQO3) ⇒ (WQO4): Let S be a subset of X. Since (X, ≤) is well-founded, S has a non-empty subset M of minimal elements, and ↑ M = ↑ S. Besides, it is easy to see that if x is minimal in S and y ≡ x, then y is minimal as well. It follows that M is a union of equivalence class for ≡. Consider B a set obtained from M by taking exactly one member of each these equivalence class. Of course, ↑ B = ↑ M = ↑ S. Moreover, since elements of B are minimal in S but non equivalent, they form an antichain, hence B is finite. Now, let B 1 and B 2 two finite basis of S that are minimal for inclusion. Let x ∈ B 1 . Since ↑ B 1 = ↑ B 2 , there exists y ∈ B 2 such that y ≤ x, and conversely, there exists z ∈ B 1 such that z ≤ y. It follows that z ≤ x. If z = x, B 1 {x} is still a finite basis of S which is in contradiction with B 1 being minimal. Therefore z = x which means that x ≡ y. If there exists y ′ ∈ B 2 such that y ′ ≤ x, the same reasoning leads to x ≡ y ′ , hence y ≡ y ′ , which is impossible by minimality of B 2 .

It follows that for every x ∈ B 1 , there exists a unique equivalent y ∈ B 2 . This provides an injective mapping of elements of B 1 to equivalent elements of B 2 . By symmetry between B 1 and B 2 , the mapping is actually bijective.

(WQO3) ⇐ (WQO4): Since any subset of X has a non-empty subset of minimal elements, (X, ≤) is well-founded. Besides, for any antichain A, A = min(A), and thus A is finite.

(WQO4) ⇒ (WQO5): An upward-closed set U is in particular a subset of X. Therefore there exists a finite basis B such that

↑ B = ↑ U = U . Since B is finite, ↑ B = x∈B ↑ x is a finite union.
(WQO4) ⇐ (WQO5): Conversely, for an arbitrary subset S ⊆ X, any finite decomposition of the upward-closed set ↑ S = n i=1 ↑ x i provides a finite basis. (WQO6) ⇔ (WQO7): follows from the prior observation on ∁ being an isomorphism between (Up(X), ⊇) and (Down(X), ⊆) (cf. end of paragraph on Closed Subsets).

(WQO2) ⇒ (WQO6): given a strictly increasing sequence U 0 U 1 U 2 • • • of upward-closed sets, define a sequence of elements of X as follows: x 0 ∈ U 0 , and for all i, x i ∈ U i U i-1 . Such a sequence exists since (U n ) is strictly increasing. Moreover, the sequence (x n ) is bad, hence finite. Indeed, let i < j, x j ∈ U j U j-1 , and

U i ⊆ U j-1 , thus u j / ∈ U i . But U i is upward-closed, so x i ≤ x j would imply x j ∈ U i .
(WQO7) ⇒ (WQO1): given an infinite sequence (x n ) n∈N of elements of X, we define a decreasing sequence of downward-closed sets D i = j≥i ↓ x j . The sequence (D n ) n∈N is decreasing for ⊆ by construction. Thus, there exists i ∈ N such that D i = D i+1 . In particular, x i ∈ D i = D i+1 and therefore x i ∈ ↓ x j for some j > i, which is equivalent to

x i ≤ x j .
The property that bad sequences are finite is of course very useful in computer science, for instance in the context of proving termination of programs. However, such a finiteness property already lies in the definition of well-foundedness. What makes WQO a more practical tool than well-founded orderings is that the notion is preserved under many operations on quasi-ordered sets. Cartesian products (with componentwise quasi-ordering [START_REF] Leonard | Finiteness of the odd perfect and primitive abundant numbers with n distinct prime factors[END_REF]) and finite sequences (with the Higman or subword quasiordering [START_REF] Higman | Ordering by divisibility in abstract algebras[END_REF]) are the most prominent examples. In Part I, many such constructions will be presented in details. In addition to these, we would like to mention that several quasi-orderings on trees labeled with elements of a WQO are WQOs themselves. And of course, the famous Robertson-Seymour Theorem states that the minor ordering on graphs (labeled by elements in a WQO) is a WQO [START_REF] Robertson | Graph minors xxiii. nash-williams' immersion conjecture[END_REF].

Properties of Closed Subsets of a WQO. The following theorem is due to Bonnet and proved in [START_REF] Bonnet | On the cardinality of the set of initial intervals of a partially ordered set[END_REF]. Similar proofs can also be found in [START_REF] Fraïssé | Theory of relations[END_REF][START_REF] Kabil | Une extension d'un théorème de P. Jullien sur les âges de mots[END_REF]. To the best of the author's knowledge, the proof presented below is new.

Theorem 2.3.1 (Bonnet). A QO (X, ≤) is FAC if and only if every downward-closed set of X is a finite union of ideals, if and only if every upward-closed set of X is a finite union of filters.

Proof. A QO (X, ≤) is FAC if and only if (X, ≥) is FAC. Upward-closed sets of (X, ≤) being downward-closed sets of (X, ≥), and filters of (X, ≤) being ideals of (X, ≤), we only need to show the first equivalence.

(⇐) Let S ⊆ X be an infinite subset of X. If the downward-closure ↓ S has an ideal decomposition ↓ S = I 1 ∪ • • • ∪ I n , then there must be infinitely many x ∈ S that belong to the same ideal I i0 . Take x, y two elements of S that belong to I i0 , by directedness there exists z ∈ I i0 such that z ≥ x, y. But I i0 ⊆ ↓ S, therefore there exists t ∈ S such that t ≥ z ≥ x, y, and S is not an antichain.

(⇒) By contraposition, let D ∈ Down(X) that does not admit a finite ideal decomposition. We apply Zorn's Lemma to the quasi-ordered set (P(P(D) ∩ Idl (X)), ≤ c ), where ≤ c denotes the covering quasi-ordering defined by:

A ≤ c B iff A ⊆ B iff ∀I ∈ A. I ⊆ B. Note that P(D) ∩ Idl (X) = Idl (D, ≤)
, where (D, ≤) is the QO obtained by restricting (X, ≤) to D (this relies on the fact that D is downward-closed, the structure of the ideals of a restriction is more complex in general, see Section 4.3). Therefore, given A a set of ideals of D, A is a downward-closed subset of D, and ≤ c corresponds to inclusion for downward-closed sets.

In order to apply Zorn's Lemma, we show that every chain of P(Idl (D)) has an upper bound. Given such a chain C, define A = C ⊆ Idl (D). For B ∈ C, B ≤ c A since B ⊆ A. Therefore, by Zorn's Lemma, (P(P(D) ∩ Idl (X)), ≤ c ) has a maximal element M ⊆ Idl (D), that is for every A ⊆ Idl (D), M < c A. In particular, for any I ∈ M , M < c (M {I}), i.e. ∃K ∈ M . K ⊆ J∈M {I} J. Trivially, K ⊆ J∈M {I} J for K ∈ M {I}. Therefore, for the above condition to be true, the following must hold: I ⊆ J∈M {I} J. In other words, ∀I ∈ M . ∃x I ∈ I. ∀J ∈ M . (J = I ⇒ x I / ∈ J). Using the axiom of choice, we can chose such an element x I for every I ∈ M . The resulting set {x I | I ∈ M } is obviously an antichain of (X, ≤). It remains to show that M is infinite. For this, we show that M = D, and since we assumed that D cannot be decomposed as a finite union of ideals, it follows that M is infinite. For the sake of contradiction, assume M is a strict subset of D. Then let

x ∈ D M , we have M < c M ∪ {↓ x}, contradicting the maximality of M .
Since a WQO is in particular a FAC QO, it follows that downward-closed and upward-closed sets of a WQO are finite unions of ideals and filters, respectively. Actually, there is a more direct and much easier proof of this fact in the case of a WQO. For upward-closed sets, the decomposition already follows from (WQO5) above. Note that this even proves that upward-closed sets are finite unions of principal filters, and indeed, all filters are principal in a WQO.

For downward-closed sets, the decomposition can be proved by induction on (Down(X), ⊆), which is well-founded when (X, ≤) is a WQO (cf. (WQO7)). Actually, the general case is often proved using this special case (cf. [START_REF] Bonnet | On the cardinality of the set of initial intervals of a partially ordered set[END_REF][START_REF] Fraïssé | Theory of relations[END_REF][START_REF] Kabil | Une extension d'un théorème de P. Jullien sur les âges de mots[END_REF]).

Note that the situation is not symmetric between upward-closed and downwardclosed sets of a WQO: unlike for filters, not all ideals are principal. Indeed, (WQO5) shows that all filters of (X, ≤) are principal when (X, ≤) is a WQO. Therefore, all ideals are principal if and only if (X, ≥) is a WQO. But ≤ and ≥ are simultaneously WQOs if and only if X is finite.

Even though not all ideals are principal, principal ideals convey the good intuition: an ideal is always the downward-closure ↓ x of some element x, however sometimes this element x is not in X: it is a limit point. When X is countable, this intuition can be made formal: ideals are exactly the downward-closure of chains. That is, ideals are limits of increasing sequences. More generally, a partially-ordered set (X, ≤) can always be seen as a topological set (X a , O) equipped with the Alexandroff topology. In this setting, a topological operation called sobrification that essentially consists in adding the "missing limits" applied to (X a , O) corresponds exactly to the set of ideals. When (X, ≤) is WQO, (X a , O) is Noetherian (for the Alexandroff topology). But topological spaces can be Noetherian for other topologies, in which case they may not correspond to some WQO. Noetherian spaces therefore constitute a generalization of WQOs, closed under more operations (e.g. infinite powerset). For more details, see [START_REF] Finkel | Forward analysis for WSTS, part I: Completions[END_REF] and references therein.

Cardinalities Let (X, ≤) be a WQO. From the fact that all filters are principal, it follows that (Fil (X), ⊆) is order-isomorphic to (X/≡, ≤), where ≡ is the equivalence relation induced by ≤. Besides, the irreducibility of filters (Proposition 2.2.1) entails that (Up(X), ⊆) embeds in (P f (Fil (X)), ⊑ H ), where P f denotes the finitary powerset and ⊑ H denotes the Hoare quasi-ordering defined by: For A, B ⊆ P f (Fil (X)),

A⊑ H B def ⇔ ∀F ∈ A. ∃F ′ ∈ B. F ⊆ F ′ . Furthermore, (Up(X), ⊆) is isomorphic to the quotient P f (Fil (X))/≡ H , where ≡ ⊑ H = H ∩ ⊒ H .
More details on the Hoare quasi-ordering are given in Section 7.3.

From this isomorphism, it follows that if X/≡ is infinite, Up(X) has the same cardinality as X. Since Down(X) is isomorphic to Up(X), it also has the same cardinality. Finally, (Down(X), ⊆) is isomorphic to (P f (Idl (X))/≡ H , ⊑ H ) (cf. Proposition 2.2.1 as well), and thus Idl (X) also have the same cardinality. If X is finite, all ideals are principal and thus Idl (X) is isomorphic to X/≡. Theorem 2.3.1 was originally proved to obtain these results on cardinalities [START_REF] Bonnet | On the cardinality of the set of initial intervals of a partially ordered set[END_REF]. In this manuscript, we are interested in computability properties of WQOs, therefore all WQOs will be countable (see Section below).

Notes on Computability

Subsequently, we assume some familiarity with classical computability theory. In this thesis, our aim is to compute operations within quasi-orders. Notably, given a QO (X, ≤), we want to compute mathematical operations in the QOs (Up(X), ⊆) and (Down(X), ⊆).

For the following discussion, let us fix a model of computations, e.g. Turing machines working over a finite alphabet A. In this framework, the notions of decidability and computability are only defined for subsets of A * and functions from A * to A * . Then, what does it mean that ≤ is decidable on X, for some QO (X, ≤) ? To give a meaning to this expression, we encode X into A * . Formally, this is done by considering a recursive subset X of A * (this is the syntax of X) and a function • from X to X (this is the semantic of the syntax). Elements of X encode elements of X: an element x ∈ X is encoded (represented) by any x ∈ X such that x = x. To say that X encodes X, we want to make sure that every element of X is actually encoded in X, that is • is surjective. However, we don't require the semantic function to be injective, that is an element of X might have several encodings. Note that the semantic is a surjective function from a countable set to X, hence X is countable. Now, observe that the quasi-ordering ≤ on X defines a quasi-ordering ≤ on X by:

x ≤y def ⇔ x ≤ y
We can now make formal the statement "≤ is decidable": it is if ≤ is decidable. Since ≤ ⊆ A * × A * , the statement " ≤ is decidable" is defined in classical theory of computations. However, the statement "≤ is decidable" is formally defined only once a syntax for elements of X and a semantic function have been fixed. Definition 2.4.1.

• Given a set X, we say that ( X, • ) is a representation (or an encoding) of X if X is a recursive subset of A * and • is a surjective function from X to X.

• Given a representation ( X, • ) of a set X, a subset Y of X is said to be decid- able if {x ∈ X | x ∈ Y } is a decidable set of X.
• Given two sets X and Y , and representations ( X, • X ) and ( Ŷ , • Y ) of these two sets, we say that a function f : X → Y is computable if there exists a computable (in the sense of the model of computations) function f : X → Ŷ such that for every x ∈ X, f (x

) Y = f ( x X ).
According to the equivalence of the main models of computations (Turing machine, Gödel's recursive functions, Church's lambda calculus, . . . ), the definition above would be equivalent if we replaced encodings into A * with encodings into N for instance.

We will say that relation is decidable if it is decidable as a subset of X × X: classical theory of computations provides ways to encode X × X, or X * , etc. given an encoding of X. These will be used silently in the remainder of this manuscript. More generally, we will take a step back from the precise model, and only use high-level structures (pairs, lists, trees, ...) to describe the encodings we will use for the sets we will encounter. This approach avoids the burden of dealing with technical encodings into finite words over a finite alphabet (Turing machines) or natural numbers (Gödel's recursive functions) for instance; especially since the encodings we will use will always be very simple.

Remark 2.4.2. Observe that even if ≤ is a partial-ordering on X, ≤ might not be antisymmetric on X, because • is not injective. More precisely, • is an embedding from ( X, ≤) to (X, ≤), but not an isomorphism. The reason why we do not require • to be injective might become clearer later.

Given a QO (X, ≤) and an encoding of X, it is natural to ask that ≤ is decidable for this encoding. However, we will not require equality to be. This leads to the somewhat strange behavior that given two encodings x, ŷ ∈ X, we cannot tell whether they represent the same element ( x = ŷ ) or only equivalent ones ( x ≡ ŷ ). In particular, an encoding of X that makes the quasi-ordering ≤ decidable is also an encoding of X/ ≡ that makes the partial-ordering ≤ over X/ ≡ decidable. More generally, if (X, ≤ X ) and (Y, ≤ Y ) are two QOs such that there exists a surjective embedding f of X into Y , any encoding of X that makes ≤ X decidable is also a valid encoding of Y that makes ≤ Y decidable: the semantic function for Y is obtained by composing the semantic function for X with f .

Part I

The Ideal Approach to Computing with Closed Sets Joint work with J.Goubault-Larrecq, P. Karandikar, N. Narayan Kumar and Ph. Schnoebelen

The general idea behind many generic algorithms from WSTS theory is a fix-point computation of an infinite closed subset, e.g. the set of coverable configurations. Classically, these algorithms are described in terms of upward-closed sets, that are representable by a finite basis (WQO5). More recently, many results suggested that it was more beneficial to work with downward-closed sets: the coverability set of a WSTS is downward-closed, and it is a central object in the theory [START_REF] Habermehl | The downward-closure of Petri net languages[END_REF][START_REF] Hofman | Coverability trees for Petri nets with unordered data[END_REF]; and it has been shown that computing with downward-closed sets provides better running-time in practice, notably using acceleration techniques [START_REF] Karp | Parallel program schemata[END_REF][START_REF] Parosh | On-the-fly analysis of systems with unbounded, lossy fifo channels[END_REF][START_REF] Abdulla | Using forward reachability analysis for verification of timed Petri nets[END_REF][START_REF] Abdulla | Using forward reachability analysis for verification of lossy channel systems[END_REF][START_REF] Finkel | Forward analysis for WSTS, part II: Complete WSTS[END_REF][START_REF] Valk | The residue of vector sets with applications to decidability problems in Petri nets[END_REF][START_REF] Finkel | A well-structured framework for analysing Petri net extensions[END_REF][START_REF] Zufferey | Ideal abstractions for well-structured transition systems[END_REF].

The issue is that downward-closed sets do not enjoy the same property as upwardclosed sets of having a finite basis: for instance in N 2 ordered with the product ordering n, m

≤ × n ′ , m ′ def ⇔ n ≤ n ′ ∧ m ≤ m ′ , the subset [0, 3]
× N is downwardclosed, but cannot be described as the downward-closure of some finite subset. In the particular case of N k , it has first been observed in [START_REF] Karp | Parallel program schemata[END_REF] that downward-closed sets could be represented as the downward-closure of some finite subset of (N ∪ {ω}) k . Later in [START_REF] Abdulla | Using forward reachability analysis for verification of lossy channel systems[END_REF], a similar property has been observed for the set of finite sequences over a finite alphabet, ordered with the embedding relation: downward-closed sets can be represented using simple regular expressions. These two positive examples lead to a general solution: the notion of Adequate Domain of Limits (see [START_REF] Geeraerts | Expand, enlarge and check: New algorithms for the coverability problem of WSTS[END_REF]). An adequate domain of limits essentially is a generalization of the two cases above: it is a set of limit elements missing from X to be able to express every downward-closed sets. Assuming the existence of such an adequate domain of limits, generic algorithms computing with downward-closed sets can be designed.

Ideals, a frequently rediscovered concept. Although it has long been known that downward-closed sets of a WQO can be decomposed as finite union of ideals (Theorem 2.3.1), the notion of ideals has only been brought to the domain of Verification quite recently, in [START_REF] Finkel | Forward analysis for WSTS, part I: Completions[END_REF]. In this article, it is proven that the set of ideals is an adequate domain of limits, and the smallest one, that is any adequate domain of limits embeds the set of ideals. Moreover, the extra elements introduced to handle downward-closed sets of N k and A * are exactly the ideals of these WQOs. This is not the first time the notion of ideals is rediscovered: in [START_REF] Diestel | Relating subsets of a poset, and a partition theorem for wqos[END_REF], one can find a proof that downward-closed sets are union of ideals which uses a completely different terminology.

Since their appearance in the domain of verification, ideals have several times proved themselves to be the right notion. Their structure carries more information than filters, which can be useful to analyze the complexity of algorithms relying on the well-foundedness of Down(X) [START_REF] Lazić | The ideal view on Rackoff's coverability technique[END_REF][START_REF] Lazić | The complexity of coverability in ν-Petri nets[END_REF]. Some important results with difficult and adhoc proofs have successfully been rethought in terms of ideals [START_REF] Leroux | Demystifying reachability in vector addition systems[END_REF][START_REF] Lazić | The ideal view on Rackoff's coverability technique[END_REF], which leaves more options for generalizations. Besides, since ideals are intuitively limit elements of X, the structure of Idl (X) is often close to that of X, this is essential in Section 9.4 for instance. This also offers the possibility to define the completion of a WSTS [START_REF] Blondin | Handling infinitely branching WSTS[END_REF], whose states are ideals of the original states. Ideals were also applied to separability of languages [START_REF] Goubault-Larrecq | Deciding piecewise testable separability for regular tree languages[END_REF][START_REF] Zetzsche | PTL-separability and closures for wqos on words[END_REF].

Contributions

In WSTS theory, the notion of effective WQO has almost as many definitions as occurrences. At the very least, elements of an effective WQO can be computationally represented and compared (i.e. ≤ is decidable for the chosen representation of elements of X). However, no unified framework has been defined: authors usually simply gather every assumptions they need for the design of their particular algorithm, and later proceed to show that these assumptions are trivially satisfied in their application. Our purpose here is to free people from this burden: we define a notion of effective WQO that should contain most of the ones present in the literature, and prove that a large class of WQOs, notably including most of the natural WQOs encountered in computer science, is effective. Our definition entails the computability of several operations on WQOs and their closed subsets which should be enough for the design of most of the algorithms that use WQOs.

More precisely, our definition assumes that we can represent elements of X, but also ideals of X, and that we can compare them. From there, we can represent upwardclosed and downward-closed sets decomposing them in union of filters/ideals. We further assume the computability of all set-theoretic operations: union, intersection and complement.

As stated before, our motivation comes from verification, but the results are applicable anywhere.

Related Work

This approach has been developed in [START_REF] Finkel | Forward analysis for WSTS, part I: Completions[END_REF], and our work is strongly inspired by it. On the one hand, our work is less general: we deal with WQOs and constructions preserving those, while they work with the more general notion of Noetherian spaces, which is preserved under constructions that do not preserve WQOs. On the other hand, we believe our presentation is more suited for computer scientists: it deals more specifically with WQOs, hence requires less knowledge of advanced notions from topology, which also allows us to describe more precisely how to compute set-theoretic operations, and their complexity. That is, we hope our presentation is closer to an actual implementation, and provide relevant insight to this end.

At the end of some sections, we provide references for earlier related results. When no such references are given, it means that our results are novel, as far as we know.

Chapter 3

Ideally Effective Well Quasi-Orders

As mentioned in the previous chapter, our goal is to represent and compute with closed subsets of WQOs. In this chapter, we introduce ideally effective WQOs. The idea is that our definition should meet every ad-hoc assumptions one needs when describing generic algorithms for the class of WSTS for instance. More precisely, we want to be able to compare closed-subset, test membership of an element in a closed subset, and compute unions, intersections and complements of closed subsets.

Formal Definition

The first step to talk about the computability of some operations over some QO is to fix the representation (see Section 2.4). Here, we are interested in operations over three QOs: (X, ≤), (Up(X), ⊆) and (Down(X), ⊆). Usually, upward-closed sets are simply represented through their finite basis, and recently, ideals have proved themselves to be the right notion to represent downward-closed sets. We formalize this idea.

Assume we are given a representation for X. Then, since all filters are principal, the same representation can be used for Fil (X), i.e. ↑ x and x share the same encodings. Now we have seen that upward-closed sets can be decomposed as finite unions of filters, hence we will represent upward-closed sets as collections of filters, e.g. lists (or arrays, or trees, ...) of encodings of elements of X.

Observe that whenever ≤ is decidable on X, we can also decide inclusion for filters:

↑ x ⊆ ↑ y ⇐⇒ x ≥ y
And since filters are irreducible, inclusion of upward-closed sets reduces to a quadratic number of inclusion tests on filters:

i ↑ x i ⊆ j ↑ y j ⇐⇒ i j ↑ x i ⊆ ↑ y j
Therefore, from an encoding of X, we can represent in a generic way Fil (X) and Up(X). Moreover, the decidability of ≤ entails the decidability of inclusion on both those sets. Now for downward-closed sets, we wish to do the same: downward-closed sets can be decomposed as finite unions of ideals (Theorem 2.3.1). Unfortunately, there is no generic way to represent ideals from the elements of X. We will therefore need to assume an encoding of ideals. This is formalized in the following definition.

Definition 3.1.1 (Ideally Effective WQOs). A WQO (X, ≤) further equipped with representations for X and Idl (X) is ideally effective if all the requirements below are satisfied:

The quasi-ordering is decidable.

(OD)

Ideal inclusion is decidable.

(ID)

and the following functions are computable:

Principal ideals: X → Idl (X) x → ↓ x (PI) Complementing filters: X → Down(X) x → X ↑ x (CF) Complementing Ideals: Idl (X) → Up(X) I → X I (CI) Intersecting Filters: X × X → Up(X) (x, y) → ↑ x ∩ ↑ y (IF) Intersecting Ideals: Idl (X) × Idl (X) → Down(X) (I, J) → I ∩ J (II)
An ideally effective WQO (X, ≤) is moreover said to be polynomial-time if there exist polynomial-time procedures for all the operations listed above.

Some immediate remarks are in order:

• The encodings of Fil (X), Up(X) and Down(X) are the ones obtained generically from encodings of X and Idl (X), as described before the definition

• This formal definition indeed captures what we wanted, all the simple set-theoretic operations on Up(X) and Down(X) that are not explicitly listed follow trivially from the one listed:

-The counter-part to requirement (PI) for upward-closed set is trivial since filters share a common representation with the elements of X.

-Membership of an element x ∈ X in closed subsets reduces to membership in filters and ideals, which itself can be tested by first computing ↑ x or ↓ x and using inclusion.

-Union of closed subsets is trivial with our encoding of Up(X) and Down(X).

-Intersections and complements of closed subsets reduce to intersections and complements of filters and ideals.

• Note that if ≤ is not antisymmetric, filters of X may have several representations, since ↑ x = ↑ y if x ≡ y. In other words, the semantic function for filters might not be injective, even when the semantic function for X is.

Similarly, the encoding of a closed subset is not unique. For instance if U = i F i is an upward-closed set, encoded as a union of filters, then U can also be encoded by ( i F i ) ∪ F for any filter F which is a strict subset of one of the F i .

However, in the case of closed subset, we can define (almost) canonical representations that are computable from any other representation. Formally, we say that a decomposition i∈I F i of an upward-closed set U is canonical if for any i, j ∈ I, i = j implies F i ⊆ F j . Testing whether a given representation is canonical is decidable since we can decide inclusion of filters, and if F i ⊆ F j for some i, j ∈ I, then F i can be dropped from the decomposition of U and we obtain a "simpler" encoding of U . By iterating, we eventually compute a canonical representation of U .

It is not difficult to show that there is exactly one canonical decomposition of U as a union of filters. However, this does not mean that we have found a canonical encoding of U since there might be several encodings for this same decomposition: for instance if encoding unions as list, the order is irrelevant and every permutation of the list gives another encoding of the same decomposition. Moreover, we have seen above that filters may have several encodings, leading to even more possible encodings of the canonical decomposition of U .

The situation is exactly the same for ideals: there exist a unique canonical decomposition of any downward-closed set D, that is we can write D as a finite union of pairwise incomparable (for inclusion) ideals. However, there might be several encodings of this canonical decomposition.

• The asymmetry in the definition between upward-closed and downward-closed sets is not surprising expected since WQOs are well-founded but the reverse orderings need not be.

Alternative Representations of Closed Subsets As noted before, assuming solely that elements of a WQO (X, ≤) can be represented and the decidability of ≤, we can already represent and compare upward-closed sets, using their finite basis. It is then always possible to represent downward-closed sets by their complement. We call it the excluded minor representation: a downward-closed set D is represented by the minimal set of elements it does not contain. This may seem simpler than extra assumptions on the representability of ideals, but this representation has some drawbacks. First it breaks the symmetry between upward-closed and downward-closed sets. Moreover, union of downward-closed subsets then corresponds to intersection of upward-closed sets, which may be costly, while we would like union to be the most basic operation on closed subsets. Besides we can show it might not be decidable to distinguish ideals among downward-closed sets with this representation. Sometimes, ideals carry valuable information that may not be directly read on their complement [START_REF] Lazić | The ideal view on Rackoff's coverability technique[END_REF][START_REF] Lazić | The complexity of coverability in ν-Petri nets[END_REF].

Another issue is the size of the representations of closed subsets. For instance in Section 6.1, we prove that set-theoretic operations require exponential-time to be computed, by showing that the output of those operations might be exponential. This comes from our representation as union of filters/ideals that can become quite large. Many practical tools suffer from this explosion of the size of the representation of closed subsets, solutions to this problem are investigated in [START_REF] Delzanno | Symbolic representation of upward-closed sets[END_REF].

Basic Ideally Effective WQOs

We quickly show that the simplest WQOs are ideally effective. They will be used later as building blocks for more complex WQOs.

Finite Quasi-Orderings

The simplest WQOs one can think of probably are finite alphabets. They consist of a finite set A ordered with equality. Most of the time it is used as a starting point to build more complex WQOs, as in the case of finite sequences with the Higman ordering (Section 6.1), extensively studied in language theory. It is also used in verification to order states of well-structured transition systems.

The ideals of (A, =) are all principal: indeed since ideals are finite in this case, they have maximal elements, and by directedness the maximal element is unique (= is antisymmetric). More generally, one can show that the ideals of a finite WQO (X, ≤) are all principal, which is no surprise: if X is finite then (X, ≥) is a WQO as well, of which the filters are the ideals of (X, ≤), hence all principal. Moreover, ideal inclusion in this case is the same as the ordering: ↓ x ⊆ ↓ y ⇐⇒ x ≤ y.

This suggests using the same representations for ideals as for elements, and elements of (A, =) can for instance be represented using natural numbers up to |A| -1. Similarly, for any finite X, we can represent its element using numbers up to |X| -1. We claim that for these representations, (A, =), and more generally any finite WQO (X, ≤), are ideally effective.

(OD) In the case of (A, =), deciding equality is trivial. In the general case, ≤ is a finite predicate, hence computable.

(ID) As argued before, inclusion on ideals is the same as the ordering on the elements.

(PI) With our representations, x → ↓ x simply is the identity function.

In the case of a finite alphabet, filters are ideals and vice versa: ↑ a = ↓ a = {a} for any a ∈ A. Therefore, the following equations suffice to conclude:

∁{a} = A {a}, {a} ∩ {b} = ∅ when a = b, {a} ∩ {a} = {a}
In the case of a finite WQO, the four operations can be performed by brute force enumeration. For instance, to compute ↓ x∩↓ y it suffices to test whether z ≤ x∧z ≤ y for every z ∈ X.

Natural Numbers

The linear order (N, ≤) is among the most frequently occurring WQOs in computer science. Observe that since ≤ is linear, any downward-closed set is actually an ideal, except the empty set ∅. There are two kinds of downward-closed sets in N: those that are bounded, i.e. of the form ↓ n, and the whole set N itself. The first kind constitutes all the principal ideals. The second kind is often denoted ↓ ω, for instance in [START_REF] Karp | Parallel program schemata[END_REF].

This suggests to represent ideals of N as natural numbers plus a special symbol ω. Using this representation (and the obvious one for N), (N, ≤) is ideally effective.

The natural ordering on N is of course decidable, and ideal inclusion can be decided as follows: principal ideals are compared as the elements, and ↓ ω is greater than all the others. Hence, ideals of (N, ≤) are linearly ordered (and observe that filters are as well), which makes intersections trivial: it consists of the maximum for filters and of the minimum for ideals. Finally, complements are computed as follows:

∁ ↑(n + 1) = ↓ n ∁ ↓ n = ↑(n + 1) ∁ ↑ 0 = ∅ ∁ ↓ ω = ∅

Ordinals

The prior analysis can be extended to an important class of linear WQOs: ordinals.

For the rest of this section, we assume basic knowledge of ordinals. Given an ordinal α, we write α for the set of ordinals {β | β ≤ α}, in accordance with the classical set-theoretic construction of ordinals. Let (X, ≤) = (α, ≤). Once again, X being linearly ordered, its ideals are its downward-closed sets (except ∅). Therefore, there are three types of ideals:

1. I = X, 2. I has a maximal element β ∈ X, in which case I = ↓ β, 3. Or I has a supremum β ∈ X I, in which case I = ↓ < β = β.
Note that in the second case, I = ↓ β = ↓ < (β + 1) = β + 1. Thus every ideal of (X, ≤) is a β for some β ∈ α + 1 0, and ideal inclusion coincides with the natural ordering on α + 1.

Now, assuming that we can represent elements of X in a way that makes ≤ decidable, (X, ≤) is ideally effective. Indeed, a representation for α and a decision procedure for ≤ are easily extended to (α + 1, ≤) (the smallest ordinal which is not recursive is a limit ordinal). Therefore, ideal inclusion is decidable for X. Intersections are computable as the maximum for filters, minimum for ideals. Finally, complements are computed as follows:

∁ ↑ β = β ∁β = ↑ β for β ∈ α ∁ ↑ 0 = ∅ ∁α = ∅
Note that this representation of ideals in the case α = ω is not the same as the representation for (N, ≤) given before: in one case we use ↓ < n for principal ideals while in the other we use ↓ n. Remark 3.2.1. The computability conditions that the ordinal α must satisfy is voluntarily vague. Notation systems for high ordinals can be complicated, and it does not fit our purpose to give a technical and lengthy analysis of this case. We will mostly use the fact that ω 2 is ideally effective in Chapter 8, for which a canonical notation system is well-known and understood: the Cantor Normal Form with base ω.

Ideally Effective Constructions

One strength of the notion of WQO is that it is preserved under many constructions: Cartesian product (Dickson's Lemma, cf. Section 5.3), finite sequences (Higman's Lemma, cf. Section 6.1), finite trees (Kruskal's Theorem), finite sets (cf. Section 7.3), etc. Many of the WQOs encountered in practice (in verification, graph theory, semantics, logic, . . . ) are actually built by incremental application of such constructions, starting from simple WQOs (essentially the ones seen in the previous section). Therefore, proving that these constructions not only preserve the property of being WQO, but also ideal effectiveness is a powerful way to prove that most of the WQOs used in practice are ideally effective. To this end, we introduce the following notions. Definition 3.3.1. A presentation of an ideally effective WQO (X, ≤), is a list of:

encodings for X and Idl (X), algorithms for the seven computable functions required by Definition 3.1.1, the ideal decomposition X = i<n I i of X as a downward-closed set, (XI) as well as its filter decomposition

X = i<n ′ F i . (XF)
A presentation is said to be polynomial-time (resp. exponential-time) if all seven algorithms listed above are polynomial-time computable (resp. exponential-time computable).

Obviously, a WQO is ideally effective if and only if it has a presentation as defined in Definition 3.3.1, and it is a polynomial-time ideally effective WQO if and only if it has a polynomial-time presentation.

The notion of presentations as actual objects is needed because they are the actual inputs of our WQO constructions. This explains why we added (XI) and (XF) in the requirements. For a given (X, ≤), the ideal and filter decompositions of X always exist and requiring them in Definition 3.1.1 would make no sense (constants are always computable). However, these decompositions are needed by algorithms who work uniformly on WQOs given via their presentations, notably to complement the empty upward-or downward-closed subset.

Let us informally call order-theoretic construction (construction for short) any operation C that produces a quasi-ordering C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] from given quasiorderings (X 1 , ≤ 1 ), . . . , (X n , ≤ n ). In subsequent sections, C will be instantiated with very well-known constructions, such as Cartesian product with component-wise ordering, finite sequences with Higman's ordering, finite sets with the Hoare quasiordering, and so on. In practice, we will always have n = 1 or 2. We also say that an order-theoretic construction preserves WQO if C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] is a WQO whenever (X 1 , ≤ 1 ), . . . , (X n , ≤ n ) are. The constructions we just mentioned are wellknown to be WQO-preserving. We extend this concept to ideally effective WQOs: Definition 3.3.2. An order-theoretic WQO-preserving construction C is said to be ideally effective if, for every ideally effective WQOs (X 1 , ≤ 1 ), . . . , (X n , ≤ n ),

• C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] is ideally effective. • A presentation of C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] is computable from presentations of the ideally effective WQOs (X i , ≤ i ) (i = 1, . . . , n). Construction C is moreover said to be polynomial-time if a polynomial-time presenta- tion of C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] is computable from polynomial-time presentations of the ideally effective WQOs (X i , ≤ i ) (i = 1, . . . , n).
Note that a construction C being polynomial-time says nothing about the complexity of producing the polynomial-time presentation of C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] from polynomial-time presentations of the (X i , ≤ i ).

In the following chapters, we prove many of the common WQO-preserving constructions to be ideally effective. This proves that most of the WQOs we use in practice are ideally effective. But it also proves that procedures to compute set-theoretic operations in these WQOs can themselves be automatically computed. Furthermore, for constructions that are not polynomial, we provide exponential lower bounds.

Chapter 4

Generic Constructions on WQOs

Before we proceed to show that natural order-constructions are ideally effective (in the sense of Definition 3.3.2), we study three more abstract transformations that will be useful in several subsequent chapters: in the first section we identify conditions for the extension of an ideally effective WQO to be ideally effective as well, we then study the particular case of a quotient under an equivalence relation. Finally, we identify conditions for the subset of an ideally effective WQO to be ideally effective as well.

Extension of a WQO

Let (X, ≤) be a WQO and let ≤ ′ be an extension of ≤, as defined in Section 2.2. Then (X, ≤ ′ ) is also a WQO: an increasing pair for ≤ is in particular an increasing pair for ≤ ′ . In this section, we investigate the ideals of (X, ≤ ′ ) and present sufficient conditions for (X, ≤ ′ ) to be ideally effective, assuming (X, ≤) is.

Note that D ∈ Down(X, ≤) might not be downward-closed for ≤ ′ . However, directedness is preserved. In the other direction, Down(X, ≤ ′ ) ⊆ Down(X, ≤), but a directed set for ≤ ′ might not be directed for ≤. This observation leads to the following proposition: Proposition 4.1.1. Given a WQO (X, ≤) and an extension ≤ ′ of ≤, the ideals of (X, ≤ ′ ) are exactly the downward closures under ≤ ′ of the ideals of (X, ≤). That is,

Idl (X, ≤ ′ ) = {↓ ≤ ′ I | I ∈ Idl (X, ≤)} .
Proof. (⊇): Let I be an ideal under ≤. Even though I may not be downward-closed in (X, ≤ ′ ), it is still directed. From there, it is easy to establish that ↓ ≤ ′ I is directed as well, non empty, and obviously downward-closed for ≤ ′ . Thus it is an ideal of (X, ≤ ′ ).

(⊆): Let J be an ideal of (X, ≤ ′ ). Although J may not be directed in (X, ≤), it is still downward-closed under ≤, hence it can be decomposed as a finite union of ideals of (X, ≤):

J = I 1 ∪ • • • ∪ I n . Then J = ↓ ≤ ′ J = ↓ ≤ ′ I 1 ∪ • • • ∪ ↓ ≤ ′ I n . Now by irreducibility of ideals, we have J = ↓ ≤ ′ I i for some i ∈ [n].
Assuming we have a representation for X and Idl (X, ≤), the proposition above suggests to represent ideals of (X, ≤ ′ ) using the same representation as for ideals of (X, ≤), but changing the semantic function: an encoding of I ∈ Idl (X, ≤) can also represent the ideal ↓ ≤ ′ I ∈ Idl (X, ≤ ′ ). The proposition ensures we can encode every ideals of Idl (X, ≤ ′ ) this way. Note that there might be several ideals I of (X, ≤) representing the same ideal ↓ ≤ ′ I of (X, ≤ ′ ): the representation of an ideal may not be unique.

Of course, given two ideals I, J ∈ Idl (X, ≤),

I ⊆ J ⇒ ↓ ≤ ′ I ⊆ ↓ ≤ ′ J.
Unfortunately, the converse is not true. Actually, we can show that with the chosen representation of ideals of (X, ≤ ′ ), ideal effectiveness of (X, ≤) does not imply ideal effectiveness of (X, ≤ ′ ): already ideal inclusion can become undecidable. This is proved in Section 8.2. Lexicographic product will provide a more natural example of extension that fails to be ideally effective (see Section 5.4).

Therefore, to obtain effectiveness results on (X, ≤ ′ ) we need to make some computability assumptions on ≤ ′ . Theorem 4.1.2. Let (X, ≤) be an ideally effective WQO and ≤ ′ an extension of ≤. Then, (X, ≤ ′ ) is ideally effective for the aforementioned encodings of X and Idl (X, ≤ ′ ), whenever the following functions are computable:

Cl I : Idl (X, ≤) → Down(X, ≤) I → ↓ ≤ ′ I Cl F : (X, ≤) → Up(X, ≤) x → ↑ ≤ ′ x
Moreover, under these assumptions, a presentation of (X, ≤ ′ ) can be computed from a presentation of (X, ≤) and algorithms realizing Cl I and Cl F . Furthermore, given polynomial-time algorithms for Cl I and Cl F , and if the presentation of (X, ≤) is polynomial-time, then the compute presentation of (X, ≤ ′ ) is polynomial-time.

Note that if I ∈ Idl (X, ≤), then ↓ ≤ ′ I is also downward-closed for ≤ and thus can be represented as a downward-closed set of (X, ≤). It is precisely this representation that the function Cl I outputs. Same goes for Cl F : ↑ ≤ ′ x ∈ Up(X, ≤). Observe that to obtain a more symmetrical situation, we could have defined Cl F on filters of (X, ≤) by: Cl F (F ) = ↑ ≤ ′ F . But since filters are principal, F = ↑ x for some x ∈ X, and the expression ↑ ≤ ′ (↑ x) is more simply written as ↑ ≤ ′ x.

Note that using functions Cl I and Cl F , it is possible to compute the downward and upward closure under ≤ ′ of arbitrary downward-and upward-closed sets for ≤ using the canonical decompositions:

↓ ≤ ′ (I 1 ∪ • • • ∪ I n ) = (↓ ≤ ′ I 1 ) ∪ • • • ∪ (↓ ≤ ′ I n ) and ↑ ≤ ′ (↑ x 1 ∪ • • • ∪ ↑ x n ) = ↑ ≤ ′ x ∪ • • • ∪ ↑ ≤ ′ x n .
Proof. We proceed to show that (X, ≤ ′ ) is ideally effective.

(OD): One can tests x ≤ ′ y, since this is equivalent to y ∈ Cl F (x). Alternatively,

x ≤ ′ y can also be tested using the function Cl I instead of Cl F : x ≤ ′ y ⇐⇒ x ∈ Cl I (↓ ≤ y).

(ID): Ideal inclusion can be decided using Cl I and the inclusion test for downwardclosed sets of (X, ≤):

↓ ≤ ′ I 1 ⊆ ↓ ≤ ′ I 2 ⇔ I 1 ⊆ Cl I I 2 .
(PI): The principal ideal

↓ ≤ ′ x of (X, ≤ ′ ) is represented by ↓ ≤ x, since ↓ ≤ ′ (↓ ≤ x) = ↓ ≤ ′ x.
(CF): For x ∈ X, the filter complement X ↑ ≤ ′ x is X Cl F (x) which can be computed, using (CF) and (II) for (X, ≤), as a downward-closed set in (X, ≤). This is represented by an ideal decomposition D = i<n I i which is canonical in (X, ≤) but not necessarily in (X, ≤ ′ ) since one may have ↓ ≤ ′ I i ⊆ ↓ ≤ ′ I j for i = j. However, extracting the canonical ideal decomposition wrt. ≤ ′ can be done using (ID) for (X, ≤ ′ ).

(II): Intersection of ideals is computed with

↓ ≤ ′ I 1 ∩ ↓ ≤ ′ I 2 = Cl I (I 1 ) ∩ Cl I (I 2 ).
Here again, this result in an ideal decomposition that is canonical for ≤ but not for ≤ ′ until we process it as done for (CF).

(CI), (IF) : dual operations are obtained similarly.

With algorithms for the closure functions Cl I and Cl F , the presentation above is computable from a presentation of (X, ≤). Moreover, this presentation is obviously polynomial-time when algorithms for Cl I and Cl F and the presentation of (X, ≤) are polynomial-time. Regarding (XF) and (XI), we note that filter and ideal decompositions of X for ≤ are also valid decompositions for ≤ ′ . However, these decompositions might not be canonical for ≤ ′ even if they are for ≤, in which case the canonical decompositions can be obtained using (OD) and (ID), as usual.

Observe that in the presentation of (X, ≤ ′ ) described in the proof above, we often have to compose functions Cl I and Cl F with operations in (X, ≤). When everything is polynomial-time, the composition remains polynomial-time. However, when both operations in (X, ≤) and functions Cl I and Cl F are exponential, it might lead to doubly exponential procedures. The following Lemma gives sufficient conditions for (X, ≤ ′ ) to be an exponential-time ideally effective WQO. It will be used several times in subsequent sections.

Lemma 4.1.3. Let (X, ≤) be an ideally effective WQO and ≤ ′ an extension of ≤. We denote by Cl I and Cl F the functions from Theorem 4.1.2. Assume the following conditions:

1. The WQO (X, ≤) is an exponential-time ideally effective WQO, 2. Function Cl I and Cl F can be computed in exponential-time, 3. For every x ∈ X, every filter from the decomposition of Cl F (x) is of polynomial size in |x|.

Then, (X, ≤ ′ ) is an exponential-time ideally effective WQO.

The notion of size we use comes from the encoding: the size of an object is the size of its representation (formally the lemma should be stated with encodings and semantic functions ...).

Proof. We simply show that the presentation of (X, ≤ ′ ) described in the proof of Theorem 4.1.2 is exponential-time (instead of the a priori doubly-exponential upper bound).

We only present the proof for (IF), the idea being the same for the six other procedures.

Given u, v ∈ X, we have:

↑ ≤ ′ u ∩ ↑ ≤ ′ v = Cl F (u) ∩ Cl F (v) = (↑ u 1 ∪ • • • ∪ ↑ u n ) ∩ (↑ v 1 ∪ • • • ∪ ↑ v m ) = 1≤i≤n 1≤j≤m ↑ u i ∩ ↑ v j where (↑ u 1 ∪ • • • ∪ ↑ u n ) is the filter decomposition in (X, ≤) of Cl F (u) (

Quotienting under a Compatible Equivalence

We now apply the results of Section 4.1 to the most commonly encountered case of extensions: quotient under an equivalence relation. Given (X, ≤) a WQO and E an equivalence relation on

X such that ≤ • E = E • ≤, define ≤ E = ≤ • E = E • ≤.
≤ E •≤ E = (≤•E)•(≤•E) = ≤• (E •≤)• E = ≤• (≤• E) • E = ≤• E = ≤ E
Observe that ≤ E is an extension of ≤, and thus results on quotients can be seen as an application of Section 4.1. However, since quotients are of such importance in computer science (and used more often than mere extensions), we reformulate Theorem 4.1.2 in this specific context: functions Cl I and Cl F take an interesting form. As in the case of extensions, elements and ideals of (X, ≤ E ) will be represented using the data structures coming from a presentation of (X, ≤). Theorem 4.2.1. Let (X, ≤) be an ideally effective WQO and E be an equivalence relation on X compatible with ≤. Then, (X, ≤ E ) is ideally effective for the aforementioned data structures of X and Idl (X, ≤ E ), whenever the following functions are computable:

Cl I : Idl (X, ≤) → Down(X, ≤) I → I Cl F : (X, ≤) → Up(X, ≤) x → ↑ x
where, given S ⊆ X, S denotes the closure under E of S, i.e., S def = {y | ∃x ∈ S : x E y}. In particular, x simply is the equivalence class of x.

Moreover, under these assumptions, we can compute a presentation of (X, ≤ E ) from a presentation of (X, ≤).

Proof. In the light of Theorem 4.1.2, it suffices to show ↓ ≤ E F = F and ↓ ≤ E I = I for any filter F and any ideal I of (X, ≤). The first equality follows from ≤ E = ≤ • E while the second comes from ≤ E = E • ≤. This is why we introduced the compatibility condition

≤ • E = E • ≤.
In particular, we see that the ideals of (X, ≤ E ) are exactly the closures under E of the ideals of (X, ≤). That is, Idl (X, ≤ E ) = I : I ∈ Idl (X, ≤) .

Induced WQOs

Let (X, ≤) be a WQO. A subset Y of X (not necessarily finite) induces a quasiordering (Y, ≤ ∩ Y × Y ) which is also WQO. In this section, we investigate the ideal effectiveness of this WQO.

Any subset S ⊆ X induces a subset Y ∩ S in Y . Obviously, if S is upward-closed (or downward-closed) in X, then it induces an upward-closed (resp. downward-closed) subset in Y . However an ideal I or a filter F in X does not always induce an ideal or a filter in Y . In the other direction though, if J ∈ Idl (Y ), the downward closure ↓ X J is an ideal of X. Therefore, to describe the ideals of Y , we need to identify those ideals of X that are of the form ↓ X J for some ideal J of Y . This is captured by the following notion: Definition 4.3.1. Given a WQO (X, ≤) and a subset Y of X, we say that an ideal

I ∈ Idl (X) is in the adherence of Y if I = ↓ X (I ∩ Y ).
In particular this implies that I ⊆ ↓ X Y (we say that I is "below Y ") and I ∩Y = ∅ (we say that I is "crossing Y "). The converse implication does not hold, as witnessed by X = N, Y = [1, 3] ∪ [START_REF] Finkel | Well-structured transition systems everywhere![END_REF][START_REF] Schmitz | Algorithmic aspects of WQO theory[END_REF] and I = ↓ 4.

We now show that the ideals of Y are exactly the subsets induced by ideals of X that are in the adherence of Y . Theorem 4.3.2. Let (X, ≤) be a WQO and Y be a subset of X. A subset J of Y is an ideal of Y if and only if J = I ∩ Y for some I ∈ Idl (X) in the adherence of Y . In this case, I = ↓ X J, and is thus uniquely determined from J.

Proof. (⇒) : If J ∈ Idl (Y ) then I def = ↓ X J is directed hence is an ideal of X. Clearly, J = I ∩ Y , so I is in the adherence of Y . (⇐): If I ∈ Idl (X) is in the adherence of Y then J def = I ∩ Y is non-empty (since I is
crossing Y ) and it is directed since for any x, y ∈ J there is z ∈ I above x and y, and z ≤ z ′ for some z ′ ∈ J since I is below Y .

Uniqueness is clear since the compatibility assumption "I = ↓ X (I ∩ Y )" completely determines I from the ideal J = I ∩ Y it induces.

An alternative definition of adherence often found in the literature (e.g. in [START_REF] Leroux | Demystifying reachability in vector addition systems[END_REF][START_REF] Goubault-Larrecq | Deciding piecewise testable separability for regular tree languages[END_REF]) is the following one: an ideal I ∈ Idl (X) is in the adherence of Y if and only if there exists a directed subset ∆ ⊆ Y such that I = ↓ X ∆. The two definitions are equivalent [START_REF] Goubault-Larrecq | Deciding piecewise testable separability for regular tree languages[END_REF]Lemma 14], so that, notably, Theorem 4.3.2 extends Lemma 4.6 from [START_REF] Leroux | Demystifying reachability in vector addition systems[END_REF].

that the two notions of adherence coincide. (⇒) : Assume I = ↓ X (I ∩ Y ). We show that ∆ = I ∩ Y is directed: let x, y ∈ ∆ ⊆ I, since I is directed, there exists z ∈ I such that z ≥ x, y. But since I = ↓ X ∆, there exists z ′ ∈ ∆ such that z ′ ≥ z ≥ x, y, which proves that ∆ is directed. (⇐): Assume that there exists a directed subset ∆ ⊆ Y such that

I = ↓ X ∆. Then ↓ X (I ∩ Y ) = ↓ X (↓ X ∆ ∩ Y ) = ↓ X (∆ ∩ Y ) = ↓ X ∆ = I.
Similarly, we can define a notion of adherence for filters. However, in this case, the condition F = ↑ X (F ∩ Y ) for some filter F = ↑ x is actually equivalent to x ∈ Y (actually to x ′ ∈ Y for some x ′ ≡ X x when ≤ is not antisymmetric). In other words, filters in the adherence of Y are exactly filters of the form ↑ y for some y ∈ Y . This is no surprise: (Y, ≤) is a WQO and therefore, its filters are principal.

Assuming that (X, ≤) is an ideally effective WQO, and given Y ⊆ X, we can simply represent elements of Y by restricting the data structure for X to Y . This requires that Y is a recursive set. Alternatively, Theorem 4.3.2 suggests that we represent ideals of Y as ideals of X that are in the adherence of Y . This requires that we can decide membership in the adherence of Y . As in the case of extensions, the ideal effectiveness of (Y, ≤) does not always follow from the ideal effectiveness of (X, ≤) (see Section 8.4). We therefore have to introduce extra assumptions.

Theorem 4.3.3. Let (X, ≤) be a WQO and Y ⊆ X. Then (Y, ≤) is ideally effective (for the aforementioned representations) provided:

• membership in Y is decidable over (the representation for) X,

• the following functions are computable:

S I : Idl (X, ≤) → Down(X, ≤) I → ↓ X (I ∩ Y ) S F : Fil (X, ≤) → Up(X, ≤) F → ↑ X (F ∩ Y )
Moreover, in this case, a presentation of (Y, ≤) can be computed from a presentation of (X, ≤). Furthermore, if functions S I and S F are computable in polynomial-time, and (X, ≤) is a polynomial-time ideally effective WQO, then so is (Y, ≤).

The rest of this subsection is dedicated to the proof of this theorem. First, let us mention that our first assumption implies that we have a data structure for elements of Y and that thanks to function S I , we can decide whether an ideal I of X is in the adherence of Y : it suffices to check that S I (I) = I.

Let us prove that (Y, ≤) is ideally effective.

(OD): since ≤ is decidable on X, its restriction to Y is still decidable.

(ID): Given two ideals I 1 , I 2 that are in the adherence of Y ,

I 1 ∩ Y ⊆ I 2 ∩ Y ⇐⇒ I 1 ⊆ I 2 .
The left-to-right implication uses that I i = ↓ X (I i ∩ Y ). Therefore, inclusion for ideals of Y can be implemented by relying on (ID) for X.

(PI): if y ∈ Y , then ↓ X y is adherent to Y and ↓ X y ∩ Y = ↓ Y y.
For the four remaining operations, we need to be able to compute a representation of D ∩ Y and U ∩ Y for D ∈ Down(X) and U ∈ Up(X).

Lemma 4.3.4. Let D ∈ Down(X). The canonical decomposition of ↓ X (D ∩ Y ) (as a downward-closed set of X) is a canonical representation of D ∩ Y (as a downward- closed set of Y ). Proof. Let i I i be the canonical decomposition of ↓ X (D ∩ Y ). Remember that an ideal J of Y is represented by the unique ideal I of X which is in the adherence of Y such that J = I ∩ Y . Thus, stating that i I i is a canonical representation of D ∩ Y means that: 1. D ∩ Y = i (I i ∩ Y ); 2. for every i, I i ∩ Y is an ideal of Y ; 3. I i ∩ Y and I j ∩ Y are incomparable for inclusion, for i = j. For the first point, i (I i ∩ Y ) = ( i I i ) ∩ Y = (↓ X (D ∩ Y )) ∩ Y = D ∩ Y .
We now argue that each I i ∩ Y is a correct representation of an ideal of Y , i.e., all I i 's are in the adherence of Y . One inclusion being trivial, we need to show that I i ⊆ ↓ X (I i ∩ Y ), for every i. Let x i ∈ I i . Since the ideals I j are incomparable for inclusion, there exists x ′ i ∈ I i such that x i ≤ x ′ i and for any

j = i, x ′ i / ∈ I j (I i is directed). Besides, x ′ i ∈ I i ⊆ ↓ X (D ∩ Y )
and thus there is an element

x ′′ i such that x ′ i ≤ x ′′ i ∈ D ∩ Y .
As the sets I j are downward-closed, x ′′ i cannot belong to any I j with j = 0, hence

x ′′ i is in I i ∩ Y . Therefore, x i ∈ ↓ X (I i ∩ Y ). Finally, the ideal decomposition D ∩ Y = j (I j ∩ Y ) is canonical since the I j 's are incomparable in X (recall the above criterion for inclusion of ideals of Y ). Observe that if D = i I i then ↓ X (D ∩ Y ) = i ↓ X (I i ∩ Y ) = i S I (I). Thus the canonical representation of D ∩ Y is indeed computable from D ∈ Down(X).
We now present the dual of the previous lemma:

Lemma 4.3.5. Given U ∈ Up(X), a canonical representation of U ∩Y (as an upward- closed set of Y ) can be computed from a canonical representation of ↑ X (U ∩ Y ) (as an upward-closed set of X).
Proof. Let i ↑ x i be a canonical filter decomposition (in X) of the upward-closed set ↑ X (U ∩ Y ). We first prove that for every i, x i is equivalent to some element of Y . Indeed, since ↑ X x i ⊆ ↑ X (U ∩ Y ), there exists y ∈ U ∩ Y with y ≤ x i . But then, y must be in some ↑ X x j . Since the decomposition is canonical, the x j 's are incomparable, hence we cannot have x j ≤ y ≤ x i for j = i. Thus,

x i ≡ y ∈ Y .
Moreover, we can compute a canonical filter decomposition of ↑ X (U ∩ Y ) using only elements in Y : for each x i , it is decidable whether x i ∈ Y (our first assumption on Y ). If not, we can enumerate elements of Y until we find some y i ≡ x i . Such an element exists, and thus the enumeration terminates.

We thus obtain a canonical filter decomposition i ↑ y i of ↓ X (U ∩ Y ) with y i ∈ Y . The rest of the proof is similar to the proof of Lemma 4.3.4.

Here also, a canonical representation of ↑ X (U ∩ Y ) is computable from U , using the function S F .

We can now describe procedures for the four remaining operations:

(CF): Given y ∈ Y , the complement of ↑ Y y is computed by using the equality Y ↑ Y y = (X ↑ X y) ∩ Y . The downward-closed set (X ↑ X y
) is computable using (CF) for X, and its intersection with Y is computable using Lemma 4.3.4.

(II): Given two ideals I and I ′ in the adherence of Y , the intersection of the ideals they induce is

(I ∩ Y ) ∩ (I ′ ∩ Y ) = (I ∩ I ′ ) ∩ Y
, which is computable using (II) for X and Lemma 4.3.4.

(IF): Computing the intersection of filters is similar to computing the intersection of ideals: given Finally, and as always, the above presentation can be computed from a presentation of (X, ≤), thanks to the functions S I and S F . Notably, the ideal decomposition of Y can be computed as the subset induced by the downward-closed set X of X, using Lemma 4.3.4, and the filter decomposition of Y can be computed as the subset induced by the upward-closed set X of X, using Lemma 4.3.5.

y 1 , y 2 ∈ Y , (↑ Y y 1 ) ∩ (↑ Y y 2 ) = (↑ X y 1 ∩ ↑ X y 2 ) ∩ Y , which is computable using (IF)
Remark 4.3.6. If Y is a downward-closed subset of X, then an ideal I is adherent to Y if and only if I ⊆ Y , and therefore Idl (Y ) = Idl (X) ∩ P(Y ). Moreover, S I is computable thanks to (II), and

S F (↑ x) = ↑ x if x ∈ Y , S F (↑ x) = ∅ otherwise. Indeed, if x / ∈ Y , then ↑ x ∩ Y = ∅. Similarly, if Y is upward-closed, S F can be computed with (II), and S I (I) = I if Y ∩I = ∅, S I (I) = ∅ otherwise. Again, Y ∩I = ∅ if and only if ∃x ∈ min(Y ) : x ∈ I.
Given such an x, then ∀y ∈ I : ∃z ∈ I : z ≥ x, y by directedness. Therefore,

I ⊆ ↓(I ∩ ↑ x) ⊆ ↓(I ∩ Y ).

References and Related Work

The notion of adherence has first been introduced in [START_REF] Leroux | Demystifying reachability in vector addition systems[END_REF]. In this paper, the authors use the notion of ideals to "demystify" the data-structures used in the well-known but obscure proof of decidability of the reachability problem for Petri Nets first shown by Kosaraju, Lambert and Mayr. Intuitively, they define, using natural constructions on WQOs, an over-approximation of the set of all runs of a given Petri Net. In the light of this section, the ideals of the actual set of runs are the ideals of the over-approximation that are adherent to the actual set of runs, which motivated the introduction of adherence in the first place. Note that in this setting, S I is not computable.

The notion of adherence has also been successfully applied to separability by piecewise testable languages in language theory [START_REF] Goubault-Larrecq | Deciding piecewise testable separability for regular tree languages[END_REF] and [START_REF] Zetzsche | PTL-separability and closures for wqos on words[END_REF].

Chapter 5

Sums and Products of WQOs

The results of this chapter are easily obtained and widely known. They are nonetheless included here for completeness, since sums and products constitute basic constructions that naturally appear when working with WQOs (see Section 9.2 for instance). They also provide warm-up examples to practice our definition.

Disjoint Sums

The disjoint sum

X ⊔ = X 1 ⊔ X 2 of two WQOs (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) is the set {1} × X 1 ∪ {2} × X 2 ,
well quasi-ordered by: i, x ≤ ⊔ j, y iff i = j and x ≤ i y .

This structure is obviously well quasi-ordered when (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) are. We let the reader check the following characterization.

Proposition 5.1.1 (Ideals of X 1 ⊔ X 2 X 1 ⊔ X 2 X 1 ⊔ X 2 ). Given (X 1 , ≤ 1
) and (X 2 , ≤ 2 ) two WQOs, the ideals of (X 1 ⊔ X 2 , ≤ ⊔ ) are exactly the sets of the form I = {i} × J with i ∈ {1, 2} and J an ideal of X i .

Thus (Idl (X 1 ⊔ X 2 ), ⊆) is isomorphic to (Idl (X 1 ), ⊆) ⊔ (Idl(X 2 ), ⊆).
Given data structures for X 1 and X 2 , we use the natural data structure for X 1 ⊔ X 2 . Moreover, Proposition 5.1.1 shows that ideals of the WQO (X 1 ⊔X 2 , ≤ ⊔ ) can similarly be represented using data structure for Idl (X 1 ) and Idl (X 2 ). Theorem 5.1.2. With the above representations of elements and ideals, disjoint union is a polynomial-time ideally effective construction. Sketch. Let (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) be two ideally effective WQOs.

In the following, we write ī for 3i when i ∈ {1, 2}, so that {i, ī} = {1, 2}. We also abuse notation and, for a downward-closed subset D = a I a of X i , we write i, D to denote a i, I a , a downward-closed subset of X ⊔ represented via ideals.

Similarly, for an upward-closed subset

U = a ↑ Xi x a of X i , we let i, U denote a ↑ ⊔ i, x a .
(OD): the definition of ≤ ⊔ is already an implementation.

(ID): we use i,

J ⊆ i ′ , J ′ ⇐⇒ i = i ′ ∧ J ⊆ J ′ .
(PI): we use

↓ ⊔ i, x = i, ↓ i x for i ∈ {1, 2}. (CF): we use X ⊔ ↑ ⊔ i, x = i, X i ↑ i x ∪ ī, X ī .
Note that this relies on (CF) for X i (to express X i ↑ i x as a union of ideals) and on (XI) for X ī.

(II): we rely on (II) for X 1 and X 2 , using

i, I ∩ j, J = i, I ∩ J if i = j, ∅ otherwise.
Operations (CI) to complement ideals and (IF) to intersect filters are analogous.

Observe that the presentation of (X 1 ⊔ X 2 , ≤ ⊔ ) described above is clearly computable from presentations for (X i , ≤ i ) (i = 1, 2), and is polynomial-time when the presentations for (X i , ≤ i ) (i = 1, 2) are. Notably, a filter (resp. ideal) decomposition of X 1 ⊔ X 2 is easily obtained by taking the union of filter (resp. ideal) decompositions of X 1 and X 2 , thus establishing (XF) (resp. (XI)).

Lexicographic Sums

The lexicographic sum X 1 + X 2 of two WQOs (X 1 , ≤ 1 ), (X 2 , ≤ 2 ) has the same support set as for their disjoint sum (i.e., X + def = X ⊔ ); only the quasi-ordering is different: i, x ≤ + j, y iff i < j or (i = j and x ≤ i y) .

Note that ≤ + extends ≤ ⊔ (i.e. ≤ ⊔ ⊆≤ + ), thus it is a WQO. Although we could apply the results obtained in Section 4.1, we rather deal with this case by hand.

Again, the following characterization is easy to obtain.

Proposition 5.2.1 (Ideals of X 1 ⊕ X 2 X 1 ⊕ X 2 X 1 ⊕ X 2 ). Given two WQOs (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ), the ideals of X 1 ⊕ X 2 are exactly the sets of the form {1} × J 1 with J 1 ∈ Idl (X 1 ), or of the form {1} × X 1 ∪ {2} × J 2 with J 2 ∈ Idl (X 2 ). Thus (Idl (X 1 ⊕ X 2 ), ⊆) is isomorphic to (Idl (X 1 ), ⊆) ⊕ (Idl (X 2 ), ⊆)
, which leads to a simple data structure for the set of ideals1 when X 1 and X 2 are effective. Theorem 5.2.2. With the above representations, lexicographic union is a polynomialtime ideally effective construction. Sketch. Let (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) be two ideally effective WQOs. We reuse the abbreviations i, U , i, D , ī, . . . , introduced for disjoint sums. Also, we only consider the case where both X 1 and X 2 are non-empty (the claim is trivial otherwise).

(OD): follows from the definition.

(ID): ideal inclusion can be tested as the lexicographic sum of Idl (X 1 ) and Idl (X 2 ).

(PI): ↓ ⊕ i, x is (represented by) i, ↓ i x . (CF): the complement X ⊕ ↑ ⊕ i, x is (represented by) i, X i ↑ i x except when i = 2 and ↑ i x = X 2 , in which case X ⊕ ↑ ⊕ 2, x is 1, X 1 .
(II): intersection of two ideals considers two cases. First 1, I ∩ 2, J is (represented by) 1, I for ideals issued from different components in X ⊕ . For i, I ∩ i, J , i.e., ideals issued from the same component, we use i, I ∩ J except when i = 2 and

I ∩ J = ∅, in which case 2, I ∩ 2, J is 1, X 1 .
Procedures for the dual operations (CI) and (IF) are similar. Moreover, the presentation above is obviously computable from presentations for (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ). Regarding (XI) and (XF), the ideal decomposition of X 1 ⊕ X 2 is the ideal decomposition of X 2 and the filter decomposition of X 1 ⊕ X 2 is the filter decomposition of X 1 . Finally, the fact that disjoint sum is a polynomial-time construction is again trivial.

Cartesian Products and Dickson's Lemma

Given two QOs (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ), we define the component-wise quasi-ordering

≤ × on the Cartesian product X 1 ×X 2 by x 1 , x 2 ≤ × y 1 , y 2 def ⇔ x 1 ≤ 1 y 1 ∧x 2 ≤ 2 y 2 . Dickson's Lemma states that (X 1 × X 2 , ≤ × ) is a WQO when (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) are.
The ideals of (X 1 × X 2 , ≤ × ) are well known.

Proposition 5.3.1 (Ideals of X 1 × X 2 X 1 × X 2 X 1 × X 2 ). Let (X 1 , ≤ 1
) and (X 2 , ≤ 2 ) be two WQOs. A subset I is an ideal of X 1 × X 2 if, and only if, I = I 1 × I 2 for some ideals I 1 , I 2 of X 1 and X 2 respectively. Proof. (⇐): One checks that I = I 1 × I 2 is non-empty, downward-closed, and directed, when I 1 and I 2 are. For directedness, we consider two elements x 1 , x 2 and y 1 , y 2 in I. Since I 1 is directed and contains x 1 , y 1 , it contains some z 1 with x 1 ≤ 1 z 1 and y 1 ≤ 1 z 1 . Similarly I 2 contains some z 2 above x 2 and y 2 (wrt. ≤ 2 ). Finally, z 1 , z 2 is in I, and above both x 1 , y 1 and x 2 , y 2 . (⇒): Consider I ∈ Idl (X 1 ×X 2 ) and write I 1 and I 2 for its projections on X 1 and X 2 . These projections are downward-closed (since I is), non-empty (since I is) and directed (since I is), hence they are ideals (in X 1 and X 2 ). We now show that I 1 × I 2 ⊆ I. Consider an arbitrary x 1 ∈ I 1 : since I 1 is the projection of I, there is some y 2 ∈ X 2 such that x 1 , y 2 ∈ I. Similarly, for any x 2 ∈ I 2 , there is some

y 1 ∈ X 1 such that y 1 , x 2 ∈ I. Since I is directed, there is some z 1 , z 2 ∈ I with x 1 , y 2 ≤ × z 1 , z 2 and y 1 , x 2 ≤ × z 1 , z 2 . But then x 1 ≤ 1 z 1 and x 2 ≤ 2 z 2 . Thus x 1 , x 2 ∈ I since I contains z 1 , z 2 and is downward-closed. Hence I = I 1 × I 2 and I is a product of ideals. Thus Idl (X 1 × X 2 , ⊆) is isomorphic to (Idl (X 1 ), ⊆) × (Idl (X 2 ), ⊆). If (X 1 , ≤ 1 )
and (X 2 , ≤ 2 ) are ideally effective, we naturally represent elements of X 1 × X 2 as pairs of elements of X 1 and X 2 , and similarly ideals of (X 1 × X 2 , ≤ × ) as pairs of ideals of X 1 and X 2 .

Theorem 5.3.2. With the above representations, Cartesian product is a polynomialtime ideally effective construction.

Proof. Let (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) be two ideally effective WQOs.

Let D 1 and D 2 be downward-closed sets of (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) respectively, given by some ideal decompositions

D 1 = i I 1,i and D 2 = j I 2,j . Then D 1 × D 2 is downward-closed in X 1 × X 2 ,
and it decomposes as i j I 1,i × I 2,j since products distribute over unions. The same reasoning holds for upward-closed sets and their filter decompositions and we rely on these properties in the following explanations.

(OD): the ordering ≤ × is obviously decidable.

(ID):

I 1 × I 2 ⊆ J 1 × J 2 iff I 1 ⊆ J 1 and I 2 ⊆ J 2 (exercise; the non-emptiness of ideals is required here). (PI): ↓ x 1 , x 2 = ↓ x 1 × ↓ x 2 .
(II): to compute intersections, use

(I 1 × I 2 ) ∩ (I ′ 1 × I ′ 2 ) = (I 1 ∩ I ′ 1 ) × (I 2 ∩ I ′ 2 )
, and build the product of downward-closed sets as explained above.

(CF): to complement filters, use (X 1 × X 2 ) ↑ × x 1 , x 2 = (X 1 ↑ x 1 ) × X 2 ∪ X 1 × (X 2 ↑ x 2 )
and build products of downward-closed sets.

Procedures for the remaining operations are obtained similarly. Note that here too, the presentation above is computable from presentations for (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ). Notably, a filter and ideal decomposition of X 1 × X 2 is easily obtained from decompositions of X 1 and X 2 , by distributing products over unions. Finally, the procedures described above are obviously polynomial-time when the presentations of (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) are.

References and Related Work

The most prominent use of the product quasi-ordering in verification is with the WQO (N k , ≤ × ) of vectors of natural numbers. Without explicitly mentioning the notion of ideals, they have long been used under the form of omega-vectors (e.g. [START_REF] Karp | Parallel program schemata[END_REF] and successor work), that is vectors of elements of N ω = N ∪ {ω}. In terms of ideals, we now know that N ω simply is a convenient representation for Idl (N), and thus N k ω is a convenient representation for Idl (N k ). Set-theoretic operations are not difficult to perform in (N k , ≤ × ), computational description of these operations are given in [START_REF] Valk | The residue of vector sets with applications to decidability problems in Petri nets[END_REF] for instance.

It is not difficult to generalize these results to an arbitrary product of WQOs X 1 × X 2 . It is therefore difficult to find any reference on that matter. We can simply mention that the structure of ideals of (X k , ≤ × ) is given as a lemma to characterize the ideals of (X * , ≤ * ) (see next chapter) in [START_REF] Kabil | Une extension d'un théorème de P. Jullien sur les âges de mots[END_REF].

The results of these sections can be generalized to Noetherian spaces [START_REF] Finkel | Forward analysis for WSTS, part I: Completions[END_REF]. There, the fact that ideals of the product are products of ideals is expressed as "Sobrification commutes with finite products", and includes a reference to this more general result.

Lexicographic Product

Given (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) QOs, the lexicographic quasi-ordering ≤ lex is the QO defined on the cartesian product

X 1 × X 2 by x 1 , x 2 ≤ lex y 1 , y 2 def ⇔ x 1 < 1 y 1 ∨ (x 1 ≡ 1 y 1 ∧ x 2 ≤ 2 y 2 ), where ≡ 1 def = ≤ 1 ∩ ≥ 1 and < 1 = ≤ 1 ≡ 1 . Moreover, if (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) are WQOs, then (X 1 × X 2 , ≤ lex ) is a WQO as well, since ≤ × ⊆ ≤ lex .
The other important property of the lexicographic quasi-ordering is that it is linear when its arguments are. More precisely, the lexicographic product of two ordinals is by definition their product.

Since ≤ × ⊆ ≤ lex , we are in the setting of Section 4.1: the ideal effectiveness of (X 1 × X 2 , ≤ lex ) comes for free provided the two following functions are computable:

Cl I : Idl (X 1 × X 2 , ≤ × ) → Down(X 1 × X 2 , ≤ × ) I × J → ↓ lex (I × J) Cl F : (X 1 × X 2 , ≤ × ) → Up(X 1 × X 2 , ≤ × ) x, y → ↑ ≤ lex x, y
The expressions of these two functions in this particular case are given in the next proposition.

Proposition 5.4.1. Given I ∈ Idl (X 1 ), J ∈ Idl (X 2 ), x ∈ A and y ∈ B: Cl I (I × J) = (↓ x I × J) ∪ (↓ <1 x I × X 2 ) when I = ↓ x I for some x I ∈ X 1 I × X 2 otherwise Cl F ( x, y ) = ↑ × x, y ∪ (↑ >1 x × X 2 )
Proof. Both left-to-right inclusions are trivial. Assume I = ↓ x I is a principal ideal of X 1 , and let y, z ∈ ↓ <1 x I × X 2 . Since y < 1 x, y, z ≤ lex x, t for any t ∈ X 2 . Since J is non-empty, y, z ∈ ↓ lex I × J.

On the other hand, if I is not principal, then I has no maximal element. That is, for any y ∈ I, there exists a strictly greater x ∈ I. Therefore, for any z ∈ X 2 , y, z ≤ lex x, t for any t ∈ X 2 , and in particular for some t ∈ J. Thus y, z ∈ ↓ lex I × J.

The correctness of the expression for Cl F is analogous.

Observe that ↓ < x = ↓ x ∩ (X 1 ↑ x) and ↑ > x = ↑ x ∩ (X 1 ↓ x) for any x ∈ X 1 .
Therefore, these expressions are computable when (X, ≤ 1 ) is ideally effective. Moreover, from the filter and ideal decomposition of X 2 , it is simple to obtain the actual filter decomposition of ↑ >1 x×X 2 and the actual ideal decomposition of ↓ <1 x× X 2 . However, a last obstacle remains to the computability of Cl I : we need to be able to decide whether a given ideal is principal. This is not an assumption listed in Definition 3.1.1, and does not follow from our definition in general. We provide in Section 8.3 an ideally effective WQO for which it is undecidable to say whether a given ideal is principal. Taking a lexicographic over this WQO, we also show that function Cl I is not computable in general.

For a time, I thought that only the shortcut provided by Section 4.1 was made impracticable by this result, and that we could prove directly (axiom after axiom) that (X 1 × X 2 , ≤ lex ) was ideally effective. Unfortunately, this is not the case: Dietrich Kuske found a mistake in one of my proofs, and I soon realized it couldn't be corrected. In the end, the WQO provided in Section 8.3 for which function Cl I is not computable is also a counter example to the ideal effectiveness of the lexicographic product. In conclusion, the lexicographic product, despite being a natural construction, is not ideally effective according to our definition.

Nonetheless, in commonly used WQOs, testing whether an ideal is principal is trivially decidable. We therefore obtain the following weaker result:

Theorem 5.4.2. Given (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) ideally effective WQOs such that it is decidable whether a given ideal of Idl (X 1 ) is principal, then (X 1 × X 2 , ≤ lex ) is an ideally effective WQO.
Moreover, from (polynomial-time) presentations of (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) and a (polynomial-time) algorithm to test principality of ideals of (X 1 , ≤ 1 ), we can compute a (polynomial-time) presentation of (X 1 × X 2 , ≤ lex ).

Proof. Follows from Theorem 4.1.2 and the analysis of functions Cl I and Cl F above.

Chapter 6

Finite Sequences over WQOs

Higman's Quasi-Ordering

A QO (X, ≤) is a WQO if and only if (X * , ≤ * ) is a WQO as well (Higman's Lemma), where as defined in Chapter 2, X * is the set of all finite sequences over X, and ≤ * denotes the embedding quasi-ordering between sequences. We sometimes refer to (X * , ≤ * ) as the Higman extension of (X, ≤) and ≤ * is called Higman's quasiordering.

Elements of X * will be denoted in bold font, such as u, v, ..., while elements of X are denoted x, y, .... In particular, if x ∈ X, then x ∈ X * denotes the sequence of length one containing only the symbol x. The product (for concatenation) of two sets of sequences

U , V ⊆ X * is denoted U • V def = {u • v | u ∈ U , v ∈ V }.
The structure of ideals of (X * , ≤ * ) is given in [START_REF] Kabil | Une extension d'un théorème de P. Jullien sur les âges de mots[END_REF] where the following theorem is proved. An alternative proof is presented at the end of Section 6.1.2. Theorem 6.1.1. The ideals of (X, ≤ * ) are exactly the finite products of atoms P = A 1 • • • A n , where atoms are:

• any set of the form D * ⊆ X * for D ∈ Down(X),

• or any set of the form

↓ * I = {x ∈ X * | x ∈ I} ∪ {ǫ} for I ∈ Idl (X). Subse-
quently, ↓ * I will be denoted I + ǫ (this notation comes from regular expressions in language theory).

This theorem states that any ideal of (X * , ≤ * ) can be decomposed as a finite product of atoms. However, for instance for X the finite alphabet {a, b}, we have

(a + ǫ)(a + b) * = (a + b) * .
That is to say, ideals of (X * , ≤ * ) admit several decompositions as products of atoms. In Section 6.1.3, we define a canonical atom decomposition for ideals of (X * , ≤ * ) which is easily obtained from any other decomposition (as in the case of upward-and downward-closed sets, it suffices to remove redundancies). But, we do not need this canonical decomposition to prove ideal effectiveness, and therefore we proceed to the main theorem of this section: the ideal effectiveness of the Higman extension, which is stated and proved in the next subsection. We then give a proof of Theorem 6.1.1 in Section 6.1.2, define the canonical decomposition in Section 6.1.3 and provide some references and pointers to related work in Section 6.1.4.

The Higman Extension is Ideally Effective

First, let us a fix a representation for X * and Idl (X * , ≤ * ): as expected, we will simply represent finite sequences of elements of X as lists of encodings of X (assuming a representation for X). Similarly, the theorem above suggests representing ideals as finite sequences (e.g. lists) of atoms. For that, we need a representation for atoms. Assuming a representation for X and Idl (X), we represent downward-closed sets of X as always, which gives us representations for each of the two kinds of atoms. Now the full set of atoms can be seen as Idl (X) ⊔ Down(X) which we can represent as we did in Section 5.1. Observe that the empty sequence of atoms, denoted ǫ to avoid confusion with the empty sequence ǫ ∈ X * , denotes the singleton ideal {ǫ}. Theorem 6.1.2. With the above representations, the Higman extension is an ideally effective construction. It is not polynomial-time in general. Given a polynomial-time presentation of an ideally effective WQO (X, ≤), we can compute an exponential-time presentation of (X * , ≤ * ).

The proof of this theorem being quite long, it is structured in several sub-parts, one for each of the main operations: (ID), (CF), (II), (IF), (CI). Each of these subsections will include a description of the operation at hand as well as complexity lower and upper bounds. The easier requirements from Definition 3.1.1 are shown valid below.

Proof. Let (X, ≤) be an ideally effective WQO.

(OD): deciding ≤ * over X * reduces to comparing elements of X, e.g. by looking for a leftmost embedding.

(PI): given a finite sequence u

= x 1 • • • x n , the principal ideal ↓ u is represented by the product (↓ x 1 + ǫ) • • • (↓ x n + ǫ).
The fact that a (exponential-time) presentation of (X * , ≤ * ) can be computed from a (polynomial-time) presentation of (X, ≤) will be clear from the procedures described in the next subsections and their complexity analysis. Notably, for (XF), the filter decomposition of X * = ↑ ǫ is given by the empty sequence (and does not depend on X), while for (XI) we note that X * is already an ideal made of a single atom.

The fact that the Higman extension is not a polynomial-time construction follows from the complexity lower bounds presented in the next subsections.

Before we move on to the technical part of the proof of the theorem above, let us introduce some convenient notations.

Given D = i I i ∈ Down(X), we write D +ǫ to denote i (I i +ǫ) ∈ Down(X * ). We will call such subsets generalized atoms. Products of atoms and generalized atoms are downward-closed sets of X * . From such a product P describing a downwardclosed sets D of X * , it is possible to recover the actual ideal decomposition of D by distributing the products over the unions in P . However, the ideal decomposition of D might be of size exponential in the size of P .

We will also use shortcuts to denote upward-closed sets. Given two upward-closed sets of sequences U = i ↑ u i and V = j ↑ v j , the product U • V is upward-closed and its filter decomposition can be computed by

U • V = i,j ↑(u i • v j ). Moreover, if U = i ↑ X x i ∈ U p(X)
is an upward-closed set of (X, ≤), then we can see U as a set of sequences of length 1, and ↑ * U = i ↑ * x i . Therefore, an upward-closed set of X can always be understood as an upward-closed set of X * . This will be used silently.

Ideal Inclusion (ID)

Proposition 6.1.3. Inclusion between ideals of (X * , ≤ * ) can be tested using a linear number of inclusion tests between downward-closed sets of X, using a sort of left-most embedding search. When (X, ≤) is an ideally effective WQO, the following equations implicitly describe an inductive algorithm deciding inclusion between ideals of (X * , ≤ * ):

1. Atoms are compared as follows:

(I 1 + ǫ) ⊆ (I 2 + ǫ) ⇐⇒ I 1 ⊆ I 2 , (I + ǫ) ⊆ D * ⇐⇒ I ⊆ D, D * 1 ⊆ D * 2 ⇐⇒ D 1 ⊆ D 2 , D * ⊆ (I + ǫ) ⇐⇒ D = ∅.
2. for any ideal P : ǫ ⊆ P ,

for any ideal P and atom

A: A • P ⊆ ǫ ⇐⇒ A = ∅ * ∧ P ⊆ ǫ 4.
Finally, for any atoms A and B, and any ideals P and Q:

(a) if A ⊆ B then:

A • P ⊆ B • Q ⇐⇒ A • P ⊆ Q (b) if A ⊆ B as in the first equivalence of case 1, i.e. A = (I 1 + ǫ), B = (I 2 + ǫ) for some I 1 , I 2 ∈ Idl (X), then: A • P ⊆ B • Q ⇐⇒ P ⊆ Q (c) if A ⊆ B
as in any of the three other equivalences of case 1, then:

A • P ⊆ B • Q ⇐⇒ P ⊆ B • Q Proof.
The three first cases being trivial, we concentrate on the forth one.

4a It is always true that

A•P ⊆ Q → A•P ⊆ B Q. Conversely, let u•v ∈ A•P ⊆ B • Q. Assuming A ⊆ B, there exists w ′ ∈ A B and by directedness, there exists w ∈ A B such that w ≥ u. Now, if A = I + ǫ for some I ∈ Idl (X), then w is of length one, is not in B and thus w • v, which is in A • P ⊆ B • Q has to actually be in Q. Since Q is downward-closed, u • v ∈ Q.
Otherwise, A = D * for some D ∈ Down(X). In this case, w • w ∈ A and thus

wwv ∈ B • Q. Because w / ∈ B, this implies wv ∈ Q, which again implies uv ∈ Q.
4b Here also, right-to-left implication is trivial. Conversely, assume A • P ⊆ B • Q and A = (I 1 + ǫ) and B = (I 2 + ǫ) for some

I 1 ⊆ I 2 ∈ Idl (X). Let u ∈ P . Pick x ∈ I 1 : xu ∈ A • P , thus xu ∈ B • Q. Therefore, u ∈ Q since sequences of B have length at most one.
4c Left-to-right implication is trivial. For the other implication, decompose P in P 1 • P 2 with P 1 ⊆ B and P 2 ⊆ Q. Now observe that whenever A ⊆ B but they are not both atoms of the form I +ǫ for some

I ∈ Idl (X), then A•P 1 ⊆ B. Therefore, A • P B • Q.
Observe that when (X, ≤) is a polynomial-time ideally effective WQO, the algorithm described above runs in polynomial-time.

Complementing Filters (CF) Proposition 6.1.4. Complements of filters can be inductively computed using the following equations: Given w ∈ X * and x ∈ X,

X * ↑ ǫ = ∅ (empty union) (6.1) X * ↑ x = (X ↑ x) * (6.2) X * ↑ xw = (X ↑ x) * • (X + ǫ) • (X * ↑ w) (6.3)
Note that X might not be an ideal, and thus X + ǫ might be a generalized atom (not an actual atom). In this case, to compute the actual ideal decomposition of X * ↑ w, we need to distribute the products over the unions that comes from the ideal decomposition of X. This step might result in an exponential blow up. For instance, take X to be the finite ordering that consists of three elements 0, 1 and 1 ′ with 0 < 1, 0 < 1 ′ and 1 ⊥ 1 ′ . Then X * ↑ 0 n+1 consists of all sequences of length at most n. Thus its canonical ideal decomposition has size

2 n : X * ↑ 0 n+1 = u∈{1,1 ′ } n ↓ u.
Note however that in the commonly encountered case where X is a finite alphabet, the operation of complementing filters can be performed in polynomial-time. Indeed, if X = {a 1 , . . . , a n } is a finite alphabet (i.e. ordered with equality), then

X = n i=1 ↓ a i , which is not an ideal for n > 1. But since X ↑ a i = j =i ↓ a j , (X ↑ a i ) * •(X +ǫ) = (X ↑ a i ) * • (a i + ǫ)
which is an ideal. In [START_REF] Kabil | Une extension d'un théorème de P. Jullien sur les âges de mots[END_REF], the authors prove this finer expression to complement filters. for an arbitrary WQO (X, ≤):

X * ↑ xyw = (X ↑ x) * • [↓(↑ x ∩ ↑ y) + ǫ] • (X * ↑ yw)
In general, our setting does not guarantee that the expression ↓ U is computable for U ∈ Up(X), but when X is a finite alphabet, the expression (↑ x ∩ ↑ y) either denotes the empty set or (x + ǫ) when x = y. Therefore, using this expression, one directly obtains the canonical form of the complement of a filter of X * in the case of a finite alphabet.

Proof. (of Proposition 6.1.4) Equations 6.1 and 6.2 are obvious. For the third equation:

(⊇) If w ′ = uyv with u ∈ (X ↑ x) * , y ∈ X + ǫ and v ∈ (X * ↑ w), then assume xw ≤ w ′ , then either x = y and w ≤ v which is a contradiction, or xw ≤ v, which is also a contradiction. (⊆) Let w ′ / ∈ ↑ xw. Then either w ′ ∈ (X ↑ x) * , or we can write w ′ = uyv with u ∈ (X ↑ x) * and y ≥ x. Moreover, v / ∈ ↑ w, since otherwise xw ≤ yv ≤ uyv = w ′ . Therefore, w ′ ∈ (X ↑ x) * • (X + ǫ) • (X * ↑ w).
Intersecting Ideals (II) Proposition 6.1.5. The intersection of two ideals of (X * , ≤ * ) can be computed inductively using the following equations:

P ∩ ǫ = ǫ D * 1 • P ∩ D * 2 • Q = (D 1 ∩ D 2 ) * • ((D * 1 • P ) ∩ Q) ∪ (P ∩ (D * 2 • Q)) (I 1 + ǫ) • P ∩ (I 2 + ǫ) • Q = ((I 1 + ǫ) • P ) ∩ Q ∪ P ∩ ((I 2 + ǫ) • Q) ∪ ∪ (I 1 ∩ I 2 ) + ǫ • (P ∩ Q) D * • P ∩ (I + ǫ) • Q = P ∩ ((I + ǫ) • Q) ∪ (D ∩ I) + ǫ • (D * • P ∩ Q)
Note that, in addition to using generalized atoms (I 1 ∩ I 2 and D ∩ I may not be ideals), we use expressions that mix unions and products. The actual ideal decomposition is obtained when distributing the products over the unions. This is computable, but may again result in an exponential blow-up of the ideal decomposition. This is witnessed by the following example: take X = {a, b} a two-symbol alphabet and D = ↓(aba) n ∩ ↓(bab) n . Every word u in {ab, ba} n is a maximal element of D: membership is obvious, and maximality can be proved using the number of symbols a and b in u, u has as many a's as (bab) n and as many b's as (aba) n . Therefore, D is the union of exponentially many incomparable ideals (words of the same size are either equal or incomparable).

Proof. (of Proposition 6.1.5) The first two equations are obviously correct. The other right-to-left inclusions are easily checked using Proposition 6.1.3. For the left-to-right directions:

• Let u ∈ (D * 1 • P ∩ D * 2 • Q). Let v be the longest prefix of u which is in D * 1 .
Without loss of generality, we assume that the longest prefix of u which is in D * 2 is longer than |v|, and thus can be written vw for some w ∈ X * . Moreover, there exists t ∈ X * so that u = vwt. We have, v

∈ (D 1 ∩ D 2 ) * , wt ∈ P and t ∈ Q. Therefore, wt ∈ P ∩ D * 2 Q. • Let x • u ∈ (I 1 + ǫ) • P ∩ (I 2 + ǫ) • Q. Depending on whether x ∈ I 1 I 2 ,
x ∈ I 2 I 1 or x ∈ I 1 ∩ I 2 , u is easily proved to be in one of the three sets it should belong to. In the case x is neither in I 1 nor I 2 , then u belongs to all three sets.

• The last case is proved similarly.

Intersecting Filters (IF) Proposition 6.1.6. The intersection of two filters can be computed inductively using the following equations, for w, v ∈ X * and x, y ∈ X:

↑ v ∩ ↑ ǫ = ↑ v ↑ ǫ ∩ ↑ w = ↑ w ↑ xv ∩ ↑ yw = (↑ x) • (↑ v ∩ ↑ yw) ∪ (↑ y) • (↑ xv ∩ ↑ w) ∪ ∪ (↑ X x ∩ ↑ X y) • (↑ v ∩ ↑ w)
The actual filter decomposition of this last upward-closed set can be computed following the remark at the beginning of this section.

Proof. The first two equations are trivial. For the third, right-to-left inclusion is obvious. Left-to-right inclusion: consider u ∈ ↑ av ∩ ↑ bw. Let u ′ be the shortest suffix of u which belongs to ↑ av ∩ ↑ bw. Consider cases depending on whether the first letter of u ′ is above x and y in X.

The naive implementation of this procedure runs in exponential-time, and it is asymptotically optimal: the canonical decomposition of the upward-closed set ↑ a n ∩ ↑ b n has at least 2n n minimal elements (this corresponds to all the words in the shuf-

fle product a n ✁ b n ).

Complementing Ideals (CI)

In this subsection we present a procedure to complement ideals. We first show how to complement atoms, and then how to complement products of atoms.

• If D ⊆ X is downward-closed, then X * D * consists of all words which have at least one letter not in D. That is, compute

X D = ↑ x 1 ∪ . . . ∪ ↑ x n , using (CI) for X. Then X * D * = ↑ x 1 + . . . + ↑ x n .
• If I ⊆ X is an ideal, then X * (I + ǫ) consists of all words which have at least one letter not in I, and all words with at least two letters. The former is obtained as in the previous case. The latter is ↑ * X • X, easily computed in a similar way using (XF) for X.

We now consider products

A 1 • • • A n of atoms. We know how to compute U i = ∁A i . We thus use the relation ∁(A 1 • • • A n ) = ∁(∁U 1 • • • ∁U n ),
⊙ : Up(X * ) × Up(X * ) → Up(X * ) as U ⊙ V := ∁(∁U • ∁V ).
Note that U ⊙ V is obviously upward-closed when U and V are. The operation ⊙ is easily shown associative using the associativity of the product, thus

U 1 ⊙ . . . ⊙ U n = ∁(∁U 1 • . . . • ∁U n ). The previous relation becomes ∁(A 1 • • • A n ) = U 1 ⊙ • • • ⊙ U n ,
and it only remains to show that ⊙ is computable on upward-closed sets. In what follows, we will often use the following obvious characterization: w ∈ S ⊙ T if and only if for all factorizations w = w 1 w 2 , w 1 ∈ S or w 2 ∈ T .

We first show that ⊙ is computable on filters, and later show that ⊙ distributes over unions. Lemma 6.1.8. On principal filters, ⊙ can be computed using the following equations:

↑ v ⊙ ↑ ǫ = X * ↑ ǫ ⊙ ↑ w = X * ↑ va ⊙ ↑ bw = ↑(vabw) ∪ (↑ v) • (↑ X a ∩ ↑ X b) • (↑ w)
where v, w ∈ X * and a, b ∈ X.

Proof. The first two equations are obvious. For the third:

(⊇) If u ≥ * vabw, then for every factorization of u = u 1 u 2 , the left factor u 1 is above va, or the right factor u 2 is above bw, and thus u ∈ ↑ va ⊙ ↑ bw. If u ≥ * vcw, where c ∈ X is such that c ≥ a and c ≥ b, then in every factorization of u = u 1 u 2 , c appears either in the left factor u 1 or in the right factor u 2 , and this suffices to show that either u ≥ * va or u ≥ * bw.

(⊆) Let u ∈ (↑ v) ⊙ (↑ w). From the factorizations u = u • ǫ and u = ǫ • z we get va ≤ * u and bw ≤ * u. Consider the shortest prefix of u into which va embeds and the shortest suffix into which bw embeds. If these factors don't overlap, we get u ≥ * vabw. If they overlap, the overlap must have length exactly one (otherwise u can be split anywhere in the middle of the overlap to obtain a contradiction). Write u = u 1 cu 2 where c ∈ X is the overlap. Then u 1 ≥ * v, c ≥ a, c ≥ b, and u 2 ≥ * w, which proves the statement.

It now remains to show that ⊙ distributes over unions. Lemma 6.1.9. Given U , U 1 , U 2 three upward-closed sets of X * , we have:

(U 1 ∪ U 2 ) ⊙ U = (U 1 ⊙ U ) ∪ (U 2 ⊙ U ) U ⊙ (U 1 ∪ U 2 ) = (U ⊙ U 1 ) ∪ (U ⊙ U 2 )
Proof. We actually show the equivalent statement that product distributes over intersection for downward-closed sets. Let

D = ∁U , D 1 = ∁U 1 and D 2 = ∁U 2 , we show that (D 1 ∩D 2 )•D = (D 1 •D)∩(D 2 •D), and D •(D 1 ∩D 2 ) = (D •D 1 )∩(D •D 2 ).
We only show the first equation, the second one being symmetrical. The left-toright inclusion is obvious. For the right-to-left inclusion, let w

∈ D 1 • D ∩ D 2 • D. Then w = u 1 v 1 for some u 1 ∈ D 1 and v 1 ∈ D. Also, w = u 2 v 2 for some u 2 ∈ D 2 and v 2 ∈ D. One of u 1 and u 2 is a prefix of the other. Assume u 1 is a prefix of u 2 (the other case is analogous). Since D 2 is downward-closed and u 1 ≤ * u 2 , u 1 ∈ D 2 . Thus, u 1 ∈ D 1 ∩ D 2 and v 1 ∈ D, w = u 1 v 1 ∈ (D 1 ∩ D 2 ) • D. It follows that computing ∁A 1 ⊙• • •⊙∁A n = (U 1 ⊙• • •⊙U n ) reduces to computing ⊙ on
filters, which is computable by Lemma 6.1.8. However, distributing over the unions can once again lead to an exponential blow-up. This is unavoidable, as shown below.

Proposition 6.1.10. The upward-closed set ∁ ↓(ab) n where X = {a, b} is a twosymbol alphabet has an exponential number (in n) of minimal elements.

Thus, ideals of X * cannot be complemented in polynomial-time, even in the simple case where X is a two-symbol alphabet.

Proof. Since ⊙ is associative, ∁ ↓(ab) n = (∁ ↓(ab) n-1 ) ⊙ (∁ ↓ ab) = (∁ ↓(ab) n-1 ) ⊙ (↑ ba ∪ ↑ bb ∪ ↑ aa). This identity suggests to proceed by induction. Let

m i=1 ↑ u i be the canonical decomposition of ∁ ↓(ab) n . Define the subsets of indexes S v = {i ∈ [m] | v is a suffix of u i }. ∁ ↓(ab) n+1 =(∁ ↓(ab) n ) ⊙ (↑ ba ∪ ↑ bb ∪ ↑ aa) =( m i=1 ↑ u i ) ⊙ (↑ ba ∪ ↑ bb ∪ ↑ aa) =( i∈Saa ↑ u i ) ⊙ (↑ ba ∪ ↑ bb ∪ ↑ aa) ∪ ( i∈S ba ↑ u i ) ⊙ (↑ ba ∪ ↑ bb ∪ ↑ aa) ∪ ( i∈S b ↑ bu i ) ⊙ (↑ ba ∪ ↑ bb ∪ ↑ aa) =( i∈Saa ↑ u i ba ∪ ↑ u i bb ∪ ↑ u i a) ∪ ( i∈S ba ↑ u i ba ∪ ↑ u i bb ∪ ↑ u i a) ∪ ( i∈S b ↑ u i a ∪ ↑ u i b ∪ ↑ u i aa)
This last step follow from the particular form that Lemma 6.1.8 takes when X = A a finite alphabet: indeed, for a, b ∈ A, either a = b and

↑ A a ∩ ↑ A b = ∅ which means ↑ va ⊙ ↑ bw = ↑ vabw; or a = b in which case ↑ va ⊙ ↑ aw = ↑ vaaw ∪ ↑ vaw = ↑ vaw since vaw ≤ vaaw.
Now, observe that for i ∈ S aa ∪ S ba , u i a ≤ u i ba; and for i ∈ S b , u i a ≤ u i aa, thus we obtain:

∁ ↓(ab) n+1 =( i∈Saa ↑ u i bb ∪ ↑ u i a) ∪ ( i∈S ba ↑ u i bb ∪ ↑ u i a) ∪ ( i∈S b ↑ u i a ∪ ↑ u i b) (6.4)
There is one last less obvious redundancy: for n ≥ 2 and i ∈ S ba , there exists u ′ i in the canonical decomposition of ∁(↓(ab) n-1 ) such that u i = u ′ i a. Indeed, we see in Equation 6.4 that a's can only be added one by one. Thus, u ′ i having b as a suffix, there exists j ∈ [m] such that u j = u ′ i b. This entails j ∈ S b , and thus u j b = u ′ i bb appears in the decomposition of ∁ ↓(ab) n+1 . Since u ′ i bb ≤ u ′ i abb = u i bb, the element u i bb is not minimal in the decomposition and can be removed. We finally obtain:

∁ ↓(ab) n+1 =( i∈Saa ↑ u i bb ∪ ↑ u i a) ∪ ( i∈S ba ↑ u i a) ∪ ( i∈S b ↑ u i a ∪ ↑ u i b) (6.5) (6.6)
We now prove that the decomposition above is indeed minimal. First,

u i bb ≤ u j a or u i bb ≤ u j b imply u i b ≤ u j which is impossible since the decomposition m i=1 u i is canonical, i.e. the u i 's are incomparable. Moreover, u i bb ≤ u j bb implies u i ≤ u j which implies i = j since m i=1 ↑ u i is the canonical decomposition of ∁ ↓(ab) n .
Similarly, u i a ≤ u j b and u i a ≤ u j bb are impossible, and u i a ≤ u j a implies i = j. The only non trivial case is when u i b ≤ u j bb. This implies that i ∈ S b and j ∈ S aa , and of course that u i ≤ u j b. Again, assume n ≥ 2, and denote by u ′ i and u ′ j the minimal elements of ∁ ↓(ab) n-1 from which u i and u j are respectively built. Then, u j = u ′ j a and a is a suffix of u ′ j . As for u i , it is either equal to u ′ i b, and b is a suffix of u ′ i ; or to u ′ i bb, in which case aa is a suffix of u ′ i . In the first case, we have

u ′ i b ≤ u ′ j ab which implies u ′ i ≤ u ′ j , thus u ′ i = u ′
j by canonicity of the decomposition at rank n-1, but this is impossible since one ends with a and the other with b. In the second case,

u ′ i bb ≤ u ′ j ab, which implies u ′ i b ≤ u ′ j
, which leads to the same kind of impossibility. In conclusion, the decomposition given in Equation 6.5 is canonical, and its number of element is given by

u n + v n + w n def = |S aa | + |S ba | + |S b |
, where the sequences are inductively defined by:

u n+1 = u n + v n v n+1 = w n w n+1 = w n + u n Thus, U n =   u n v n w n   = A n U 0 where A =   1 1 0 0 0 1 1 0 1   .
This matrix has only one real eigenvalue λ ≃ 1.75488 > 1 and two conjugate complex eigenvalues 0.122561 ± 0.744862i of absolute value strictly smaller than λ. As a consequence, λ n will asymptotically dominate the expression, and the sequences u n , v n and w n are exponential in n.

A proof of Theorem 6.1.1

It is not difficult to see that atoms indeed are ideals (downward-closed and directed), and that Idl (X * , ≤ * ) is closed under products. Therefore, products of atoms all are ideals, and our objective is to prove the other inclusion: all ideals of (X * , ≤ * ) can be written as a finite product of atoms. Propositions 6.1.4 and 6.1.5 do not actually rely on the structure of ideals. They can be understood as:

• The complement of a filter is a finite product of atoms.

• The finite products of atoms are closed under intersections.

Let I ∈ Idl (X * , ≤ * ). Its complement ∁I is upward-closed, and can therefore be decomposed ∁I = i F i as a finite union of filters. It follows that I = ∁(∁I) = i ∁F i . The downward-closed sets ∁F i are finite unions of finite products of atoms (Proposition 6.1.4), and their intersection is also a finite union of finite product of atoms (Proposition 6.1.5). Finite products of atoms being ideals, I can be written as a finite union of ideals of (X * , ≤ * ). But since ideals are irreducible (Proposition 2.2.1), I is a finite product of atoms.

Canonical Ideal Decomposition

Note that when X is the finite alphabet {a, b}, then (a + ǫ)(a + b) * = (a + b) * , thus the representations we use for ideals are not unique. Intuitively, the expression (a + ǫ) is subsumed by (a + b) * . In general, if A is an atom and D is downward-closed in X such that A ⊆ D * , then AD * = D * A = D * . Subsequently, we show that these are the only cause of non-uniqueness: avoiding such redundancies, every ideal has a unique representation (assuming unique representations for ideals of X).

Below, we use letters such as A, P, etc to denote sequences of atoms (syntax), and corresponding letters such as A, P , etc to denote the ideals obtained by taking the product (semantic). For example if

P = (A 1 , A 2 , . . . , A n ), then P = A 1 A 2 . . . A n .
Thus it is possible to have P, Q such that P = Q but P = Q. Definition 6.1.11. A sequence of atoms A 1 , . . . , A n is said to be reduced if for all i, the following hold:

• A i = {ǫ} = ∅ * . • If i + 1 ≤ n and A i+1 is some D * , then A i ⊆ A i+1 . • If i -1 ≥ 1 and A i-1 is some D * , then A i ⊆ A i-1 .
Every ideal has a reduced decomposition into atoms, since any decomposition can be converted to a reduced one by dropping atoms which are redundant as per Definition 6.1.11. It remains to show uniqueness of the reduced representation: Theorem 6.1.12. If P and Q are reduced sequences of atoms such that P = Q, then

P = Q. Proof. By induction on |P| + |Q|. The result is trivial if |P| ≤ 1 or |Q| ≤ 1.
Otherwise, let us write P as

A 1 A 2 P ′ and Q as B 1 B 2 Q ′ . We first show that A 1 = B 1 . If A 1 ⊆ B 1 , since P ⊆ Q, the inclusion test described in Proposition 6.1.3 gives us P ⊆ B 2 Q ′ ⊆ B 1 B 2 Q ′ ⊆ P , so P = B 2 Q ′ ,

and the induction hypothesis then yields

P = B 2 Q ′ . Similarly, if B 1 ⊆ A 1 , then Q = A 2 P ′ . In particular, A 1 and B 1 cannot be incomparable, otherwise Q = B 1 B 2 Q ′ = B 1 P = B 1 A 1 A 2 P ′ = B 1 A 1 Q, which is impossible since Q and B 1 A 1 Q do not
even have the same length. Hence, B 1 must contain or be contained in A 1 . Without loss of generality, we assume B 1 ⊆ A 1 . For the sake of contradiction, let us assume that A 1 ⊆ B 1 . In that case, we have seen that P = B 2 Q ′ , which in particular implies

A 1 = B 2 . Since B 1 ⊆ A 1 = B 2 ,
and Q is reduced, B 2 cannot be of the form D * , hence is equal to I 2 + ǫ for some ideal I 2 of X. Since B 1 ⊆ B 2 , B 1 cannot be of the form D * either, and must therefore be equal to I 1 + ǫ for some ideal I 1 of X. Moreover, I 1 ⊆ I 2 . We apply Proposition 6.1.3 to the inclusion of

Q = B 1 B 2 Q ′ in P = A 1 A 2 P ′ = B 2 A 2 P ′ and we obtain that B 2 Q ′ ⊆ A 2 P ′ . From the inclusions B 2 Q ′ ⊆ A 2 P ′ ⊆ P = B 2 Q ′ , we deduce that A 2 P ′ = B 2 Q ′ , hence by induction hypothesis A 2 P ′ = B 2 Q ′ . This is impossible since P = B 2 Q ′ , which implies that P = A 2 P ′ , which contradicts P = A 1 A 2 P ′ .
We now want to show that

A 2 P ′ = B 2 Q ′ .
Since the situation is symmetric, we only prove one inclusion. We distinguish two cases.

1. If A 1 is of the form I + ǫ, then so is B 1 and Proposition 6.1.3 directly implies

A 2 P ′ ⊆ B 2 Q ′ . 2. Otherwise, A 1 is of the form D * , in which case A 2 ⊆ A 1 = B 1 , because P is reduced. Therefore, by Proposition 6.1.3, A 2 P ′ ⊆ B 2 Q ′ .
By symmetry, we obtain A 2 P ′ = B 2 Q ′ and conclude the proof with the induction hypothesis.

Concluding Remarks

Complexity In conclusion, we have shown that all of the four main set-theoretic operations (intersection of filters and ideals, complements of filters and ideals) require exponential-time, and already for rather simple WQOs: in the most common case of sequences over a finite alphabet, already three among these four operations are exponential. Only, the quasi-ordering and ideal inclusion can be decided in polynomial time.

References and Related Work

The quasi-ordering ≤ * was studied by Higman in [START_REF] Higman | Ordering by divisibility in abstract algebras[END_REF] where he proved that (X * , ≤ * ) is a WQO if and only if (X, ≤) is.

The structure of the ideals of (X * , ≤ * ) was first studied by Jullien in [START_REF] Jullien | Sur un théorème d'extension dans la théorie des mots[END_REF], in the case where X is a finite alphabet. His proof is essentially the one we sketched at the end of Section 6.1.2. His results were later generalized to any WQO X by Kabil and Pouzet in [START_REF] Kabil | Une extension d'un théorème de P. Jullien sur les âges de mots[END_REF]. They present a different proof, and further generalizations of this result to quasi-orderings that are out of scope of this thesis.

Abdulla, Bouajjani and Jonsson independently implicitly rediscovered the structure of the ideals of (A * , ≤ * ), where A is a finite alphabet, in [START_REF] Parosh | On-the-fly analysis of systems with unbounded, lossy fifo channels[END_REF]. They use the fact, due to Higman, that downward-closed languages are regular, and prove by induction over regular expressions that for every regular expression recognizing a downwardclosed language, there exists a simple regular expression (SRE) recognizing the same language, where simple regular expressions are exactly finite unions of finite products of atoms.

They also provide a linear-time algorithm to decide inclusion between downwardclosed sets represented as SREs, and they define the same normal form as ours for SREs, which is computable in quadratic-time from any other representation. In [START_REF] Abdulla | Using forward reachability analysis for verification of lossy channel systems[END_REF], Abdulla et al. prove that downward-closed sets can be represented as SREs using the same proof as the one Jullien presented in [START_REF] Jullien | Sur un théorème d'extension dans la théorie des mots[END_REF], i.e. which we generalized for any WQO X at the end of Section 6.1.2. In particular, this proof requires to express ∁ ↑ w as an SRE and to show that SREs are closed under intersection. In other terms, they essentially prove (CF) and (II).

In [START_REF] Abdulla | Using forward reachability analysis for verification of timed Petri nets[END_REF], Abdulla et al. use the WQO ((A ⊛ ) * , ≤ * ), where A is a finite alphabet, and finite multisets over A (see Section 7.1) are quasi-ordered with ≤ emb . They provide a structure to represent downward-closed sets of (A ⊛ , ≤ emb ) and ((A ⊛ ) * , ≤ * ) which is essentially the one obtained when composing results from this chapter with Section 7.1.

Here also, these results have been generalized to Noetherian spaces in [START_REF] Finkel | Forward analysis for WSTS, part I: Completions[END_REF]. The structure of the ideals then is still the same in this context.

Finally, we would like to point out that some alternative representations of downwardclosed sets are investigated, in particular in the case of finite sequences over a finite alphabet, since it is the most common case (with motivations coming from language theory). For instance in [START_REF] Karandikar | On the state complexity of closures and interiors of regular languages with subwords and superwords[END_REF], the authors represent closed sets with automata, and study the state complexity of closure operations on regular languages (represented as deterministic, non deterministic or alternating automata).

Finite Sequences under Stuttering

Let (X, ≤) be a WQO. Its sequence extension under the stuttering quasi-order (or simply stuttering extension) is (X * , ≤ st ), where X * , as before, is the set of all finite sequences from X. The quasi-ordering ≤ st over X * is defined by

x 1 . . . x n ≤ st y 1 . . . y m def ⇔ ∃f : [n] → [m] increasing . ∀i ∈ [n]. x i ≤ y f (i)
The only difference with ≤ * is that we do not require the witness f to be strictly increasing, but only increasing. For instance, if X = {a, b} is a finite alphabet, then aabbaa ≤ st aba ≤ st aabbaa but aabbaa ≤ st ab. Or with

X = N, 1 • 1 • 1 ≤ st 2. Note that even if (X, ≤) is a partial-order, (X * , ≤ st ) need not be (e.g. 2 • 2 ≤ st 2 ≤ st 2 • 2).
Another way to define this quasi-ordering is the following: define the stuttering equivalence relation ∼ st on X * as the smallest equivalence relation such that for all u, v ∈ X * and a ∈ X, uav ∼ st uaav. Informally, this equivalence does not distinguish between words which differ only in the number of times consecutive characters are repeated. Then, ≤ st =≤ * • ∼ st , where • denotes the composition of relations, as defined in Section 4.2. However, the results from Section 4.2 cannot be applied to this quasi-ordering since ≤ st = ∼ st • ≤ * . If X is a finite alphabet, this equation holds and (X * , ≤ st ) can be treated as a quotient. Also observe that ∼ st is not the same as the equivalence relation ≡ st =≤ st ∩ ≥ st induced by the quasi-ordering, even if (X, ≤) is a partial-order ≤. For instance, if a ≤ b in X, then ab ≡ st b in X * , but ab ∼ st b does not hold. However the inclusion ∼ st ⊆ ≡ st is always valid.

The Stuttering Extension is Ideally Effective

Obviously, ≤ st is an extension of ≤ * , thus ≤ st is a WQO and Section 4.1 applies. That is, the ideals of (X * , ≤ st ) are of the form ↓ ≤st I for I an ideal of (X * , ≤ * ). Moreover,

• if D is a downward-closed subset of X, then ↓ ≤st D * = D * , • if I is an ideal of (X, ≤), then ↓ ≤st (I + ǫ) = I * ,
• if P 1 and P 2 are ideals of (X * , ≤ * ) (cf. Section 6.1), then ↓ ≤st (P

1 • P 2 ) = (↓ ≤st P 1 ) • (↓ ≤st P 2 ).
Therefore, the downward closure for ≤ st of an ideal of (X * , ≤ * ) can be written as a product of atoms of the form D * , the atoms of the form (I + ǫ) being transformed into

I * . Lemma 6.2.1. Ideals of (X * , ≤ st ) are products D * 1 • • • D * n , for D i ∈ Down(X).
Assuming we have a representation for X and Idl (X), we can use the same representation of X * as before, and the lemma above suggests a simple representation for ideals of (X * , ≤ st ): as lists of downward-closed sets of (X, ≤). Theorem 6.2.2. With the above representations, the stuttering extension is an ideally effective construction. It is not polynomial-time in general. Given a polynomial-time presentation of an ideally effective WQO (X, ≤), we can compute an exponential-time presentation of (X * , ≤ st ).

Proof. Let (X, ≤) be an ideally effective WQO. Then (X * , ≤ * ) is ideally effective as well. Therefore, in the light of Theorem 4.1.2, to prove that the stuttering extension is an ideally effective construction, it suffices to show that the functions Cl I and Cl F introduced in Section 4.1 are computable in this particular context. The fact that the stuttering extension is not a polynomial-time construction follows from the complexity lower bounds presented in Section 6.2.3. To prove the last part of the theorem, i.e. that we can compute an exponential-time presentation of (X * , ≤ st ) when (X, ≤) is a polynomial-time ideally effective WQO, we rely on Lemma 4.1.3.

The function Cl I is easily shown computable using the equations above: given a product of atoms

P = A 1 • • • A n ∈ Idl (X * , ≤ * ), Cl I (P ) = ↓ ≤st P = (↓ ≤st A 1 ) • • • (↓ ≤st A n )
and the image of an atom by Cl I is obtained by Cl I (D * ) = ↓ ≤st D * = D * for D ∈ Down(X) and Cl I (I + ǫ) = I * for I ∈ Idl (X). Thus Cl I is computable in linear-time.

The function Cl F is computable as well, although less straight-forward:

given u = x 1 • • • x n ∈ X * , Cl F (u) = ↑ st u = ↑ *    y 1 • • • y k | 0 ≤ k ≤ n 0 = i 0 < i 1 < • • • < i k = n ∀j ∈ [k]. y j ∈ min( ij-1<ℓ≤ij ↑ X x ℓ )   
Intuitively, the set ranges over all ways to cut u in k pieces (factor), and embeds the i-th piece entirely into the same element y i .

Note that the expression above is the fully generic formula to describe the function Cl F for any X. Since there are exponentially many families of indexes i j to range over, this expression is computable in exponential-time. In Section 6.2.3, we show that this blow-up is unavoidable, already for a WQO as simple as N 2 . However, in simple cases, Cl F (w) takes a much simpler form and is computable in linear-time. For instance, for

X = N ordered naturally, Cl F (x 1 • • • x n ) = ↑ * ( max 1≤i≤n
x i ), and for X = A a finite alphabet, Cl F (w) = ↑ * v where v is the shortest (in length) element of the class of w for ∼ st (that is, v is the word w where we remove all stuttering). Indeed, when X is a finite alphabet, we have seen that ≤ st can be obtained as a quotient of ≤ * with the equivalence relation ∼ st . And we have seen in Section 4.2 that in the case of a quotient, Cl F simply outputs the closure of a given filter under the equivalence relation. Here, any class of ∼ st has indeed a unique minimal element for ≤ * , which is obtained from any member of the class from removing stuttering.

We now prove the correction of the above expression for the function Cl F . The right-to-left inclusion being obvious, we focus on the other inclusion. Given w ≥ st x 1 • • • x n , there exist an increasing mapping p from [n] to [|w|] such that each x i is associated to a greater element in w. Denoting the image of p by {y 1 , . . . , y k }, this entails a decomposition of w = w 0 y 1 w 1 y 2 • • • y k w k where the y i 's are in X and the w i 's in X * . Further define i j to be the greatest i such that p(i) = j (i.e. the index of the right-most symbol of x 1 • • • x n to be mapped to y j ). It follows that 0

= i 0 < i 1 < • • • < i k = n, and for all ℓ ∈ [n] and j ∈ [k], i j-1 < ℓ ≤ i j ⇒ x ℓ ≤ y j . Then w ≥ * y 1 • • • y k which
is indeed an element of the set described in the proposition.

In conclusion, the functions Cl I and Cl F introduced in Section 4.1 are computable, therefore, by Theorems 4.1.2 and 6.1.2, stuttering extension is an ideally effective construction. As mentioned at the beginning of the proof, the fact that it is not a polynomial-time construction will follow from Section 6.2.3 where we provide exponential lower bounds for several operations in (A * , ≤ st ), the stuttering extension of a finite alphabet (A, =). The latter being a polynomial-time ideally effective WQO, it proves that stuttering extension does not preserve the polynomial-time complexity of WQOs. Note that per our definition of polynomial-time construction, an exponential lower bound for only one operation of (A * , ≤ st ) would have been enough to conclude. But we provide a complete complexity analysis of a presentation of (X * , ≤ st ). Notably, in Section 6.2.2, we provide polynomial-time upper bounds when possible.

But for now, let us simply prove the last part of the theorem: let (X, ≤) be an ideally effective WQO given by a polynomial-time presentation. Let us prove that the presentation of (X * , ≤ st ) implicitly described above (through Theorem 4.1.2 is indeed exponential-time. It suffices to observe that we are in the setting of Lemma 4.1.3. Indeed, if we have a polynomial-time presentation of (X, ≤), then we can compute an exponential-time presentation of (X * , ≤ * ) using Theorem 6.1.2. Secondly, the functions Cl I and Cl F described above can obviously be computed in exponential-time. Thirdly, observe that for any u ∈ X * , every filter in the filter decomposition of Cl F (u) as an upward-closed set of (X * , ≤ * ) is of linear size in |u|: to describe Cl F (u) we used sequences y 1 • • • y k for k ≤ n whose elements y i are obtained using a polynomial number of filter intersection in the polynomial-time WQO (X, ≤). Therefore, elements y i have encodings whose size are bounded by a polynomial in the size of elements of u. Finally, the function Cl I being computable in linear time, its output is of course of linear size at most.

The four assumptions from Lemma 4.1.3 being fulfilled, we have proved that (X * , ≤ st ) has an exponential-time presentation. However, not all procedures in this presentation are actually exponential-time. We refine this statement in the next two subsections, by providing for each operation in (X * , ≤ st ) either an exponential-time lower bound (matching the upper bound we have just shown) or a polynomial-time upper bound.

Better Complexity Upper Bounds

Let (X, ≤) be a polynomial-time ideally effective WQO. In this subsection, we provide better upper bounds for the procedures of the ideally effective WQO (X * , ≤ st ).

The presentation of (X * , ≤ st ) we have given in the proof above is obtained from a presentation of (X, ≤) as a somewhat abstract composition of the proof of Theorems 6.1.2 and 4.1.2. But of course, the structure of (X * , ≤ st ) is quite simple and can be understood directly.

Notably, the quasi-ordering ≤ st can be decided using a linear number of comparison in X, searching for the left-most embedding, as we did to decide ≤ * . Similarly, ideals of (X * , ≤ st ) are in particular ideals of (X * , ≤ * ) (they are products of atoms of the form D * for D ∈ Down(X)), and thus ideal inclusion can be decided using the polynomial-time procedures given in Proposition 6.1.3. Finally, the function that maps u ∈ X * to ↓ st u is quite simple as well:

if u = x 1 • • • x n , then ↓ st u = (↓ X x 1 ) * • • • (↓ X x n ) * .
Note that there is a more abstract way to understand these three results. Looking closely at the proof of Theorem 4.1.2, one may notice that these three operations ((OD), (ID), (PI)) can be performed using only the function Cl I , which can be computed in linear-time here. Moreover, these three operations could also be performed in polynomial-time in (X * , ≤ * ) (remember we assumed (X, ≤) is a polynomial-time ideally effective WQO). Therefore it is no surprise that the composition of the two can still be performed in polynomial-time.

Next, we give a polynomial-time procedure to complement filters:

Proposition 6.2.3. (CF): X * ↑ st (x 1 • • • x n ) = (X ↑ x 1 ) * • • • (X ↑ x n ) * Proof. (⊆) Let y 1 • • • y m that is not greater than x 1 • • • x n for ≤ st . Consider f : [k] → [m] (for some k < n) the longest left-most embedding of x 1 • • • x n into y 1 • • • y m , that is x 1 • • • x k ≤ st y 1 • • • y m but x 1 • • • x k • x k+1 ≤ st y 1 • • • y m .
Since this is the left-most embedding, the elements y i for i < f (1) are not in ↑ X x 1 , and thus

y 1 • • • y f (1)-1 ∈ (∁ ↑ X x 1 ) * . Similarly, y f (1) • • • y f (2)-1 ∈ (∁ ↑ X x 2 ) * (consider this sequence to be empty if f (1) = f (2)
). And so on, up to

y f (k) • • • y m ∈ (∁ ↑ X x k+1 ) * , since otherwise we would have x 1 • • • x k • x k+1 ≤ st y 1 • • • y m .
In the end we have shown that

y 1 • • • y m ∈ (∁ ↑ X x 1 ) * • • • (∁ ↑ X x k+1 ) * ⊆ (∁ ↑ X x 1 ) * • • • (∁ ↑ X x n ) * . (⊇) Let v = v 1 • • • v n ∈ (∁ ↑ X x 1 ) * • • • (∁ ↑ X x n ) * , where v i ∈ (∁ ↑ X x i ) * for i ∈ [n]. Assume x 1 • • • x n ≤ st v, consider an embedding f : [n] → [|v|]
that witnesses this inequality and consider the function g that maps i ∈

[n] to j ∈ [n] if the f (i)- th element of the sequence v is in v j . Then, because v 1 ∈ (∁ ↑ X x 1 ) * , g(1) > 1. Moreover, g(2) ≥ g(1) > 1 but v 2 ∈ (∁ ↑ X x 2 ) * thus g(2) > 2.
And so on by induction we show that g(i) > i, which is impossible for g(n), reaching a contradiction and proving that

x 1 • • • x n ≤ st v.

Complexity Lower Bounds

Previously, we have exhibited a linear-time procedure for (CF). This proves that there might exist more efficient procedures than the one obtained by composing Theorems 4.1.2 and 6.1.2. Subsequently, we show that for the three remaining operations, namely (II), (CI) and (IF), no generic polynomial-time procedure exist. That is, asymptotically, the procedures we have obtained in Theorem 6.2.2 are optimal.

Our first observation is that, unlike in the case of (X * , ≤ * ), we won't be able to provide an exponential-lower bound in the simple case of a two-symbol alphabet. Indeed, when quotiented by ∼ st , the structure of {a, b} * is very simple: there are only two words of any given size n > 0: (ab) ( n/2) and (ba) ( n/2) if n is even, (ab) m a and (ba) m b if n = 2 * m+1. As a result, ({a, b} * , ≤ st ) is isomorphic to 0⊕(N×{a, b}, ≤ lex ). All operations are computable in polynomial-time in this WQO. We thus consider A = {a, b, c} a three-symbol alphabet, and prove that (II), (CI) and (IF) for (A * , ≤ st ) require exponential-time computations.

(II): The canonical ideal decomposition of the downward-closed set

(a * b * c * ) n ∩ (b * a * c * ) n has exponential size.
Indeed, all ideals of the form

x * 1 c * x * 2 • • • x * n c * for x i ∈ {a, b} are maximal for inclusion in (a * b * c * ) n ∩ (b * a * c * ) n .
(CI): The upward-closed set ∁(a * (b+c) * ) n has exponentially many minimal elements. Indeed, we prove that every word

x 1 ax 2 • • • x n a for x i ∈ {b, c} is a minimal element of this upward-closed set. Let u = x 1 ax 2 • • • x n a be such a word. Observe that u ∈ (a * (b + c) * ) n if and only if I def = x * 1 a * • • • x * n a * ⊆ (a * (b + c) * ) n .
This cannot be the case: there are n occurrences of a * on both sides, hence the a * must be mapped to each other. That leaves no option for x * 1 . Therefore, u ∈ ∁(a * b * c * ) n . It remains to show that u is minimal. If v is strictly smaller (for stuttering) than u, then it belongs to

I i = x * 1 a * • • • a * x * i x * i+1 a * • • • x * n a * for some i ∈ [n], or to J i = x * 1 a * • • • x * i-1 a * a * x * i+1 • • • x * n a * for some i ∈ [n].
The ideal I i is I where we removed an atom a * while J i is I where we removed the atom x * i . Now, because a * a * = a * and x * i x * i+1 ⊆ (b + c) * , all ideals I i and J i are subsets of (a * (b + c) * ) n , which proves the minimality of u.

(IF): The upward-closed set ↑ st (ac) n ∩ ↑ st (bc) n has exponentially many minimal elements. Indeed, applying Section 4.1:

↑ st (ac) n ∩ ↑ st (bc) n = Cl F ((ac) n ) ∩ Cl F ((bc) n ) = ↑ * (ac) n ∩ ↑ * (bc) n
This last set has exponentially many minimal elements (for ≤ * ): at least one per element in a n ✁ b n . Moreover, since there is no repetition of a letter in either (ac) n or (bc) n , none of these minimal elements have repetitions either (i.e. none can be written u = u 1 aau 2 or u = u 1 bbu 2 ). Thus, on these words, ≤ * and ≤ st coincide, and these exponentially many minimal elements are also minimal for ≤ st .

Finally, we provide an exponential lower bound for the function Cl F . In simple cases, namely when (X, ≤) is either (N, ≤) or a finite alphabet, the function Cl F is computable in polynomial-time as sketched in the proof of Theorem 6.2.2. We therefore look at the stuttering extension of (N 2 , ≤ × ), which is the next simplest WQO we could think of.

Proposition 6.2.4. Let w n = 0, n 1, n -1 • • • n, 0 ∈ (N 2 ) * (it
consists of all elements of N 2 whose sum is equal to n). The set ↑ st w n , where N 2 is equipped with the product ordering, has exponentially many pairwise incomparable minimal elements for ≤ * . In particular, function Cl F requires exponential-time to compute.

Proof. Applying the expression of Cl F given in the proof of Theorem 6.2.2:

↑ st w n = ↑ * n, n ∪ n-1 i=0 ↑ * i, n n, n -i -1 ∪ 0≤i<j<n ↑ * i, n -1 j, n -i -1 n, n -j -1 ∪ . . . 0≤i1<... <i k-1 <n ↑ * i 1 , n -1 i 2 , n -i 1 -1) • • • (n, n -i k-1 -1 ∪ . . . ↑ * w n
Each line in the above description corresponds to a value of k ∈ [n]: the first line corresponds to k = 1, w n is decomposed in one piece, the second line to k = 2, w n is decomposed in two pieces, etc., and the last line is obtained for k = n. We now argue that this decomposition of the upward closed set ↑ st w n is canonical. Because ≤ * is antisymmetric here, and since all of those sequences are pairwise distinct, it suffices to show that each sequence is minimal (for

≤ * ) in ↑ st w n . Let 0 < k ≤ n and i 0 = 0 < i 1 < • • • < i k-1 < i k = n, and u = Π k j=1 i j , n -i j-1 -1 = i 1 , n-1 i 2 , n-i 1 -1 • • • n, n-i k-1 -1 . We show that if v < * u then w n ≤ st v.
For any such v < * u, there exists an index 1 ≤ ℓ ≤ k such that v is smaller than some word obtained from u by replacing the ℓ-th symbol by a strictly smaller element. That is, v is smaller than some

i 1 , n-1 i 2 , n-i 1 -1 • • • i ℓ-1 , n-i ℓ-2 -1 •x• i ℓ+1 , n- i ℓ -1 • • • n, n -i k-1 -1 for some 1 ≤ ℓ < k and x < × i ℓ , n -i ℓ-1 .
But then, w n ≤ st v since letter i ℓ , ni ℓ isn't smaller than any letter in v.

Finite Sequences on a Circle

Consider a WQO (X, ≤), and define an equivalence relation ∼ cj on X * as follows: u ∼ cj v iff there exist w, t such that u = wt and v = tw. One can imagine an equivalence class of ∼ cj as a word written on an (oriented) circle instead of a line. We can now define a notion of subwords under conjugacy via ≤ cj def = ∼ cj • ≤ * , which is exactly the relation denoted c in [19, p.49]. We call the QO (X * , ≤ cj ) the conjugacy extension of the QO (X, ≤). The conjugacy extension is a WQO-preserving construction.

The Conjugacy Extension is Ideally Effective

Since ≤ * • ∼ cj = ∼ cj • ≤ * , the results from Section 4.2 apply to (X * , ≤ cj ). Notably, assuming we can represent some set X of a WQO (X, ≤) and the set Idl (X) of its ideals, we know how to represent the elements of X * (as usual) and the set of the ideals of (X * , ≤ cj ). Theorem 6.3.1. With the above representations, the conjugacy extension is an ideally effective construction. It is not polynomial-time in general. Given a polynomial-time presentation of an ideally effective WQO (X, ≤), we can compute an exponential-time presentation of (X * , ≤ cj ).

Proof. Let (X, ≤) be an ideally effective WQO. Then (X * , ≤ * ) is ideally effective as well. Therefore, in the light of Theorem 4.2.1, to prove that the conjugacy extension is an ideally effective construction, it suffices to show that the functions Cl I and Cl F defined in Section 4.2 are computable in this particular context. The fact that the conjugacy extension is not a polynomial-time construction follows from the complexity lower bounds presented in Section 6.3.2. The last part of the theorem will be trivial here.

Recall from Section 4.2 that in this context, Cl I and Cl F simply correspond to closure under ∼ cj . Notably, Cl F (↑ * w) = ↑ cj w = ↑ * w, where w denotes the equivalence class of w ∈ X * under ∼ cj . Here, the equivalence class of some w ∈ X * is given by {c (i) (w) | 1 ≤ i ≤ |w|}, where c (i) designates the i-th iterate of the cycle operator c(w

1 • • • w n ) = w 2 • • • w n w 1 ,
which corresponds to rotating the sequence i times. Thus, the function Cl F is computable in polynomial-time (linear-time if the data structure used to encode finite sequences allows to compute the cycle operator c in constant time. However, for linked lists for instance, c has a quadratic cost).

The function Cl I is similar: remember ideals of (X * , ≤ * ) are finite sequences of atoms, where atoms are either D * for some downward-closed set D of X, or I + ǫ, for I some ideal of X. Then, given P = A 1 • • • A k an ideal of (X * , ≤ * ):

Cl I (P ) = P = k i=1 c (i) (P ) • e(A i )
where e(D * ) = D * and e(I + ǫ) = ǫ, and c is here used as the cycle operator on the set of sequences over atoms. The presence of the extra e(A i ) in the above expression might become clearer when considering a simple example as P = a * b * . Indeed, aabb ∈ P , thus abba ∈ Cl I (P ).

Since the functions Cl I and Cl F are computable, by Theorem 4.2.1 and Theorem 6.1.2, the conjugacy extension is ideally effective. More precisely, from a polynomial-time presentation of (X, ≤), we can compute an exponential-time presentation of (X * , ≤ * ) from which we can compute a presentation of (X * , ≤ cj ) using Theorem 4.2.1. Moreover, since the functions Cl I and Cl F are computable in polynomial-time, the latter presentation is exponential-time as well.

As in the case of the stuttering extension, we can be a little bit more precise, and mention that we actually obtain polynomial-time procedures to decide the quasiordering ≤ cj (OD), inclusion on Idl (X * , ≤ cj ) (ID), and the principal ideal function (PI). However, for the four remaining operations, i.e. (CF), (II), (CI) and (IF), we provide in Section 6.3.2 matching exponential-time lower bounds. In particular, the conjugacy extension is not a polynomial-time construction.

Complexity Lower Bounds

Exponential lower bounds for (X * , ≤ cj ) are obtained for the same families that were used for (X * , ≤ * ).

(CF): Filters (for ≤ * ) of sequences over a finite alphabet can be complemented in polynomial time, hence, so can filters for ≤ cj (Cl F is computable in polynomialtime). Consider, as in the case of the Higman quasi-ordering, the finite ordering (X, ≤) consisting of three element 0, 1 and

1 ′ such that 0 ≤ 1, 1 ′ . Since ↑ cj 0 n+1 = ↑ * 0 n+1 , X * ↑ cj 0 n+1 = u∈(1+1 ′ ) n ↑ cj u. Moreover, given two sequences u, v ∈ X * of the same length, u ≤ cj v iff u ∼ cj v.
Thus, the canonical ideal decomposition of X * 0 n+1 is obtained by removing equivalent elements in the expression above. However, there are at most n sequences in the equivalence class of some sequence u of length n. Thus, the canonical ideal decomposition of the downward-closed set above has at least 2 n /n maximal elements.

(IF): In a similar manner, since ↑ cj a n = ↑ * a n and ↑ cj b n = ↑ * b n , the canonical filter decomposition of ↑ cj a n ∩ ↑ cj b n has exponentially many minimal elements.

(CI): Here, we again consider the same example as in Section 6.1: complementing the family of ideals ↓ cj (ab) n .

Let m ∈ N and n = 5m -1. Subsequently, we exhibit a family F elements of ↓ cj (ab) n such that at least exponentially many (in m, and thus in n) members of F are minimal in ↓ cj (ab) n .

Define the family F as the family of sequences

u = a k1 b k ′ 1 a k2 • • • a km b k ′ m such that for all i, k i ≥ 2, k ′ i ≥ 2 and m i=1 k i + k ′ i = |u| = n + m + 1. Elements of F are in X * ↓ cj (ab) n . Indeed, for p, q ∈ N, a p b q ≤ cj (ab) p+q-1 but a p b q ≤ cj (ab) p+q-2 . Thus, for u ∈ F, u ≤ cj (ab) m i=1 ki+k ′ i -m = (ab) n+1 but u ≤ cj (ab) n . It follows that all elements from F are minimal for ≤ cj in X * ↓ cj (ab) n (removing a symbol in u ∈ F would entail u ≤ cj (ab) n ).
Moreover, members of F have the same length, hence they are either equivalent under ∼ cj or incomparable with respect to ≤ cj . Since equivalence classes are of linear size in the length of the sequence, and the length of the sequences described above are linear in n, it suffices to show that F has exponentially many elements to conclude.

Observe that we can assign either (2, 3) or (3, 2) to the first m -1 pairs (k i , k ′ i ), and use the last pair to make the sum equal to n+1+m. Indeed,

m i=1 k i +k ′ i = 5(m -1) + k m + k ′ m = n -4 + k m + k ′ m . Therefore, it suffices to chose k m + k ′ m = 4 + m + 1
, which is always possible. This proves that F has at least 2 m-1 elements, among which at least 2 m-1 n+m+1 are minimal in ↓ cj (ab) n . (II): Again, the example from Section 6.1 still witnesses an exponential blow-up. We have:

D = ↓ cj (aba) n ∩ ↓ cj (bab) n = ↓ * ((aba) n ∪ (baa) n ∪ (aab) n ) ∩ ↓ * ((bab) n ∪ (abb) n ∪ (bba) n )
We know the decomposition of (aba) n ∩ (bab) n already contains exponentially many maximal sequences (see Section 6.1). These sequences are still maximal in D, since all sequences in D have length bounded by 2n. Moreover, since all these maximal sequences have same length 2n, the family remains exponential when quotiented by ∼ cj .

Chapter 7

Finite Multisets over WQOs

Given a WQO (X, ≤), we consider the set X ⊛ of finite multisets over X. Intuitively, multisets are sets where an element might occur multiple times. Formally, a multiset M ∈ X ⊛ is a function from X to N: M (x) denotes the number of occurrences of

x in M . The support of a multiset M denoted Supp(M ) is the set {x ∈ X | M (x) = 0}.
A multiset is said to be finite if its support is.

A natural algorithmic representation for these objects are lists of elements of X, but keeping in mind that a permutation of a list represents the same multiset. Formally, this means that X ⊛ is the quotient of X * by the equivalence relation ∼ defined for all u, v ∈ X * by u ∼ v iff the sequence u can be obtained by permuting the symbols in v, i.e. formally if

u = u 1 • • • u n and v = v 1 • • • v m , u ∼ v def ⇔ n = m ∧ ∃σ ∈ S n . ∀i ∈ [n]. u i = v σ(i)
where S n denotes the permutation group over [n]. In the rest of this section, we will use u to denote the closure under ∼ of some U ⊆ X * . For single words such as u ∈ X * , we will denote the equivalence class of u as {|u|}. Finite multisets are equivalence classes of sequences under ∼, and will be represented by any member of the class. For instance, if X = {a, b, c} is a finite alphabet, M = {|aac|} is the multiset such that M (a) = 2, M (c) = 1 and M (b) = 0. Its other representations are M = {|aca|} = {|caa|}. Sometimes, it will be more convenient to use the functional point of view, and we will define some multiset M by providing values M (x) for every x ∈ X. It is necessary to check that multisets defined in this fashion are finite.

Below we introduce notations for several natural operations, in particular generalizations of set-theoretic operations:

• Multiset union: (M 1 +M 2 )(x) = M 1 (x)+M 2 (x).
It is clear from that definition why we denote this operation with the symbol +, but keep in mind that this operation simply is the quotiented version of sequence concatenation, that is {|uv|} = {|u • v|} = {|u|} + {|v|} . As in the case of sequences, we lift this operation to set of multisets. Recall that if U , V are sets of sequences,

U • V = {u • v | u ∈ U , v ∈ V } .
Similarly, given S, T sets of multisets, we note

S ⊕ T = {M + N | M ∈ S, N ∈ T }. In other words, U • V = U ⊕ V .
We chose the notation ⊕ instead of overloading the symbol + in order to avoid possible confusion with set union.

• Multiset difference:

(M 1 -M 2 )(x) = max(0, M 1 (x) -M 2 (x)). • Membership: x ∈ M ⇔ x ∈ Supp(M ) ⇔ M (x) > 0.
• Inclusion:

M 1 ⊆ M 2 ⇔ ∀x ∈ X. M 1 (x) ≤ M 2 (x).
• Set intersection, or infemum:

(M 1 ∩ M 2 )(x) = min(M 1 (x), M 2 (x)).
• Set union, or supremum:

(M 1 ∪ M 2 )(x) = max(M 1 (x), M 2 (x)).
• Cardinality:

|M | = x∈X M (x), or if w ∈ X * is a member of the equivalence class M , |M | = |{|w|}| = |w|.
We will thus often refer to |M | as the length of M , or its size.

• Restriction: given Y ⊆ X, the restriction of M seen as a function to the domain Y is defined by:

M |Y (x) = M (x) if x ∈ Y 0 otherwise • Set Difference: we will write M Y for M |X Y
We will denote the empty multiset, i.e. the only multiset of empty support, by ∅.

Multisets under the Embedding Quasi-Ordering

Since X ⊛ is the quotient of X * under ∼, it is natural to quasi-order it with ≤ * • ∼. We denote by ≤ emb this quasi-ordering on X ⊛ and immediately observe that the assumption of Section 4.2 is satisfied:

≤ * • ∼ = ∼ • ≤ * .
In this particular case, we can also defined ≤ emb directly by:

{|x 1 • • • x n |} ≤ emb {|y 1 • • • y m |} def ⇔ ∃f : [n] → [m] injective s.t. ∀i ∈ [n], x i ≤ y f (i)
As in the case of words, a function f that satisfies the right-hand side of the above equivalence is said to be a witness of

{|x 1 • • • x n |} ≤ emb {|y 1 • • • y m |}.
We now study the ideal effectiveness of the construction that maps a QO (X, ≤) to the QO (X ⊛ , ≤ emb ), relying on Section 4.2.

The Finite Multiset Extension with Embedding is Ideally Effective

Theorem 7.1.1. With the generic representations introduced in Section 4.2, the finite multiset extension with embedding is an ideally effective construction. It is not polynomial-time in general. Given a polynomial-time presentation of an ideally effective WQO (X, ≤), we can compute an exponential-time presentation of (X ⊛ , ≤ emb ).

Proof. Let (X, ≤) be an ideally effective WQO. Then (X * , ≤ * ) is ideally effective as well. Therefore, in the light of Theorem 4.2.1, to prove that the finite multiset extension with embedding is an ideally effective construction, it suffices to show that the functions Cl I and Cl F introduced in Section 4.2 are computable in this particular context. The fact that this extension is not a polynomial-time construction follows from the complexity lower bounds presented in Section 7.1.3. To prove the last part of the theorem, i.e. that we can compute an exponential-time presentation of (X ⊛ , ≤ emb ) when (X, ≤) is a polynomial-time ideally effective WQO, we rely on Lemma 4.1.3.

Here, the functions Cl I and Cl F are defined as:

Cl I : Idl (X * , ≤ * ) → Down(X * , ≤ * ) P → P Cl F : (X * , ≤ * ) → Up(X * , ≤ * ) u → ↑ * u
where, as before, U is the closure under ∼ of U ⊆ X * . When u is a single sequence, u is the equivalence class of u under ∼. Although we have introduced the notation {|u|} for this equivalence class, we rather make the distinction between {|u|} ∈ X ⊛ as an element of X ⊛ and u ⊆ X * as a subset of X * . According to the definition of ∼, the equivalence class of a finite sequence u ∈ X * consists of all the possible permutations of u, that is:

x 1 • • • x n = σ∈Sn x σ(1) • • • x σ(n) Therefore, Cl F (x 1 • • • x n ) = σ∈Sn ↑ * x σ(1) • • • x σ(n) is computable.
For the function Cl I , remember ideals of (X * , ≤ * ) are finite sequences of atoms, where atoms are either D * for some downward-closed set D of X, or I + ǫ, for I some ideal of X. Observe that the atoms are already closed under ∼: for any D ∈ Down(X) and I ∈ Idl (X), D * = D * and I + ǫ = I + ǫ. Moreover, given U , V ⊆ X * set of sequences, U • V = V • U (in other words, the operator ⊕ introduced at the beginning of this chapter is commutative). It follows that given n atoms A 1 , . . . , A n , and any permutation σ ∈ S n , we have

A 1 • • • A n = A σ(1) • • • A σ(n)
. Finally, we know that given D ∈ Down(X), D * = D * • D * . Combining the two previous equations, we get that for any sequence of atoms A 1 , . . . , A n and any downward-closed set D,

D * • A 1 • A 2 • • • A n = D * • A 1 • D * • A 2 • • • D * • A n . Let P = A 1 • • • A n an ideal of (X * , ≤ * ), we define the downward-closed set of X D def = E ∈ Down(X) ∃i ∈ {1, • • • , n} : E * = A i . Moreover, define 1 ≤ i 1 < i 2 < • • • < i k ≤ n the maximal subsequence of 1, . . . , n
such that for all j, A ij is an atom of the form I + ǫ for some I ∈ Idl (X). In particular, for every i ∈ [n] such that for all j ∈ [k], i = i j , the atom A i is of the form E * for some E ∈ Down(X). Using the equations established before, we conclude that for every σ ∈ S k ,

P = D * A σ(1) D * • • • D * A σ(k) D *
and thus,

P = σ∈S k D * A σ(1) D * • • • D * A σ(k) D * = σ∈S k D * A σ(1) D * • • • D * A σ(k) D * Moreover, it is not difficult to see that σ∈S k D * A σ(1) D * • • • D * A σ(k) D * is closed under ∼,
which finally proves that:

Cl I (P ) = σ∈S k D * A σ(1) D * • • • D * A σ(k) D *
In conclusion, the functions Cl I and Cl F are computable, hence (X ⊛ , ≤ emb ) is an ideally effective WQO and the finite multiset extension with embedding is ideally effective.

However, the algorithms implicitly described above to compute the functions Cl I and Cl F run in exponential-time, since they enumerate all permutations over a set of linear size. Assuming (X, ≤) is a polynomial-time Since the procedures of the presentation of (X ⊛ , ≤ emb ) provided by Theorem 4.2.1 compose these functions Cl I and Cl F with the procedures from the exponential-time ideally effective WQO (X * , ≤ * ), the naive upper bound for these procedures on multisets is doubly-exponential. To prove that (X ⊛ , ≤ emb ) is an exponential-time WQO, we apply Lemma 4.1.3. The verification of the hypothesis of the lemma are immediate.

As in the case of the stuttering extension, we now provide a complete complexity analysis. Over the two next subsections, we provide for each of the seven operations of an ideally effective WQO either a polynomial-time algorithm or an exponentialtime lower bound. The fact that the finite multiset extension with embedding is not a polynomial-time construction follows from any of those lower bounds.

Moreover, since finite multisets are an important structure in computer science, we also provide in the next subsections a better representation of ideals of (X ⊛ , ≤ emb ) and explicit procedures for the seven operations, that is procedures that do not rely on the composition of two abstract constructions.

Better Complexity Upper Bounds

Deciding The Quasi-Ordering ≤ emb A convenient characterization of the quasi-ordering ≤ emb is obtained using Hall's Marriage Theorem. Below, we restate Hall's Theorem. It can be found in any textbook about graph theory.

Theorem 7.1.2 (Hall). Let G = (V 1 ⊔V 2 , E) be a finite bipartite graph. E contains the graph of an injection from V 1 to V 2 if and only if for every W ⊆ V 1 , |W | ≤ |N G (W )|.
Here we write N G (W ) for the neighborhood of W :

N G (W ) = {y | ∃x ∈ W. (x, y) ∈ E}.
Here is how this theorem applies to ≤ emb : Proposition 7.1.3. Let (X, ≤) be a WQO. Let M, N be two finite multisets over X. E) where (i, j) ∈ E iff x i ≤ y j . This is the bipartite graph with elements of N in one bag, elements of M in the other bag, and elements in N are linked to elements in M that are greater. Then

N ≤ emb M iff ∀S ⊆ N. |S| ≤ |M | ↑ Supp(S) | Proof. Write N = {|x 1 • • • x n |} and M = {|y 1 , . . . , y m |}. Define the bipartite graph G = ([n] ⊔ [m],
N ≤ emb M iff there is an injection f : [n] → [m] such that ∀i ∈ [n]. x i ≤ y f (i) iff there is an injection f : [n] → [m] such that ∀i ∈ [n]. (i, f (i)) ∈ E iff E contains the graph of an injection iff ∀W ⊆ [n]. |W | ≤ |N G (W )|
the last equivalence being by Theorem 7.1.2. Finally, a subset W of [n] defines a multiset S ⊆ N and N G (W ) represents exactly the sub-multiset of elements of M that are greater than some elements of S, i.e. M | ↑ Supp(S) .

From this characterization, we deduce a polynomial-time procedure to decide ≤ emb , assuming (X, ≤) is ideally effective. Corollary 7.1.4. (OD): Let (X, ≤) be a QO such that X has a representation that makes ≤ decidable. Then, the quasi-ordering ≤ emb over X ⊛ is decidable. If ≤ can furthermore be decided in polynomial-time, then ≤ emb can be decided in polynomialtime.

Proof. In a graph G = (V, E), a matching is a subset S of E such that all the edges of S have distinct ending points, that is no vertex is an ending point of two distinct edges in S. The injectivity condition in our statement of Hall's Theorem guarantees that the set of edges S = {(x, f (x)) | x ∈ V 1 } is a matching. The usual formulation of Hall's Theorem gives a necessary and sufficient condition for the existence of a matching that covers V 1 .

Given multisets N and M represented as elements of X * (cf. beginning of this chapter), consider the bipartite graph G defined in the proof of Proposition 7.1.3. When ≤ is decidable (on X), this graph is clearly computable using a quadratic number of call to a decision procedure for ≤. Therefore, if the decision procedure runs in polynomial-time, G is computable in polynomial-time. Besides, there are polynomialtime algorithms to compute the maximum size of a matching in a bipartite graph (see Ford-Fulkerson algorithm, or Hopcroft-Karp algorithm). Thus, the relation ≤ emb can be decided: it suffices to compute the maximal size of a matching in G and test whether it is equal to |N |. This last part runs in polynomial-time when G is of polynomial size in |M | + |N |, notably when ≤ can be decided in polynomial-time.

The Ideals of (X ⊛ , ≤ emb ) Let (X, ≤) be a WQO.

Following the representation chosen in Section 4.2, we have represented the ideals of (X ⊛ , ≤ emb ) as the closure under ∼ of the ideals of (X * , ≤ * ). As we have shown in the proof of Theorem 7.1.1, there are potentially exponentially many ideals of (X * , ≤ * ) that share a same closure under ∼. Indeed, recall that for any sequence of atoms A 1 , . . . , A n and any σ ∈ S n ,

A 1 • • • A n = A σ(1) • • • A σ(n) .
We are going to define a canonical representation for ideals of (X ⊛ , ≤ emb ) which is furthermore computable from any other representation when (X, ≤) is ideally effective. This canonical representation will notably allow us to design an efficient inclusion test for ideals. Recall that the inclusion test provided by the proof of Theorem 7.1.1 works as follows: given two ideals P , Q ∈ Idl (X * , ≤ * ), we check whether P ⊆ Q by checking whether P ⊆ Cl I (Q), and we have seen that in general, the function Cl I is costly. Our canonical representation will allow to test for inclusion without using Cl I .

Let P be an ideal of (X ⊛ , ≤ emb ), where P = A 1 • • • A n is some ideal of (X * , ≤ * ).

P = A 1 • • • A n = n i=1 A i by definition of ⊕ = 1≤i≤n Ai=E * E * ⊕ 1≤i≤n Ai=I+ǫ (I + ǫ)
This last step consists in grouping atoms per kind, as we did in the proof of Theorem 7.1.1. Recall that the atoms of the form E * for E ∈ Down(X) are closed under ∼, and thus E * = E * . However, as the notation ⊕ suggests, we want to stress that we are in the world of multisets (X ⊛ = X * / ∼) and not of finite sequences. Therefore, we rather write E * = E ⊛ . As before, we introduce D to be the union of subsets E ∈ Down(X) such that E * is an atom of P , so that 1≤i≤n

Ai=E * E ⊛ = D ⊛ . Now, given a finite multiset M ∈ X ⊛ such that M ∈ P , by definition of ⊕, there exist M 1 , M 2 ∈ X ⊛ such that M = M 1 + M 2 , M 1 ∈ D ⊛ and M 2 ∈ 1≤i≤n Ai=I+ǫ (I + ǫ). (7.1)
As before, let A i1 , . . . , A i k the atoms of P of the form I + ǫ for I ∈ Idl (X), and more precisely, write A i k = I i k + ǫ. Moreover, write M 2 = {|x 1 . . . x p |} for some p ∈ N. Equation 7.1 reformulates as {|x 1 . . . x p |} ∈ k j=1 I ij + epsilon. Then, a little combinatorics shows:

{|x 1 • • • x p |} ∈ k j=1 (I ij + ǫ) iff ∃f : [p] → [m] injective s.t.∀i ∈ [p]. x i ∈ I f (i)
Note that this last expression is very similar to the definition ≤ emb , but with ∈ used instead of ≤. This motivates the following notation:

{|x 1 • • • x p |} ∈ emb {|I 1 • • • I m |} def ⇔ ∃f : [p] → [m] injective s.t.∀i ∈ [p]. x i ∈ I f (i)
Note that the right-hand side is a finite multiset of ideals of X. Denoting B = {I i1 • • • I i k } ∈ Idl (X) ⊛ the multisets of all ideals I ij that appear in P (with multiplicity), we have proved that P = ↓ ∈ B ⊕ D ⊛ , where as expected,

↓ ∈ B = {M ∈ X ⊛ | M ∈ emb B}.
Theorem 7.1.5. Let (X, ≤) be a WQO. Then:

Idl (X ⊛ , ≤ emb ) = {↓ ∈ B ⊕ D ⊛ | B ∈ Idl (X) ⊛ , D ∈ Down(X)} where ↓ ∈ B = {M ∈ X ⊛ | M ∈ emb B} and ∈ emb is defined as ≤ emb , but using ∈ instead of ≤.
Before proving this theorem, we would like to present a convenient characterization of ↓ ∈ B ⊕ D ⊛ that will be constantly used throughout this section. Given B ∈ Idl(X) ⊛ a multiset of ideals of X and D ∈ Down(X) a downward-closed set of X:

↓ ∈ B ⊕ D ⊛ = {M 1 + M 2 | M 1 ∈ emb B ∧ M 2 ∈ D ⊛ } = {M | M D ∈ emb B} Indeed, if M is such that M D ∈ emb B, then define M 1 = M D and M 2 = M |D to satisfy M = M 1 + M 2 ∈ ↓ ∈ B ⊕ D ⊛ . For the other direction, for any decomposition M = M 1 + M 2 satisfying M 1 ∈ emb B and M 2 ∈ D ⊛ , M 2 must be a sub-multiset of M |D , and thus M D ⊆ M 1 . It is thus obvious that M D ∈ emb B.
We are now ready to prove Theorem 7.1.5.

Proof. We know from Section 4.2 that ideals of (X ⊛ , ≤ emb ) are exactly the subsets P for P ∈ Idl (X * , ≤ * ). We have shown above how for any ideal P ∈ Idl (X * , ≤ * ), P is of the desired form. Conversely, observe that given D ∈ Down(X) and

{|I 1 • • • I k |} ∈ Idl (X) ⊛ , we have ↓ ∈ B ⊕ D ⊛ = (I 1 + ǫ) • • • (I k + ǫ) • D * .
Alternatively, we can also check "by hand" that ↓ ∈ B⊕D ⊛ is an ideal of (X ⊛ , ≤ emb ):

• Downward-closed: let M ∈ ↓ ∈ B⊕D ⊛ , and N ≤ emb M . Since D is downwardclosed, N D ≤ emb M D (a witness can be obtained by restricting a witness for N ≤ emb M ). Moreover, composing the embeddings witnessing

N D ≤ emb M D and M D ∈ emb B, we obtain N D ∈ emb B (elements of B are downward-closed); hence N ∈ ↓ ∈ B ⊕ D ⊛ . • Directed: let M, N ∈ ↓ ∈ B ⊕ D ⊛ . Write B = {|I 1 • • • I k |}. Define P = M |D + N |D + {|z 1 • • • z k |}
where for all i ∈ [k], z i is greater than every element of M and N that belong to I i . Such an element z i exists since I i is directed, and M and N are finite. Obviously, P ∈ ↓ ∈ B ⊕ D ⊛ and M, N ≤ emb P .

Observe that this representation of ideals is not unique: for instance with X = N,

↓ ∈ {| ↓ 3 • ↓ 1|} ⊕ (↓ 2) ⊛ = ↓ ∈ {| ↓ 3|} ⊕ (↓ 2) ⊛ . This form of ideals of (X ⊛ , ≤ emb )
is not yet canonical. But already for ideals of this form, we get an efficient inclusion test (cf. Corollary 7.1.7). Proposition 7.1.6. Let (X, ≤) be a WQO. Let B 1 , B 2 ∈ Idl (X) ⊛ and D 1 , D 2 ∈ Down(X).

↓ ∈ B 1 ⊕ D ⊛ 1 ⊆ ↓ ∈ B 2 ⊕ D ⊛ 2 iff D 1 ⊆ D 2 and B 1 Down(D 2 ) ⊆ emb B 2 Proof. Write B = B 1 Down(D 2 ) = {|I 1 • • • I n • ↓ y 1 • • • ↓ y m |}
, where I 1 , . . . , I n are limit ideals (i.e. those that are not principal), and y 1 , . . . , y m ∈ X.

(⇒) For any x ∈ D 1 , the multiset with

|B 2 | + 1 copies of x is in ↓ ∈ B 1 ⊕ D ⊛ 1 , hence it must be in ↓ ∈ B 2 ⊕ D ⊛ 2 . However M ∈ emb B 2 implies |M | ≤ |B 2 |, thus x must be in D 2 , proving D 1 ⊆ D 2 . If n = 0, then {|y 1 • • • y m |} ∈ ↓ ∈ B 1 ⊕ D ⊛ 1 ⊆ ↓ ∈ B 2 ⊕ D ⊛ 2 with y i / ∈ D 2 by definition, entailing {|y 1 • • • y m |} ∈ emb B 2 . This proves B ⊆ emb B 2 .
Otherwise, n = 0 and the set

A = {{|x 1 • • • x n • y 1 • • • y m |} | ∀i. x i ∈ I i D 2 } is infinite, included in ↓ ∈ B 1 ⊕ D ⊛ 1 ⊆ ↓ ∈ B 2 ⊕ D ⊛ 2 and

the only way to have

A ⊆ ↓ ∈ B 2 ⊕ D ⊛ 2 is if ∀M ∈ A, M ∈ emb B 2 . Now consider the set of embeddings from [n + m] to [|B 2 |],
it is finite, hence infinitely many memberships are witnessed by a same embedding f . It is easy to see that f witnesses

B ≤ emb B 2 . (⇐) Let M ∈ ↓ ∈ B 1 ⊕ D ⊛ 1 . Since D 1 ⊆ D 2 , M D 2 ≤ emb M D 1 . Moreover, M D 1 ∈ emb B 1 , and therefore M D 2 ∈ emb B, by definition of B. We conclude M D 2 ∈ emb B 2 .
Corollary 7.1.7. If (X, ≤) is a polynomial-time ideally effective WQO, then inclusion of ideals of (X ⊛ , ≤ emb ) is decidable in polynomial-time.

Proof. If (X, ≤) is a polynomial-time WQO, then we can compare downward-closed sets of (X, ≤) in polynomial-time. Moreover, Corollary 7.1.4 applied to the QO (Idl (X), ⊆) entails that ⊆ emb can be tested in polynomial-time.

Besides, given P an ideal of (X * , ≤ * ), we can compute in polynomial-time D and B such that P = ↓ ∈ B ⊕ D ⊛ , following the implicit procedure described before Theorem 7.1.5. Then, the right-hand side of Proposition 7.1.6 can be tested in polynomial-time.

Although we have just seen that rewriting ideals of (X ⊛ , ≤ emb ) under the form ↓ ∈ B ⊕ D ⊛ is enough to get an efficient inclusion test, it is not difficult from there to get an actual canonical form. Definition 7.1.8. Let (X, ≤) be a WQO. Given B ∈ Idl (X) ⊛ and D ∈ Down(X), we say that the pair (B, D) is reduced if for every I ∈ B, I ⊆ D. Proposition 7.1.9. Let (X, ≤) be a WQO and I be an ideal of (X ⊛ , ≤ emb ). Then there exist a unique B ∈ Idl (X) ⊛ and a unique D ∈ Down(X) such that (B, D) is reduced and I = ↓ ∈ B ⊕ D ⊛ . We say that (B, D) is the canonical representation of I. When (X, ≤) is an (polynomial-time) ideally effective WQO, this unique reduced pair is computable (in polynomial-time) from any other pair Of course, ideals and downward-closed sets of X might not have unique encodings, thus canonical representations might also have several encodings at the lowest level.

(B ′ , D ′ ) such that ↓ ∈ B ′ ⊕ D ′⊛ = I. Proof. Uniqueness: if ↓ ∈ B 1 ⊕ D ⊛ 1 = ↓ ∈ B 2 ⊕ D ⊛

Explicit Expressions and Complexity Lower Bounds

In this section, we explicitly describe procedures to complement filters and ideals, and intersect filters and ideals, without relying on Section 4.2. For each of these four operations, we also provide exponential-time lower bounds. Observe that for a finite alphabet A, (A ⊛ , ≤ emb ) is isomorphic to (N |A| , ≤ × ). Thus, we have to turn to more complex WQOs to provide exponential lower bounds.

To increase readability of the proposition of this section, we will use the symbol × to denote iteration of multiset addition, i.e.

n × M = M + • • • + M n times
. We also extend the definitions of ∈ emb and ↓ ∈ to multisets B ∈ Down(X) ⊛ of downward-closed sets of X (instead of ideals). In this case,

↓ ∈ B ⊕ D ⊛ is not an ideal of (X ⊛ , ≤ emb ), but it is downward-closed. Besides, if B = {|D 1 , . . . , D m |} and for all i, D i = ni j=1 I i,j , then ↓ ∈ B ⊕ D ⊛ = j1∈[n1] ••• jm∈[nm] ↓ ∈ {|I 1,j1 • • • I m,jm |} ⊕ D ⊛
Thus, when a downward-closed set D of (X ⊛ , ≤ emb ) is given as a union of such sets ↓ ∈ B ⊕ D ⊛ , it is possible to compute the actual ideal decomposition of D. Note however that the ideal decomposition of ↓ ∈ B ⊕ D ⊛ in this setting is polynomial in

|D i | but exponential in m.
Complementing Filters (CF) Proposition 7.1.10. Let M be a multiset over X,

X ⊛ ↑ M = S⊆Supp(M ) S =∅ ↓ ∈ {| X • • • X |M |S |-1 times |} ⊕ [X ↑ S] ⊛
The above expression is computable, using (XI) and (CF) for X. However, it requires exponential-time to enumerate all the subsets of M . This enumeration is shown to be unavoidable in the next proposition.

Note that X may not be an ideal, in which case the actual ideal decomposition is obtained by distributing the ideal decomposition of X as described at the beginning of this subsection.

Proof. For T ⊆ M , define the downward-closed set

D(T ) = ↓ ∈ {| X • • • X |T |-1 times |} ⊕ [X ↑ Supp(T )] ⊛ N ∈ X ⊛ ↑ M iff M ≤ emb N iff ∃T ⊆ M. |T | > |N | ↑ Supp(T ) | (negating Proposition 7.1.3) iff T ⊆M T =∅ |N | ↑ Supp(T ) | ≤ |T | -1 iff N ∈ T ⊆M T =∅ D(T ) Now for T ⊆ M , let S = Supp(T ), it is obvious that T ⊆ M |S and D(T ) ⊆ D(M |S ).
We can thus restrict the union above to the union described in the proposition. Proposition 7.1.11. There exists an ideally effective WQO (X, ≤) such that the expression provided in Proposition 7.1.10 is canonical. In particular, complementing filters of (X ⊛ , ≤ emb ) requires exponential-time.

Proof. Our goal is to provide a WQO X and an infinite family (M n ) n∈N such that for any n ∈ N and any S, T ⊆ M n , D(S) and D(T ) are incomparable (for inclusion), provided S = T .

One can check that this is not the case for X = N. Indeed, as soon as M has at least two ordered elements n 1 ≤ n 2 , D({|n 1 |}) ⊆ D({|n 1 , n 2 |}). Since elements of N are linearly-ordered, we can prove:

N ⊛ ↑ M = ↓ ∈ {| X • • • X |M |-1 times |}] ⊕ [↓ min(M ) -1] ⊛
We thus take X = N 2 (which is an ideal), and define M n = {| 0, n 1, n -1 • • • n, 0 |}. Now let S and T be two distinct subsets of M n , we show that D(S) ⊆ D(T ).

• If |S| ≤ |T |, but S = T , there exists x ∈ Supp(T ) Supp(S), and since elements of M n are pairwise incomparable, x / ∈ ↑ Supp(S). This proves that ∁ ↑ Supp(S) ⊆ ∁ ↑ Supp(T ), and by Proposition 7.1.6, D(S) ≤ emb D(T ).

• If |S| > |T | then D(S) ≤ emb D(T ) since there are too many copies of X in D(S).

Notice that we have actually proved that our expression for X ⊛ ↑ M is canonical if and only if M is an antichain.

This proposition claims that it suffices to take the union over subsets S of Supp(B) that induce a connected graph G(S). Now in the case of N, ideals of B can be sorted, and it suffices to consider subsets S ⊆ Supp(B) that are convex in the following sense: if I, J ∈ S and K ∈ B such that I ⊆ K ⊆ J, then K ∈ S as well. It is obvious that subsets S that are not convex induce a non connected graph G(S). Thus it suffices to take the union over convex subsets. Moreover, there are only a quadratic (in |B|) number of convex subsets of Supp(B). Besides, since filters of N have at most one minimal elements, the expression builds at most one multiset per subset S ⊆ Supp(B). Therefore,

N ⊛ ↓ ∈ B ⊕ D ⊛ is computable in quadratic-time. Proof. Let S ⊆ Supp(B) and M such that Supp(M ) ⊆ U S,B,D and |M | = |B |S | + 1. We show that if G(S) is not connected then M is not minimal in X ⊛ ↓ ∈ B ⊕ D ⊛ .
First of all, Supp(M ) ⊆ X (D ∪ B S). Besides, if there exists some x ∈ M such that x ∈ X (D ∪ B), then {|x|} ≤ emb M and {|x|} / ∈ ↓ ∈ B ⊕ D ⊛ . This implies that M is not minimal, except if |M | = 1, which would imply S = ∅ ∅ ∅, which would imply G(S) is connected, which is a contradiction. We can now assume that Supp(M ) ⊆ S.

Take S 1 ⊔ S 2 a non-trivial partition of S such that S 1 × S 2 ∩ E = ∅, i.e. for all (I, J) ∈ S 1 × S 2 , I ∩ J (D ∪ B S) = ∅. Hence, for every x ∈ M , either x ∈ S 1 or x ∈ S 2 , the two options being mutually exclusive.

Define

M i = M | Si for i = 1, 2. In particular, M = M 1 + M 2 . Moreover, M i ∈ emb B implies M i ∈ emb B |Si . It is thus impossible that both M 1 and M 2 belong to ↓ ∈ B ⊕ D ⊛ : it would imply M = M 1 + M 2 ∈ ↓ ∈ B ⊕ D ⊛ . Without

Intersecting Filters (IF) and Ideals (II)

We now present procedures to intersect filters and ideals of (X ⊛ , ≤ emb ). To emphasize the similarities between these two operations, we gather their description in a same proposition. Remember S n stands for the group of permutations over [n]. The occurrence of S n in the next formulas is no surprise, since S n is at the heart of the equivalence relation ∼ from which multisets are built, and thus at the heart of functions Cl F and Cl I . Yet, the two following formulas are less redundant than the expression one would directly get applying Section 4.2. Proposition 7.1.14. Given M, N ∈ X ⊛ , B ∈ Idl (X) ⊛ and D ∈ Down(X):

(IF): Intersection of filters:

↑ M ∩ ↑ N = ↑ P + M 2 + N 2 M = M 1 + M 2 , |N 1 | = |M 1 | N = N 1 + N 2 , P ∈ M 1 ∩ N 1
where

{|x 1 • • • x k |} ∩ {|y 1 • • • y k |} = {{|z 1 • • • z k |} | ∃σ ∈ S k . ∀i ∈ [k]. z i ∈ min(↑ x i ∩ ↑ y σ(i) )}
(II): Intersection of ideals:

↓ ∈ B ⊕ D ⊛ ∩ ↓ ∈ C ⊕ E ⊛ = B=B1+B2 C=C1+C2 |B1|=|B2| ↓ ∈ [B 1 ∩ C 1 + B 2 ⊓ E + C 2 ⊓ D] ⊕ (D ∩ E) ⊛
where

{|I 1 • • • I k |} ∩ {|J 1 • • • J k |} = σ∈S k {|(I 1 ∩ J σ(1) ) • • • (I k ∩ J σ(k) )|} and {|I 1 • • • I k |} ⊓ D = {|(I 1 ∩ D) • • • (I k ∩ D)|}
These expressions are computable in exponential-time (enumeration of n! and m! permutations). Here again, it is unavoidable in general, which is proved thereafter in Proposition 7.1.15.

Proof.

(IF): (⊇) It is immediate that every multiset P + M 2 + N 2 obtained as described in the proposition embeds both M and N .

(⊆) Let Q ∈ ↑ M ∩ ↑ N . There exist decompositions Q = Q 1 + Q 2 + Q 3 + Q 4 , M = M 1 + M 2 and N = N 1 + N 2 such that: -|M 1 | = |N 1 | = |Q 1 | and M 1 ≤ emb Q 1 and N 1 ≤ emb Q 1 -|M 2 | = |Q 2 | and M 2 ≤ emb Q 2 -|N 2 | = |Q 3 | and N 2 ≤ emb Q 3
Indeed, fix two embeddings f and g witnessing M ≤ emb Q and N ≤ emb Q.

Then take Q 1 to be the intersection of the images of f and g, while Q 2 is what remains of the image of f and Q 3 what remains of the image of g. Finally, Q 4 is what is outside both those images. Now, by the first condition, Q 1 must be greater than some P ∈ M 1 ∩ N 1 , and thus

P + M 2 + N 2 ≤ emb Q 1 + Q 2 + Q 3 ≤ emb Q. (II): (⊇) Given decompositions B = B 1 + B 2 , C = C 1 + C 2 with |B 1 | = |C 1 |, we show ↓ ∈ [B 1 ∩ C 1 + B 2 ⊓ E + C 2 ⊓ D] ⊕ (D ∩ E) ⊛ ⊆ ↓ ∈ B ⊕ D ⊛ using Proposition 7.1.6. The inclusion in ↓ ∈ C ⊕ E ⊛ is analogous. We have B 1 ∩ C 1 ⊆ emb B 1 and B 2 ⊓ E ⊆ emb B 2 , thus (B 1 ∩ C 1 + B 2 ⊓ E + C 2 ⊓ D) Down(D) ⊆ emb B 1 ∩ C 1 + B 2 ⊓ E ⊆ emb B 1 + B 2 = B Moreover, D ∩ E ⊆ D. (⊆): Let M ∈ ↓ ∈ B ⊕ D ⊛ ∩ ↓ ∈ C ⊕ E ⊛ . Define M 1 = M (D ∪ E), M 2 = M (D ∪ ∁E), M 3 = M (∁D ∪ E). Thus, M (D ∩ E) = M 1 + M 2 + M 3 . Moreover, M 1 + M 2 = M D ∈ emb B, hence we can decompose B in B 1 + B 2 such that M 1 ∈ emb B 1 , M 2 ∈ emb B 2 and |M 1 | = |B 1 |. Respectively, M 1 + M 3 = M E ∈ emb C and we define C 1 and C 2 similarly. Therefore, |B 1 | = |M 1 | = |C 1 | and M 1 ∈ emb B 1 ∩ C 1 . Moreover, Supp(M 2 ) ⊆ E and M 2 ∈ emb B 2 , thus M 2 ∈ emb (B 2 ⊓ E). Similarly M 3 ∈ emb (C 2 ⊓ D), which concludes the proof.
We now prove a lower bound matching the exponential upper bound given above. We show that intersections of filters and ideals are already exponential in (N 2 ⊛ , ≤ emb ). As stated above, it is obviously polynomial in (A ⊛ , ≤ emb ), if A is a finite alphabet. It is also polynomial in (N ⊛ , ≤ emb ), which will be proved in Proposition 7.1.16.

Proposition 7.1.15. Let (X, ≤) = (N 2 , ≤ × ) and n = 2m + 1 be an odd integer.

Define M n = {| n -1, 0 • n -2, 1 • • • m, m |} = m i=0 {| n -i -1, i |} and N n = {| 0, n -1 • 1, n -2 • • • m, m |} = m i=0 {| i, n -i -1 |}. Then: (IF): The upward-closed set ↑ M n ∩ ↑ N n has exponentially many (in n) minimal ele- ments.
(II): The downward-closed set ↓ M n ∩ ↓ N n has exponentially many (in n) maximal elements.

It follows that both these operations require exponential-time computations.

Proof. Recall from Section 5.

M ↑ σ = m i=0 {| max(n -i -1, σ(i)), max(i, n -σ(i) -1) |} M ↓ σ = m i=0 {| min(n -i -1, σ(i)), min(i, n -σ(i) -1) |}
We now argue that multisets M ↑ σ are minimal elements of ↑ M n ∩ ↑ N n and M ↓ σ are maximal elements of ↓ M n ∩ ↓ N n . This concludes the proof since these two families are exponential in n.

The multisets M ↑ σ are obviously members of ↑ M n ∩ ↑ N n . Assume they are not minimal, then there exists a multiset P strictly smaller than some M ↑ σ which is in ↑ M n ∩ ↑ N n . There are two possibilities for P to be strictly smaller: either it is shorter, i.e.

|P | < |M ↑ σ | = m + 1 but then M n ≤ emb P is impossible since |M n | = m + 1. Or P ≤ emb M ↑
σ -{|x|} + {|xe j |} for some x ∈ M ↑ σ and some j = 1, 2 where e 1 = 1, 0 and e 2 = 0, 1 . Without loss of generality, assume j = 0. Besides, x = max(ni -1, σ(i)), max(i, nσ(i) -1) for some i ∈ [0, m]. Depending on whether i ≥ nσ(i) -1 this will either violates M n ≤ emb P or N n ≤ emb P considering the number of elements greater than max(i, n-σ(i)-1) in M n or N n . Proposition 7.1.16. There are polynomial-time procedures to intersect filters and ideals of (N ⊛ , ≤ emb ).

Proof.

(IF): Observe that since (N, ≤) is linear, multisets of N ⊛ can be sorted. In particular, if

M = {|x 1 • • • x n |} and N = {|y 1 • • • y m |} with x 1 > x 2 > • • • > x n and y 1 > y 2 > • • • > y m and n < m then M ≤ emb N if and only if ∀i ∈ [n]. x i ≤ y i . Moreover, notice that if |M | ≤ |N |, then ↑ M ∩ ↑ N = ↑(M + (|N | -|M |) × {|0|}) ∩ ↑ N , i.e.
we can pad the shortest multiset with zeros. We can thus restrict our attention to multisets of the same length.

Given M = {|x 1 • • • x n |} and N = {|y 1 • • • y n |} with x 1 > x 2 > • • • > x n and y 1 > y 2 > • • • > y n , ↑ M ∩ ↑ N = ↑{| max(x 1 , y 1 ) • • • max(x n , y n )|} Indeed, if {|z 1 • • • z p |} ∈ ↑ M ∩ ↑ N with z 1 > z 2 > • • • > z p , then using the observation above, z i ≥ max(x i , z i ) for i ∈ [n].
(II): Here also, ideals of N are linearly ordered on the one hand, and ideals can be padded on the other hand. That is, we can restrict our attention to intersections

↓ ∈ B ⊕ D ⊛ ∩ ↓ ∈ C ⊕ E ⊛ of
ideals of the following shape:

• B = {|I 1 • • • I n |} with I 1 ⊇ I 2 ⊇ • • • ⊇ I n , • C = {|J 1 • • • J m |} with J 1 ⊇ J 2 ⊇ • • • ⊇ J m ,
• We can assume m = n: assume otherwise suppose without loss of generality that |B| < |C|. We distinguish two cases:

-Either D = ∅, in which case D is an ideal (all downward-closed sets of N are ideals, except ∅), in which case B can be padded with copies of D (cf. proof of Definition 7.1.8):

↓ ∈ B ⊕ D ⊛ = ↓ ∈ [B + (|C| -|B|) × {|D|}] ⊕ D ⊛ . -Or D = ∅, in which case all multisets M ∈ ↓ ∈ B ⊕ D ⊛ have length bounded by n = |B|. Thus ↓ ∈ B ⊕ D ⊛ ∩ ↓ ∈ C ⊕ E ⊛ = ↓ ∈ B ⊕ D ⊛ ∩ (N ≤n ∩ ↓ ∈ C ⊕ E ⊛ ) = ↓ ∈ B ⊕ D ⊛ ∩ ↓ ∈ {|J 1 • • • J n |} ⊕ E ⊛
where N ≤n designates the set of multisets of length at most n of N. Indeed, for a multiset of length bounded by n to be in ↓ ∈ C ⊕ E ⊛ , only the n greatest ideals of C are relevant. • For all I ∈ B, D ⊆ I: this is a weak form of the canonical form described in Definition 7.1.8. Indeed, assuming canonical form for the ideal ↓ ∈ B ⊕ D ⊛ would entail that for all I ∈ B, I ⊆ D, i.e. D I. But because of the previous step of padding, it might be the case that D ∈ B.

• Similarly, for all J ∈ C, E ⊆ J.

It is clear that from any two ideals I, J of (N ⊛ , ≤ emb ) we can produce in polynomial-time two ideals (I ′ , J ′ ) that have the specific form described above, and such that I ∩ J = I ′ ∩ J ′ . Now, for ideals ↓ ∈ B ⊕ D ⊛ and ↓ ∈ C ⊕ E ⊛ satisfying the above conditions, we have:

↓ ∈ B ⊕ D ⊛ ∩ ↓ ∈ C ⊕ E ⊛ = ↓ ∈ {|(I 1 ∩ J 1 ) • • • (I n ∩ J n )|} ⊕ (D ∩ E) ⊛
We prove this equation by induction on n. The base case is trivial since

D ⊛ ∩ E ⊛ = (D ∩ E) ⊛ .
For the inductive case, let x ∈ N and M ∈ N ⊛ such that x ≥ y for all y ∈ M , and let I ∈ Idl (N) and B ∈ Idl (N) ⊛ such that I ⊇ K for any K ∈ B, and let J ∈ Idl (N) and C ∈ Idl (N) ⊛ such that J ⊇ K for any K ∈ C. Finally, let D, E ∈ Down(N) and assume that |B| = |C|, that D ⊆ K for any K ∈ B and that E ⊆ K for any K ∈ C. We have:

{|x|} + M ∈ ↓ ∈ [{|I|} + B] ⊕ D ⊛ ∩ ↓ ∈ {|J|} + C ⊕ E ⊛ ⇔ x ∈ I ∩ J ∧ M ∈ ↓ ∈ B ⊕ D ⊛ ∩ ↓ ∈ C ⊕ E ⊛
Left to right implication follows from the fact I and J are greater than ideals from B and C, and greater than D and E. Right to left implication holds since x is greater than any elements of M . Now by induction hypothesis, M is in

↓ ∈ {|(I 1 ∩ J 1 ) • • • (I n ∩ J n )|} ⊕ (D ∩ E) ⊛ , assuming B = {|I 1 • • • I n |}
where elements are sorted, and similarly for C. Thus this is equivalent to {|x|}

+ M ∈ ↓ ∈ {|(I ∩ J) • (I 1 ∩ J 1 ) • • • (I n ∩ J n )|} ⊕ (D ∩ E) ⊛ .

Related Work

The WQO (X ⊛ , ≤ emb ) appears naturally to order configurations of some Petri Net extensions. The structure of its ideals and its ideally effectiveness are used in [START_REF] Abdulla | Using forward reachability analysis for verification of timed Petri nets[END_REF] for a forward algorithm to semi-decide reachability in timed Petri Nets, and in [START_REF] Lazić | The complexity of coverability in ν-Petri nets[END_REF] to derive tight complexity upper bounds of the coverability problem for ν-Petri Nets. In the first case, (X, ≤) is a finite alphabet, while in the second case it is (N k , ≤ × ).

Here also, these results have been generalized to Noetherian spaces in [START_REF] Finkel | Forward analysis for WSTS, part I: Completions[END_REF].

Multisets under the Manna-Dershowitz Ordering

Let (X, ≤) be a WQO such that ≤ is antisymmetric. Such an ordering is often called well partial-order, abbreviated WPO. The multiset ordering N ≤ ms M , on the set X ⊛ of finite multisets over (X, ≤ ), has been introduced by Manna and Dershowitz in 1979 in the context of proving termination for rewriting systems ( [START_REF] Dershowitz | Proving termination with multiset orderings[END_REF]). It is also called domination ordering, or the multiset extension of < (all terms would induce a risk of confusion with the quasiorderings of Section 7.1).

It is known that (X ⊛ , ≤ ms ) is a linear ordering whenever (X, ≤) is. More precisely, if (X, ≤) is isomorphic to some ordinal α, then (X ⊛ , ≤ ms ) is isomorphic to ω α .

Before we give the formal definition of ≤ ms , let us introduce some notations. Operations + andon multisets introduced at the beginning of this chapter, do not act as inverse, and in particular are not associative (as in the case of N). For instance (A + B) -C = A + (B -C). Subsequently, we adopt the convention of a leftassociation, i.e. we write

A + B -C for (A + B) -C. With this convention for instance, A + B -C = A -(C -B) + (B -C).
Definition 7.2.1. The multiset ordering is equivalently defined by one of the following statements. The second formulation is the original definition, while the first one comes from [START_REF] Huet | Equations and rewrite rules: a survey[END_REF].

(Def 1) ∀x ∈ X. N (x) > M (x) ⇒ (∃y > x. M (y) > N (y)) (Def 2) ∃S, T ∈ X ⊛ . S ⊆ M ∧ N = M -S + T ∧ S dominates T
where a multiset S dominates another multiset T if ∀x ∈ T ∃y ∈ S. x < y, see [START_REF] Dershowitz | Proving termination with multiset orderings[END_REF].

(Def 3) M -N dominates N -M (Def 4) N = {|x 1 • • • x n |}, M = {|y 1 • • • y m |}, ∃f : [n] → [m] : ∀i ∈ [n]. ((x i < y f (i) ) ∨ (x i ≤ y f (i) ∧ ∀j = i. f (j) = f (i))).
Intuitively, N ≤ ms M if N embeds in M as in the previous section, but we don't require that the embedding is injective when an element is mapped to a strictly greater element.

Proof. Equivalence between the four definitions.

First observe that for any two multisets M and N , we have N = M -(M -N ) + (N -M ) (with implicit left parenthesizing). Implication (3) ⇒ (2) directly follow from this observation.

(1) ⇒ (3) Let M and N as in the first definition. Let x in N -M . Since 0 < max(0, N (x) -M (x)), we have N (x) > M (x). According to the first definition, this implies that there exists y > x with M (y) > N (y), which means y ∈ M -N . This shows M -N dominates N -M .

(2) ⇒ (1) Assume N = M -S + T with S ⊆ M and S dominates T . Let x ∈ X such that N (x) > M (x), that is M (x) -S(x) + T (x) > M (x), i.e. T (x) > S(x). In particular, x ∈ T , hence there exists y ∈ S such that x < y. Take y maximal in S with this property (S is finite), then T (y) = 0. Indeed, if not, there must be z ∈ S with z > y, which contradicts the maximality of y. Now since T (y) = 0, N (y) = M (y) -S(y) < M (y) since y ∈ S, which proves N ≤ ms M for the first definition.

(2) ⇒ (4) Let N ≤ ms M according to the second definition, there are S, T ∈ X ⊛ such that S ⊆ M , N = M -S + T and S dominates T . That is, we can write

N = {|y 1 • • • y m • t 1 • • • t n |} and M = {|y 1 • • • y m • s 1 . . . s r |}. Define f : [m + n] → [m + r] by f (i) = i if i ≤ m ǫ i otherwise , where ǫ i for i ∈ [n] is such that t i < s ǫi (it
j | j / ∈ Im(f ) ∨ (∃i ∈ [n]. x i < y j = y f (i) )|} and T = {|x i | x i < y f (i) |}. Then obviously S ⊆ M . Moreover, M -S = {|y j | ∃i ∈ [n]. f (i) = j ∧ x i = y j |}, hence N = M -S + T (indeed,
every element in N is either equal to its image or strictly smaller). Finally, S dominates T , proving that N ≤ ms M according to the second definition.

Note that we require (X, ≤) to be a partial-order, and in this case, (X ⊛ , ≤ ms ) is a partial-order as well. From the fourth definition, it is obvious that ≤ emb ⊆ ≤ ms . Hence, ≤ ms is a WQO (when X is) and Section 4.1 applies. However function Cl I is not computable here (this is shown in Section 8.3.2). The reason is the same as in Section 5.4: we cannot decide in general whether a given ideal is principal. Nonetheless, in this case, we can show that (X ⊛ , ≤ ms ) is ideally effective, but of course, for a different representation of ideals. Let us now define this representation of ideals. By Proposition 4.1.1, Idl (X ⊛ , ≤ ms ) = {↓ ≤ms I | I ∈ Idl (X ⊛ , ≤ emb )} . This helps proving the following proposition: Proposition 7.2.2. Let (X, ≤) be a WPO. Then,

Idl (X ⊛ , ≤ ms ) = {↓ ms B + D ⊛ | B ∈ X ⊛ , D ∈ Down(X)}
Warning: unlike in the previous section, here B is a multiset of elements of X, not of ideals. Observe that •

↓ B + D ⊛ = {M 1 + M 2 | M 1 ≤ ms B ∧ M 2 ∈ D ⊛ } = {M | M D ≤ ms B}.
It is directed: let M 1 , M 2 ∈ ↓ B + D ⊛ . Let N = B + M 1|D + M 2|D . Then N ∈ ↓ B + D ⊛ and M i ≤ ms N . (⊆) Let J ∈ Idl (X ⊛ , ≤ ms ), J = ↓ ≤ms I for some I ∈ Idl (X ⊛ , ≤ emb ), and
I = ↓ ∈ C ⊕ E ⊛ = {M | M E ∈ emb C} for some C ∈ Idl (X) ⊛ and E ∈ Down(X). Write C as {|I 1 • • • I k • ↓ x 1 • • • ↓ x m |} where the I i 's are limit ideals (i.e. not principal). Define B = {|x 1 • • • x m |} and D = E ∪ I 1 ∪ • • • ∪ I k . We show that J = ↓ ≤ms I = ↓ B + D ⊛ . • (⊆) It is simple to see that I ⊆ ↓ B + D ⊛ and since ↓ B + D ⊛ is downward-
closed, we have one inclusion.

• (⊇) To show the second inclusion, let M ∈ ↓ B + D ⊛ . Since each ideal I i is directed and unbounded, while M is finite, it is possible to pick in each I i an element strictly greater than any of the elements in M |Ii . Putting these elements together, we define a multiset M ′ ∈ emb {|I According to this proposition, we can represent ideals of (X ⊛ , ≤ ms ) as pairs (B, D) ∈ X ⊛ × Down(X), the semantic being the set ↓ ms B + D ⊛ . Elements of X ⊛ are represented as in the previous section. We can now state the main result of this section.

Theorem 7.2.3. With aforementioned representations, the finite multiset extension with domination ordering is an ideally effective construction. It is not polynomial-time in general. Given a polynomial-time presentation of an ideally effective WQO (X, ≤), we can compute an exponential-time presentation of (X ⊛ , ≤ ms ).

Let (X, ≤) designates an ideally effective WPO. The rest of this section is dedicated to the proof of the theorem. Here is the outline:

(OD), (PI) Any of the four equivalent definition of ≤ ms provide a procedure to decide ≤ ms .

The third one is the most convenient to notice that when (X, ≤) is given by a polynomial-time presentation, ≤ ms can be decided in polynomial-time.

(PI) The function M → ↓ ms M is trivial with our representation of ideals: it outputs the pair (M, ∅). This procedure obviously runs in polynomial-time when (X, ≤) is given by a polynomial-time presentation.

(ID), In Section 7.2.1, we give a procedure to decide ideal inclusion. This procedure runs in polynomial time when (X, ≤) is given by a polynomial-time presentation. We will also define canonical representations for ideals of (X ⊛ , ≤ ms ).

(CF),(II),(IF) In subsections 7.2.2, 7.2.4 and 7.2.5, we give procedures to complement filters, intersect ideals and intersect filters, respectively. These procedures run in polynomial-time when (X, ≤) is given by a polynomial-time presentation.

(II) In Section 7.2.3, we give a procedure to complement ideals. This procedure runs in exponential-time when (X, ≤) is given by a polynomial-time procedure. In this same subsection, we prove that a matching lower bound. We also provide a polynomial-time procedure some specific WQOs.

• It will be obvious that the procedures mentioned above are computable from a presentation of (X, ≤).

(XF) The set of all finite multisets is the upward-closure of the empty multiset.

(XI) As a downward-closed set, X ⊛ is its own ideal decomposition, since it is an ideal.

In the following subsections, (X, ≤) always designates a WQO.

Ideal Inclusion (ID)

Proposition 7.2.4. Given B 1 , B 2 ∈ X ⊛ and D 1 , D 2 ∈ Down(X):

↓ B 1 + D ⊛ 1 ⊆ ↓ B 2 + D ⊛ 2 iff B 1 D 2 ≤ ms B 2 and D 1 ⊆ D 2 ∪ ↓ < Supp(B 2 -B 1 )
If (X, ≤) is an (polynomial-time) ideally effective WQO, the above characterization of inclusion leads to a (polynomial-time) procedure to decide inclusion.

Proof.

(⇒) First, B 1 ∈ ↓ B 1 + D ⊛ 1 ⊆ ↓ B 2 + D ⊛ 2 , thus B 1 D 2 ≤ ms B 2 . For the second part, let x ∈ D 1 , consider the multiset M = B 1 D 2 + {|x • • • x|} with |B 2 | + 1 copies of x. Obviously, M ∈ ↓ B 1 + D ⊛ 1 ⊆ ↓ B 2 + D ⊛ 2 and thus M D 2 ≤ ms B 2 . Now, if x / ∈ D 2 , then x ∈ M D 2 and M (x) = B 1 (x)+|B 2 |+1 > |B 2 | ≥ B 2 (x), thus there exists y > x such that B 2 (y) > M (y) = B 1 (y). This implies that y ∈ Supp(B 2 -B 1 ) and x < y. (⇐) Let M ∈ ↓ B 1 +D ⊛ 1 , i.e. M D 1 ≤ ms B 1 . We want to show M D 2 ≤ ms B 2 . Decompose M in two parts: M D 2 = (M D 2 ) D 1 + (M D 2 ) |D1 . For the first part, (M D 2 ) D 1 = (M D 1 ) D 2 ≤ ms B 1 D 2 . Besides, by the third definition of ≤ ms , B 1 D 2 = B 2 -S + T for S = B 2 -(B 1 D 2 ) and T = (B 1 D 2 ) -B 2 ,
and S dominates T .

For the second part, observe that

D 2 ∪ ↓ < Supp(B 2 -B 1 ) = D 2 ∪ ↓ < Supp(B 2 - (B 1 D 2 )) and thus D 1 D 2 ⊆ ↓ < Supp(S). It follows that (M D 2 )
|D1 is dominated by S, and we obtain:

M D 2 = (M D 2 ) D 1 + (M D 2 ) |D1 ≤ ms B 1 D 2 + (M D 2 ) |D1 = B 2 -S + (T + (M D 2 ) |D1 ) ≤ ms B 2
Computability: Assuming (X, ≤) is a (polynomial-time) ideally effective WQO, the objects B 1 D 2 and D 2 ∪ ↓ < Supp(B 2 -B 1 ) can be computed (in polynomialtime), and ≤ ms and ⊆ on Down(X) can be decided (in polynomial-time).

Notice that as in the case of finite multisets with the embedding ordering, this representation is not unique, and we now provide a canonical representation for each ideal. Proposition 7.2.5. For every ideal I of (X ⊛ , ≤ ms ), there exists a unique representation

I = ↓ B + D ⊛ such that B |D = ∅.
Besides, when (X, ≤) is an (polynomial-time) ideally effective WQO, this canonical representation is computable (in polynomial-time) from any other representation.

Proof. Given

I = ↓ B + D ⊛ , the canonical representation of I is ↓(B D) + D ⊛ , which is obviously computable using |B| • |D| membership tests in (X, ≤). Now for uniqueness, assume ↓ B 1 + D ⊛ 1 = ↓ B 2 + D ⊛
2 and for i ∈ {1, 2}, B i|D i = ∅. By contradiction, assume there exists x ∈ B 1 -B 2 , and assume x maximal.

• Either x ∈ D 2 : but since D 2 ⊆ D 1 ∪ ↓ < Supp(B 1 -B 2 ) and x /
∈ D 1 by assumption, it implies that there exists y > x such that B 1 (y) > B 2 (y). This contradicts the maximality of x.

• Or x / ∈ D 2 : then since B 1 D 2 ≤ ms B 2 , there must be y > x such that B 2 (y) > B 1 (y). Once again, we can pick y maximal.

-Either y ∈ D 1 : but D 1 ⊆ D 2 ∪ ↓ < Supp(B 2 -B 1
), but by maximality, y cannot be in ↓ < Supp(B 2 -B 1 ). On the other hand, y is in B 2 , and thus cannot be in D 2 either. Contradiction.

-Or y / ∈ D 1 : and since B 2 D 1 ≤ ms B 1 , this implies the existence of z > y > x such that B 1 (z) > B 2 (z), contradicting the maximality of x.

Using the symmetry of the situation, we have proved

B 1 = B 2 . Thus B 1 -B 2 = B 2 -B 1 = ∅, which entails D 1 = D 2 .

Complementing Filters

(CF) Proposition 7.2.6. Given N ∈ X ⊛ and x ∈ X, define N x = N | ↑ x -{|x|}.
The complement of ↑ N is given by:

X ⊛ ↑ N = x∈Supp(N ) ↓ N x + (X ↑ x) ⊛
From this expression, we easily derive a (polynomial-time) procedure to complement filters when (X, ≤) is a (polynomial-time) ideally effective WQO.

Proof. (⊆) Let M /

∈ ↑ N , by negating the first definition, this is equivalent to

∃x ∈ N. N (x) > M (x) ∧ ∀y > x. M (y) ≤ N (y) Then M ∈ ↓ N x + (X ↑ x) ⊛ directly follows from the fact that ∀y ∈ X. M | ↑ x (y) ≤ N (y). (⊇) Let x ∈ Supp(N ) and M ∈ ↓ N x + (X ↑ x) ⊛ .
We show that there exists y such that N (y) > M (y) and for all z > y, N (y) ≥ M (y). Let S, T be two multisets such that M | ↑ x = N x -S + T and S dominates T . We consider two cases:

1. If x is maximal in S, then take y = x. By domination, for any z ∈ T , z ≥ x, hence forall z ≥ x, M (z) = N x (z). In particular, M (x) = N x (x) < N (x) and M (z) ≤ N x (z) = N (z) for z > x.
2. Otherwise, take a maximal y ∈ S such that y ≥ x. In particular, T (y) = 0 and S(y) ≥ 1, which implies that M (y) = N x (y) -S(y) + T (y) < N x (y) ≤ N (y).

Besides, given z > y, M (z) = N x (z) -0 + 0 ≤ N (z).

Complementing Ideals (CI)

Proposition 7.2.7. Let B ∈ X ⊛ and D ∈ Down(X). Given x ∈ X, define B x = B | ↑ x + {|x|} Then:

X ⊛ (↓ B + D ⊛ ) = S⊆Supp(B) ↑{B x | x ∈ min(X (D ∪ ↓ S))}
The above expression is clearly computable (in exponential-time) when (X, ≤) is a (polynomial-time) ideally effective WQO.

Proof. (⊆) Let M / ∈ ↓ B + D ⊛ . Let N = M D,
by assumption N ≤ ms B. Thus, there exists x ∈ X such that N (x) > B(x) and for all y > x, N (y) ≥ B(y) (negation of the first definition of ≤ ms ). Since N (x) > 0, x / ∈ D. Let S be the largest subset of Supp(B) such that x / ∈ ↓ S. It exists since x / ∈ ∅ and the property is stable by union. The element x is thus in X (D ∪ ↓ S) and there exists y ∈ min(X (D ∪ ↓ S)) such that y ≤ x.

We now prove that B y ≤ ms M . Observe that, by maximality of S, for all z ∈ Supp(B) S, x ≤ z. Thus, B | ↑ x = B | ↑ y which proves that B y ≤ ms B x . On the other hand, for any z ∈ X, B x (z) ≤ M (z). This is immediate for z ≥ x.

For z = x, M (x) = N (x) > B(x) = B x (x) -1. And for z > x, M (z) = N (z) ≥ B(z) = B x (z)
. This proves B y ≤ ms B x ≤ ms M which concludes this direction of the proof.

(⊇) For any x ∈ X, B x ≤ ms B: this is immediate by negating the first definition of ≤ ms and instantiating with x. Thus, for any x / ∈ D, B x / ∈ ↓ B + D ⊛ , which proves the desired inclusion.

We now provide a matching lower bound on the operation of complementing ideals, proving that the procedure given by Proposition 7.2.7 is asymptotically optimal in general. Notice that for a finite alphabet A, (A ⊛ , ≤ emb ) = (A ⊛ , ≤ ms ), since there are no elements x, y ∈ A such that x < y. Thus, (A ⊛ , ≤ ms ) ≡ (N |A| , ≤ × ) and all operations can be performed in polynomial-time. Besides, as stated in the introduction of this chapter, (N, ≤ ms ) is isomorphic to the ordinal ω ω , for which all operations are computable in polynomial-time as well.

The next natural candidate would be N 2 , but then it suffices to take union over subsets of size 2 of Supp(B) in the formula of Proposition 7.2.7, which results in polynomial-time complexity. More generally: Proposition 7.2.8. For (X, ≤) = (N k , ≤ × ), there is a polynomial-time procedure to complement ideals, described by the following expression: Given B ∈ X ⊛ and D ∈ Down(X),

X ⊛ (↓ B + D ⊛ ) = S⊆Supp(B) |S|≤k ↑{B x | x ∈ min(X (D ∪ ↓ S))}
The only difference with the general expression is that it suffices to take the union over subsets of Supp(B) that have size at most k, leading to a polynomial-time implementation.

1. If T = S U : from S / ∈ D and S⊑ H S U , we deduce that S = S V for some V U (D has been chosen for this property). Therefore, there exists

i ∈ U V , hence S = S V ⊑ H T i , while T = S u ⊑ H T i . However, B U (R) = 0 for any T i ⊑ H R, thus M (T i ) = 0 < 1 ≤ B(T i ).
2. Otherwise, T = T i for some i / ∈ U , and we can assume that

S U = T i . Then M (T i ) = 0 < B(T i ) = 1. • If x / ∈ Q, then we have B U (S) ≥ M (S) > B(S)
and by definition of B U this is only possible for S = S U in which case B U (S) = M (S) = B(S) + 1. From B U (S) = M (S) we deduce that S / ∈ P , and P is not empty, thus there is some i such that T i ∈ P . Note that this T i cannot be equal to

S U since B U (S U ) = M (S U ). Thus, S U ⊏ H T i and M (T i ) = 0 < B(T i ) = 1.
In conclusion, the exponential-time procedure described in Proposition 7.2.7 is optimal in the general.

Intersecting Ideals (II)

Proposition 7.2.10. Let ↓ B 0 + D ⊛ 0 and ↓ B 1 + D ⊛ 1 be two ideals given by their canonical representation, that is for i ∈ {0, 1}, B i|D i = ∅. For i ∈ {0, 1}, define ī = 1i and:

B ′ i = B i D ī -B 0 ∩ B 1 S i = {x ∈ B ′ i | ∃z ∈ B ′ ī. z > x ∧ ∀t ∈ B ′ i . t > z} B = B 0 ∩ B 1 + B ′ 0|S 0 + B ′ 1|S 1 + B 0|D 1 + B 1|D 0 D = x∈B0-B y∈B1-B (↓ x ∪ D 0 ) ∩ (↓ y ∪ D 1 )
The intersection of two ideals is an ideal:

(↓ B 0 + D ⊛ 0 ) ∩ (↓ B 1 + D ⊛ 1 ) = ↓ B + D ⊛
When (X, ≤) is an (polynomial-time) ideally effective WQO, this leads to a (polynomial-time) procedure to intersect ideals, in particular because in this case, we can compute the canonical representation in polynomial-time. i . Of these multisets B ′ i , we only keep in B elements from sets S i . These sets consist of elements of B ′ i that are dominated by elements in

• • • • ≤ ≥ B 0|D 1 B 1|D 0 B 0 ∩ B 1 S 0 S 1 B ′ 0 B ′ 1 B 0 B 1 Figure 7.1: Intersection of Ideals B ′ ī that are not themselves dominated in B ′ i .
In other words, for every x ∈ S i (point in the cloud), there exists some y > x which is in B ′ ī, but not in S ī, i.e. not in the other cloud.

Proof. First of all, notice from the construction that for any x ∈ X, B(x) ∈ {B 0 (x), B 1 (x)}. Indeed, consider the following cases:

• If x ∈ D 0 : then B 0 (x) = 0 since we assumed ideals given by their canonical representations. Thus B(x) = min(0,

B 1 (x)) + 0 + B ′ 1|S 1 (x) + 0 + B 1|D 0 (x). By definition, B ′ 1 (x) = 0 and B 1|D 0 (x) = B 1 (x). Thus B(x) = B 1 (x). • Similarly if x ∈ D 1 , B(x) = B 0 (x).
• Otherwise, x / ∈ D 0 ∪ D 1 . Note that S 0 ∩ S 1 = ∅ by construction. Three cases remain:

-If x ∈ S 0 , then x / ∈ S 1 thus B ′ 0|S 0 (x) = B ′ 0 (x) and B ′ 1|S 1 (x) = 0. Thus, B(x) = (B 0 ∩ B 1 )(x) + (B 0 D 1 )(x) -(B 0 ∩ B 1 )(x) = B 0 (x). -Similarly if x ∈ S 1 , B(x) = B 1 (x). -Otherwise, B(x) = min(B 0 (x), B 1 (x)) ∈ {B 0 (x), B 1 (x)}. (⊆) Let M ∈ (↓ B 0 + D ⊛ 0 ) ∩ (↓ B 1 + D ⊛ 1 ). We want to show M D ≤ ms B. Let x / ∈ D such that M (x) > B(x).
We distinguish two cases:

1. Either B(x) = max(B 0 (x), B 1 (x)). Four possibilities: (a) x / ∈ D 0 ∪ D 1 .
In that case, since M D 0 ≤ ms B 0 and M D 1 ≤ ms B 1 , there exist y > x and z > x such that M (y) < B 0 (y) and M (z) < B 1 (z). Now, if B 0 (y) > B(y) and B 1 (z) > B(z) hold simultaneously, then x ∈ ↓ y ∩ ↓ z ⊆ D which is a contradiction. Thus, at least one of the previous inequality does not hold, implying either B(y) > M (y) or B(z) > M (z).

(b) x ∈ D 0 D 1 . In that case, we only have the existence of z > x such that

B 1 (z) > M (z). Again, if B 1 (z) > B(z) then x ∈ ↓ z ∩ D 0 ⊆ D, which is a contradiction. Thus B(z) ≥ B 1 (z) > M (z).
(P(X), ⊑ H ) is well-founded. With the above remark, this is exactly (WQO7) from the definition of WQO we gave in Chapter 2. In particular, (P(X), ⊑ H ) needs not be a WQO, see Section 9.2 for more details. However, (P f (X), ⊑ H ) is a WQO, where P f (X) denotes the set of all finite subsets of X. Indeed, it is the quotient of (X * , ≤ st ) (see Section 6.2) by the relation ≃ defined by u ≃ v iff Supp(u) = Supp(v), where Supp(u) is the finite set of elements of X that appear in the finite sequence u ∈ X * . Moreover, ≃ • ≤ st =≤ st • ≃, and Section 4.2 applies. However, procedures for this WQO are rather simple to obtain directly, and more efficient than if relying on Section 4.2. Since (P f (X), ⊑ H ) can be obtained as a quotient of (X * , ≤ st ) its ideals are exactly the closure under ≃ of the ideals of (X * , ≤ st ). The latter has been shown to be sets of the form

D * 1 • • • D * k (cf. Section 6.
2), and thus their closure under ≃ is

(D 1 ∪ • • • ∪ D k ) * . In terms of sets, this is exactly P f (D 1 ∪ • • • ∪ D k ), the set of finite subsets of D 1 ∪ • • • ∪ D k . Lemma 7.3.1.
The ideals of (P f (X), ⊑ H ) are exactly the sets of the form P f (D), where D is a downward-closed subset of X.

Proof. In complement of the sketch of proof that precedes the lemma, we present below a direct and simple proof:

(⇐) : ∅ ∈ P f (D), so P f (D) is nonempty. It is downward-closed, since if S⊑ H T ∈ P f (D), then S ⊆ ↓ X T ⊆ ↓ X D = D. It is directed, since if S, T ∈ P f (D), then S ∪ T ∈ P f (D).
(⇒) : Let J be an ideal of P f (X). Let D = J = S∈J S. Then clearly J ⊆ P f (D). Since J is downward-closed under ⊑ H , D is downward-closed under ≤ and {x} ∈ J for all x ∈ D. Since J is nonempty (it is an ideal), ∅ ∈ J . Finally, if S, T ∈ J , then there is some U ∈ J such that S, T ⊑ H U . Thus S ∪ T ⊑ H U , and S ∪ T ∈ J . Therefore, J has the empty set and singletons, and is closed under finite unions, and so is equal to P f (D).

We now turn to ideal effectiveness. Assume we have encodings for X and Idl (X). Finite sets of X are represented as the explicit list of the encoding of their elements. Once again, this corresponds to the representation suggested by Section 4.2: finite sets are equivalence classes of finite sequences.

Moreover, Lemma 7.3.1 suggests a very simple representation for ideals of (P f (X), ⊑ H ): the ideal P f (D) for some D ∈ Down(X) is simply encoded with the encoding of D, which we know how to encode whenever we have an encoding for Idl (X).

Theorem 7.3.2. The Hoare Extension is a polynomial-time ideally effective construction.

Proof. Let (X, ≤) be an ideally effective WQO.

Given S ∈ P f (X), the notation ↓ S could represent the downward-closure of S as a subset of X, or the downward-closure of {S} as a subset of P f (X). We therefore annotate every occurrence of a closure: ↓ X S denotes the downward-closure of S as a subset of X, while ↓ H S denotes the downward-closure of S in P f (X).

(OD) The quasi-ordering S⊑ H T can be tested using at most |S| • |T | comparisons of elements of S and T .

(

ID) Given D 1 , D 2 ∈ Down(X), checking P f (D 1 ) ⊆ P f (D 2 ) boils down to check- ing D 1 ⊆ D 2 .
(PI): Given S ∈ P f (X), ↓ H S = P f (↓ X S) (obvious when considering the alternative definition of ⊑ H given at the beginning of this chapter). Note that ↓ X S = x∈S ↓ x is computable.

(CF): Given S ∈ P f (X), the complement of ↑ H S is given by:

P f (X) ↑ H S = x∈S P f (X) ↑ H {x} = x∈S P f (X ↑ x)
(II): To intersect ideals:

P f (D 1 ) ∩ P f (D 2 ) = P f (D 1 ∩ D 2 ).
(IF): Filters may be intersected using ↑ S ∩ ↑ T = ↑(S ∪ T ).

(CI): Given D a downward-closed set of X, P f (X) P f (D) consists of the set that contain at least one element not in D. That is:

P f (X) P f (D) = ↑ H {{x} | x ∈ min(X D)}
All of the above expressions trivially lead to (polynomial-time) procedures when (X, ≤) is an (polynomial-time) ideally effective WQO. This proves that (P f (X), ⊑ H ) is an (polynomial-time) ideally effective WQO when (X, ≤) is. Moreover, the procedures above are obviously computable from a presentation of (X, ≤). Besides, (XI) The whole set P f (X) is an ideal since X is downward-closed, and (XF) the filter decomposition of P f (X) is the empty set: ↑ H ∅ (not to be confused with the empty filter decomposition, which denotes the empty upward-closed set of P f (X)).

Therefore, the Hoare extension is a polynomial-time ideally effective construction.

(CI): We actually show a stronger statement, denoted CD, that complementing an arbitrary downward-closed set is computable. This strengthening is necessary for (IF).

Let D be an arbitrary downward-closed set. We compute ∁D as follows:

1. Initialize U := ∅; 2. While ∁U ⊆ D do (a) pick some x ∈ ∁U ∩ ∁D; (b) set U := U ∪ ↑ x 3. Return U .
Every step of this high-level algorithm is computable. The complement ∁U is computed using the procedure to complement filters composed with the procedure to intersect ideals:

∁ n i=1 ↑ x i = n i=1 ∁ ↑ x i
which is computed with (CF) and (II) (or with (XI) in case n = 0, i.e., for U = ∅). Then, inclusion ∁U ⊆ D is tested with (ID). If this test fails, then we know ∁U ∩ ∁D is not empty, and thus we can enumerate elements x ∈ X by brute force, and test membership in U and in D. Eventually, we will find some x ∈ ∁U ∩ ∁D.

To prove partial correctness we use the following loop invariant: U is upwardclosed and U ⊆ ∁D. The invariant holds at initialization and is preserved by the loop's body since if ↑ x is upward-closed and since x / ∈ D and D downwardclosed imply ↑ X ⊆ ∁D. Thus when/if the loop terminates, one has both ∁U ⊆ D and the invariant U ⊆ ∁D, i.e., U = ∁D.

Finally, the algorithm terminates since it builds a strictly increasing sequence of upward-closed sets, which must be finite by Eq. (WQO6).

(IF): This follows from (CF) and CD, by expressing intersection in terms of complement and union.

(XF): Using CD we can compute ∁∅.

Remark 8.1.3 (On Theorem 8.1.2). The above methods are generic but in many cases there are simpler and more efficient ways of implementing (CI), (IF), etc. for a given WQO. This is why Definition 3.1.1 lists eight requirements instead of just four: we wanted to provide efficient procedures for all main operations in concrete cases. In particular, this theorem does not state that a polynomial-time presentation can be computed from a polynomial-time short presentation.

As seen in the above proof, the fact that (CF), (II), (PI) and (XI) entail (CI) is non-trivial. The algorithm for CD computes an upward-closed set U from an oracle answering queries of the form "Is U ∩ I empty?" for ideals I. This is an instance of the Generalized Valk-Jantzen Lemma [START_REF] Goubault-Larrecq | On a generalization of a result by Valk and Jantzen[END_REF], an important tool for showing that some upward-closed sets are computable.

The existence of such a non-trivial redundancy in our definition led us to the question of whether there are other redundancies. The following proposition answers negatively.

presented in this chapter are often obtained by modifying the shape of ω 2 around elements corresponding to steps t i (halting steps), so that some set-theoretic operation on the WQO is able to spot the difference: it is then possible to compute t i using an oracle for this operation, which proves the operation to be non computable. This is often done by quotienting the natural ordering on the ordinal ω 2 by a well-chosen equivalence relation. Therefore, it is advised to read Section 3.2.3 and Section 4.2 before the remainder of this chapter.

In all our examples, it is crucial that despite being undecidable, the halting problem is semi-decidable. In particular, given a time t and a machine number i, one can decide whether t ≤ t i . It suffices to simulate the machine T i for t steps: if it halted before, then t i < t, otherwise t ≤ t i .

The remainder of the proof of Proposition 8.1.4 is split over the five next subsections, one for each of the five statements from the beginning of the proof. Let X = ω 2 . According to the Cantor Normal form, elements of X can be written ω •i+j for some i, j ∈ N. We let ≤ denote the usual linear ordering on ordinals. Define E as the smallest equivalence relation such that:

Ideal Inclusion (ID)

• • • . . . • • • . . . • • • . . . • • • . . . • • • . . . . . . (t 2 = ω) • . . . 0 1 2 t 0 t 0 + 1 t 0 + 2 ω ω + 1 ω + 2 ω + t 1 ω + t 1 + 2 ω + t 1 + 2 ω • 2 ω • 2 + 1 ω • 2 + 2 ω • 3
(ω • i + t)E(ω • i + t + 1) when t = t i
As in Section 4.2, this defines a quasi-ordering

≤ E =≤ •E over X. Note that E is indeed compatible with ≤, that is to say ≤ E =≤ •E = E• ≤).
For a visual definition of E, see Fig. 8.1: an edge between two points means these two elements are equivalent with respect to ≤ E , otherwise, greater elements are drawn above smaller elements.

Here is an intuition behind the definition of the structure (X, ≤ E ). Associate to each Turing Machine T i a copy of N where each natural number represents an execution time of the machine T i . The WQO X is made of ω copies (one per Turing machine) on top of one another: this is a countable lexicographic sum, otherwise seen as the lexicographic product of ω by N. In this QO, we interpret the ordinals ω•i+t as the Turing machine T i running for t steps. Then, the equivalence relation E is gluing some elements together in each copy of N so that each copy has only one or two equivalence class(es): the class of all elements smaller or equal to t i , and if t i is finite, the class of all elements strictly above. Therefore, the copy associated with T i has two equivalence classes if and only if T i halts (and one otherwise).

Below, we show that the WQO (X, ≤ E ) is almost shortly effective: (ID) cannot be decided, but (PI), (CF) and (II) are computable. This proves that in general, a procedure to decide ideal inclusion cannot be computed from procedures to compute (PI), (CF) and (II). The representations we use for elements of X is clear: elements of X are of the form ω • i + t.

For ideals, we rely on the standard representation of ideals of a quotient defined in Section 4.2, that is ideals of (X, ≤ E ) are represented as ideals of (ω 2 , ≤), but denote their closure under E. Remember the ideals of ω 2 are exactly sets α = {β | β < α} for α < ω 2 + 1.

(OD): Let us mention that the quasi-ordering is decidable:

ω • i + t ≤ E ω • i ′ + t ′ iff i < i ′ ; or i = i ′
and t, t ′ < t i ; or i = i ′ and t i ≤ t, t ′ . Conditions t, t ′ < t i and t i ≤ t, t ′ are decidable by simulating T i for max(t, t ′ ) steps.

(PI): Ideals of (X, ≤ E ) are encoded as ideals of (ω 2 , ≤) and thus ↓ ≤ E x for x ∈ X is encoded as ↓ ≤ x which is computable according to Section 3.2.3.

(CF): Given ω • i + t ∈ X, it is possible to test whether t ≤ t i . If t ≤ t i , then ω • i + t is in the lower equivalence class of the i-th copy of N (the upper equivalence class might be reduced to ∅ if T i does not halt). Therefore:

X ↑ ≤ E ω • i + t = ω • i
Otherwise, t > t i , and t i has been found (we run T i for t steps, and T i halted in less than t steps). Therefore we can output:

X ↑ ≤ E ω • i + t = ω • i + t i
(II): Ideals are linearly quasi-ordered by inclusion, thus intersection consists in taking the minimum for inclusion. Although we cannot decide inclusion of ideals of (X, ≤ E ), observe that it suffices to always output the minimum for inclusion of ideals of (ω 2 , ≤). In other words, given I, J ∈ Idl (ω 2 , ≤) and denoting S the closure under E of some S ⊆ X, we have:

I ∩ J = I ∩ J
Finally, observe that machine T i does not halt if and only if ω

• i + 1 = ω • (i + 1
). Therefore, there can be no algorithm to decide ideal inclusion.

Complementing Filters (CF)

The WQO for which we cannot compute (CF), but for which we can decide (ID) and compute (PI) and (II) is the same WQO (X, ≤ E ) as before ! Only, we change our representation of its ideals. This (surprising) result shows the importance of the chosen encoding of sets when dealing with computability questions.

As observed in the previous subsection, each copy of the natural numbers has only one or two equivalence classes for ≡ E =≤ E ∩ ≥ E . Therefore, the only limit ideal of (X, ≤ E ) is the whole set X itself. All other ideals are principal. We thus encode ideals of (X, ≤ E ) using encodings of elements of X, plus an extra symbol for the ideal X itself.

With these representations of X and Idl (X), we now show that (ID), (PI) and (II) are computable.

(OD): Note that we have not changed our representation of X, and thus the quasiordering ≤ E is still decidable.

(ID): Inclusion is now decidable since it is essentially the same as the quasi-ordering, with the extra element ω 2 which is greater than any other.

(PI): With our representation of ideals, the function x → ↓ x is the identity function.

(II): Ideals are linearly quasi-ordered by inclusion, and thus, intersection consists of taking the minimum for inclusion, which is now decidable.

However, assume we have an algorithm to complement filters: on input ↑(ω•(i+1)) for some i ∈ N, it returns some ↓(ω • i + t) For this algorithm to be correct, it must be the case that

↓ ≤ E (ω • i + t) = ↓ ≤ E (ω • i + t ′ )
for all t ′ ≥ t, i.e. ω • i + t and ω • i + t ′ are equivalent. Thus, t i < ω if and only if t i < t, and the halting problem could be decided by bounded simulation.

Principal Ideals (PI)

• • • . . . • • • . . . • • • • . . . • • • . . . • • • • . . . . . . • • . . . • • • . . . • • • . . . • • • • . . . • • • . . . • • • • . . . . . . • • . . . 0, 1, 0 0, 1, 1 0, 1, 2 0, 1, t 0 -1 0, 1, t 0 0, 1, t 0 + 1 0, 1, ω 1, 1, 0 1, 1, 1 1, 1, 2 1, 1, t 1 -1 1, 1, t 1 1, 1, t 1 + 1 1, 1, ω 2, 1, 0 2, 1, 1 2, 1, 2 (t 2 = ω) 2, 1, ω 3, 1, 0 Figure 8.2: WQO for (II)
For (PI), we again consider the same WQO (X, ≤ E ), taking yet another representation of its ideals. If the ordinals α and β are E-equivalent, then ↓ α and ↓ β are two representations of the same ordinal. We thus make representations of ideals unique by allowing only two types of ideals:

• the limit ordinals of ω 2 + 1, that is ω 2 = X and ω • i = {α | α < ω • i} for i ∈ N;
• and the successor ordinals of the form ω

• i + t i + 1 for i ∈ N.
The set of ideals is still recursive, since given i and t, it is possible to check whether t = t i + 1. Ideal inclusion corresponds to a sub-order of the natural ordering on ordinals, and is thus decidable. The inclusion on ideals being linear, intersecting ideals again corresponds to taking the minimum, and hence is computable. However, we now have a procedure for (CF):

• X ↑(ω • i + t) = ω • i if t ≤ t i . • X ↑(ω • i + t) = ω • i + t i + 1 if t > t i .
Note that if t > t i , then t i has been found, and thus it can be output.

But there are no procedures for (PI) anymore: if there were, one could compute ↓ ω • i that should be mapped to ω • i + t i + 1 if T i halts, and to ω • (i + 1) otherwise.

Intersecting Ideals (II)

Let Y = (N ⊔ N) + (1 ⊔ 1) quasi-ordered with the sum quasi-orderings introduced in Chapter 5. The set Y consists of two copies of N, augmented with two top elements that will be denoted 1, ω and 2, ω , that are incomparable with each other, but greater than any other element of Y . In particular, note that for any a ∈ {1, 2} and n ∈ N, i, a, ω > i, 3a, n . In other words, Y is not quasi-ordered as ω + 1 ⊔ ω + 1, although it has the same support.

Define X = N × Y equipped with the lexicographic quasi-ordering ≤ lex defined in Section 5.4. Intuitively, X is the WQO obtained by putting ω copies of Y on top of each other. Elements of X are of the form i, a, n where i ∈ N designates the copy of Y (the floor of the tower), a ∈ {1, 2} designates the disjoint copy (left or right) and n ∈ (ω + 1). Due to space constraints, only the left copy is labeled on Fig. 8.2). Once again, we extend the quasi-ordering by an equivalence relation E defined by :

• i, (a, n) E i, (b, m) for i ∈ N, a, b ∈ {1, 2} and n, m ∈ N and n, m < t i . • i, (a, n) E i, (a, m) for i ∈ N, a ∈ {1, 2} and n, m ∈ N and n, m ≥ t i .
Note that each copy of Y has either 3 or 5 equivalence classes (depending on whether T i halts).

The representation of the elements of X is the one described above. For ideals, we again rely on the fact that the equivalence relation E is "gluing" many elements, and thus there are no infinite strictly increasing sequence of elements within a copy of Y . Thus, the only limit ideal is X itself. All other ideals are principal, hence represented by ↓ x for x ∈ X.

We now show that for these representations, the operations (ID), (PI) and (CF) are computable, but not (II).

(OD): The quasi-ordering is decidable, as in previous cases by bounded simulations of Turing machines.

(ID): Inclusion is then trivially decidable: it is the same as the quasi-ordering (plus the maximal element X).

(PI): Computing principal ideals is again the identity function.

(CF): To complement filters:

∁ ↑ 0, a, n = ∅ when n ∈ N and n < t 0 and a ∈ {1, 2}.

∁ ↑ i + 1, a, n = ↓ i, 1, ω ∪ ↓ i, 2, ω when n ∈ N and n ≤ t i+1 and a ∈ {1, 2}. ∁ ↑ i, a, n = ↓ i, 3 -a, n when ω ≥ n ≥ t i and a ∈ {1, 2}.
Finally, observe that ↓ i, 1, ω ∩ ↓ i, 2, ω is an ideal if and only if T i does not halt. Thus, if intersections were computable, the size of the ideal decomposition of the result would decide the halting problem.

Ideal Decomposition of X (XI)

As mentioned at the beginning of this subsection, the result for (XI) is a little weaker, as for a given X, its ideal decomposition is a constant, hence computable. Thus we here provide an infinite collection of WQOs (X i , ≤ i ) i∈N such that one cannot compute

• • • . . . • • • . . . • • • . . . • • • . . . 1, 0 1, 1 1, 2 1, t i -1 1, t i 1, t i + 1 Figure 8.3: X i when T i halts. (X i , ≤ i •E i ) is isomorphic to 1 ⊕ (1 ⊔ 1). • • • . . . • • . . . • • • . . . • • . . . 1, 0 1, 1 1, 2 1, n 1, n + 1 Figure 8.4: X i when T i does not halt. (X i , ≤ i •E i ) is isomorphic to 1.
the ideal decomposition of X i given i ∈ N, while (PI), (CF) and (II) are computable for each X i .

Define X i = N ⊔ N with the natural ordering extended with relation E i defined by (cf. Figures 8.3 and 8.4):

• a, n E i b, m for a, b ∈ {1, 2} and n, m < t i . • a, n E i a, m for a ∈ {1, 2} and n, m ≥ t i .
First of all, for any i ∈ N, (X i , ≤ i ) is ideally effective, where the representation for X is the usual one for disjoint sum, and we represent ideals as elements, since they are all principal (X i / ≡ i is a finite WQO for every i).

(OD): As in the other cases, the quasi-ordering is decidable by bounded simulations.

(ID): Ideal inclusion is then the same as the quasi-ordering on X i .

(PI): The ideal ↓ x has the same representation as x, for x ∈ X i .

(CF): Complements of filters are computed using:

∁ ↑ a, n = ∅ if n < t i ∁ ↑ a, n = ↓ 3 -a, t i if n ≥ t i
(II): Ideal intersections are computed using:

↓ a, n ∩ ↓ a, m = ↓ a, min(n, m) ; ↓ a, n ∩ ↓ 3 -a, m = ↓ 1, min(n, m) when min(n, m) < t i ↓ 1, 0 otherwise.
However, the function that maps i ∈ N to the ideal decomposition of X i is not computable, since otherwise it would decide the halting problem. Indeed, X i is an ideal if and only if T i does not halt.

Observe that the implication

X ↑ ≤ ′ x ⊇ Cl I (X U ) ⇒ X ↑ ≤ ′ x ⊇ X U holds because X ↑ ≤ ′ is already downward-closed for ≤ ′ .
For a downward-closed set D, it is equivalent to contain an arbitrary subset S or its downward-closure ↓ S. Now, we can test this last condition ↑ ≤ ′ x ⊆ X Cl I (X U ) by computing a finite basis of the upward-closed set (for ≤) X Cl I (X U ) = i∈I ↑ x i and testing whether x ≥ ′ x i for some i ∈ I. Computing such a finite basis is possible since U ∈ Up(X, ≤), on which we can perform complements ((CF) and (II)), then we can compute function Cl I which outputs a downward-closed set of (X, ≤),on which we know how to compute complements ((CI) and (IF)). Finally, the ordering ≤ ′ is decidable using x ≤ ′ y ⇐⇒ x ∈ Cl I (↓ ≤ y).

Therefore, if entering the while loop, it means that Cl F (x) ⊆ U , and there exists some y ∈ X such that y ∈ Cl F (x) U . To find such an element, it suffices to enumerate elements of X and for each test whether it is greater than x for ≤ ′ (possible since ≤ ′ is decidable) and if it belongs to U .

Besides, observe that since at step 2b we know that y / ∈ U , the sequence of upwardclosed sets built by the while loop is strictly increasing, therefore finite (Eq. (WQO6)). Thus, the program terminates.

To prove correction, observe that U ⊆ Cl F (x) is an invariant of the program, and whenever the program terminates (and it will), the conditional of the while loop is false, that is Cl F (x) ⊆ U . Therefore, the return value U is indeed the upward-closed set of Cl F (x) ∈ Up(X, ≤).

We have just proved that function Cl F can be computed from function Cl I . The asymmetry between upward-and downward-closed sets of a WQO strikes again, and we can show that the converse is not true: we cannot compute Cl I from Cl F . Indeed, consider again the WQO (X, ≤ E ) from Section 8.1.1. It is obtained as a quotient of the ordinal (ω 2 , ≤), which is ideally effective. Below, we show that function Cl F : ω 2 → Up(ω 2 , ≤) is computable. Of course Cl I cannot be computable, otherwise (X, ≤ E ) would be ideally effective for the representations we used in Section 8.1.1.

Remember that given x ∈ ω 2 , Cl F (x) is the filter decomposition of ↑ ≤ E x, where x is the equivalence class under E of x. Here, since the ordering ≤ is linearly ordered, x has a unique minimal element. Let

x = ω • i + t ∈ ω 2 . If t ≤ t i then x = {ω • i + j | 0 ≤ j ≤ t i }, in which case Cl F (x) = ↑ ≤ E ω • i + t = ↑ ≤ ω • i. Otherwise, when t > t i , x = {ω • i + j | j > t i }, and Cl F (x) = ↑ ≤ E ω • i + t = ↑ ≤ ω • i + t i + 1. Therefore, Cl F is computable.
Let us also mention that removing any assumption in Theorem 8.2.1 breaks the theorem. In particular, the situation above provides an example of an ideally effective WQO (X, ≤) and a decidable relation E such that (X, ≤ • E) is not ideally effective. This legitimate the introduction of the function Cl I .

On the other hand, function Cl I is not a necessary condition in the following sense: there exists an ideally effective WQO (X, ≤) such that the function Cl I associated to the extension from (X ⊛ , ≤ emb ) to (X ⊛ , ≤ ms ) is not computable (see Section 8.3.2), but the WQO (X ⊛ , ≤ ms ) is still ideally effective. However, note that (X ⊛ , ≤ ms ) is ideally effective for another representation of ideals than the one fixed in Section 4.1. Otherwise, Cl I is really necessary: let (X, ≤) be an ideally effective WQO and ≤ ′ an extension of ≤. Assume (X, ≤ ′ ) is ideally effective when representing its ideals as ideals of (X, ≤). Then given I ∈ Idl (X, ≤), we can enumerate D ∈ Down(X) and check whether D = Cl I (I) as follows: with (ID) for ≤ ′ we can check that ↓ ≤ ′ I = ↓ ≤ ′ D, and with (CI) for ≤ and ≤ ′ we can check that X D = X (↓ ≤ ′ I). If it is the case, it means X D is upward-closed for ≤ ′ , and thus D is downward-closed for ≤ ′ .

Last remark: as in the case of Theorem 8.1.2, we have presented only Theorem 4.1.2 in Section 4.1 (and not the version above without the function Cl F ) for complexity reasons. In practical cases, it is important to have an efficient version of Cl F . We prove that in general, one cannot decide whether an ideal of an ideally effective WQO is principal. The counter-example is again built following the same idea. Define X = ω 2 , and extend the natural ordering so that for any given i ∈ N, elements ω • i + t for t ≥ t i form an equivalence class (Fig. 8.5).

Deciding whether an Ideal is Principal

• • • . . . • • • . . . • • • . . . • • • . . . • • • . . . (t 2 = ω) • . . . 0 1 2 t 0 -1 t 0 t 0 + 1 ω ω + 1 ω + 2 ω + t 1 -1 ω + t 1 ω + t 1 + 1 ω • 2 ω • 2 + 1 ω • 2 + 2 ω • 3
We show that (X, ≤ E ) is ideally effective using Section 4.2.

• Cl I (ω • i + j) = ω • (i + 1) if j > t i , • Cl I (ω • i + j) = ω • i + j otherwise. • Cl F (ω • i + j) = ω • i + t i if j ≥ t i , • Cl F (ω • i + j) = ω • i + j otherwise.
The functions Cl I and Cl F being computable, (X, ≤ E ) is ideally effective. However, ω • (i + 1) is a principal ideal if and only if T i halts, hence, one cannot decide whether an ideal is principal.

This is yet another independence result: one could add the axiom "principality of ideals is decidable" to our definition of ideal effectiveness, and the axiomatic system would still be minimal (no axiom is implied by the others). Note that to actually prove this statement, one should also check that the other axioms remain independent in the presence of the new one. This is the case: for every WQOs considered in the proof of Proposition 8.1.4, it is decidable whether a given ideal is principal.

Nonetheless, we decided not to include this as an axiom: a priori, deciding whether an ideal is principal does not seem related to our original motivation: handling closed subsets. It turned out to be sometimes related, for instance in Section 5.4 where it is crucial to be able to decide whether an ideal is principal to prove ideal effectiveness of the lexicographic quasiordering. This is further discussed in Section 8.3.1. Another case where the inability to test whether an ideal is principal affected our work is discussed in Section 8.3.2. Because of these two examples mostly, we considered adding this requirement to our definition. However, the WQO defined above is obtained as a quotient of an ideally effective WQO, that in addition satisfies the extra assumptions of Section 4.1. This proves that the ability to decide ideal principality is not preserved under quotient. We favored the generality of our results on quotient over the specific lexicographic quasi-ordering, and decided to exclude this axiom from Definition 3.1.1.

Down(X).

Intuitively, we want a pair u, D ∈ X * × Down(X) to encode the equivalence class of infinite sequences that have head u and tail D. There are three issues with this representation:

1. If D = ∅, there are no infinite sequences with tail D. We therefore define Down ′ (X) = Down(X) {∅}, the set of non-empty downward-closed subsets of X. Note that working with X * × Down(X) amounts to represent X ≤ω , the set of sequences of length at most ω. Subsequently, we will restrict our attention to X * × Down ′ (X).

2. If u has a non-empty suffix in D, then there are no infinite sequence of head u and tail D, since we defined the head to be as small as possible. We therefore want u, D to denote any infinite sequence in u • D ω .

3. However, all the elements of u • D ω do not belong to the same equivalence class. For instance, if X = {a, b, c} is a finite alphabet, and if u = aaba and D = {a, c}, then aaba(a + c) ω contains the word aabaa ω , which is strictly smaller than aaba(ca) ω for instance. The reason is that D(aabaa ω ) = {a} D.

The solution is to restrict our attention to the maximal elements of u • D ω : they are all equivalent, and thus represent a unique element of X ω / ≡ ω . This is proved in the next proposition.

Proposition 9.1.5.

1. Let u, v ∈ X ω . If u ≡ ω v, then h(u) = h(v) and D(u) = D(v).
We can thus define the head and tail of an equivalence class S ∈ X ω / ≡ ω . They will be denoted h(S) and D(S) respectively.

2. Given an equivalence class S of X ω / ≡ ω , S consists exactly of the maximal elements of h(S) • (D(S)) ω .

3. Given u, D ∈ X * × Down ′ (X), the maximal elements of u • D ω all are equivalent for ≡ ω . Let S be the equivalence class they all belong to. We have D(S) = D and h(S) = u 1 , where u = u 1 u 2 and u 2 is the longest suffix of u which is in D * .

According to the third point of the proposition above, we let u, D ∈ X * × Down ′ (X) represent the equivalence class S ∈ X ω / ≡ ω to which every maximal element of u • D ω belongs. Note that in general the maximal elements of u • D ω are strictly included in S. For instance, in the case introduced before: if X = {a, b, c} is a finite alphabet, and if u = aaba and D = {a, c}, the infinite sequence aab(ca) ω is equivalent to maximal elements of u • D ω , but does not belong to it.

Moreover, an equivalence class S has several representations. In light of the proposition, we define h(S), D(S) to be its canonical representation. According to the third point, this representation is computable from any other representation u, D : it suffices to remove the suffix of u which is in D.

Ideal Effectiveness of the Infinite Sequences Extension

It follows from the previous proposition that the relation ≤ ω on X * × Down ′ (X) extends the classical product ordering ≤ × (it is actually be obtained as a composition with an equivalence relation, as defined in Section 4.2). Therefore, Section 4.1 applies to the quasi-ordering ≤ ω , and we therefore once again turn to the functions Cl I and Cl F .

Lemma 9.1.7. Given I ∈ Idl (X * , ≤ * ), J ∈ Idl (Down(X), ⊆), u ∈ X * and D ∈ Down(X):

Cl I (I × J ) def = ↓ ω (I × J ) = (I • ( J ) * ) × J Cl F ( u, D ) def = ↑ ω u, D = u=u1u2 ↑ × u 1 , D ∪ ↓ Supp(u 2 ) Proof. Let u, D ∈ I × J and v, E ≤ ω u, D , that is v ∈ (↓ u) • D * and E ⊆ D. Since D ∈ J and u ∈ I which is downward-closed, v ∈ I • ( J ) * . Finally, since J is downward-closed, E ∈ J and v, E ∈ I • ( J ) * ) × J .
Conversely, given v, E ∈ I • ( J ) * ) × J , decompose v = uw with u ∈ I and w ∈ ( J ) * . Since w is finite, it actually belongs to a finite union

( i D i ) * of downward-closed sets of J . Since J is directed, D def = E ∪ i D i is in J . Therefore, v, E ≤ ω u, D ∈ I × J . Let v, E ≥ ω u, D , that is u ∈ (↓ * v) • E * and D ⊆ E. Decompose u = u 1 u 2 with u 1 ≤ * v and u 2 ∈ E * : u 1 , D ∪ ↓ Supp(u 2 ) ≤ × v, E .
Conversely, if u = u 1 u 2 , then trivially u ∈ (↓ * u 1 ) • (↓ Supp(u 2 )) * and D ⊆ D∪↓ Supp(u 2 ). Thus, according to Corollary 9.1.2, u 1 , D∪Supp(u 2 ) ∈ ↑ ω u, D . Now according to Sections 4.1, 5.3 and 6.1, (X ω , ≤ ω ) is ideally effective provided that:

1. (X, ≤) is ideally effective, 2. (Down ′ (X), ⊆) is ideally effective, 3. Functions Cl I and Cl F are computable.

The first condition is the basic assumption we have made throughout other sections. The second one however is novel: indeed, (Down(X), ⊆) might not even be a WQO in general, making its ideal effectiveness a non-relevant question. The necessity of this extra assumption will be further discussed in the next section. Finally, we could neither prove that the third condition follows from the two first conditions, nor that it was independent. The two operations we use in Lemma 9.1.7 whose computability does not follow a priori from the two first conditions listed above are J (used in the expression of Cl I ) and ↓ Supp(u) (used in the expression of Cl F ). We have already used the second one earlier, and it seems obviously computable, since Supp(u) (for u a finite word) is a finite set, ↓ Supp(u) = x∈Supp(u) ↓ x. However, this expression will output a downward-closed set represented as a list of ideals of X. But, we need this downward-closed set to be represented according to the encoding chosen to show that (Down(X), ⊆) is ideally effective. Indeed, assuming that both (X, ≤) and (Down ′ (X), ⊆) are ideally effective is not enough, we need to ensure that the representations used for downward-closed sets of (X, ≤) can be translated into representations of elements of Down ′ (X).

In other words, we want to assume that the following transfer function is computable:

Down(X) → Down ′ (X) D → D
Similarly, the operation J is a way to link the representations in the other direction: going from ideals of Down ′ (X) back to ideals of X. We thus assume the computability of the flattening function:

Idl (Down ′ (X)) → Down(X) J → J
Finally, we obtain the following theorem:

Theorem 9.1.8. Let (X, ≤) a WQO such that (Down(X), ⊆) is a WQO. Then (X ω / ≡ ω , ≤ ω ) is an ideally effective WQO provided that:

• (X, ≤) is ideally effective for some representations of X and Idl (X),

• (Down ′ (X), ⊆) is ideally effective, for some representations of Down ′ (X) and Idl (Down ′ (X)),

• The next chapter is devoted to a deeper understanding of the assumptions that (Down(X), ⊆) is a WQO, and furthermore an ideally effective one. Remark 9.1.9. It is natural to assume that we represent the elements of Down ′ (X) using the same representation we have used so far, thus rendering the transfer function trivial. Note that in the expression of Cl F , we also perform unions of downward-closed sets, which is trivial with our usual representation, but might not be for an arbitrary one. Thankfully, union of downward-closed sets corresponds to intersection of filters:

↑ D 1 ∩ ↑ D 2 = ↑(D 1 ∪ D 2 )
Unions of downward-closed sets are therefore computable when Down ′ (X) is ideally effective.

However, even if we assume the usual representation for Down ′ (X), we could not prove that the computability of the flattening function is implied by the other assumptions (namely ideal effectiveness of both X and Down(X)). Nor could we prove that it is independent (in the fashion of Chapter 8).

However, we would like to point out that the flattening function allows to test whether an ideal is principal: J ∈ Idl (Down(X)) is principal if and only if J ∈ J . This does not suffice to prove that the flattening function is not computable in general since the counter-example for deciding whether an ideal is principal given in Section 8.3 takes place in a more general setting. In other words, the flattening function allows to decide whether an ideal is principal only in WQOs that are the ideal space of another WQO.

Furthermore, assume we represent downward-closed sets as finite sets of ideals. Then, the flattening allows to decide whether an ideal of X is principal. Indeed, given an ideal of X, one can compute ↓ I def = {J ∈ Idl (X) | J I}. Indeed, this set can be obtained as ↓ Idl(X) I ∩ (Idl (X) ↑ Idl(X) I). We claim that (↓ I) = I if and only if I is not principal in Idl (X). Indeed, if I is principal, I = ↓ x for some x ∈ X. Then for every J ∈ ↓ I, x / ∈ J, and therefore x / ∈ ↓ I, but x ∈ I. Conversely, if x ∈ I but x / ∈ (↓ I), then ↓ x ⊆ I but ↓ x I, i.e. ↓ x = I. Once again, this is not enough to conclude that the flattening function is not computable in general: it might be the case the the assumption Down ′ (X) is ideally effective implies that we can test whether an ideal of X is principal. In particular, for all ideally effective WQOs (X, ≤) we know of such that we cannot decide whether an ideal is principal, Down ′ (X) is not ideally effective.

Better Quasi-Orderings

Chapters 5 to 7 provide an effective algebra of ideally effective WQOs: any WQO obtained as sums of products of finite sequences of finite subsets of finite multisets of ordinals and/or finite WQOs is an ideally effective WQO. And procedures for settheoretic operations in this WQO do not only exist, they can be computed from the structure of the WQO.

However, the operations of taking the infinite sequences of a WQO (quasi-ordered with embedding), or the infinite powerset (quasi-ordered with ⊑ H ) are not a priori part of this algebra. Indeed, these two operations do not preserve the WQO property. This was first proved by Rado in [START_REF] Rado | Partial well-ordering of sets of vectors[END_REF]: he exhibited a WQO (X, ≤) such that (X ω , ≤ ω ) is not WQO. This WQO is now commonly known as Rado's structure. Moreover, this counter example is minimal: given a WQO (X, ≤), (X ω , ≤ ω ) is WQO if and only if (X, ≤) does not embed Rado's structure.

Inspired by this characterization, Nash-Williams [START_REF] St | On better-quasi-ordering transfinite sequences[END_REF][START_REF] St | On well-quasi-ordering infinite trees[END_REF] defined the notion of Better Quasi-Orderings (BQO), that notably satisfies the following property: if (X, ≤) is a BQO, then the ordinal sequences over X, quasi-ordered with embeddability is a WQO. Alternatively, Section 9.1 has shown that P(X) is WQO if and only if X ω is, and thus, Rado provided a sufficient and necessary condition for P(X) to be WQO. What Nash-Williams intended are conditions on (X, ≤) such that P(X), P 2 (X) def = P(P(X)), P 3 (X), and so on iterating transfinitely all are WQOs.

Many positive results on BQOs followed, the intuitive rule being that whenever an order-construction preserves WQO, its infinitary version preserves BQO: if (X, ≤) is WQO, then the set of finite sequences over X is WQO (Higman's Theorem), while if it is BQO, the set of sequences over a countable ordinal is BQO. Similar results for sets and trees have been proved.

Of course, BQOs are better WQOs, that is a BQO is in particular a WQO, and indeed the original definition was given in a similar way: (X, ≤) is BQO if any application f : B → X from a barrier B to X is good, that is there exists s ⊳ t ∈ B such that f (s) ≤ f (t). The formal definitions of barriers and ⊳ are too technical and out of the scope of this thesis, and will therefore not be given, we simply stress the similarities with (WQO1): the application f : B → X is a generalization of an infinite sequence (application from N to X). For that matter, N is a barrier on which ⊳ coincides with the natural ordering, which proves that any BQO is WQO.

Jullien [START_REF] Jullien | Contribution à l'étude des types d'ordres dispersés[END_REF] later provided an alternative definition of BQOs, which is proved equivalent in [START_REF] Pouzet | Sur les prémeilleurordres[END_REF][START_REF] Fraïssé | Theory of relations[END_REF]. This definition uses the notion of indecomposability of an ordinal sequence (which we solely call sequence from now on, see Chapter 2 for definitions, terminology and notations. In particular, in what follows, ≤ denotes sequence embedding). A sequence s is said to be indecomposable if for any sequences s 1 , s 2 such that s = s 1 • s 2 and s 2 = ǫ, s ≤ s 2 , that is indecomposable sequences embed in all their non-empty suffixes. Note that an indecomposable sequence necessarily has an indecomposable length, where an ordinal α is indecomposable if it cannot be written α = β + γ with 0 = γ < α, or equivalently, α = ω β for some ordinal β. Definition 9.2.1. Jullien [START_REF] Jullien | Contribution à l'étude des types d'ordres dispersés[END_REF] A QO (X, ≤) is BQO if any non-empty sequence s over X of countable length can be written s = s 1 • s 2 with s 2 non-empty and indecomposable, i.e. s has an indecomposable suffix.

In this chapter, we are looking for sufficient conditions on (X, ≤) to ensure that (X ω , ≤ ω ) is an ideally effective WQO. In particular, we need (Down(X), ⊆) to be WQO (cf. Corollary 9.1.4). Note that since every construction presented in the previous chapters that preserve WQOs also preserve BQOs, and since our basic WQOs (namely natural numbers and finite quasi-orderings) are BQOs, our effective algebra of WQOs is actually an algebra of BQOs. Thus, we can also close this algebra under the construction of the infinite sequences (which preserves BQO), or the full powerset construction. But what about effectiveness ? To prove that (X ω , ≤ ω ) is an ideally effective WQO, we need that (Down(X), ⊆) is not only a WQO, but an ideally effective one. In other words, we want to show that Down is an ideally effective construction on BQOs. It cannot be an ideally effective construction on WQOs since it does not even preserve WQOs. In Section 9.4, we will actually show a stronger statement. But first, we introduce a finer notion than BQO.

α-WQO

Observe that Definition 9.2.1 can be naturally layered: X is a BQO if all ordinal sequences over X satisfy some property. In the following definition, we only ask that this property holds for ordinal sequences up to some length. The following definition can be found in [START_REF] Fraïssé | Theory of relations[END_REF]: Definition 9.3.1. [START_REF] Fraïssé | Theory of relations[END_REF], Chapter 8 Given an indecomposable ordinal α, a QO (X, ≤) is α-WQO if any β-sequence s over X for β ≤ α can be written s = s 1 • s 2 with s 2 non-empty and indecomposable.

Note that the notion of α-WQO when α is not indecomposable coincides with the notion β-WQO if there exists γ such that α = γ + β. Indeed, if (X, ≤) is β-WQO, then any sequence s ∈ X α can be decomposed s = uv with v ∈ X β , and thus v has an indecomposable suffix. This is the reason we are only interested in α-WQOs for indecomposable ordinals α.

With this definition, a QO is BQO if and only if it is α-WQO for every countable ordinal α. Moreover, the notion of WQO coincides with ω-WQO, which provides a simple proof that BQOs are WQOs. Proposition 9.3.2. (X, ≤) is WQO if and only if it is ω-WQO.

Proof. Observe that ω-sequences have been introduced in the previous chapter.

(⇒) If (X, ≤) is WQO, and s is an ω-sequence, then the decomposition of s is given by its head and tail which were introduced in Proposition 9.1.1. Indeed, let s ′ be the ω-sequence such that s = h(s) • s ′ . It is not hard to see that s ′ is indecomposable since it is made of elements that are covered infinitely often in s.

(⇐) If (X, ≤) is ω-WQO, and s ∈ X ω , let s = s 1 s 2 be the decomposition given by Definition 9.3.1, and let x be the first element of s 2 . Since s 2 is indecomposable, x must be smaller than some subsequent element of s 2 .

We are mainly interested in this finer definition for the following property: (Down(X), ⊆) is WQO if and only if (X, ≤) is ω 2 -WQO. This is proved in the following proposition, among other characterizations: 10. X ω 2 is well-founded for the sequence embedding quasi-ordering, 11. (X, ≤) is a WQO and does not contain Rado's structure, where ⊑ S is the Smyth quasi-ordering on P(X), defined by: S⊑ S T def ⇔ ∀y ∈ T. ∃x ∈ S. x ≤ y.

Proof. 2 ⇐⇒ 3: follows from the isomorphism between (Down(X), ⊆) and (P f (Idl (X))/≡ H , ⊑ H ), and the fact that (Y, ≤) is WQO if and only if (P f (Y ), ⊑ H ) is.

5 ⇐⇒ 3 ⇐⇒ 4: also follows from aforementioned isomorphisms (notably at the end of Chapter 2).

4 ⇐⇒ 6 ⇐⇒ 7: dual of ⊑ H which coincides with inclusion for downwardclosed sets, ⊑ S coincides with ⊇ for upward-closed set: S⊑ S T if and only if ↑ S ⊇ ↑ T . Besides, any subset S is equivalent for ⊑ S to its upward-closure, which is equivalent to its finite basis.

3 ⇐⇒ 8: follows from Corollary 9.1.4 9 ⇒ 8: X ω is a subset of X <ω 2 . 8 ⇒ 9: The embedding quasi-ordering on X <ω 2 is an extension of Higman's quasiordering on (X ω ) * , which is a WQO by Higman's Lemma.

10 ⇒ 1: Let s ∈ X ω 2 . Consider the set of all non-empty suffixes of s. Since X ω 2 is well-founded, this set has a minimal element. It is simple to see that this minimal element is an indecomposable suffix of s.

1 ⇒ 8: Let Y be the set of indecomposable sequences of X ω . We show that Y is a WQO. It follows that X * × Y is a WQO, since by Proposition 9.3.2, (X, ≤) is WQO. Moreover, since (X, ≤) is ω 2 -WQO, any ω-sequence s can be decomposed s = s 1 s 2 with s 2 indecomposable. Therefore, X ω is isomorphic to an extension of X * × Y , and as such is WQO.

We proceed to show that Y is WQO. An infinite sequence S = (s i ) i<ω of elements of Y can be flattened as a sequence s = i<ω s i ∈ X ω 2 . This sequence can be written s = uv with v indecomposable, and we can further assume that the length of u is a multiple of ω, that is u = s 0 s 1 • • • s n for some n < ω. Now we can unflatten v to see it back as an ω-sequence V = s n+1 s n+2 • • • over Y . Since v is indecomposable, s n+1 embeds in some finite prefix of what remains of V , i.e. s n+1 ≤ s n+2 • • • s m for some m < ω. But since s n+1 is an infinite sequence, by the pigeon-hole principle an infinite suffix of s n+1 embeds in s i for some n + 2 ≤ i ≤ m, and since s n+2 is indecomposable, s n+1 ≤ s i . This is an increasing pair of S, which proves Y is a WQO.

3 ⇒ 10: This implication follows from an analysis of the embedding relation between ordinal sequences which is very similar to the one we conducted in Proposition 9.1.1, but we failed to provide a proof that uses this analysis without replaying it. As previously observed, the "unflattening" defines a reflection from X ω 2 to (X ω ) ω which is in general not an embedding. Therefore, the image of the embedding quasiordering on X ω 2 is an extension of the embedding on (X ω ) ω . However, if extensions of a WQO are WQOs, extensions of a well-founded quasi-orderings may not be well-founded. As a result, we cannot deduce the well-foundedness of X ω 2 from the well-foundedness of (X ω ) ω (which follows from Section 9.1 when X ω is a WQO). Given a sequence s ∈ X ω 2 , we denote by s i ∈ X ω the ω-sequences such that s = s 1 s 2 • • • , that is ∀i, j ∈ N, s i (j) = s(ω • i + j). Recall from Section 9.1 the notion of tail of an ω-sequence. The tail of a sequence s ∈ X ω 2 , denoted D(s) ∈ Down(Down(X)), is defined by D(s) = i<ω j≥i ↓ D(s i ), where ↓ D denotes {E ∈ Down(X) | E ⊆ D}, that is the downward-closure is taken over Down(Down(X)), and ↓ D is a principal ideal of downward-closed sets. Assuming Down(X) is a WQO, Down(Down(X)) is well-founded ((WQO7)) and a infinite increasing subsequence can be extracted from the ω-sequence (D(s i )) i<ω , implying that D(s) = ∅. It remains to show that whenever two ω 2 -sequences s and t are ordered s ≤ t, then D(s) ⊆ D(t). Let s, t be such two sequences and f : ω 2 → ω 2 be a witness of the embedding s ≤ t. Let i ∈ N. The image of f (ω

• (i + 1)) is in ω 2 , thus it is some ω • n + m. This means that s i ≤ t 0 t 1 • • • t n t n+1
. Therefore, by the pigeon-hole principle, there exists j ≤ n + 1 and an infinite suffix s ′ i of s i such that s ′ i ≤ t j . Observe that D(s ′ i ) = D(s i ), and by Proposition 9.1.1, D(s ′ i ) ⊆ D(t j ). In the end, if D ∈ D(s), it is covered by infinitely many D(s i ), and thus by infinitely many D(t j ), and is thus a member of D(t).

Lastly, for Item 11, we cannot provide a proof since we did not define Rado's structure. 11 ⇐⇒ 8: is proved in the Rado's original article [START_REF] Rado | Partial well-ordering of sets of vectors[END_REF]. The right-to-left direction can also be found in [START_REF] Milner | Basic wqo-and bqo-theory[END_REF][START_REF] Fraïssé | Theory of relations[END_REF] (with a nice illustration of Rado's structure in [START_REF] Milner | Basic wqo-and bqo-theory[END_REF]). Otherwise, a direct proof of 11 ⇐⇒ 6: can be found in [START_REF] Jančar | A note on well quasi-orderings for powersets[END_REF].

Many of the equivalences above generalize to countable ordinals. Proposition 9.3.4. Given an indecomposable countable ordinal α, (X, ≤) is α-WQO if and only if (X <α , ≤) is WQO [START_REF] Fraïssé | Theory of relations[END_REF][START_REF] Marcone | Foundations of bqo theory[END_REF].

The above generalizes items 1 and 9. Items 2, 3,4, 5, 6 and 7 are generalized as the equivalence between [START_REF] Marcone | Fine analysis of the quasi-orderings on the power set[END_REF]:

• (X, ≤) is (α • ω)-WQO, • (Idl (X), ⊆) is α-WQO, • (Down(X), ⊆) is α-WQO, • (P(X), ⊑ H ) is α-WQO, • (P(X), ⊑ S ) is α-WQO, • (P f (X), ⊑ S ) is α-WQO, • (Up(X), ⊇) is α-WQO.
The generalization of Item 11 is what led Nash-Williams to the original definition of BQOs, with the notion of blocks. This intuition of blocks is formalized in [START_REF] Pouzet | Sur les prémeilleurordres[END_REF], Theorem III-3.3. Concerning Item 10, the implication X α well-founded ⇒ X α-WQO is proved in [START_REF] Fraïssé | Theory of relations[END_REF], the general proof being as simple as the one above. However, we were unable to find mention of the converse implication in the literature, and have been unable to prove it or disprove it. It seems possible to generalize the proof given above for α = ω 2 to indecomposable ordinals of the form ω α+1 . Indeed, we essentially used that if X is ω α+1 -WQO, then Y def = X ω α is WQO, and then X ω α+1 can be approximated by Y ω . But in the case X is ω λ -WQO, with λ a limit ordinal, we cannot use the same methods.

Finally, let us mention that all the order-constructions mentioned in the previous chapters that preserve WQO also preserve α-WQO. For α = ω 2 , this will be a trivial consequence of our analysis in the next section. In the general case, and for more details on BQO theory, we redirect the reader to the following surveys [START_REF] Milner | Basic wqo-and bqo-theory[END_REF][START_REF] Marcone | Foundations of bqo theory[END_REF][START_REF] Pouzet | Sur les prémeilleurordres[END_REF][START_REF] Fraïssé | Theory of relations[END_REF].

Ideally Effective ω 2 -WQOs

In this section, we extend our notion of effectiveness to ω 2 -WQOs.

If (X, ≤) is an ordinal, then so is (Idl (X), ⊆) (Section 3.2.3), and therefore it is ideally effective (successor of a recursive ordinal is recursive). Similarly, if (X, ≤) is finite, then (Idl (X), ⊆) is isomorphic to (X, ≤) and is thus ideally effective. Recall that (Down(X), ⊆) is ideally effective whenever (Idl (X), ⊆) is (Section 7.3). Thus in these cases, (X ω , ≤ ω ) is ideally effective. It remains to show that the constructions we have considered will preserve these properties. The properties we are formally interested in are formalized in the next definition. Definition 9.4.1. A ω 2 -WQO (X, ≤) further equipped with representations for X, Idl (X) and Idl (Idl (X)) is Idl 2 -effective if:

• (X, ≤) is an ideally effective WQO for the given representations of X and Idl (X),

• (Idl (X), ⊆) is an ideally effective WQO for the given representations of Idl (X)

and Idl (Idl (X)).

• The flattening function defined below is computable:

Idl (Idl (X)) → Idl (X) J → J
The basic WQOs from Section 3.2 are examples of Idl 2 -effective ω 2 -WQOs.

• For a finite WQO (X, ≤), ideals of X are isomorphic to X itself, and thus so are ideals of ideals. This proves that (X, ≤) is an ω 2 -WQO. We thus represent the three sets X, Idl (X) and Idl (Idl (X)) using the same encoding, computability of set-theoretic operations then follow from the ideal effectiveness of finite WQOs. Finally, the flattening function is the identity.

• The set of ideals of an ordinal (α, ≤) ordered with inclusion is isomorphic to α + 1. Therefore, the set of ideals of ideals of α is isomorphic to α + 2, and (α, ≤) is indeed a ω 2 -WQO. According to Section 3.2.3, both (α, ≤) and (α + 1, ≤) are Idl 2 -effective. For the flattening function, given a successor ordinal β + 1 ∈ α + 2, (β + 1) = β, and given a limit ordinal λ ∈ α + 2, λ = λ.

Next, we prove that when (X, ≤) is an Idl 2 -effective ω 2 -WQO, (X ω , ≤ ω ) is an ideally effective WQO. The previous definition has been designed to this end. Proposition 9.4.2. Let (X, ≤) be an Idl 2 -effective ω 2 -WQO. Then (Down(X), ⊆), (P(X), ⊑ H )) and (X ω , ≤ ω ) are ideally effective WQOs.

Proof. The ideal effectiveness of (Down(X), ⊆) follows from the isomorphism between the latter and (P f (Idl (X)), ⊑ H ), as a result of Section 7.3. In this same section, we have also argued that (P(X)/ ≡ H , ⊑ H ) is isomorphic to (Down(X), ⊆).

To establish the ideal effectiveness of (X ω , ≤ ω ), we use Theorem 9.1.8. Obviously, (X, ≤) is ideally effective, and (Down(X), ⊆) as well according to what precedes. Since we have shown that (Down(X), ⊆) is ideally effective using the standard representation for downward-closed sets (i.e. finite sets of ideals), the transfer function is trivial. Finally, we have to show that the following function is computable:

Idl (Down(X)) → Down(X) J → J
However, Definition 9.4.1 only provides the computability of this function:

Idl (Idl (X)) → Idl (X) J → J
Recall from Section 7.3 that ideals of Down(X) ≡ P f (Idl (X)) are of the form P f (D) for D ∈ Down(Idl (X)), and therefore simply encoded as elements of Down(Idl (X)). Let J be an actual ideal of Down(X) (i.e. its semantic), and D be its representation (its syntax). Then, J = D. Indeed, D stands for P f (D) = {E ∈ P f (Idl (X)) | E ⊆ D}, and an element E ∈ P f (Idl (X)) actually stands for E, that is the downward-closed set obtained as the union of the ideals members of E. Therefore, J = { E | E ∈ P f (Idl (X)) and E ⊆ D}.

Let x ∈ J , there exists a downward-closed set F ∈ Down(X) such that x ∈ F ∈ J . Therefore, x is in some ideal I ∈ Idl (X) which appears in the canonical decomposition of F , and by definition, I ∈ D. Thus x ∈ I ∈ D, proving J ⊆ D.

For the other direction, let x ∈ D, there exists I ∈ Idl (X) such that x ∈ I ∈ D. Therefore {I} ⊆ D and the downward-closed set I is a member of J . It follows that x ∈ I ∈ J and D ⊆ J .

It now remains to prove that D is computable. Remember D ∈ Down(Idl (X)), and it therefore has an ideal decomposition D = I 1 ∪ • • • I n for some I 1 , . . . , I n ∈ Idl (Idl (X)). We can similarly prove D = n i=1 I i , and given I ∈ Idl (Idl (X)), I is computable by Definition 9.4.1.

We now want to show that our algebra of ideally effective WQOs is actually an algebra of Idl 2 -effective ω 2 -WQOs. In particular, this would imply that (X ω , ≤ ω ) is ideally effective for every WQO (X, ≤) in our algebra. Since we have shown that our basic WQOs introduced in Chapter 3 are Idl 2 -effective ω 2 -WQOs, it now suffices to show that each of the constructions introduced in the previous chapters not only preserve WQOs and ideal effectiveness, but also ω 2 -WQOs and Idl 2 -effectiveness. Definition 9.4.3. An order-theoretic WQO and ω 2 -WQO-preserving construction C is said to be Idl 2 -effective if, for every Idl 2 -effective ω 2 -WQOs (X 1 , ≤ 1 ), . . . , (X n , ≤ n ):

• C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] is an Idl 2 -effective ω 2 -WQO, and

• Presentations of C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] and Idl (C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )])
are computable from presentations of the (X i , ≤ i ) and the (Idl (X i ), ⊆) (i = 1, . . . , n).

• The flattening function for C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )] is computable from flattening functions for the (X i , ≤ i ) (i = 1, . . . , n).

Theorem 9.4.4. The following constructions are ω 2 -WQO-preserving and Idl 2 -effective:

• Disjoint Sum (Section 5.1),

• Lexicographic Sum (Section 5.2),

• Cartesian Product with Dickson's quasi-ordering (Section 5.3),

• Finite Sequences extension with Higman's quasi-ordering (Section 6.1),

• Finite Sequences extension with Stuttering quasi-ordering (Section 6.2),

• Finite Multisets extension with Embedding quasi-ordering (Section 7.1)

• Finite Powerset with Hoare quasi-ordering (Section 7.3), Proof. First, observe that proving that a construction C is ω 2 -WQO-preserving and Idl 2 -effective is equivalent to proving the conjunction of the following statements:

1. C is WQO-preserving.

2. C is ideally effective.

3. C is ω 2 -WQO-preserving.

For every

Idl 2 -effective ω 2 -WQOs (X 1 , ≤ 1 ), . . . , (X n , ≤ n ), Idl (C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )]
) is an ideally effective WQO.

A presentation of Idl

(C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )]
) is computable from presentations of the (X i , ≤ i ) and the (Idl (X i ), ⊆) (i = 1, . . . , n).

For every

Idl 2 -effective ω 2 -WQOs (X 1 , ≤ 1 ), . . . , (X n , ≤ n ), the flattening func- tion for Idl (C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )]) is computable.
7. A procedure for this flattening function is computable from procedures for the flattening functions for (Idl (X i ), ⊆)

(i = 1, . . . , n).
For each of the constructions C mentioned in the theorem, the first two statements are already proved in the section dedicated to construction C. We therefore focus, for each construction, on proving statements three to seven. Statement three will always be proved by showing that Idl (C[(X 1 , ≤ 1 ), . . . , (X n , ≤ n )]) is a WQO when the (X i , ≤ i ) are ω 2 -WQOs. Statements five and seven will always be trivial from the rest, and we will not mention them.

Let (X, ≤), (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) be ideally effective ω 2 -WQOs. In particular, (Idl (X), ⊆) and (Down(X), ⊆) are ideally effective.

Disjoint Sum: In Section 5.1 we have proved that the set Idl (X 1 ⊔ X 2 , ⊔) ordered with inclusion is isomorphic to the disjoint sum of Idl (X 1 ) and Idl (X 2 ). Therefore, it is a WQO, and the disjoint sum construction is ω 2 -WQO-preserving. Moreover, since Idl (X 1 ) and Idl (X 2 ) are ideally-effective, Section 5.1 proves that (Idl (X 1 ⊔ X 2 ), ⊆ ) ∼ = (Idl (X 1 ), ⊆) ⊔ (Idl (X 2 ), ⊆) is ideally effective as well. Finally, the flattening function for the sum simply is the sum of the flattening functions for X 1 and X 2 : given an ideal of Idl (Idl (X 1 ⊔ X 2 )), it is of the form i, I for some i ∈ {1, 2} and some I ∈ Idl (Idl (X i )). Therefore, i, I = i, I .

Lexicographic Sum: Here also, the lexicographic sum is ω 2 -WQO-preserving and the ideal effectiveness of Idl (X 1 ⊕ X 2 ) ∼ = Idl (X 1 ⊆) ⊕ Idl (X 2 , ⊆) follows from Section 5.2. The flattening function is exactly the same as before, but keep in mind that the representation 2, I actually stands for the set X 1 ∪ I.

Cartesian Product with Dickson's Quasi-Ordering: Again, Cartesian Product is ω 2 -WQO-preserving and Idl 2 -effective because this construction commutes with the ideal construction: Idl (X 1 × X 2 ) ∼ = Idl (X 1 , ⊆) × Idl (X 2 , ⊆). For the flattening function: given I ∈ Idl (Idl (X 1 )) and J ∈ Idl (Idl (X 2 )), (I ×J ) = ( I)×( J ).

Finite Sequences with Higman's Quasi-Ordering: In this case, the set Idl (X * ) is in bijection with (Idl (X) ⊔ Down(X)) * , but inclusion on the former does not correspond to the natural quasi-ordering ≤ * (≤ ⊔ ) on the latter, instead it corresponds to an extension of this natural QO.

The Atom Construction Preserves Ideal Effectiveness: We first deal with the atoms Atm(X) (see Section 6.1 for the definition): the set of atoms is isomorphic to an extension of (Idl (X) ⊔ Down(X), ⊆ ⊔ ). Actually, the atom ∅ * can always be removed from an atom decomposition of an ideal of Idl (X * ) (see Definition 6.1.11). We therefore work with (Idl (X) ⊔ Down ′ (X), ⊆ ⊔ ) instead, where Down ′ (X) def = Down(X) {∅}. Let ⊑ be the image of the inclusion quasi-ordering on the atoms of X * by the isomorphism above, that is:

1, I ⊑ 1, J ⇐⇒ I + ǫ ⊆ J + ǫ ⇐⇒ I ⊆ J 1, I ⊑ 2, D ⇐⇒ I + ǫ ⊆ D * ⇐⇒ I ⊆ D 2, D ⊑ 2, D ′ ⇐⇒ D * ⊆ D ′ * ⇐⇒ D ⊆ D ′ 2, D ⊑ 1, I ⇐⇒ D * ⊆ I + ǫ which is never true (D = ∅
With this notation, (Atm(X), ⊆) is isomorphic to (Idl (X) ⊔ Down(X), ⊑). We show that the latter is ideally effective using Section 4.1, since ⊆ ⊔ ⊆ ⊑: it suffices to show that function Cl F and Cl I are computable. To compute Cl F , use the following equations:

Cl F ( 1, I ) = ↑ ⊔ 1, I ∪ ↑ ⊔ 2, I Cl F ( 2, D ) = ↑ ⊔ 2, D
Regarding function Cl I , recall from Section 5.1 that the set of ideals of (Idl (X) ⊔ Down(X), ≤ ⊔ ) is the disjoint sum of the set of ideals of Idl (X) and of the set of ideals of Down(X), that is, an ideal of (Idl (X) ⊔ Down(X), ≤ ⊔ ) is either of the form 1, I for I ∈ Idl (Idl (X)) or of the form 2, J for J ∈ Idl (Down(X)). Note that Down(X) is ideally effective according to Proposition 9.4.2.

We can now show that Cl I is computable:

Cl I ( 1, I ) def = ↓ ⊑ 1, I = 1, I Cl I ( 2, J ) def = ↓ ⊑ 2, J = 2, J ∪ n i=1
1, I i where n i=1 I i is the ideal decomposition of J where J is seen as an ideal of P f (Idl (X)).

Let us argue the correctness and computability of the second equation. The ideal J ∈ Idl (Down(X)) is actually encoded as an element of Idl (P f (Idl (X))), according to our representation of downward-closed sets of X. Therefore, J = S∈J S is a downward-closed set of ideals of X, which admits a decomposition into ideals of ideals of X. This is precisely the decomposition n i=1 I i we use in the equation above. It remains to show that this particular decomposition can be computed from the actual encoding of J . Remember from Section 7.3 that the ideals of P f (Idl (X)) are of the form P f (D) for D ∈ Down(Idl (X)), and therefore J is actually encoded as D (as in the proof of Proposition 9.4.2). We now prove that semantically, D = S∈J S, which concludes the proof since the ideal decomposition of D can be computed.

Let I ∈ D, then S def = {I} ∈ P f (D) = J which proves that I ∈ S ∈ J . Conversely, given some I ∈ J , there exists some S ∈ J = P f (D) such that I ∈ S ⊆ D. Therefore, I ∈ D.

In conclusion, functions Cl I and Cl F being computable, (Atm(X), ⊑) is ideally effective.

Back to the Idl 2 -effectiveness of X * , the ideals of X * are finite sequences of atoms. Unfortunately, the quasi-ordering on these sequences does not coincide with one of the three quasi-ordering on X * that we have shown to be ideally effective. Indeed, when embedding a sequence of atoms into another, we are allowed to stutter (in the sense of Section 6.2) on atoms of the form 2, D for D ∈ Down(X), but not on atoms of the form 1, I for I ∈ Idl (X). Hence, we introduce a quasi-ordering on sequences which generalizes both the Higman quasi-ordering and the stuttering quasi-ordering. We call it the partial stuttering quasi-ordering, and we now show that it is an ideally effective construction (for any ideally effective WQO (X, ≤), not only for atoms, which is the case we are ultimately interested in).

The Partial Stuttering Quasi-Ordering is Ideally Effective: Given an ideally effective WQO (X, ≤) and an upward-closed set A ⊆ X, define the partial stuttering quasi-ordering on A by:

x 1 • • • x n ≤ A st y 1 • • • y m def ⇔ ∃f : [n] → [m]. ∀i ∈ [n]. x i ≤ y f (i) and ∀i = j ∈ [n]. f (i) = f (j) ⇒ y f (i) ∈ A.
This QO generalizes both the Higman quasi-ordering (from Section 6.1) and the stuttering quasi-ordering (from Section 6.2): if A = ∅, then ≤ A st =≤ * and when A = X, ≤ A st = ≤ st . In all generality, the following holds: ≤ * ⊆ ≤ A st ⊆ ≤ st . In particular, this QO is an extension of ≤ * , and we can use Section 4.1 to prove it ideally effective.

Since A is upward-closed, ≤ A st is transitive: it suffices to compose the witnesses of the embeddings. Moreover, it is also still possible to concatenate witnesses, that is if

u ≤ A st u ′ and v ≤ A st v ′ then u • v ≤ A st u ′ • v ′ (≤ A
st is compatible with concatenation). In particular, it is still the case that (↓ A st P 1 ) • (↓ A st P 2 ) = ↓ A st (P 1 • P 2 ), for P 1 , P 2 ideals of (X * , ≤ * ). Therefore, it only remains to compute Cl I on atoms.

Cl I (I + ǫ) = I * when I ∩ A = ∅ Cl I (I + ǫ) = I + ǫ otherwise Cl I (D * ) = D * Proof. If A ∩ I = ∅ then: • ↓ A st I ⊆ I * : if u ≤ A st x for some x ∈ I, then u ∈ (↓ x) * ⊆ I * . The case u ≤ A st ǫ is trivial. • I * ⊆ ↓ A
st I: given u ∈ I * , since u is finite and I is directed, we can find x ∈ I such that x is greater than every element of u. Moreover, since I is directed, there exists z ∈ I which is greater than all elements of u (greater than x) and which is in A (pick any y ∈ A ∩ I). It satisfies u ≤ A st z. If A ∩ I = ∅ then: for any u ≤ A st x for some x ∈ I, since x / ∈ A, |u| ≤ 1 and therefore u = ǫ, or u = y for y ≤ x ∈ I. The other inclusion is trivial. So is the third equation.

Observe that the condition I ∩U = ∅ for I ∈ Idl (X) and U ∈ Up(X) is decidable. Indeed, I ∩ ↑ x = ∅ ⇐⇒ x ∈ I: the right-to-left direction is trivial, and if there exists y ∈ I ∩ ↑ x, then x ≤ y ∈ I which implies x ∈ I since I is downward-closed.

Emptiness of the intersection with an upward-closed is then tested by distributing the intersection over the unions. Therefore, Cl I is computable.

As in Section 6.2, function Cl F is more complicated:

let u = x 1 • • • x n , Cl F (u) = ↑ st u = ↑ *        y 1 • • • y k | 0 ≤ k ≤ n 0 = i 0 < i 1 < • • • < i k = n ∀j ∈ [k]. y i ∈ min( ij-1<ℓ≤ij ↑ X x ℓ ) ∀j ∈ [k]. (i j = i j-1 + 1 ∨ y j ∈ A)       
Remember the intuition given in Section 6.2: if u ≤ st bw, we can extract the image

v = y 1 • • • y k of an embedding witnessing u ≤ st w (v is a subsequence of w). This induces a factorization u = u 1 • • • u k of u where u i ≤ st y i for all i ∈ [k]. Now for ≤ A
st , we must also ensures that either y i ∈ A (it can embeds several elements), or |u i | = 1. The proof is left to the reader.

In conclusion, Cl F is computable as well, which proves that (X * , ≤ A st ) is ideally effective for any A ∈ Up(X) whenever (X, ≤) is ideally effective. In our case, (Idl (X * ), ⊆) is isomorphic to (Atm(X) * , ≤ 2,Down ′ (X) st

), where as expected, 2, Down ′ (X) designates { 2, D | D ∈ Down ′ (X)} ∈ Up(Atm(X)). The latter is ideally-effective according to what precedes.

To establish the Idl 2 -effectiveness of (X * , ≤ * ), it remains to prove the computability of the flattening function. Let P ∈ Idl (Idl (X * )). It is encoded as an ideal of (Atm(X) * , ≤ 2,Down ′ (X) st

). These ideals are themselves encoded as sequences of some particular atoms of Atm(X), which we will subsequently call higher atoms. Given I ∈ Idl (Idl (X)), then 1, I ∈ Idl (Atm(X)) and 1, I + ǫ is a higher atom. If D ∈ Down(Idl (X)), then 1, D ∈ Down(Atm(X)) and 1, D * is a higher atom. Lastly, given E ∈ Down(Down(X)), 2, E ∈ Down(Atm(X)) and 2, E * is a higher atom. Moreover, these are the only types of higher atoms. Now, any P ∈ Idl (Idl (X * )) is encoded as a product A 1 • • • A n of higher atoms, and the flattening of P is the product of flattening of its higher atoms:

P = ( A 1 ) • • • ( A n )
It thus remain to prove that the flattening of higher atoms is computable. Let A be an higher atom.

• If A = 1, I + ǫ, then A = 1, I . • If A = 1, D * , then A = 1, D * . Indeed, if u ∈ A then there exists some ideals I 1 , . . . , I n ∈ D ⊆ Idl (X) for n = |u| such that u ∈ (I 1 + ǫ) • • • (I n + ǫ). But since for every i, I i ⊆ D, u ∈ ( D) * . Conversely, let u = x 1 • • • x n ∈ ( D) * .
In particular, for each i, x i ∈ D, and there exists an ideal such that

x i ∈ I i ∈ D. Therefore, u ∈ (I 1 +ǫ) • • • (I n + ǫ) ∈ 1, D * .
Besides, we can compute D = I 1 ∪ • • • ∪ I m the ideal decomposition of D, with I i ∈ Idl (Idl (X)), and we have

D = ( I 1 ) ∪ • • • ∪ ( I m ) 125
This last expression is computable using the flattening function for Idl (Idl (X)).

• Lastly, if A = 2, E * for some E ∈ Down(Down(X)), then A = 2, E * .

The proof is similar to the previous one. Besides, the expression E for E ∈ Down(Down(X)) has already been shown computable in Proposition 9.4.2.

Finite Sequences with Stuttering: In this case, Idl (X * , ≤ st ) is isomorphic to (Down(X) * , ⊆ st ). which is ideally effective since (Down(X), ⊆) is (cf. Section 6.2). Note that the quasi-ordering ≤ A st on X * introduced in the previous paragraph generalizes both ≤ * (A = ∅) and ≤ st (A = X). Therefore, the Idl 2 -effectiveness of these two constructions follows from the Idl 2 -effectiveness of (X * , ≤ A st ), which can be proved following the lines of the previous case.

Finite Multisets with the Embedding Quasi-Ordering: In this case, Idl (X ⊛ , ≤ emb ) is isomorphic to an extension of (Idl (X) ⊛ × Down(X), ≤ × ). The latter is ideally effective according to Sections 5.3 and 7.1. We show that its extension is ideally effective using Section 4.1.

Let ⊑ denotes the image of ⊆ by the function that maps an ideal

I ∈ Idl (X ⊛ ) to B, D ∈ Idl (X) ⊛ × Down(X) where I = ↓ ∈ B ⊕ D ⊛ , that is: B, D ⊑ C, E def ⇔ B E ⊆ emb C ∧ D ⊆ E Function Cl F is easily seen computable: given B, D an ideal of (Idl (X) ⊛ × Down(X), ≤ × ), Cl F ( B, D ) = C⊂B ↑ × C, D ∪ ↓ Supp(B -C)
For function Cl I : recall from Section 5.3 that ideals of (Idl (X) ⊛ ×Down(X), ≤ × ) are pairs of ideals of Idl (X) ⊛ and of ideals of Down(X). Using the results of Section 7.1, the ideals of Idl (X) ⊛ are of the form ↓ ∈ B⊕D ⊛ for (B, D) ∈ Idl (Idl (X)) ⊛ × Down(Idl (X)). Let ↓ ∈ B ⊕ D ⊛ , I be an ideal of (Idl (X) ⊛ × Down(X), ≤ × ):

Cl I ( ↓ ∈ B ⊕ D ⊛ , I ) = ↓ ∈ B ⊕ (D ∪ ↓ ⊆ {I 1 , . . . , I n }) ⊛ , I
where I 1 ∪ • • • ∪ I n is a decomposition of the downward-closed set I, and ↓ ⊆ here designates the downward-closure of a set of ideals within Down(Idl (X)), i.e. ↓ ⊆ S = {I ∈ Idl (X) | ∃J ∈ S. I ⊆ J}. It has been shown before that the expression I is computable for I ∈ Idl (Down(X)).

Proof. Let B ∈ ↓ ∈ B ⊕ D ⊛ ⊆ Idl (X) ⊛ and D ∈ I ⊆ Down(X), so that ↓ ∈ B ⊕ D ⊛ is an element of Idl (X ⊛ ). Let ↓ ∈ C ⊕ E ⊛ ⊆ ↓ ∈ B ⊕ D ⊛
⊆ I = I 1 ∪ • • • ∪ I n . That is, Idl (D) ⊆ ↓ ⊆ {I 1 , . . . , I n }. Hence, C ∈ ↓ ∈ B ⊕ (D ∪ ↓ ⊆ {I 1 , . . . , I n }) ⊛ and obviously E ∈ I.
The other inclusion is clear.

In the case of sequences, we have seen that ideals of X * are some kind of "higher" sequences as well, but the ordering on these sequences is not the classical embedding ordering. Therefore, we introduced a quasi-ordering ≤ A st on sequences that generalizes the Higman quasi-ordering, and that almost commutes with the ideal construction. In particular, Chapter 6 should have presented (X * , ≤ A st ) first, and proved its ideal effectiveness. Then, the ideal effectiveness of (X * , ≤ * ) and (X * , ≤ st ) would have been obtained as a corollary.

The answer to the Idl 2 -effectiveness of extensions (≤ ⊆ ≤ ′ , see Section 4.1) follows a similar path: the ideals of (X, ≤ ′ ) is not an extension of the ideals of (X, ≤), essentially because the support of the QO is not the same: Idl (X, ≤) = Idl (X, ≤ ′ ). What we found to be the good notion that generalizes extensions is the setting where there exists a surjective and monotone function f : (X, ≤ X ) → (Y, ≤ Y ). In this case, (X, ≤ X ) is ideally effective, and functions Cl I and Cl F (similar definitions) are computable, then (Y, ≤ Y ) is ideally effective. Moreover, it is now possible to show that this setting is preserved under the ideal construction: the existence of f always imply the existence of a surjective and monotone map g : Idl (X, ≤ X ) → Idl (Y, ≤ Y ). Thanks to this more general notion, we were able to show that (X * , ≤ cj ) is Idl 2 -effective.

Perspectives

In conclusion, we have provided an effective algebra of ideally effective ω 2 -WQOs, whose set-theoretic operations in these ω 2 -WQOs can be automatically computed. Most of the commonly used WQOs fall in this algebra, but this inductive approach becomes particularly handy for WQOs that consist of a high number of iterations of these constructions. This is for instance the case of the quasi-ordering used for priority channel systems [START_REF] Ch | The power of priority channel systems[END_REF], which essentially is the n-th iteration of Higman's extension of the one element WQO, for a fixed n ∈ N.

Note that this algebra is not closed under taking infinite sequences. Indeed, this construction is not Idl 2 -effective as it does not even preserve ω 2 -WQOs. However, given any quasi-ordering in this algebra, the set of infinite sequences over this WQO is ideally effective, and procedures for set-theoretic operations can be computed. The same can be said for taking the powerset (P(X), ⊑ H ) of a quasi-ordering in this algebra. This has applications in verification: some algorithms to verify WSTS [START_REF] Abdulla | Well (and better) quasi-ordered transition systems[END_REF][START_REF] Parosh | Better is better than well: On efficient verification of infinite-state systems[END_REF] rely on (P(X), ⊑ H ) being an effective WQO. Also in [START_REF] Blondin | Handling infinitely branching WSTS[END_REF], the authors define the completion of a WSTS which is a transition system whose states are the ideals of the original set of states. For this system to be well-structured, we need that the original WQO is ω 2 -WQO, and to apply e.g. forward analysis, it is crucial that Idl (X) be an ideally effective WQO.

Extending the Algebra One of the most natural extension of our work would be to add more classical constructions to our algebra, the most relevant being trees and graphs. In these two cases, the objects at hand are more complex, and therefore so are the ideals, and a fortiori operations manipulating them. Already characterizing the structure of the ideals is difficult, and finding convenient representations becomes tough as well. Moreover, there are several classes of trees to consider, each of which can be quasi-ordered with several variants (bounded/unbounded width, bounded/unbounded height, ranked/unranked trees, etc.). The case of graphs is no simpler: already the minor relation is not simple to manipulate, and in practice many variants of this quasiordering are used, that are sometimes only WQOs on certain classes of graphs.

In conclusion, a complete investigation of these two cases would be long and difficult, and the results would be quite technical. In the case of trees, some cases have been shown effective (in some sense close to ours) in [START_REF] Finkel | Forward analysis for WSTS, part I: Completions[END_REF] and [START_REF] Goubault-Larrecq | Deciding piecewise testable separability for regular tree languages[END_REF] for instance.

Infinite Sequences. If we want the infinite sequences construction to be part of our algebra, we need a class of WQOs that is preserved by this construction. Section 9.1 shows that this is the same as being preserved by the construction Down. From Proposition 9.3.4 we deduce that the smallest such class is that of α-WQOs for α < ω ω .

This motivates the following inductive definition:

Definition 9.5.1. Given n ∈ N, (X, ≤) is Idl n -WQO if: • (X, ≤) is ω n -WQO, • (X, ≤) is an ideally effective WQO, • (Idl (X), ⊆) is Idl n-1 -effective,
• The representation of ideals of X coincides in the two lines above.

• The flattening function from Idl (Idl (X)) to Idl (X) is computable.

(X, ≤) is Idl ω -effective if it is Idl n -effective for every n ∈ N.

Note that from Proposition 9.3.4, it is simple to derive that if (X, ≤) is ω n -WQO, then Idl n (X) is a WQO, where Idl n (X) is the n-th composition of the ideal completion of X. Note that X ω ω -WQO is not equivalent to X being ω n -WQO for every n. Indeed, Proposition 9.3.4 shows that if X is ω n -WQO for every n, then so is Idl (X). However, Idl (X) is ω ω -WQO if and only if X is ω ω+1 -WQO. Therefore, the two conditions are not equivalent since it is proved in [START_REF] Marcone | Foundations of bqo theory[END_REF] that α-WQO and β-WQO are two different notions when α and β are two distinct indecomposable countable ordinals.

However, for our purpose, being ω n -WQO for every n ∈ N seems sufficient: it allows any finite number of application of the infinite sequences construction to a WQO of our algebra, provided all of our constructions are Idl n -effective (similar definition) Disjoint and lexicographic sums, and cartesian products are obviously Idl ω effective. But this is less clear for finite sequences for instance, since Idl (X * ) is not directly expressible with our constructions (we had to use an extension).

A promising first step would be to generalize Section 4.1 to Idl n -effective WQOs. Does assuming the computability of Cl I and Cl F at the first level is enough to show that an extension is still Idl n -effective, or do we need such functions for each level Idl m (X) for m ≤ n ? Ideally Effective BQOs. What about a notion of effectiveness for BQOs? The characterization X ω n -WQO if and only if Idl n (X) WQO is convenient to inductively define Idl n -effectiveness. But does it generalizes further ? There is a classical definition of the transfinitely iterated powerset P α (X) in BQO theory, which can be adapted to Idl α (X), and it is well known that X is BQO if and only if P ω1 (X) is WQO. However, we did not find any layered version of this theorem, that is: X ω α+1 -WQO if and only if P α (X) WQO. With such a property, we could for instance define Idl α -effectiveness as Idl β (X) being ideally effective for every β ≤ α. It would probably also be necessary to assume that representations used for each Idl β (X) are compatible, in the sense that the representation for ideals of Idl β (X) is the same as the representation for the elements of Idl β+1 (X); and to have some uniformity assumptions of the form: the function that to β ∈ α associates a full presentation of Idl β (X) is computable.

Minimality of the Definition Is Definition 9.4.1 minimal ? Does there exists a ω 2 -WQO (X, ≤) such that (Idl (X), ⊆) is not ideally effective ? A starting point would be to investigate the domination ordering on finite multisets or the lexicographic product, since we were unable to prove these constructions to be Idl 2 -effective.

Part II

First-Order Logic over an Ideally Effective WQOs

Joint work with Ph. Schnoebelen and G. Zetzsche

Results on the expressiveness and decidability of first-order theories, and in particular first-order theories over some fixed structure abound. One of the simplest structures one can think of are quasi-ordered sets, and indeed many such structures have been studied in the last decades (see [START_REF] Boudet | About the theory of tree embedding[END_REF][START_REF] Comon | Ordering constraints on trees[END_REF][START_REF] Comon | The first-order theory of lexicographic path orderings is undecidable[END_REF][START_REF] Kudinov | Definability in the subword order[END_REF][START_REF] Kuske | Theories of orders on the set of words[END_REF][START_REF] Karandikar | Decidability in the logic of subsequences and supersequences[END_REF][START_REF] Ramanujam | Definability in first order theories of graph orderings[END_REF] and references therein). In the following chapters, we investigate first-order logics over well quasi-ordered sets. More precisely, given a WQO (X, ≤), we consider the first-order logic with ≤ as the only predicate, denoted FO(X, ≤), where ≤ is interpreted as the quasi-ordering ≤ over X. We can for instance express the following properties:

• ∀x, y, z. x ≤ y ∧ y ≤ z → x ≤ z. This expresses that ≤ is transitive, which is true for any QO (X, ≤)

• ∀x, y. ∃u. x ≤ u ∧ y ≤ u ∧ [∀z. (x ≤ z ∧ y ≤ z) → u ≤ z]. This expresses that (X, ≤) is a semi-lattice. This formula is for instance satisfied on the structure (N k , ≤ × ) but not on (A * , ≤ * ).

• ∃x, y, z, u, v, w. x

≤ u ∧ x ≤ v ∧ x ≤ w ∧ y ≤ u ∧ y ≤ v ∧ y ≤ w ∧ z ≤ u ∧ z ≤ v ∧ z ≤ w ∧ x ⊥ y ∧ x ⊥ z ∧ y ⊥ z ∧ u ⊥ v ∧ u ⊥ w ∧ v ⊥ w, where
x ⊥ y is an abbreviation for x ≤ y ∧ y ≤ x. This formula expresses that some finite ordering embeds into (X, ≤). For instance, this particular finite ordering does not embed into N 2 , but does embed into N k for k ≥ 3.

We also consider formulas that include constants from X, that is we consider the first-order theory with ≤ as the only predicate, and a (potentially infinite) set of constants X, interpreted over X. This logic will be denoted FO(X, ≤, X). For instance, the formula ∀x. (x ≥ 2, 3 ∧ x ≥ 3, 2 ) ↔ x ≥ 3, 3

expresses that over N 2 , ↑ 2, 3 ∩ ↑ 3, 2 = ↑ 3, 3 . More generally, we can represent any upward-closed set U = n i=1 ↑ x i as a formula ϕ U (x) = n i=1 x ≥ x i with one free variable x, such that for any element x of X, x ∈ U if and only if X, x → x |= ϕ(x). Therefore, the logic provides a representation for upward-closed sets, and also for downward-closed sets using the excluded minor representation. Moreover, the logic can express that a "set" (represented as a formula with one free variable) is closed, or directed: ∀x, y. ϕ(x) ∧ y ≥ x ⇒ ϕ(y) ∀x, y.ϕ(x) ∧ ϕ(y) ⇒ ∃z. ϕ(z) ∧ z ≥ x ∧ z ≥ y As a result, if FO(X, ≤, X) is decidable, we can compute unions, intersections and complements of closed subsets. In the following chapters, we investigate connections between this representation of closed subsets and the notion of effectiveness introduced in the first part. Of course, the decidability of the full logic FO(X, ≤, X) seems to be a much stronger property, and this is confirmed by the undecidability of Σ 2 (A * , ≤ * ), proved in [START_REF] Karandikar | Decidability in the logic of subsequences and supersequences[END_REF] already for A a two-elements alphabet. In the following chapters, we thus mostly study sub-fragments of the existential fragment Σ 1 (X, ≤, X). The existential fragment of a structure remains an important piece of the logic, notably due to the success of SMT solvers over the past decades. It corresponds to constraint solving, which has many applications in theorem proving and rewriting theory for instance [START_REF] Boudet | About the theory of tree embedding[END_REF].

In Chapter 10, we prove that the positive existential fragment of FO(X, ≤, X) is decidable for any ideally effective WQO (X, ≤). In [START_REF] Boudet | About the theory of tree embedding[END_REF], it is shown that the positive existential fragment of first-order logic interpreted over terms on a finite signature, and where the only predicate ≤ is interpreted as tree embedding, is decidable. In these terms, we extend this result to the case where the set of terms is generated by an infinite signature, but with no symbols of arity greater than 0 (i.e. only constants). In this case, the ordering on terms (trees) coincides with the ordering over the elements.

In Chapter 11, we show that our result cannot be extended to the full existential fragment, since Σ 1 (A * , ≤ * , A * ) is already undecidable for a two-symbols alphabet A, while (A * , ≤ * ) is ideally effective (Section 6.1).

The first-order structure of words (over a finite alphabet) is of particular importance in computer science, and it has been studied for various orderings, although the most studied structure on words probably is (A * , •, =) where • is interpreted as concatenation. Its Σ 2 fragment is undecidable [START_REF] Quine | Concatenation as a basis for arithmetic[END_REF][START_REF] Valery | Undecidability of the positive ∀∃ 3 -theory of a free semigroup[END_REF], but its existential fragment has been shown decidable by Makanin [START_REF] Diekert | Makanin's algorithm[END_REF], and has been intensively studied since, notably because its exact complexity is still an open problem [START_REF] Plandowski | Satisfiability of word equations with constants is in PSPACE[END_REF][START_REF] Day | The satisfiability of extended word equations: The boundary between decidability and undecidability[END_REF]. In [START_REF] Kuske | Theories of orders on the set of words[END_REF], first-order logics over A * with several orderings are considered. It is in particular shown that Σ 3 (A * , ≤ * ) is undecidable. This result is improved in [START_REF] Karandikar | Decidability in the logic of subsequences and supersequences[END_REF]: Σ 2 (A * , ≤ * ) is undecidable. Note that in the case of A * , it is possible to define constants (up to permutation of the letters of A) in the Σ 2 fragment, as shown in [START_REF] Karandikar | Decidability in the logic of subsequences and supersequences[END_REF]. However, without constants, Σ 1 (A * , ≤ * ) is decidable (this is discussed in Section 10.3). In Section 11.1, we close the gap, showing that in the presence of constants, Σ 1 (A * , ≤ * , A * ) is undecidable.

Chapter 11 is based on the article [START_REF] Halfon | Decidability, complexity, and expressiveness of first-order logic over the subword ordering[END_REF]: only parts of the article are rewritten here. A brief overview of the results of [START_REF] Halfon | Decidability, complexity, and expressiveness of first-order logic over the subword ordering[END_REF] that are not presented in this thesis is given in conclusion.

Equivalence and Normal Forms Two formulas ϕ and ψ are said to be equivalent, denoted ϕ ⇔ ψ, if ϕ = ψ .

We assume the reader is familiar with the following normal forms:

• Alpha-renaming: if ϕ is quantifier-free and y / ∈ fv(ϕ), then the formulas ∃x. ϕ and ∃y. ϕ[x ← y] are equivalent, where ϕ[x ← y] denotes the syntactical substitution of variable y for variable x in ϕ. In particular, we can always assume that a variable is not quantified twice in a first-order formula.

• Prenex normal form: any formula ϕ is equivalent to a formula in prenex normal form, that is with all quantifiers in front; i.e. of the form Qx 1 . Qx 2 . . . Qx n . ψ where ψ is quantifier-free and Q ∈ {∃, ∀}. Given a formula, one can compute an equivalent formula in prenex normal form.

• Finally, quantifier-free formulas can be put in disjunctive (resp. conjunctive) normal form, that is as a disjunction of conjunctions of litterals, where a litteral is either an atomic formula or its negation.

Since the problems we study are closed under equivalence, we can always assume that the input formulas of our problems are given in such forms.

Fragments. The main fragments we are interested in are fragments where the quantifier alternation is controlled. Let Σ i be the set of closed formulas in prenex normal form that start with a certain number of consecutive existential quantifiers, then a certain number of consecutive universal quantifiers, and so on alternating at most i times between consecutive blocks of each type of quantifiers. The fragment Π i is defined analogously, but we ask that formulas start with universal quantifiers. By convention, Σ 0 = Π 0 is the set of quantifier-free formulas.

The fragment Σ i of FO(X, ≤, X) will be denoted Σ i (X, ≤, X).

Syntactic Sugar. In the subsequent chapters, we will use the usual syntactic abbreviations for logical operators (notably for the universal quantification ∀), as well as the following shortcuts:

• Not smaller: x ≤ y def ⇔ ¬(x ≤ y).

• Order equivalence: x ≡ y def ⇔ x ≤ y ∧ y ≤ x. The symbol ≡ will be denoted = if (X, ≤) is anti-symmetric.

• Incomparability: x ⊥ y def ⇔ x ≤ y ∧ y ≤ x.

• Membership in an upward-closed set: if

U = i ↑ u i , x ∈ U def ⇔ i x ≥ u i .
• Membership in a downward-closed set: if D is downward-closed, its complement ∁D = X D is upward-closed, and the previous abbreviation can be used:

x ∈ D def ⇔ ¬(x ∈ ∁D).

Positive Existential Fragment

We begin our investigation with a very simple fragment of FO(X, ≤, X), which we call the extended positive existential fragment. As its name indicates, it is a sub-fragment of the more common existential fragment Σ 1 (X, ≤, X). In this section, we show the decidability of the extended positive existential fragment, under the assumption that (X, ≤) is an ideally effective WQO.

Definition 10.2.1. The extended positive existential fragment of FO(X, ≤, X) is defined by the following grammar:

ϕ ::= u ≤ x | u ≤ x | x ≤ u | x ≤ u | x ≤ y | ϕ ∧ ϕ | ϕ ∨ ϕ | ∃x. ϕ
where c ∈ X and x, y ∈ Var.

We call it extended due to the presence of negation in some atomic formulas. Observe that it suffices to add the predicate "x ≤ y" to this grammar to generate the full existential fragment of FO(X, ≤, X). Theorem 10.2.2. If (X, ≤) is an ideally effective WQO, then the extended positive existential fragment of FO(X, ≤, X) is decidable.

Our first observation is that the four atomic formulas x ⊲⊳ u (for x ∈ Var a variable, u ∈ X a constant and ⊲⊳ ∈ {≤, ≥, ≤, ≥}) can be reformulated as x ∈ U for some upward-closed set U ⊆ X or as x ∈ D for some downward-closed set D ⊆ X. Indeed:

u ≤ x ⇔ x ∈ ↑ u u ≤ x ⇔ x ∈ ¬ ↑ u x ≤ u ⇔ x ∈ ↓ u x ≤ u ⇔ x ∈ ¬ ↓ u
Since (X, ≤) is an ideally effective WQO, we can compute these sets (which actually are principal ideals and filters). We push this approach beyond atomic formulas: given a closed formula of the extended positive existential fragment, we can compute its prenex normal form, and put the quantifier-free part of the formula in Disjunctive Normal Form. We obtain a formula ϕ = ∃x 1 • • • ∃x k . p i=1 qi j=1 ϕ i,j where the ϕ i,j are atomic. Moreover, since (X, ≤) is ideally effective, we can compute intersections of closed subsets. Thus for each i ∈ [p] and each j ∈ [q i ], there exist formulas ψ 1 and ψ 2 such that qi j=1 ϕ i,j is equivalent to ψ 1 ∧ ψ 2 , ψ 1 is a conjunction of exactly one constraint of the form x ∈ U x ∩ D x per x ∈ Var(ϕ), for some upward-closed set U x and some downward-closed set D x , and ψ 2 is a conjunction of constraints of the form x ≤ y for some x, y ∈ Var(ϕ). In the end, satisfiability of a conjunction qi j=1 ϕ i,j reduces to the following problem we call Partial-Embeddability under constraints:

PARTIAL-EMBEDDABILITY UNDER CONSTRAINTS INPUT:

A finite quasi-ordering (V, ≤), a collection of upward-closed sets (U v ) v∈V of X, and a collection of downward-closed sets (D v ) v∈V of X. QUESTION: Does there exist a monotone f : V → X such that ∀v ∈ V. f (v) ∈ U v ∩ D v ?

Now to conclude the proof, we show how to reduce the satisfiability of any instance to the satisfiability of a finite number of resolved instances. This process is essentially the one described in our first observation: if an instance is not resolved, then there exists a pair (v 1 , v 2 ) ∈ V 2 such that v 1 ≤ v 2 and either U v2 ⊆ U v1 or D v1 ⊆ D v2 , or both. In this case, we can update U v2 to U v2 ∩ U v1 ⊆ U v1 (respectively D v1 to D v1 ∩ D v2 ⊆ D v2 ). In this instance, the pair (v 1 , v 2 ) no longer violates conditions R1 and R3 of the definition of resolved (we will deal with conditions R2 and R4 later).

However, this new instance might not be resolved because of another pair (v 3 , v 4 ), and it might be the case that v 3 or v 4 is actually equal to v 1 or v 2 . Then, performing the same update for (v 3 , v 4 ) might break again the property U v2 ⊆ U v1 ∧ D v1 ⊆ D v2 . Therefore we must be careful in which order the updates are performed.

Observe that the update for a pair (v 1 , v 2 ) does not change D v2 and U v1 . We thus have to consider the upward-closed sets and the downward-closed sets independently, and update upward-closed sets following a non-decreasing order with respect to (V, ≤), while updating downward-closed sets following a non-increasing order with respect to (V, ≤).

Besides, to ensure conditions R2 and R4, we use the decomposition of upwardclosed sets (resp. downward-closed sets) as a union of filters (resp. ideals). If U = i F i and D = j I j , then x ∈ U ∩ D is equivalent to i,j x ∈ F i ∩ I j . Because of this disjunction, one instance will be reduced into several, which will all be further reduced until all the instances are resolved. The original instance is satisfiable if and only if one of the resulting resolved instances is satisfiable.

Formally, given an unresolved instance (V, ≤, (U v ) v∈V , (D v ) v∈V ), let n = |V | and label the elements of V as v 1 , . . . , v n such that ∀i, j ∈ [n], i < j ⇒ v i ≥ v j . In other words, v 1 v 2 • • • v n is a linearization of ≤. We then run the following algorithm:

1. Let L be a singleton list containing the original instance.

2. Let L ′ be an empty list, that will be used as a temporary variable. As observed at the beginning of this proof, steps 3(a)i and 4(a)i preserve satisfiability, and steps 3(a)ii and 4(a)ii simply transform unions into disjunction over multiple instances. The first loop (at line 3) updates upward-closed sets, while the second loop (at line 4) updates downward-closed sets. After the first loop is executed for index j, the following holds for every instance of L: ∀v ∈ V. v ≤ v j ⇒ U v ⊆ U vj , and the upward-closed sets U v for v ≤ v j will no longer be modified. Moreover, U vj is a filter, and will no longer be modified. Thus conditions R1 and R2 hold at the end of the algorithm. A similar invariant holds for the second loop. Hence, at the end of the algorithm, all instances in L are resolved, and the original instance is satisfiable if and only if one of the resolved instances of L is.

Full Existential Fragment

In the previous section, we have established the decidability of a sub-fragment of the existential fragment of FO(X, ≤, X). As observed earlier, it suffices to add the predicate x ≤ y to the grammar of Definition 10.2.1 to obtain a grammar for the full existential fragment of FO(X, ≤, X) (this grammar produces existential formulas whose negations have been pushed down to the atoms).

The same approach we used for the extended positive existential fragment can be applied to the full existential fragment:

• push the negations of ϕ in,

• convert predicates x ⊲⊳ c into constraints x ∈ U and x ∈ D,

• put in prenex normal form, with the quantifier-free part in DNF.

We obtain a formula

ϕ = ∃x 1 • • • ∃x k . p i=1 x∈Var
x ∈ U i,j

x ∩ D i,j

x ∧ ψ i,j

for some collections of upward-closed sets (U x ) x∈Var and downward-closed sets (D x ) x∈Var . However this time, formulas ψ i,j are conjuncts of predicates of the form x ≤ y for some x, y ∈ Var (as before) but also of the form x ≤ y. Thus, if we interpret ψ i,j as a quasi-ordering on Var, some monotone mapping from Var to X might actually not satisfy ψ i,j . We need the stronger notion of embedding: x ≤ y if and only if f (x) ≤ f (y). We obtain a reduction to the following problem: EMBEDDABILITY UNDER CONSTRAINTS INPUT:

A finite quasi-ordering (V, ≤), and two collections (U v ) v∈V and (D v ) v∈V of upward-closed and downward-closed sets of X respectively. QUESTION: Does there exists an embedding f : V → X such that ∀v ∈ V. f (v) ∈ U v ∩ D v ? Note that since ψ i,j might not fully define a quasi-ordering on Var (i.e. ψ does not enforce exactly one among x < y, x = y or x ⊥ y ), we have to make an additional 1. Simple languages membership: x ∈ ua * vb * w, or simply x ∈ ua * v.

In the rest of the proof, we will write ∃x ∈ L for several languages L of the form ua * vb * w, for some u, v, w ∈ A * and a, b ∈ A. This can indeed be expressed in our logic since we have seen that we can express membership in upward-closed sets and downward-closed sets, and ua * vb * w = ↑(uvw)∩(↓ u)a * (↓ v)b * (↓ w) (see Section 6.1 for the structure of downward-closed sets of (A * , ≤ * )). Similarly, ua * v = ↑(uv) ∩ (↓ u)a * (↓ v). Recall |u| a denotes the number of occurrences of a in u.

∃x ∈ a * : x ≤ * v ∧ x ≤ * u.

The correctness of this expression follows from the observation that for x ∈ a * , x ≤ * u is equivalent to |x| ≤ |u| a .

Successor (weak version 1): ∃n

: u = a n ∧ v = a n-1 b. u ∈ aaa * ∧ v ∈ a * b ∧ ∃x ∈ a * baa : |v| a < |u| a ∧ v ≤ * x ∧ u ≤ * x.
Note that the above formula is actually equivalent to "∃n ≥ 2 : u = a n ∧ v = a n-1 b", from which it is not difficult to build a formula for the actual predicate we want to express. These expressions define the leftmost embedding of w x into w y : the variable t i,j,k describes how many letters from a y k i i are available for embedding the a

x j i i factor of w x . The variable e i,j,k counts how many of these available letters are actually used for the a x j i i factor in the left-most embedding of w x into w y .

We are now ready to define ψ ≤ * and ψ ≤ * :

ψ ≤ * def ⇔ ∃(t i,j,k ) J ∃(e i,j,k ) J : τ ∧ η ∧ (i,j)∈I

x j i ≤ ℓ k=1 e i,j,k ψ ≤ * def ⇔ ∃(t i,j,k ) J ∃(e i,j,k ) J : τ ∧ η ∧ (i,j)∈I

x j i > ℓ k=1
e i,j,k

Since formulas τ and η are inductive equations that uniquely define the values of t i,j,k and e i,j,k as functions of the x and y vectors, ψ is equivalent to the negation of ϕ (quantifying universally or existentially on the t i,j,k and e i,j,k yields equivalent formulas). Moreover, ϕ expresses that there is enough room to embed each factor a x j i i in w y , i.e., that w x ≤ * w y as claimed.

Decidability of Σ 1,1

Theorem 11.2.4. The Σ 1,1 fragment is decidable.

Decidability is obtained by reduction to Σ 1,0 . In the fashion of a quantifier elimination procedure, we show that formulas of the form ∃t : ϕ where ϕ ∈ Σ 1,0 and t is the only alternation-unbounded variable, are equivalent to some computable Σ 1,0 formula (next proposition). To compute an equivalent Σ 1,0 formula to any Σ 1,1 closed formula ψ, it then suffices to proceed by induction. Proposition 11.2.5. Let ϕ be a Σ 1,0 formula with a single free variable t. Then ∃t : ϕ is equivalent to ∃t ∈ (a * 1 • • • a * n ) p : ϕ for some computable p ∈ N. Proof. To prove this proposition, we exhibit a natural number p, computable from ϕ, such that for any word u ∈ A * , if u / ∈ (a * 1 • • • a * n ) p and u ∈ ϕ , then there exists v ∈ ϕ whose alternation is strictly smaller than u's (but not necessarily smaller than p). Thus, starting from any u ∈ ϕ , and by iterating the aforementioned property, we eventually get a solution to ϕ which is of alternation at most p. of ideals. This raises the question: can we find a non effective WQO whose first-order theory is decidable ? Or simply its existential fragment, or even positive existential fragment ?

Résumé

Avec des motivations venant du domaine de la Vérification, nous définissons une notion de WQO effectifs pour lesquels il est possible de représenter les ensembles clos et de calculer les principales opérations ensemblistes sur ces représentations. Dans une première partie, nous montrons que de nombreuses constructions naturelles sur les WQO préservent notre notion d'effectivité, prouvant ainsi que la plupart des WQOs utilisés en pratique sont effectifs. Cette partie est basée sur un article non publié dont Jean Goubault-Larrecq, Narayan Kumar, Prateek Karandikar et Philippe Schnoebelen sont co-auteurs.

Dans une seconde partie, nous étudions les conséquences qu'a notre notion sur la logique du première ordre interprété sur un WQO. Bien que le fragment existentiel positif soit décidable pour tous les WQOs effectif, les perspectives de généralisation sont limitées par le résultat suivant: le fragment existentiel de la logique du première ordre sur les mots finis, ordonnés par plongement, est déjà indécidable. Ce résultat a été publié à LICS 2017 avec Philippe Schnoebelen et Georg Zetzsche.

Abstract

With motivations coming from Verification, we define a notion of effective WQO for which it is possible to represent closed subsets and to compute basic set-operations on these representations. In a first part, we show that many of the natural constructions that preserve WQOs also preserve our notion of effectiveness, proving that a large class of commonly used WQOs are effective. This part is based on an unpublished article with Jean Goubault-Larrecq, Narayan Kumar, Prateek Karandikar and Philippe Schnoebelen.

In a second part, we investigate the consequences of our notion on first-order logics over WQOs. Although the positive existential fragment is decidable for any effective WQO, the perspective of extension to larger fragments is hopeless since the existential fragment is already undecidable for the first-order logic over words with the subword ordering. This last result has been published in LICS 2017 with Philippe Schnoebelen and Georg Zetzsche.

  for X and Lemma 4.3.5. (CI): Given an ideal I in the adherence of Y , Y (I ∩ Y ) = (X I) ∩ Y , which is computable using (CI) for X and Lemma 4.3.5.

  which motivates the following definition: Definition 6.1.7. Define the operator

2

 2 and that both representations are canonical, then by Proposition 7.1.6, D 1 = D 2 , and thus ∀I ∈ B i , I ⊆ D i . Therefore, the second condition directly givesB 1 ⊆ emb B 2 ⊆ emb B 1 , which implies B 1 = B 2 .Computability: If (X, ≤) is effective, inclusion is decidable, thus one can compute the canonical representation of an ideal from any other representation by testing for every I ∈ Supp(B) whether I ⊆ D. If it is the case, removing all copies of I from B does not change ↓ ∈ B ⊕ D ⊛ .

  loss of generality, assume M 1 / ∈ ↓ ∈ B ⊕ D ⊛ . The elements of M 1 overall belong to only m = |B |S1 | ideals of B. Thus, any submultiset N of M 1 with m + 1 elements is already not a member of ↓ ∈ B ⊕ D ⊛ , and since |S 1 | < |S|, such multisets N are strictly smaller than M .

  3 that ↑ a, b ∩ ↑ c, d = ↑ max(a, c), max(c, d) and ↓ a, b ∩ ↓ c, d = ↓ min(a, c), min(c, d) . Given σ a permutation of [0, m], define:

  exists by the domination hypothesis). It is obvious that f satisfies the requirements from the fourth definition, its restriction to [m] is injective, and its restriction to m + [n] is a domination.(4) ⇒ (2)Assume N = {|x 1 • • • x n |} ≤ ms M = {|y 1 • • • y m |},and let f : [n] → [m] be a function satisfying the requirements of the fourth definition. Define S = {|y

  Proof. (⊇) We show that given B ∈ X ⊛ and D ∈ Down(X), ↓ B + D ⊛ is an ideal. • It is downward-closed: let N ≤ ms M ∈ ↓ B + D ⊛ . Obviously, this implies that N D ≤ ms M D and by assumption M D ≤ ms B. Thus, by transitivity, N D ≤ ms B.

Fig. 7 .

 7 Fig. 7.1 may help the understanding of the above expression. The multiset B, depicted by the areas dashed in red on the figure, consists of the intersection B 0 ∩ B 1 , restrictions B i|D ī , plus the red clouds. Note that, as shown on the picture, these 3 parts of the definition of B are pairwise disjoint. Indeed, we assume that ideals ↓ B i + D ⊛ i are given by their canonical representations, hence there are no elements from D i in B i . Thus B 0 ∩ B 1 ∩ B i|D ī ⊆ B ī|Dī = ∅. The red clouds are disjoint from the two aforementioned parts by construction: we restrict our attention to what is left of the two multisets, which we denote B ′ i . Of these multisets B ′ i , we only keep in B elements from sets S i . These sets consist of elements of B ′ i that are dominated by elements in

Figure 8 . 1 :

 81 Figure 8.1: WQO for (ID), (CF) and (PI)

Figure 8

 8 Figure 8.5: WQO for Subsection 8.3

Proof. Of Proposition 9 . 1 . 5 1.

 915 According to Corollary 9.1.2, we immediately get that D(u) = D(v) by double inclusion. Moreover, we have h(u) ∈ ↓ h(v) • D(u) * , but by definition of h(u),

  The transfer function is computable. It maps a non-empty list [I 1 , . . . , I n ] of ideals of X (encoded according to the representation of the first condition) to an element D ∈ Down ′ (X) (encoded according to the representation of the second condition) such that D = n i=1 I i . • The flattening function is computable. It maps J ∈ Idl (Down ′ (X)) to a list [I 1 , . . . I n ] of ideals of X (encoded according to the first condition) such that J = n i=1 I i .

  be a smaller ideal. Then by Proposition 7.1.6, C Down(D) ⊆ emb B and E ⊆ D. Let I 1 ∪ • • • ∪ I n be the ideal decomposition of the downward-closed set I. Since C is a multiset of ideals, C Down(D) = C Idl (D). Indeed, remember that since D is downwardclosed, its ideals are exactly the ideals of X that are subsets of D. Moreover, since D ∈ I, then D

3 .

 3 for j = 1 to n: (a) for each instance I in L: i. Update U vj := U vj ∩ i<j U vi in I. ii. For each x ∈ min(U vj ), add a version of I updated with U vj := ↑ x to L ′ . (b) L := L ′ . 4. for i = n down to 1: (a) for each instance I in L: i. Update D vi := D vi ∩ i<j D vj in I. ii. For each ideal I in the canonical ideal decomposition of D vi , add a version of I updated with D vi := I to L ′ . (b) L := L ′ . 5. Return L.

2 .

 2 Occurrence comparison (strict): |u| a < |v| a .

4 .

 4 If u = a n and v = a n-1 b for some n ≥ 2, then the formula is satisfied with x = a n-2 baa.(⇐) Conversely, suppose the formula is satisfied with u = a n , x = a ℓ baa and v = a m b for some ℓ, m, n ∈ N.Then |v| a < |u| a ∧ v ≤ * x ∧ u ≤ * x translates as m < n ∧ ℓ < m ∧ n ≤ ℓ + 2, i.e. ℓ < m < n ≤ ℓ + 2 which implies n = m + 1 = ℓ + 2. Letter occurrence comparison (equality, weak version): u, v ∈ A * b∧|u| a = |v| a . ∃x ∈ a * : ∃y ∈ a * b : ∃n : x = a n ∧ y = a n-1 b ∧ y ≤ * u ∧ y ≤ * v ∧ x ≤ * u ∧ x ≤ * v. Correctness: (⇒) If u, v ∈ A * b with |u| a = |v| a ,then the formula is satisfied with n = |u| a + 1. (⇐) Suppose the formula is satisfied. Then a n-1 b ≤ * u and a n ≤ * u together imply |u| a = n -1. Moreover, if u ended in a, then a n-1 b ≤ * u would entail a n ≤ * u, which is not the case. Since |u| ≥ 1, we therefore have u ∈ A * b. By symmetry, we have |v| a = n -1 and v ∈ A * b. Hence, |u| a = n -1 = |v| a . 5. Successor (weak version 2): ∃n : u = aaba n b ∧ v = aba n+1 b ∧ w = ba n+2 b. u ∈ aaba * b ∧ v ∈ aba * b ∧ w ∈ ba * b ∧ [u, v, w ∈ {a, b} * b ∧ |u| a = |v| a = |w| a ] .

6 .

 6 Successor (weak version 3): ∃n: u = ba n b ∧ v = ba n+1 b. ∃x, y, z : ∃m : x = aaba m b ∧ y = aba m+1 b ∧ z = ba m+2 b ∧ u, v ∈ ba * b ∧ u ≤ * y ∧ u ≤ * x ∧ v ≤ * z ∧ v ≤ * y.Again, observe that the formula only works for n ≥ 1.Correctness:(⇒) If u = ba n b and v = ba n+1 b for some n ≥ 1, then the formula is satisfied with m = n -1. (⇐) Suppose the formula is satisfied for u = ba k b and v = ba ℓ b. Then u ≤ * y ∧ u ≤ * x imply k = m + 1; and v ≤ * z ∧ v ≤ * y imply ℓ = m + 2 7. Successor: ∃n : u = a n ∧ v = a n+1 . ∃x, y, z : ∃m : x = ba m b ∧ y = ba m+1 b ∧ ∃k : y = ba k b ∧ z = ba k+1 b ∧ u, v ∈ a * ∧ u ≤ * y ∧ u ≤ * x ∧ v ≤ * z ∧ v ≤ * y.Correctness of the above formula (for n ≥ 1) is similar to the previous one. Note that because of the word y, k has to be equal to m + 1.

8 . 1 j

 81 Occurrence comparison (equality): |u| a = |v| a . ∃x, y : ∃n : x = a n ∧ y = a n+1 ∧ x ≤ * u ∧ y ≤ * u ∧ x ≤ * v ∧ y ≤ * yAs for the second predicate, correctness relies on the equivalence x ≤ * u ⇔ |x| ≤ |u| a for x ∈ a * .9. Unary concatenation (weak version): u ∈ a * ∧ v = bu. u ∈ a * ∧ v ∈ ba * ∧ |v| a = |u| a .The predicate u ∈ a * ∧ v = ub is similarly expressible.10. Addition: |w|a = |u| a + |v| a . ∃x, y ∈ a * : |x| a = |u| a ∧ |y| a = |v| a ∧∃z ∈ a * ba * : xb ≤ * z ∧ xab ≤ * z ∧ by ≤ * z ∧ bya ≤ * z ∧ |w| a =|z| a Note that we can define xa and ya thanks to Successor and xb, (xa)b, by and b(ya) thanks to Unary concatenation (Items 7 and 9). Correctness: (⇒) Obvious. (⇐) the constraints on the second line enforce that z = xby and hence |z| a = |x| a + |y| a = |u| a + |v| a .11. Longest unary suffix: v is the longest suffix of u which is in a * , which we will later denote by v = ls(u, a).v ∈ a * ∧ ∃x ∈ b * a * : ∃y ∈ b * a * : |x| b = |y| b = |u| b ∧ |y| a = |x| a + 1 ∧ x ≤ * u ∧ y ≤ * u ∧ |v| a = |x| a .Correctness: there are two cases: either u ∈ a * , or u = u ′ ba n for some u ′ ∈ A * and n ∈ N. The first case is left to the reader.(⇒) If v = a n ,then the formula is satisfied with x = b |u ′ | b ba n and y = xa. (⇐) Suppose the formula is satisfied, then v = a m , x = b k a m , y = b k a m+1 for k = |u| b and for some m ∈ N. Moreover, since x ≤ * u, m ≤ n. And since y ≤ * u, m + 1 ≤ n, from which we derive m = n, and v = a n . 12. Unary concatenation: v ∈ a * ∧ w = uv. v ∈ a * ∧ ∧ ∃x, y ∈ a * : x = ls(u, a) ∧ y = ls(w, a) ∧ |w| b = |u| b ∧ u ≤ * w (11.1) ∧ |y| a = |x| a + |v| a ∧ |w| a = |u| a + |v| a (11.2) Correctness: (⇒) If v ∈ a * and w = uv, then the formula is satisfied with x = ls(u, a) and y = ls(w, a). (⇐) Let v = a n , x = a p and y = a q . The implication being clear if |u| b = 0 or |w| b = 0, we write u = u ′ ba k and w = w ′ ba ℓ . The second line implies that k = p and ℓ = q. Moreover, y = xv (forth line), and thus w = w ′ bxv. Hence, u ≤ * w implies u ≤ * w ′ bx. Thus, w and uv have the same number of occurrences of both a and b, and one is subword of the other: they are therefore equal. 13. Perfect alternation: u ∈ (ab) * . ∃v : v = uab ∧ v = abu Note that the equation v = uab can be obtained using twice Item 12. Correctness: (⇒) Obvious. (⇐) Assume abu = uab. If u = ǫ, then u ∈ (ab) * . Otherwise, u = abu ′ for some u ′ ∈ A * , and the equation becomes ababu ′ = abu ′ ab, which is equivalent to abu ′ = u ′ ab. By induction, we can prove that u ∈ (ab) * . 14. Occurrence comparison of different letters: |u| a = |v| b . ∃x ∈ (ab) * : |u| a = |x| a ∧ |v| b = |x| b .w x . We first define formulas τ and η that use extra free variables t i,j,k and e i,j,k for (i, j, k) ∈ [n] × [ℓ] × [ℓ] j,k)∈J t i,j,k = 0 if e i ′ ,j ′ ,k ′ > 0 for some (i ′ , j ′ ) (i, j) and k ′ > k y k i -j-′ =1 e i,j ′ ,k otherwise η def = (i,j,k)∈J e i,j,k = min t i,j,k , x j i -

  and respectively for v), and where n and m are at most exponential in |u| and |v|, respectively. Now, since |u i | and |v j | are polynomial in |u| and |v|, ↑ u i ∩ ↑ v j can be computed in time exponential in |u| and |v|, and finally, computing ↑ ≤ ′ u ∩ ↑ ≤ ′ v reduces to a quadratic number of exponential operations.

  • • • I k |}. Now the following holds: M ≤ ms B +M ′ +M |E (cf. definition 4 for instance), and since B +M ′ ∈ emb C, it proves that M ∈ ↓ ≤ms I.

For every I ∈ Idl (X, ≤), every ideal from the decomposition of Cl I (I) is of polynomial size in |I|.

Note that with this representation, a pair i, J where J ∈ Idl(X i ) denotes {1} × J when i = 1, and {1} × X 1 ∪ {2} × J -and not {2} × J-when i =

Acknowledgements

Complementing Ideals (CI)

The procedure to complement ideals is very similar to the procedure to complement filters: Proposition 7.1.12. Given B ∈ (Idl (X, ≤)) ⊛ and D ∈ Down(X, ≤),

where U S,B,D = min(X (D ∪ (Supp(B) S))).

Concretely, minimal multisets M of X ⊛ ↓ ∈ B ⊕ D ⊛ are multisets of size exactly |B |S |+1 whose elements are among the minimal elements of X (D ∪ (Supp(B) S)), for some S ⊆ Supp(B). The above procedure can obviously be implemented in exponential-time. Observe that this is already unavoidable in the case of (X, ≤) = (N 2 , ≤ × ): consider B n = n × {| ↓ 1, 1 |} and D n = ↓ 0, 0 . Indeed, it is immediate to check that any multiset of size n + 1 whose elements are among 0, 1 and 1, 0 is a minimal element of

There are 2 n such multisets. Below we present an optimization of the above procedure from which it is simple to derive a polynomial-time complexity implementation in the case of (X, ≤) = (N, ≤). Proposition 7.1.13. Given B ∈ (Idl (X, ≤)) ⊛ and D ∈ Down(X, ≤),

where G(S) = (S, E) and E = {(I, J) | I ∩ J (D ∪ B S) = ∅} Proof. We show that for every minimal elements x of X (D ∪ ↓ S) for some S ⊆ Supp(B) such that |S| > k, x is also a minimal element of X (D ∪ ↓ S ′ ) for some S ′ ⊆ Supp(B) with |S ′ | ≤ k. Indeed, denote by e i the element of N k that has a 1 on the i-th component, zeros elsewhere. Since x is minimal in X (D ∪ ↓ S), for every i ∈ [1, k], x i = xe i is either in D, or in ↓ S, or x i / ∈ N k (if the i-th component of x is 0). Therefore, we can define a subset S ′ ⊂ S of size at most k such that for every i ∈ [1, k], x i ∈ D or x i ∈ ↓ S ′ , or x i / ∈ N k . Obviously, x is still in X (D ∪ ↓ S ′ ), and is still minimal since for every i,

Finally, the lower bound is proved using the polynomial-time ideally effective WQO (P f (N 2 ), ⊑ H ) (cf. Section 7.3). Proposition 7.2.9. Let (X, ≤) = (P f (N 2 ), ⊑ H ) where N 2 is ordered with the product ordering. For n ∈ N, i ∈ [1, n] and U ⊆ [1, n], define:

The upward-closed set X ⊛ (↓ B + D ⊛ ) has at least 2 n -1 minimal elements. In particular, any procedure for (CI) runs in exponential-time in the worst case.

Proof. The elements (x i ) 1≤1≤n form an antichain of size n of N 2 . The downwardclosed set D is chosen so that any set which is both smaller than S [1,n] and in ∁D is equal to S U for some U ∈ [1, n].

Recall from Proposition 7.2.7 that minimal elements of X ⊛ (↓ B + D ⊛ ) are of the form B S , where B S = B | ↑ S + {|S|}. We here show that multisets B S U all are minimal elements of X ⊛ (↓ B + D ⊛ ) when U ranges over strict subsets of [1, n]. Given U ⊆ [1, n], B S U will be denoted B U for readability. Since (x i ) 1≤i≤n is an antichain, given U, V ⊆ [1, n], S U ⊑ H S V ⇔ S u ⊆ S V ⇔ U ⊆ V . Thus B U has one copy of each T i such that i / ∈ U , and an extra copy of S U . For any

n] and M be some multiset such that M < ms B U . According to the second definition of ≤ ms , there exists multisets P and Q such that ∅ = P ⊆ B U , M = B U -P + Q and P dominates Q. Without loss of generality, we can assume that Supp(M ) ∩ D = ∅. Subsequently, we show that M ≤ ms B. Assume M (S) > B(S) for some S ∈ X. By case analysis:

i , for i ∈ {0, 1}, using Proposition 7.2.4. We thus want to show that:

We prove the result for i = 0, the case i = 1 being symmetrical. To prove the first point, assume some x / ∈ D 0 is such that B(x) > B 0 (x). By our preliminary remark, it implies B(x) = B 1 (x) > B 0 (x), which also implies x ∈ B 1 , and thus x / ∈ D 1 . Now, since we are in the case

For the second point, distributing the intersection over the unions leads to four cases to consider:

2. Given x ∈ B 0 -B, by construction of B, x / ∈ D 1 . Thus for any z in ↓ x ∩ D 1 , z < x, and z ∈ ↓ < Supp(B 0 -B).

Given y

Intersecting Filters (IF)

Proposition 7.2.11. Given two multisets M 0 and M 1 , and i ∈ {0, 1}, we write ī for 1i, and define

The intersections of two filters is a filter:

When (X, ≤) is an (polynomial-time) ideally effective WQO, this leads to a (polynomial-time) procedure to intersect filters.

It is easier to understand this complicated condition on examples. Take

which is indeed greater than both M 0 and M 1 . On the other hand, if

is not part of the final result in the second example, while it is in the second. Intuitively, the condition expresses that an element x from M 0 will not be in the final result if it is dominated by some z ∈ M 1 such that z is in the final result. The fact that z is in the final result is expressed by negating the existence of a t in M 0 that dominates z. The condition on the multiplicities of z and t becomes clear when considering the case

2)] and comparing it to the second example.

) for some x. This implies that M ′ i (x) > N (x) for some i ∈ {0, 1}, and without loss of generality, we assume i = 0. This implies M ′ 0 (x) > 0, thus x ∈ S 0 and M ′ 0 (x) = M 0 (x). Since M 0 ≤ ms N , there exists y > x such that M 0 (y) < N (y).

If M ′ 1 (y) < N (y), then M (y) < N (y), which concludes the proof. We now prove that the other case,

. Instantiated with z = y, it gives the existence of t ∈ M 0 -M 1 such that t > y. Besides, we can consider this t maximal. Similarly, we instantiate with z = t in the condition of y ∈ S 1 , to obtain the existence of u ∈ M 1 -M 0 such that u > t. Now, we instantiate one more time the condition given by x ∈ S 0 , but with z = u. This gives the existence of v ∈ M 0 -M 1 such that v > u > t, which contradicts the maximality of t. Thus this case is impossible, and M ≤ ms N .

(⊇) We show that M 0 ≤ ms M , the other case being symmetrical. Assume M 0 (x) > M (x) = max(M ′ 0 (x), M ′ 1 (x)). This implies that M ′ 0 (x) = 0 and M ′ 1 (x) < M 0 (x). From M ′ 0 (x) = 0, we deduce the existence of z ∈ M 1 -M 0 such that z > x and for any t ∈ M 0 -M 1 , t ≤ z. This last part implies that z ∈ S 1 , thus

Finitary powerset over X

When (X, ≤) is a QO, a natural quasi-ordering on P(X), the powerset over X, is the Hoare quasi-ordering (also called domination quasi-ordering), denoted ⊑ H , and defined by

A convenient characterization of this quasi-ordering is the following: S⊑ H T iff S ⊆ ↓ X T . Note that (P(X), ⊑ H ) is in general not antisymmetric even when (X, ≤) is. For example S ≡ H ↓ X S for any S ⊆ X. Actually, (P(X)/ ≡ H , ⊑ H ) is order-isomorphic to (Down(X), ⊆). It is sometimes stated that (X, ≤) is a WQO if and only if Chapter 8 A Minimal Set of Axioms

Shortly Effective WQOs

The main notion of this part of the manuscript, Ideal Effectiveness (Definition 3.1.1), is defined through a list of requirements. A question that might occur to the reader, is whether some of the requirements are unnecessary, that is, whether some requirement is automatically fulfilled when the others are.

When we are only interested in computability, and not complexity, the answer is (surprisingly ?) yes. Let us formally prove this. Definition 8.1.1. A short presentation of a WQO (X, ≤) is a list of:

• Representations for X and Idl (X);

• Algorithms for the operations (ID), (PI), (CF), (II);

• The ideal decomposition of X.

We say that a WQO equipped with some representation for X and Idl (X) is shortly effective if it has a short presentation.

Note that a short presentation of (X, ≤) is obtained from one of its presentation by dropping procedures to decide ≤ (OD), to intersect filters (IF), to complement ideals (CI) and by dropping the filter decomposition of X. Theorem 8.1.2. Given a short presentation of a WQO (X, ≤), one can compute a presentation of (X, ≤). In particular, a WQO is shortly effective if and only if it is ideally effective.

Proof. We explain how to obtain the missing procedures:

(OD): The quasi-ordering ≤ can be tested using (ID) and (PI): given x, y ∈ X, x ≤ y if and only if ↓ x ⊆ ↓ y.

Proposition 8.1.4. A presentation of a WQO cannot be computed from a short presentation where one component (other than the encodings of X and Idl (X) has been dropped. In other words, the requirements listed to define short effectiveness are minimal to capture the notion of ideal effectiveness.

Proof. To prove this proposition, we prove the following statement:

(ID) There exists a WQO (X, ≤) such that there exist algorithms to perform operations (PI), (CF) and (II), but ideal inclusion is undecidable.

(PI) There exists a WQO (X, ≤) such that there exist algorithms to perform operations (ID), (CF) and (II), but function x → ↓ x is not computable.

(CF) There exists a WQO (X, ≤) such that there exist algorithms to perform operations (ID), (PI) and (II), but there are no algorithm to complement filters.

(II) There exists a WQO (X, ≤) such that there exist algorithms to perform operations (ID), (PI) and (CF), but there are no algorithm to intersect ideals.

(XI) There are no algorithm such that for all WQO (X, ≤), given a list containing encodings for X and Idl (X) as well as procedures for (ID), (PI), (CF) and (II), the algorithm computes the ideal decomposition of X.

Observe that the first four statements are stronger than the statement we need to prove. Indeed, there cannot be an algorithm that produces an algorithm for (ID) given the rest of a short presentation for any WQO (X, ≤), since there is a specific WQO for which this algorithm does not even exist.

In the case of (XI) however, we cannot prove such a stronger statement since for each specific WQO, the ideal decomposition of the whole set is a constant, hence always computable.

Before we proceed to prove the five statements above, let us introduce the general idea, as well as some notations. In this remainder of this chapter, we build WQOs equipped with encodings for X and Idl (X) for which some operation is not computable. To prove non-computability of an operation, we always reduce the halting problem for Turing machines. More precisely, from now on we fix an enumeration (T i ) i∈N of Turing machines, such that there is a universal Turing Machine that can simulate T i when given i as input. We use the following version of the halting problem: given i, decide whether T i halts on the empty input (i.e. starting with an empty tape). This problem is well-known to be undecidable. Also define t i ∈ N ∪ {ω} to be the halting time of machine T i (on the empty input). For illustration purposes, we will assume that our enumeration is such that T 0 and

All the WQOs given subsequently are built along the same idea: an element of the WQO intuitively corresponds to some execution step of some Turing machine T i . Elements are ordered such that an element corresponding to step t of the execution of machine T i is greater or equal to an element corresponding to step t ′ of the execution of machine T j whenever i > j or i = j and t ′ > t. The simplest WQO satisfying these conditions is the ordinal ω 2 (equivalently, the lexicographic ordering over N 2 ). WQOs

Effective Extensions

Given (X, ≤) an ideally effective WQO and ≤ ′ an extension of ≤, we have given in Theorem 4.1.2 sufficient conditions for (X, ≤ ′ ) to be ideally effective. In this section, we prove the following stronger theorem: Theorem 8.2.1. Let (X, ≤) be an ideally effective WQO and ≤ ′ an extension of ≤. Then, (X, ≤ ′ ) is ideally effective (for the encodings of X and Idl (X, ≤ ′ ) described in Section 4.1), whenever the following function is computable:

Moreover, under these assumptions, a presentation of (X, ≤ ′ ) can be computed from a presentation of (X, ≤) and algorithms realizing Cl I .

Proof. It suffices to show that, under these assumptions, we can compute function Cl F :

Indeed, if Cl F is computable, we can conclude with Theorem 4.1.2. The idea to compute Cl F using only Cl I and operations in (X, ≤) is quite similar to the algorithm to compute CD using the other operations presented in the proof of Theorem 8.1.2. In particular, our algorithm relies on brute force enumeration of elements of X, and we will not get a complexity upper bound for Cl F , even if Cl I is polynomial-time. This is why we dropped the conclusion about polynomial-time presentation in the formulation of the theorem above (compared to Theorem 4.1.2). Let x ∈ X. We can compute ↑ ≤ ′ x as follows:

Every step of this high-level algorithm is computable.

Step 1 can be performed using (PI) for (X, ≤). To test the conditional part of the while loop, we use the following equivalence: for any x ∈ X and U ∈ Up(X, ≤),

The Lexicographic Quasi-Ordering Is Not Ideally Effective

In this section, we prove that the lexicographic quasi-ordering introduced in Section 5.4 is not ideally effective in general. More precisely, in Section 5.4 we proved that (X 1 × X 2 , ≤ lex ) is ideally effective provided that (X 1 , ≤ 1 ) and (X 2 , ≤ 2 ) are ideally effective WQOs, and that we can decide whether an ideal of X 1 is principal. Subsequently, we justify the necessity of this last assumption.

Let (X 1 , ≤ 1 ) be the WQO defined in the previous section, in particular it is undecidable given I ∈ Idl (X 1 ) whether I is principal. Let X 2 be the finite set {a, b} ordered with equality. What matters most here is that X 2 is not an ideal.

Proof. (⇒) By contraposition, if I = ↓ x is a principal ideal for some x ∈ X 1 , then the elements x, a and x, b have no common upper bound in I × X 2 .

(⇐) Let x, c , y, d ∈ I × X 2 . Since I is not principal (but directed), there exists z ∈ I such that z is strictly greater than both x and y. Then z, a ∈ I × X 2 , and is greater for ≤ lex than both x, c , y, d . Theorem 8.3.2. Let (X 1 , ≤ 1 ) and (X 2 , =) be the two WQOs defined above. We represent elements of X 1 × X 2 as pairs of encodings of X 1 and X 2 . Then, for any representation of ideals of (X 1 × X 2 , ≤ lex ), the lexicographic product (X 1 × X 2 , ≤ lex ) is not ideally effective.

Proof. Fix some representation of ideals of (X 1 × X 2 , ≤ lex ).

Recall that both (X 1 , ≤ 1 ) and (X 2 , =) are ideally effective. Therefore, given I ∈ Idl (X 1 ), we can compute its complement U def = X 1 I. We can then compute

In particular, we can decide whether I × X 2 is an ideal. According to the previous lemma, this is impossible.

The Domination Ordering on Multisets Does Not Effectively

Extend the Embedding Quasi-Ordering

Let (X, ≤) be a WPO. Recall from Section 7.2 the definition of its finite multiset extension under the domination ordering (X ⊛ , ≤ ms ). Also, remember that ≤ ms is an extension of ≤ emb , where (X ⊛ , ≤ emb is the finite multiset extension under the embedding ordering, shown ideally effective in Section 7.1. Proving (X ⊛ , ≤ ms ) to be ideally effective following the approach of Section 4.1 would require to show that the functions Cl I and Cl F associated to this extension are computable. Subsequently, we show that this is not the case in general. This justifies that ideal effectiveness was shown from scratch in Section 7.2, with a better encoding of ideals of (X ⊛ , ≤ ms ) than the one from Section 4.1.

Recall that ideals of (X ⊛ , ≤ emb ) are elements

in Proposition 7.2.2, it was crucial to distinguish principal ideals from limit ideals. Suppose B = {| ↓ x 1 , . . . , ↓ x n , I 1 , . . . , I m |} where I 1 , . . . , I m are limit ordinals, then it was proved in Proposition 7.2.

Applying this to the WQO X from Section 8.3:

Deciding whether an Ideal is Adherent

Finally, we show that adherence cannot be decided in general. Remember from Section 4.3 that given Y ⊆ X, an ideal

Below, we define a WQO (X, ≤) and a recursive subset Y ⊆ X such that deciding whether a given ideal of X is adherent to Y is undecidable. Moreover, we show that this WQO is not ideally effective, proving that some extra assumptions are necessary for induced WQOs to be ideally effective (however, this does not prove that the extra assumptions made in Section 4.3 are necessary).

Define X = ω 2 ordered by the natural ordering. (X, ≤) is ideally effective since it is an ordinal, as proved in Section 3.2.3. Consider the subset Y = {ω • i + t | i, t ∈ N, t ≤ t i }. This is a recursive subset of X Observe that the ideal ω • (i + 1) is adherent to Y if and only if T i halts. Therefore, adherence to Y is undecidable. Moreover, Y ↑ Y ω • (i + 1) gives the halting time t i of T i , hence (Y, ≤) is not ideally effective.

Chapter 9 Toward Ideally Effective BQOs

We motivate our introduction of Better Quasi-Orderings with yet another construction: that of taking infinite sequences over a WQO (X, ≤). By infinite, we mean sequences of length ω.

Infinite Sequences of WQOs

Let (X, ≤) be a QO. We consider the QO (X ω , ≤ ω ) where X ω denotes the set of infinite sequences over X, and ≤ ω denotes the embedding relation introduced in Chapter 2 restricted to X ω . Formally, if u = (u i ) i∈N and v = (v i ) i∈N , we have:

⇔ There exists a strictly increasing mapping f :

If |X| > 1, the set X ω has uncountably many elements, and thus we cannot represent all its elements algorithmically. However, if (X, ≤) is a WQO, then (X ω , ≤ ω ) has countably many equivalence classes for ≡ ω . This relies on the following characterization of ≤ ω over X ω .

For the remainder of this section, let (X, ≤) designates a WQO.

Proposition 9.1.1. Given u = (u i ) i∈N ∈ X ω , define the tail of u as D(u) = i∈N j≥i ↓ u j , and the head of u as the finite prefix h(u) = u 0 • • • u j of u, where j is the smallest natural number such that ∀k > j. u k ∈ D(u).

Then, for all u ∈ X ω :

Proof. Of Proposition 9.1.1 and Corollary 9.1.2. Let u = (u i ) i∈N ∈ X ω . Intuitively, D(u) consists of all elements of X that will be covered infinitely often in u. The sequence D i = j≥i (↓ u j ) is a decreasing sequence of downward-closed subsets of (X, ≤). Thus since (X, ≤) is WQO, (D i ) i∈N stabilizes to some element D i0 , and its limit is

We show the following:

(⇒) Assume u ≤ ω v and let f : N → N be a witness of this embedding. Let i 0 be the greatest index such that f

is the embedding quasi-ordering on X * , see Section 6.1). Moreover, by definition of h(v):

The remainder of f is defined inductively: for every i > |u 1 |, pick for f (i) an index j such that j > max{i, f (1), f (2), . . . , f (i-1)} and v j ≥ u i . Such an index j exists since u i ∈ D(v) and D(v) consists of all the elements of X that are covered infinitely often in v, that is:

Corollary 9.1.3. The set X ω / ≡ ω is countable.

Proof. It follows from Proposition 9.1.1 that

Since X * and Down(X) are countable (X is assumed countable), so is X ω / ≡ ω .

Finally, one last property is directly implied by Proposition 9.1.1:

Note that (WQO7) in Section 2.3 only gives well-foundedness of (Down(X), ⊆). And indeed, (Down(X), ⊆) may not be a WQO. Hence, neither is (X ω , ≤ ω ). This matter is discussed in Section 9.2.

Encodings for X ω and its Ideals

Subsequently, let (X, ≤) designates an ideally effective WQO such that (Down(X), ⊆) is also a WQO. In this setting, (X ω , ≤ ω ) is a WQO as well.

We have argued that it is hopeless to represent every element of X ω , and we will therefore focus on the ideal effectiveness of its quotient (X ω / ≡ ω , ≤ ω ). The above results suggest to represent equivalence classes of X ω / ≡ ω as pairs from X * × Regarding the flattening function: let J ∈ Idl (Idl (X ⊛ )). It is encoded as ↓ ∈ B ⊕ D ⊛ , I where B ∈ Idl (Idl (X)) ⊛ , D ∈ Down(Idl (X)) and I ∈ Idl (Down(X)).

We claim that:

where B = {|I 1 , . . . , I n |}, for some I 1 , . . . , I n ∈ Idl (Idl (X)).

Indeed, let M ∈ J , there exists an ideal of

1 belongs to an ideal I ∈ B 1 , which itself belongs to an ideal of ideals J ∈ B, then x ∈ J .

Finally, for every x ∈ M ′′ 1 , there exists an ideal I ∈ B 2 such that x ∈ I, and since

x i ∈ I i . Thus, for each i, there exists I i ∈ I i such that x i ∈ I i . Define I j to be an arbitrary ideal of I j for j ∈ [k +1, n], and define B = {|I 1 , . . . , I n |}. We have

Finally, we can similarly prove that there exists D ∈ I ⊆ Down(X) such that M 3 ∈ D ⊛ , ultimately proving that M ∈ J .

Finite Powerset with Hoare Quasi-Ordering: In this case, Idl (P f (X), ⊆) is isomorphic to (Down(X), ⊆), which has been shown to be ideally effective in Proposition 9.4.2. The computability of the flattening function has also been proved there.

Unfortunately, we did not finish our investigation in time to include all the results in this manuscript, but we have recently obtained that:

• These extra assumptions are met in the case of (X * , ≤ cj ) which is thus Idl 2effective.

• The domination ordering on finite multisets is also Idl 2 -effective.

Remark 9.4.5. As the reader may have noticed, constructions that "commute" with the ideal constructions are particularly easy to show Idl 2 -effective. For instance, for the cartesian product, Idl (X 1 × X 2 ) = Idl (X 1 ) × Idl (X 2 ) and therefore, the Idl 2effectiveness comes for free with the ideal-effectiveness.

Chapter 10

Constraints Solving on an Ideally Effective WQO

Definitions

In this section, we define formally all the notions discussed in the previous introduction that will be used in the subsequent sections of this chapter. The main object is the firstorder logic over the structure (X, ≤) with constants, denoted FO(X, ≤, X).

Syntax. The syntax of this logic consists of all first-order formulas over the signature with predicate ≤ and a constant symbol u for each u ∈ X. We use the font u to distinguish constants from variables in the formulas. These formulas are generated by the following grammars:

• Terms: t ::= x | u where u ∈ X and x ∈ Var, a countably infinite set of variables.

• Formulas:

The notation FO(X, ≤) denotes the first-order logic over X without constant symbols, i.e. where terms are restricted to be variables from Var.

Semantic. We interpret these formulas over a WQO (X, ≤): a valuation is a function from Var to X. A formula ϕ is said to be satisfied by a valuation V : Var → X, denoted by X, V |= ϕ, if:

Truth Problems. A formula is said to be:

• satisfiable if there exists a valuation V : Var → X such that X, V |= ϕ;

The set of free variables of a formula ϕ will be denoted fv(ϕ). We sometimes write ϕ(x 1 , . . . , x n ) to emphasize that fv(ϕ) = {x 1 , . . . , x n } where the x i 's are distinct. When such an enumeration x 1 , . . . , x n of fv(ϕ) is understood, we denote the solutions of ϕ by ϕ , defined by:

Note that with this definition, a formula ϕ is satisfiable if and only if ϕ = ∅; and valid if and only if ϕ = X n . As a consequence, observe that a formula is satisfiable if and only if its negation is not valid.

A formula is said to be closed if it has no free variables. In this case, satisfiability and validity coincide (the only valuation being the empty valuation), and the two notions will be used interchangeably.

In the remainder of Part II, we study satisfiability and validity over fragments of (X, ≤): given a fragment (i.e. subset) F of FO(X, ≤, X), define the following problems, SATISFIABILITY OF THE F FRAGMENT INPUT:

A first-order formula ϕ ∈ F QUESTION: Is ϕ satisfiable ? VALIDITY OF THE F FRAGMENT INPUT:

A first-order formula ϕ ∈ F QUESTION: Is ϕ valid ?

If F consists of closed formulas only (and it will always be the case), then the two problems coincide, and we will say that F is decidable (resp. undecidable) to express that both problems are decidable (resp. undecidable). Indeed, we take V = qi j=1 fv(ϕ i,j ); ψ 2 induces a quasi-ordering on V , that is, x ≤ y in V if and only if x ≤ y is a conjunct of ψ 2 . Finally, ψ 1 gives a collection of upward-closed sets (U v ) v∈V and a collection of downward-closed sets (D v ) v∈V . Subsequently, we show that this problem is decidable, which proves the decidability of the extended positive existential fragment since it then suffices to solve an instance of the Partial-Embeddability under constraints problem for each qi j=1 ϕ i,j .

Lemma 10.2.3. The Partial-Embeddability under constraints problem is decidable.

Proof. The algorithm to solve the Partial-Embeddability under constraints problem is based on the following observation: given v 1 , v 2 ∈ V such that v 1 ≤ v 2 , the function f we seek to define must satisfy the following conditions:

But, 1 and 3 together imply that f (v 1 ) ∈ D v2 , and 1 and 2 together imply that f (v 2 ) ∈ U v1 . That is to say, our instance is equi-satisfiable with the same instance where D v1 is replaced by

This motivates the following definition: an instance of the Partial-Embeddability problem under constraints is said to be resolved if:

Observe that the satisfiability status of a resolved instance I = (V, ≤, (↑ x v ) v∈V , (I v ) v∈V ) is immediate, hence the name:

This last condition is decidable. The left-to-right direction of the first equivalence is trivial. For the left-to-right direction of the second equivalence: if there exists some

x v is a solution to I. Indeed:

disjunction in ϕ over all finite quasi-orderings satisfying ψ i,j before reducing to this problem.

Replacing the monotone mapping by an embedding induces some changes: we say that an instance (V, ≤, (U v ) v∈V , (D v ) v∈V ) of the Embeddability under constraints problem is resolved if:

Once again, a resolved instance I = (V, ≤, (↑ x v ) v∈V , (I v ) v∈V ) can be easily solved:

Here again, f (v) ∈ ↑ x v ∩ I v by construction. Moreover, it is an embedding:

Now, to reduce an unresolved instance to resolved instances as in the previous section, we need to handle pairs of elements of V such that v 1 ≤ v 2 . This was not the case with the Partial-Embeddability problem since monotone mappings may lose that information. Observe that given a pair (v 1 , v 2 ) ∈ V 2 such that v 1 ≤ v 2 , and U v2 ⊆ U v1 , if U v2 is a filter (say U v2 = ↑ x 2 ) then we can update U v1 with U v1 ∩ ∁(↓ x 2 ). This operation is sound and complete. Indeed, if the original instance has a solution f , then

, and f would not be a solution. Thus,

At this point, one can see how this affects the rest of the proof: while in the case of partial-embeddability, we could update upward-closed sets in a certain order on V that was ensuring termination, here there could be a pair

which the sequence of updates described above never reaches a resolved instance. This suspicion will be confirmed in the next chapter, where the following is proved: where (A,=) is a two-symbol alphabet and ≤ * is the Higman quasi-ordering introduced in Section 6.1:

This result contrasts with the NP-completeness of Σ 1 (A * , ≤ * ), proved in [START_REF] Kuske | Theories of orders on the set of words[END_REF]. Note that more generally, the decidability of Σ 1 (X, ≤) reduces to the embeddability problem without constraints, that is given a finite quasi-ordering, does it embed in (X, ≤) ? This problem in the case of (N k , ≤ × ) is called the dimension problem [START_REF] Yannakakis | The complexity of the partial order dimension problem[END_REF]. In the case of (A * , ≤ * ) for a finite alphabet A, every instance is positive [START_REF] Kuske | Theories of orders on the set of words[END_REF].

Chapter 11

First-Order Logic over the Subword Ordering

This section is dedicated to the proof of undecidability of the existential fragment of FO(A * , ≤ * , A * ) where A = {a, b} is a two-symbol alphabet, i.e. ordered with equality.

More precisely we prove the following:

Theorem 11.1.1. For each recursively enumerable set S ⊆ N, there is a Σ 1 formula ϕ over the structure FO(A * , ≤ * , A * ) with one free variable such that ϕ = {a k | k ∈ S}. In particular, Σ 1 (A * , ≤ * , A * ) is undecidable.

To prove Theorem 11.1.1, we use the following result on recursively enumerable sets:

Theorem 11. 1.2 ([64]). Let S ⊆ N be a recursively enumerable set. Then there is a finite set of variables {x 0 , . . . , x m } and a finite set E of equations, each of the form

Proof. Of Theorem 11.1.1

The proof consists in building more and more complex predicates that can be expressed in the existential fragment of FO(A * , ≤ * , A * ). The new predicates we express are described in the meta language of mathematics. For each of them, we provide an existential first-order formula in our logic extended with the predicates built so far. Recall that A = {a, b}. As in the rest of the manuscript, elements in A * are denoted u, v, ... in bold font. For variables in the formulas, we use letters x, y, z, u, v, w. When proving the correctness of the formulas we provide, we identify a variable and its valuation, infringing the previous rule.

The following predicates can be expressed in Σ 1 (A * , ≤ * , A * ):

Here again y = bu, z = yx and z = xy results from several applications of Item 12.

Correctness: (⇒) The formula is satisfied with x = (bu) m .

(⇐) The conditions in brackets require (bu)x = x(bu). As in Item 13, a simple induction proves that this implies x ∈ (bu)

16. Recursively Enumerable sets: ϕ S (u) = ∃n ∈ S : u = a n , for any set S ⊆ N which is recursively enumerable.

We use the fact that every recursively enumerable set of natural numbers is Diophantine. Applying Theorem 11.1.2 to S yields a finite set E of equations over the variables {x 0 , . . . , x m }. The formula ϕ S is of the form

where ψ is a conjunction of the following formulas:

• for each equation x i = 1, we add x i = a;

• for each equation x i = x j + x k , we add a formula expressing

• for each equation x i = x j •x k , we add a formula expressing

11.2 Alternation Bounded Fragments of FO(A * , ≤ * , ...)

In this section, we refine the usual Σ i fragments (i ∈ N) with the notion of letter alternation. A language L ⊆ A * over some alphabet

Intuitively, the number of alternations between two distinct letters of a word of L is bounded by ℓ•n. Equivalently, the number of factors of the form ab for a, b ∈ A, a = b is bounded by ℓ • n.

The motivation behind this notion is the observation that if all variables of a Σ 1 formula are restricted to belong to an alternation-bounded language, then the validity of such formulas reduces to Presburger arithmetic, the first-order theory of natural numbers with addition. Indeed, a word of (a * 1 • • • a * n ) ℓ can be encoded using ℓ • n integer variables, one for each maximal factor of the form a * , for a ∈ A. It is thus of interest to investigate the effect of letter alternation on decidability: while Σ i bounds the quantifier alternation of a formula, the fragment Σ i,j also bounds the number of variables whose (letter) alternation is not bounded.

Before defining the Σ i,j fragments, we need to formalise the possibility to restrict quantified variables to alternation-bounded languages. In this section, we will therefore use first-order logic formulas over the following extended syntax:

Note that the language (a * 1 • • • a * n ) ℓ is downward-closed, therefore this extended logic is not more expressive than the one we used until now. Definition 11.2.1. Given a closed first-order formula ϕ and a variable x ∈ Var, we say that x is alternation-bounded in ϕ if all quantifications over x occurring in ϕ are guarded by a language (a *

Otherwise, x is said to be alternation-unbounded. The fragment Σ i,j consists of all Σ i closed formulas with at most j alternationunbounded variables.

In the next subsection, we formalise the intuition given above, proving that Σ 1,0 is decidable. We then prove the decidability of Σ 1,1 in Section 11.2.2, by reduction to Σ 1,0 .

Decidability of Σ 1,0

Theorem 11.2.2. The Σ 1,0 fragment is decidable.

We reduce Σ 1,0 to existential Presburger arithmetic, the first-order theory of natural numbers with ordering and addition (but no multiplication). This logic has been proved decidable by Mojzesz Presburger in his Master thesis in 1929.

Let ϕ be a closed formula in Σ 1,0 , and ℓ be the greatest alternation-bound appearing

n . Therefore, a variable x in ϕ will be encoded by ℓ • n Presburger variables (x j i ) i∈[n],j∈[ℓ] following this decomposition. For variables with alternation bound k < ℓ, it suffices to add the constraints x j i = 0 for i ∈ [n] and k < j ≤ ℓ. In the other direction, given x = x 1 1 , . . . , x ℓ n ∈ N ℓ•n , we denote by w x the associated word w x = ℓ j=1 a

n . Since ≤ * is the only predicate in our logic, it suffices to build Presburger formulas for x ≤ * y and x ≤ * y with the above encoding of variables (notice that we can also use this encoding for constants). The rest of the reduction is straightforward: we replace every occurrence of x ≤ * y or x ≤ * y in ϕ by the adequate Presburger formula to obtain a Presburger formula which is equivalent to ϕ. Proposition 11.2.3. There are existential Presburger formulas ψ ≤ * and ψ ≤ * such that:

Proof. Let I = [n] × [ℓ] and order the pairs (i, j) ∈ I lexicographically: (i ′ , j ′ ) (i, j) if j ′ < j or j = j ′ and i ′ < i. This captures the order of the a

However, the alternation decrease in each step are so small that we need a finer notion of alternation to prove that the alternation strictly decreases at each step. Any word u ∈ A * can be factored into blocks of repeating letters, i.e. u = k i=1 a i ℓi with ℓ i > 0 and a i = a i+1 for all i. By an a-block of u, we mean an occurrence of a factor a ℓi i with a i = a. Subsequently, we use the number of blocks of a word as a measure of alternation of the word. Note that if a word has k blocks, then it belongs to (a

Therefore, alternation-bounded languages are the same for the two notions.

Without loss of generality, we assume ϕ to be in prenex form: ϕ = ∃z 1 . . . ∃z k : ψ. Further assume that ψ has no sub-formula of the form t ⊲⊳ u for any constant u. This can be assumed since we can always introduce a new alternation-bounded variable which is equal to u. Let (t, z 1 , . . . , z k ) ∈ ψ be a solution to ψ. Let ℓ be the maximal number of blocks of the words z 1 , . . . , z k . We now show that if t has more than p def = k • ℓ + n blocks, then there exists t ′ such that (t ′ , z 1 , . . . , z k ) ∈ ψ and t ′ has strictly fewer blocks than t.

Given u ∈ A * , we write Im u for the image of the left-most embedding of u into t. This is a set of positions in t and, in case u ≤ * t, these positions only account for the longest prefix of u that can be embedded in t. In particular, | Im u| = |u| if and only if u ≤ * t (and

In any other case, f (i) is left undefined. In the end, Im u is the set of all indexes f (1), . . . , f (n) that have been defined.

Let b 0 be an a-block of t. This block is said to be irreducible if and only if:

1. either it is the last, i.e. right-most, a-block of t, 2. or writing t under the form t = t 0 b 0 t 1 b 1 t 2 where b 1 is the next a-block, i.e. a / ∈ t 1 , one of the following holds:

• there is some i ∈ [k] such that:

• there is i ∈ [k] such that:

Otherwise b 0 is said to be reducible.

The whole point of reducible blocks is that they can be swapped to the right: if b 0 is a reducible a-block of t, then t can be decomposed t = t 0 b 0 t 1 b 1 t 2 as above, and the word t ′ = t 0 t 1 b 0 b 1 t 2 satisfies the conditions we want. Indeed, since b 0 and b 1 are both blocks of the same letter, b 0 b 1 is now a single block of t ′ , which means that t ′ has strictly less blocks than t. Moreover, (t ′ , z 1 , . . . , z k ) ∈ ψ : we show that for any

Since b 0 is reducible, one of Im u 1 or Im u 2 is empty. Thus one of u 1 or u 2 is the empty word, entailing z i ≤ * t ′ .

Assume, by way of contradiction, that z i ≤ * t ′ . Let u 1 be the maximal prefix of z i that embeds into t. We proceed to show that b 0 is irreducible (a contradiction).

-Firstly, b 0 ∩ Im u 1 = ∅. Otherwise, since a / ∈ t 1 , the left-most embedding of u 1 into t ′ = t 0 t 1 b 0 b 1 t 2 does not use t 1 at all and we would have

-Secondly, t 1 ∩ Im u 1 is not empty. If it were, since a / ∈ t 1 , the left-most embedding of u 1 into t 0 t 1 b 0 b 1 t 2 would not use t 1 and again we would have z

Now to conclude the proof, it remains to show that t indeed has a reducible block. This results from our choice of p: every irreducible block is either a right-most a-block for some a (n possible blocks), or can be associated with a block alternation in some z i (ℓ • k possible blocks). Thus there are at most ℓ • k + n = p irreducible blocks in t. Since we assumed that t has more than p blocks, t must have some reducible blocks.

Concluding Remarks

Other Results from [START_REF] Halfon | Decidability, complexity, and expressiveness of first-order logic over the subword ordering[END_REF]. In the previous Section, we have introduced new fragments Σ i,j of the logic FO(A * , ≤ * , A * ) that refine the usual fragments Σ i . We proved the decidability of Σ 1,0 by polynomial-time reduction to the existential fragment of Presburger's arithmetic, hence proving a NP upper bound for this fragment. The two problems are actually inter-reducible, settling the NP-completeness of Σ 1,0 . The inter-reducibility further carries over any quantifier rank, and Σ i,0 is inter-reducible with the Σ i fragment of Presburger Arithmetic (see [START_REF] Halfon | Decidability, complexity, and expressiveness of first-order logic over the subword ordering[END_REF] for details). Recent results of Haase [START_REF] Haase | Subclasses of Presburger arithmetic and the weak EXP hierarchy[END_REF] on these fragments then settle the complexity of Σ i,0 presented in Table 11.1. The notation Σ EXP n used in this table denotes the n-th level of the weak EXP hierarchy, which lies between NEXP and EXPSPACE [START_REF] Hemachandra | The strong exponential hierarchy collapses[END_REF][START_REF] Gottlob | Second order logic and the weak exponential hierarchies[END_REF].

We then provided a polynomial-time reduction from Σ 1,1 to Σ 1,0 from which we derive that Σ 1,1 is NP-complete as well. A careful analysis of the proof of undecidability of Σ 1 in Section 11.1 actually reveals that already Σ 1,3 is undecidable. The gap is closed in [START_REF] Halfon | Decidability, complexity, and expressiveness of first-order logic over the subword ordering[END_REF]: Σ 1,2 is also decidable. However, only a NEXP upper bound is known, for the same NP lower bound. The exact complexity of this fragment remains an open problem.

Table 11.1: The cell in row i and column j shows the decidability/complexity of the fragment Σ i,j , where U denotes undecidability.

All other fragments are undecidable, which follows either from the aforementioned undecidability of Σ 1,3 or from the undecidability of Σ 2,1 , which is proved in [START_REF] Halfon | Decidability, complexity, and expressiveness of first-order logic over the subword ordering[END_REF]. These results are compiled in Table 11.1.

Perspectives. In Section 11.1, we proved that Σ 1 (A * , ≤ * , A * ) was already undecidable for A a two-symbol alphabet. This implies the undecidability for any alphabet of two or more symbols. We actually proved that it also implies the undecidability of Σ 1 (X * , ≤ * , X * ) for any finite ordering (X, ≤) in which there exists an incomparable pair of elements a ⊥ b.

Therefore, the only finite orderings for which the decidability status of Σ 1 (X * , ≤ * , X * ) is not settled are the linear orderings. Observe that if X is a singleton, FO(X * , ≤ * , X * ) is the theory of integers with ordering, which is PSPACE-complete [START_REF] Ferrante | The computational complexity of logical theories[END_REF][START_REF] Joseph | The complexity of decision problems in automata theory and logic[END_REF]. Otherwise, X embeds the linearly-ordered set ({0, 1}, 0 ≤ 1). We conjecture that Σ 1 ({0, 1} * , ≤ * , {0, 1} * ) is undecidable, which would imply that Σ 1 (X * , ≤ * , X * ) is undecidable for any order (X, ≤) with |X| ≥ 2. However, we could only prove that Σ 2 ({0, 1} * , ≤ * , {0, 1} * ) is undecidable, which already means that Σ 2 (X * , ≤ * , X * ) is undecidable for any partial order (X, ≤) with |X| ≥ 2.

From the perspective of Chapter 10, Theorem 11.1.1 shows that Σ 1 (X, ≤, X) cannot be decided in general for an arbitrary ideally effective WQO (X, ≤). In order to find an extra sufficient criterion for an ideally effective WQO to have a decidable existential fragment, a promising angle would be to study other order constructions that preserve ideal effectiveness. This would once again result in an algebra of WQOs whose existential fragment is decidable. For instance, the Cartesian product preserves Σ 1 decidability. Another construction that would in addition be interesting in practice would be finite multisets. Since (A ⊛ , ≤ emb ) when (A, =) is a finite alphabet is isomorphic to (N k , ≤ × ), its first-order theory is decidable (using Presburger arithmetic). What about Σ 1 (N ⊛ , ≤ emb ) for instance ?

In the case some constructions turn out to preserve Σ 1 decidability, one can wonder about higher quantification alternation. For instance, is Σ 2 (X ×Y, ≤ × , X×Y) decidable whenever Σ 2 (X, ≤ X , X) and Σ 2 (Y, ≤ Y , Y) are ?

Finally, what about the converse implication ? The natural way to represent downward-closed sets in logic is with "excluded minors", and as shown in Section 8.2, this representation may fail to distinguish ideals. However, directedness is a Π 2 formula, and therefore if Π 2 (X, ≤, X) is decidable, then it is decidable whether ϕ is an ideal. But otherwise, this is unlikely that decidability of the existential fragment, or positive existential fragment, imply ideal effectiveness in a general way. In particular because our definition requires downward-closed sets to be represented as finite union