Abstract 1 Introduction 2 Preliminaries 3 Finite-Set-to-Point Reparameterizations 4 Reparameterization of arbitrary sets by finite sets 5 Conclusion and Further Results References Appendix A Interpretations and Reparameterizations Appendix B Proof of Claim 3.5 Appendix C Proof of Lemma 3.10 Appendix D Proof of Theorem 4.4 Appendix E Proof of Lemma 4.5

From Sets to Points: Simplifying MSO Interpretations via Reparameterizations

Alexander Rabinovich ORCID Blavatnik School of Computer Science and Artificial Intelligence, Tel Aviv University, Israel
Abstract

We study the conditions under which monadic second-order (MSO) interpretations can be simplified by replacing representations of elements as tuples of arbitrary sets with representations as tuples of finite sets or points. Using reparameterizations of MSO formulas, we prove that for formulas with free finite-set variables, it is decidable whether a point reparameterization exists, and that such a reparameterization can be effectively constructed over countable chains. Moreover, over countable Dedekind-complete labeled chains, a formula with free arbitrary set variables admits a finite-set reparameterization if and only if it has at most countably many satisfying assignments. These results yield effective simplification procedures for MSO interpretations over broad classes of countable linear orders.

Keywords and phrases:
Monadic Second-Order Logic, 𝑀𝑆𝑂 interpretation, interpretation simplification, reparameterization, decidability
Category:
Track B: Automata, Logic, Semantics, and Theory of Programming
Funding:
Alexander Rabinovich: Supported in part by Len Blavatnik and the Blavatnik Family foundation.
Copyright and License:
[Uncaptioned image] © Alexander Rabinovich; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Logic and verification
; Theory of computation Models of computation
Acknowledgements:
I would like to thank the reviewers for their careful reading and valuable comments.
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

The notion of interpretation was first systematically defined and developed in the foundational work of Tarski, Mostowski, and Robinson [11]. Since then, interpretations have become a fundamental tool in mathematical logic, where they play a central role in the study of relative definability and interpretability between theories, and in the foundations of mathematics more broadly. They are also of central importance in the foundations and philosophy of science. In contemporary model theory and theoretical computer science, interpretations are routinely used to compare the expressive power of logical formalisms and to encode one class of structures inside another, for instance by interpreting complex structures in simpler, well-understood combinatorial objects such as labeled chains or trees.

We address the following question: when can a monadic second-order111Let us recall that monadic second-order logic is an extension of first-order logic by set variables (which range over the subset of the domain of a structure), and the quantifiers over the set variables (see Section 2.2 for a formal definition). (𝑀𝑆𝑂) interpretation be simplified – that is, when can elements of the interpreted structure be represented by simpler objects (finite sets or points) without changing the interpreted structure?

Interpretations of 𝔄 in 𝔅

Consider three standard variants of d–dimensional 𝑀𝑆𝑂 interpretations of a structure 𝔄 in a structure 𝔅. In each case, an element of 𝔄 is coded inside 𝔅 by a d-tuple:

Set interpretations

(𝑀𝑆𝑂, d–dimensional): each element of 𝔄 is represented by a d-tuple of (arbitrary) subsets of 𝔅.

Finite-set interpretations

(𝑀𝑆𝑂, d–dimensional): each element of 𝔄 is represented by a d-tuple of finite subsets of 𝔅.

Point interpretations

(𝑀𝑆𝑂, d–dimensional): each element of 𝔄 is represented by a d-tuple of elements of 𝔅.

A natural problem is to determine whether a given interpretation can be simplified, for instance from set interpretations to finite-set or point interpretations. In general, the domain of an interpretation over a structure 𝔅 is defined by a formula φ(X¯), where X¯ is a tuple of free variables. We capture this notion of simplification using reparameterizations, a concept introduced in [3].

Definition 1.1 (Reparameterization).

Let φ(X¯) be an 𝑀𝑆𝑂 formula and let 𝒞 be a class of structures. A formula G(X¯,Y¯) is a reparameterization of φ over 𝒞 if:

Same domain:

φ(X¯)Y¯G(X¯,Y¯) over 𝒞.

Bounded preimage:

There exists N such that, for every 𝒞 and every parameter tuple Y¯,

|{X¯G(X¯,Y¯)}|N.

We call X¯ the domain variables and Y¯ the image variables of G. The reparameterization is functional if it defines the graph of a partial function: X¯1Y¯G(X¯,Y¯).

A reparameterization G(X¯,Y¯) is m-to-d-dimensional if X¯ is an m-tuple and Y¯ is a d-tuple. It is a set-to-finite-set (respectively, finite-set-to-point) reparameterization if X¯ ranges over tuples of sets (respectively, finite sets) and Y¯ over tuples of finite sets (respectively, elements).

Intuition.

A reparameterization replaces the original parameters X¯ by auxiliary parameters Y¯ in such a way that each Y¯ corresponds to only boundedly many X¯. In the functional case, each X¯ determines at most one Y¯.

Suppose that φ(X¯) (with |X¯|=m) admits a reparameterization G(X¯,y¯) whose image variables y¯ are first-order and |y¯|=d. Then any interpretation whose domain is defined by φ can be simplified to a d–dimensional point interpretation (see Appendix A).

Bojańczyk [2] proved that, over finite words, it is decidable whether an 𝑀𝑆𝑂 formula with m free first-order variables admits an m-to-d-dimensional point-to-point reparameterization. Gallot–Lhote–Nguyen [3] studied finite-set-to-point reparameterizations over finite words and trees. We prove that the decidability results of [3] extend to the setting of arbitrary countable labeled linear orders (chains): given an 𝑀𝑆𝑂 formula φ with free finite-set variables, it is decidable whether φ admits a point reparameterization over countable chains.

Finally, building on [1], we show that it is decidable whether an 𝑀𝑆𝑂 formula φ with free set variables admits a set-to-finite-set reparameterization over countable Dedekind-complete labeled chains.

Our contributions and paper organization

We develop a uniform approach to simplifying MSO interpretations via reparameterizations over countable labeled chains. Our main results are as follows. First, for 𝑀𝑆𝑂 formulas whose free variables are finite-set variables, we show that it is decidable whether the formula admits a reparameterization by first-order (point) image variables over an 𝑀𝑆𝑂-definable class of countable labeled chains; moreover, whenever such a reparameterization exists, a functional one can be effectively constructed (see Theorem 3.1). Second, building on results of [1], we obtain an effective characterization of when a formula with free set variables admits a finite-set reparameterization over countable Dedekind-complete labeled chains: this holds exactly when the formula has at most countably many satisfying assignments in every structure from the class (see Theorem 4.2). Together, these results yield effective procedures for simplifying set interpretations to finite-set interpretations, and finite-set interpretations to point interpretations.

The paper is organized as follows. Section 2 contains preliminaries. Section 3 contains our main result and studies finite-set-to-point reparameterizations. It provides an effective characterization of when such reparameterizations exist over countable chains. Section 4 studies reparameterizations from arbitrary sets to finite sets and establishes the corresponding characterization. Section 5 contains the conclusion and further results. In Appendix A, we recall the standard definition of interpretation and explain how reparameterizations can be used to simplify interpretations. Although not strictly necessary for our main results, this material provides useful background and motivation for the reparameterization problem. Some proofs are deferred to the appendix.

2 Preliminaries

Here we recall standard notions concerning chains [9] and monadic second-order logic [7, 5, 12], and introduce basic tools from the composition method [10, 5] used throughout the paper.

2.1 Chains

A k-chain is a structure =(M,<,P1,,Pk), where (M,<) is a linear order and P¯=(P1,,Pk) is a k-tuple of monadic predicates. When k is clear from the context (or irrelevant), we simply say chain or labeled chain instead of k-chain.

An interval is a subset IM such that whenever b,cI and b<d<c, we have dI. We denote by I the induced substructure on I.

2.2 Monadic Second-Order Logic

We work in monadic second-order logic (𝑀𝑆𝑂) over the signature of -chains

σ:={<,P1,,P}.

First-order variables x,y, range over elements, and second-order variables X,Y, range over subsets of the domain. Atomic formulas are x<y, x=y, Pi(x), and X(x). Formulas are built from atomic formulas using Boolean connectives and quantifiers x,x,X,X. We also use second-order variables that are intended to range over finite sets. Since finiteness is 𝑀𝑆𝑂-definable over linear orders, this semantic restriction can be enforced syntactically by relativizing quantification to the formula expressing finiteness.

We recall the following classical result of Rabin [7].

Theorem 2.1 (Rabin, 1969 [7]).

The monadic second-order theory of countable linear orders is decidable.

2.3 Types

The quantifier rank qr(φ) of an 𝑀𝑆𝑂 formula φ is the maximal nesting depth of quantifiers. For r,k, let 𝔉𝔬𝔯𝔪kr(σ) denote the set of 𝑀𝑆𝑂 formulas of quantifier rank at most r over the signature σ, with free set variables X1,,Xk.

For -chains 1 and 2, and k-tuples A1¯=(A1,1,,A1,k) with A1,iM1 and A2¯=(A2,1,,A2,k) with A2,iM2, we write (1,A1¯)kr(2,A2¯) if (1,A1¯) and (2,A2¯) satisfy the same formulas in 𝔉𝔬𝔯𝔪kr(σ). This is an equivalence relation with finitely many equivalence classes. If is an -chain and A¯=(A1,,Ak) is a k-tuple of subsets of M, then we may view (,A¯) as an (+k)-chain, namely

(,A¯):=(M,<,P1,,P,A1,,Ak).

The following lemma implies that every kr-equivalence class is definable by a formula in 𝔉𝔬𝔯𝔪kr(σ).

Lemma 2.2 (Hintikka, [6]).

For every r,k, there exists a finite, effectively computable set Hkr𝔉𝔬𝔯𝔪kr(σ) such that:

  1. 1.

    The disjunction τHkrτ is valid.

  2. 2.

    If τ,τHkr are distinct, then ττ is unsatisfiable.

  3. 3.

    Given φ𝔉𝔬𝔯𝔪kr(σ), one can effectively compute a set HφHkr such that φ is equivalent to the disjunction of the formulas in Hφ.

By (1) and (2), for every σ-structure and every k-tuple A¯M, there exists a unique τHkr such that τ(A¯). We denote this formula by typekr(,A¯) and call it the (r,k)-type of (,A¯). When k is clear from the context, we write typer(,A¯) and call it the r-type of (,A¯). When (,A¯) is clear from the context and IM is an interval, we write typer(I) for the r-type of the induced substructure (,A¯)I.

We define the set of (r,k)-types to be the set of satisfiable formulas in Hkr.

2.4 Concatenation of Chains and Sum of Types

Given l-chains 𝔄 and 𝔅, their sum (or concatenation) 𝔄+𝔅 is obtained by placing 𝔄 before 𝔅. The following proposition implies that kr is a congruence with respect to concatenation.

Proposition 2.3 (Sum of types [10]).

There is a computable function that, given r and k, returns an operation + on 𝐻𝑖𝑛kr such that

typer(𝔄+𝔅)=typer(𝔄)+typer(𝔅).

For every r,k, the set 𝐻𝑖𝑛kr, equipped with the sum operation +, forms a finite semigroup.

Lemma 2.4 (r-local normal form).

Let ψ(X¯,z¯) be an 𝑀𝑆𝑂 formula of quantifier depth at most q, where X¯ is a tuple of free monadic second-order variables and z¯=(z1,,zm) is a tuple of free first-order variables. For every rq+2, the formula

ψ(X¯,z¯)i<mzi<zi+1

is equivalent to a finite positive Boolean combination of formulas asserting the r-types of the induced subchains on the intervals

(,z1),[zi,zi+1),and[zm,),

viewed as substructures of the expansion (,X¯). Moreover, this Boolean combination is computable from ψ.

3 Finite-Set-to-Point Reparameterizations

Gallot–Lhote–Nguyen [3] studied finite-set-to-point reparameterizations over finite trees, using automata-theoretic techniques. In this paper, we extend their decidability results (Theorem 3.12 in [3]) beyond finite structures and establish them for arbitrary countable linear orders.

Theorem 3.1 (Finite-set-to-point reparameterization over countable chains).

Let 𝒞 be an 𝑀𝑆𝑂-definable class of labeled countable linear orders, and let φ(X¯) be an 𝑀𝑆𝑂 formula whose free variables X¯ are finite-set variables. It is decidable whether, over 𝒞, φ admits a reparameterization by a formula using only first-order image variables. In addition, whenever such a reparameterization exists, there also exists a functional reparameterization using only first-order image variables, and such a functional reparameterization is effectively computable from φ and an 𝑀𝑆𝑂 definition of 𝒞.

Throughout this section we write X¯ for a tuple of finite set variables.

Lemma 3.2 (Reducing to the full class of countable chains).

Let ψ be an 𝑀𝑆𝑂 sentence defining a class 𝒞ψ:={ countable chainψ}. Let φ(X¯) be an 𝑀𝑆𝑂 formula. Then the following are equivalent:

  1. 1.

    φ admits a reparameterization by a formula with only first-order image variables over 𝒞ψ.

  2. 2.

    φψ admits a reparameterization by a formula with only first-order image variables over the class of all countable chains.

Consequently, without loss of generality we may carry out all reparameterization arguments over the full class of countable chains by replacing φ with φψ.

3.1 Idempotent obstruction to point reparameterization

Definition 3.3 (Idempotent obstruction to point reparameterization).

Let φ(X¯) be an 𝑀𝑆𝑂 formula of quantifier depth q. We say that φ has an idempotent obstruction to point reparameterization if there exist satisfiable q-types τ,τ1,τ2 such that:

  1. 1.

    τ is idempotent, i.e., τ+τ=τ;

  2. 2.

    τ is realized at least twice in some structure , i.e.,

    2X¯τ(X¯);
  3. 3.

    one of the following types implies φ(X¯):

    τ,τ1+τ,τ+τ2,τ1+τ+τ2.
Lemma 3.4 (Obstruction lemma).

Let φ(X¯) be an 𝑀𝑆𝑂 formula.

If φ has an idempotent obstruction to point reparameterization, then φ admits no reparameterization whose image variables are first-order.

Furthermore, over countable chains, the existence of such an obstruction is decidable.

Proof.

We first address decidability. By Theorem 2.1, Lemma 2.2, and Proposition 2.3, one can effectively enumerate all q-types in 𝐻𝑖𝑛kq, test idempotency (τ+τ=τ), and decide whether (τ1+τ+τ2)φ holds for some q-types τ1,τ,τ2. Moreover, since the 𝑀𝑆𝑂 theory of countable chains is decidable by Theorem 2.1, we can also check whether τ is realized at least twice in some structure , that is, whether 2X¯τ(X¯) is satisfiable.

We now prove the nonexistence of point reparameterizations in the presence of an idempotent obstruction.

Assume toward a contradiction that φ admits a reparameterization by a formula with only first-order image variables. Thus there exists an 𝑀𝑆𝑂 formula

G(X¯,y¯)withy¯=(y1,,yd)

such that:

  1. (i)

    (Same domain) for all structures,

    φ(X¯)y¯G(X¯,y¯),
  2. (ii)

    (Bounded preimage) there exists N such that for every structure and every tuple b¯Md,

    |{A¯G(A¯,b¯)}|N.

We will use the following claim, whose proof is given in Appendix B.

Claim 3.5.

For every r>q and every idempotent q-type τ(X¯), there exists an idempotent r-type τ(X¯) such that ττ. Moreover, if 2X¯τ(X¯) is satisfiable, then 2X¯τ(X¯) is also satisfiable.

Step 1: Fix realizations of the types.

By assumption, there exist 1,2 and assignments A¯1,A¯2 realizing τ1(X¯) and τ2(X¯), respectively.

Now let r be greater than both q and the quantifier depth of G. Choose an idempotent r-type τ(X¯) such that ττ and

2X¯τ(X¯)

for some chain . Such an r-type exists by ˜3.5.

Also, in the given structure pick two distinct assignments

A¯(0)A¯(1)

such that both realize τ(X¯) in , and hence also realize τ(X¯) in .

Step 2: Build many witnesses using idempotence.

For K, form the ordered sum

K:=1+++Kcopies+2.

For every subset S{1,,K} define an assignment A¯S of X¯ in K as follows:

  • on 1 use A¯1;

  • on 2 use A¯2;

  • on the -th middle copy of use A¯(1) if S, and use A¯(0) otherwise.

Since τ is idempotent, the q-type of the concatenation of any number of copies of τ is again τ. Therefore, for every S, the q-type of A¯S in K is τ1+τ+τ2, and hence

Kφ(A¯S).

By (i), for every S there exists some tuple b¯ such that

KG(A¯S,b¯).
Step 3: Pigeonhole argument.

Choose K>(d+1)(N+1). Fix S{1,,K}. By (S), there exists a d-tuple b¯ such that

KG(A¯S,b¯).

Since b¯ consists of d elements, it partitions the K middle blocks into at most d+1 consecutive regions. By the pigeonhole principle, there exists a region containing at least N+1 consecutive copies i,,i+N such that none of the coordinates of b¯ lies in this region.

For every subset S{i,,i+N}, let SS denote the symmetric difference. By locality (Lemma 2.4), the truth of G(A¯,b¯) depends only on the r-types of the substructures over the intervals determined by b¯. Replacing A¯(0) by A¯(1) (or vice versa) inside the chosen region i,,i+N does not change these r-types, since the region is disjoint from the tuple b¯. Hence

KG(A¯SS,b¯)

for every such S.

There are 2N+1 choices of S, and hence more than N distinct assignments A¯SS in the preimage of b¯, contradicting ().

3.2 From the absence of an idempotent obstruction to point reparameterization

Our main technical result shows that, in the absence of an idempotent obstruction, the formula φ(X¯) admits a point reparameterization.

Theorem 3.6 (Main).

If φ(X¯) has no idempotent obstruction to point reparameterization, then φ admits a functional reparameterization by an 𝑀𝑆𝑂 formula whose image variables are first-order. Furthermore, such a reparameterization can be effectively constructed from φ.

Theorem 3.1 is an immediate consequence of Lemma 3.2, Lemma 3.4 and Theorem 3.6.

 Remark (Countability Assumption).

It is worth emphasizing that the structural characterization of idempotent obstructions to point reparameterization, given in Lemma 3.4 and Theorem 3.6, holds over arbitrary chains. The restriction to countable chains in this paper is used only to ensure decidability in Lemma 3.4 and the effectiveness of the construction in Theorem 3.6.

Proof overview

The proof of Theorem 3.6 proceeds in four steps.

Step 1: Encoding by 𝒒-type words.

Given a chain and a tuple A¯ of finite subsets of its domain, we split along the elements of A¯ into intervals and associate to each interval its q-type. This yields a word u=u0u over a finite alphabet of q-types.

Step 2: Uniformly bounded factorization.

By Lemma 3.13, the word u admits a restricted factorization s of uniformly bounded length, which is again a word over q-types. Hence every instance (,A¯) is associated with one of finitely many such factorization words.

Step 3: Local reparameterizations.

For each such restricted factorization word s, we construct an 𝑀𝑆𝑂 formula Gs(X¯,y¯) that reparameterizes φ on the class of structures (,A¯) whose associated q-type word admits s as a restricted factorization. The assumption that φ has no idempotent obstruction ensures that this construction is well defined and yields a functional reparameterization.

Step 4: Global construction.

We combine the finitely many formulas Gs into a single formula G(X¯,y¯), which yields a uniform reparameterization.

Definition 3.7 (q-type word associated with a labeled chain).

Let be a labeled linear order (chain), and let A¯=(A1,,Ak) be a k-tuple of finite subsets of its domain. Let

A:=i=1kAi,

and let a1<<a be the increasing enumeration of the distinct elements of A (so =|A|). Set a0:= and a+1:=+ as formal endpoints.

Fix q, and let X1,,Xk be set variables corresponding to A1,,Ak. For each i=0,,, let ui be the q-type (with free variables X1,,Xk) of the structure obtained by restricting (,A¯) to the interval

[ai,ai+1):={xaix<ai+1},

where the order is restricted to [ai,ai+1) and each Xj is interpreted as Aj[ai,ai+1).

The q-type word associated with (,A¯), denoted by 𝑡𝑦𝑝𝑒q𝑤𝑜𝑟𝑑(,A¯), is the word

u:=u0u1u

over the finite alphabet of q-types with free variables X1,,Xk. If A=, then =0 and u=u0.

The next lemma follows immediately from the definition.

Lemma 3.8.

Assume q2. Let u0u1u be a q-type word associated with a labeled chain as in Definition 3.7. Then, for every chain and every tuple A¯:

  1. 1.

    If ,A¯u0, then jAj=.

  2. 2.

    For every i>0, if ,A¯ui, then jAj is a singleton consisting of the minimal element of . Moreover, there exists a unique tuple B¯ such that ,B¯ui.

(The assumption q2 is necessary to express that an element is minimal.)

A key step in the proof is to replace 𝑡𝑦𝑝𝑒q𝑤𝑜𝑟𝑑(,A¯) by a finite uniformly bounded object that still captures the semigroup information relevant to our argument. This leads us to the notion of the restricted factorization word defined below. Intuitively, restricted factorizations compress long type words while preserving the semigroup structure relevant to reparameterization.

Definition 3.9 (Restricted Factorization).

Let (S,+) be a finite semigroup. A word e0em1S+ is a restricted factorization of a word u=u0u1 with uiS if there exist words w0,,wm1 such that

u=w0wm1,

and for each i, the sum of the letters in wi equals ei, and either wi is a single letter or ei is idempotent.

Note that a word u may admit several distinct restricted factorizations. Moreover, even for a fixed restricted factorization e0em1 of u, there may be several choices of words w0,,wm1 witnessing it.

By Ramsey’s theorem (see, e.g., [4]), we obtain the following lemma; its proof is deferred to Appendix C.

Lemma 3.10 (Uniform bound on restricted factorizations).

For every finite semigroup (S,+), there exists NS such that every word over S admits a restricted factorization e0em with mNS.

As a consequence of Lemma 3.8 and Definition 3.9, we obtain the following properties of restricted factorization words.

Lemma 3.11 (Properties of restricted factorization words).

Assume q2. Let u0u1u be a q-type word associated with a labeled chain, and let s=e0em be a restricted factorization of u0u1u. Then:

  1. (a)

    For i>0, if ,A¯ei, then has a minimal element m, and this element belongs to j=1kAj; moreover, either ei is idempotent, or j=1kAj={m} and A¯ is the unique tuple such that ,A¯ei.

  2. (b)

    Either e0 is idempotent, or for every ,A¯e0 we have jAj=.

Notation.

𝑅𝐹𝑊kq denotes the set of words over 𝐻𝑖𝑛kq satisfying properties Lemma 3.11(a)–(b); we call its elements restricted factorization words.

Definition 3.12 (Models of a restricted factorization word).

Let s𝑅𝐹𝑊kq. Define

𝑀𝑜𝑑(s):={(,A¯)|A¯ is a k-tuple of finite subsets of ,and s is a restricted factorization of 𝑡𝑦𝑝𝑒q𝑤𝑜𝑟𝑑(,A¯)}.

Applying Lemma 3.10 to the semigroup of (q,k)-types, we obtain the following.

Lemma 3.13 (Short factorization word property).

For every q,k there exists Nq,k such that for every chain and every k-tuple of finite subsets A¯, there exists s𝑅𝐹𝑊kq of length at most Nq,k such that (,A¯)𝑀𝑜𝑑(s).

The next definition introduces a formula that will be crucial for the proof.

Definition 3.14 (Reparameterization induced by a factorization word).

Let s𝑅𝐹𝑊kq be a restricted factorization word over 𝐻𝑖𝑛kq. We define, by induction on |s|, an 𝑀𝑆𝑂 formula

Hs(X¯,y¯),

where y¯ is a tuple of first-order variables. This formula will be used to obtain a reparameterization of τ(X¯) - the sum of the letters of s in the semigroup of q-types, provided that the construction does not fail.

Inductive definition of 𝑯𝒔.

Base case. Suppose s consists of a single letter τ(X¯).

Case 1 (idempotent).

Assume that τ(X¯) is idempotent, i.e. τ+τ=τ.

  • If 2X¯τ(X¯) is satisfiable, then by Lemma 3.4 no reparameterization by first-order image variables exists for τ(X¯); we declare the construction to fail.

  • Otherwise, define Hs(X¯):=τ(X¯).

Case 2 (non-idempotent letter).

Assume that s consists of a single non-idempotent letter τ(X¯). By Lemma 3.11, either τ(X¯)jXj= or τ(X¯)jXj contains exactly one element. In the former case, set Hs(X¯):=τ(X¯), and in the latter, Hs(X¯,y):=τ(X¯)jXj(y).

Inductive step. Let s=e0em+1 and set s1:=e0em. Let Hs1(X¯,y¯1) and Hem+1(X¯,y¯2) be the corresponding formulas.

We write y¯1<y to mean that all coordinates of y¯1 are <y, and define y¯2y analogously.

Define

Hs(X¯,y¯1,y,y¯2):=( y¯1<yy¯2yjXj(y)
(Hs1(X¯,y¯1))<y(Hem+1(X¯,y¯2))y).

Here, for a formula H, H<y (resp. Hy) denotes the standard relativization of all quantifiers to elements satisfying <y (resp. y). Equivalently, in the first line of the definition of Hs, one could replace the conjunct y¯2y by the requirement that y is the minimal element among the coordinates of y¯2. By construction, the tuple of image variables y¯ in Hs(X¯,y¯) may be empty.

Lemma 3.15 (Properties of Hs).
(Bounded dimension)

The number of first-order variables in y¯ used by Hs(X¯,y¯) is at most 2|s|.

(Range restriction)

Hs(X¯,y¯) implies that y¯jXj.

(Bounded preimage)

For every chain and every tuple b¯,

|{A¯Hs(A¯,b¯)}| 1.

Lemma 3.15 is proved by induction on the length of s.

Note that Hs is not necessarily functional. However, one can enforce functionality by selecting the lexicographically minimal tuple y¯ satisfying Hs(X¯,y¯). Such a minimum exists by the range restriction property (see Lemma 3.15) and because X¯ is a tuple of finite sets. Define

Gs(X¯,y¯):=Hs(X¯,y¯)z¯(Hs(X¯,z¯)y¯lexz¯).

By construction, Gs(X¯,y¯) defines the graph of a partial function, i.e., for every X¯ there is at most one tuple y¯ such that Gs(X¯,y¯) holds. In particular, Gs yields a functional reparameterization over 𝑀𝑜𝑑(s).

Lemma 3.16.

Assume that s𝑅𝐹𝑊kq does not contain an idempotent τ(X¯) such that 2X¯τ(X¯) is satisfiable. Then Hs and Gs are well defined, and the following hold:

(Functionality)

If (,A¯)𝑀𝑜𝑑(s), then ,A¯!y¯Gs(X¯,y¯).

(Completeness)

,A¯y¯Gs(X¯,y¯) iff (,A¯)𝑀𝑜𝑑(s).

(Bounded preimage)

For every chain and every tuple b¯,

|{A¯Gs(A¯,b¯)}| 1.

We are now ready to prove Theorem 3.6.

Proof of Theorem 3.6.

Let φ(X¯) be a formula of quantifier depth at most q2. Assume that there is no idempotent obstruction to point reparameterization of φ(X¯).

Let

𝒮φ:={s𝑅𝐹𝑊kqμq(s)φand|s|Nq,k},

where μq(s) denotes the sum of the letters of s in the semigroup of q-types, and Nq,k is the bound given by Lemma 3.13. The condition μq(s)φ is equivalent to the fact that φ holds in every structure in 𝑀𝑜𝑑(s).

Assume s𝒮φ. By the assumption, there is no idempotent obstruction to point reparameterization of φ(X¯). Hence, s does not contain an idempotent τ(X¯) such that 2X¯τ(X¯) is satisfiable, and therefore, by Lemma 3.16, the construction of Gs does not fail for any s𝒮φ.

Fix an arbitrary linear order on the finite set 𝒮φ:

𝒮φ={s1<s2<<sn}.

For i=1,,n, define

Gi(X¯,y¯):=Gsi(X¯,y¯si)j<i¬y¯sjGsj(X¯,y¯sj),

where all tuples of image variables are padded to a common arity if necessary. Thus, Gi holds precisely when i is the least index such that Gsi(X¯,y¯si) holds.

Finally, define

G(X¯,y¯):=i=1nGi(X¯,y¯).

By construction and Lemma 3.16, G is functional and has preimage bound 1.

It remains to show that y¯G(X¯,y¯) is equivalent to φ(X¯).

() Assume that G(A¯,b¯). Then Gs(A¯,b¯s) for some s𝒮φ. By completeness (Lemma 3.16), (,A¯)𝑀𝑜𝑑(s). Hence, by the definition of 𝒮φ, we obtain ,A¯φ.

() Assume that φ(A¯). By Lemma 3.13, there exists s𝒮φ such that (,A¯)𝑀𝑜𝑑(s). Since φ has no idempotent obstruction, the construction of Gs does not fail. By Lemma 3.16, it follows that

,A¯y¯Gs(X¯,y¯),

and hence ,A¯y¯G(X¯,y¯).

Combining the two implications, we conclude that φ and y¯G are equivalent and hence G is a functional reparameterization whose image variables are all first-order.

4 Reparameterization of arbitrary sets by finite sets

Cardinality obstruction

By a simple cardinality argument, if there are uncountably many tuples satisfying φ(X¯) over a countable chain , then φ cannot be reparameterized using only image variables ranging over finite sets. We record this observation explicitly:

Lemma 4.1 (Cardinality obstruction for finite-set reparameterization).

Let be a countable chain and let φ(X¯) be an 𝑀𝑆𝑂 formula. If

Sφ():={A¯=(A1,,Ak)Ai and φ(A¯)}

is uncountable, then φ admits no reparameterization over {} using only image variables ranging over finite sets.

Proof.

If G(X¯,F¯) were such a reparameterization with F¯ ranging over finite subsets of , then the set of possible parameter tuples F¯ would be countable (finite subsets of a countable set form a countable family, and finite products of countable sets are countable). The bounded-preimage condition would then force Sφ() to be countable, a contradiction. Building on results of [1], we show that over Dedekind-complete chains, the cardinality obstruction above is the only obstruction to finite-set reparameterization:

Theorem 4.2 (Reparameterization over Dedekind-complete chains).

Let 𝖣𝖢 be the class of Dedekind-complete countable linear orders, and let φ(X¯) be an 𝑀𝑆𝑂 formula. The following are equivalent:

  1. 1.

    φ admits a reparameterization over 𝖣𝖢 using only image variables ranging over finite sets.

  2. 2.

    For every 𝖣𝖢, the set Sφ() is at most countable.

In addition, it is decidable whether (2) holds, and one can effectively construct such a reparameterization from φ.

 Remark.

Arguments analogous to those in Lemma 3.2 show that Theorem 4.2 immediately generalizes to the case where 𝖣𝖢 is replaced by any 𝑀𝑆𝑂-definable subclass C𝖣𝖢.

We first address decidability. In [1], the authors study an extension of monadic second-order logic over linear orders by a cardinality quantifier of the form “there exist uncountably many sets such that ”. They prove that, over the class of countable linear orders, every formula of this extended logic is effectively equivalent to a pure 𝑀𝑆𝑂 formula. Consequently, Condition (2) of Theorem 4.2 can be expressed in 𝑀𝑆𝑂 and is therefore decidable over countable linear orders by Rabin’s theorem [7].

We now turn to the existence and effective construction of finite-set reparameterizations. Assume that φ does not have a cardinality obstruction to finite-set reparameterization. We will prove that φ admits a reparameterization over 𝖣𝖢 using only image variables ranging over finite sets. We begin with the following definition.

Definition 4.3 (Reparameterization by finite unions of intervals).

A reparameterization G(X¯,Y¯) is a reparameterization of φ over 𝒞 by finite unions of intervals if each image variable Yi is restricted to range over finite unions of intervals.

The following theorem is a consequence of results in [1]; see Appendix D for a proof.

Theorem 4.4 (Reparameterization by finite unions of intervals).

Let 𝒞 be the class of countable chains, and let φ(X¯) be an 𝑀𝑆𝑂 formula. If for every 𝒞 the set Sφ() is at most countable, then φ effectively admits a reparameterization over 𝒞 in which each image variable ranges over finite unions of intervals.

The Dedekind completeness assumption in Theorem 4.2 is needed to represent intervals by pairs of endpoints, which is possible only in Dedekind-complete orders. Theorem 4.2 then follows from Theorem 4.4, together with the observation that, over such orders, finite unions of intervals can be encoded by a bounded tuple of finite sets.

Lemma 4.5 (Uniform coding of finite unions of intervals).

There exists a constant m and a first-order formula ψ(x,F0,,Fm) such that:

  1. 1.

    For every Dedekind-complete linear order L and every set UL that is a finite union of intervals, there exist finite sets F0,,FmL such that for all xL:

    xU(L,<,F0,,Fm)ψ(x,F0,,Fm).
  2. 2.

    Conversely, for every Dedekind-complete linear order L and every tuple of finite sets F¯L, the set defined by {xL(L,<,F¯)ψ(x,F¯)} is a finite union of intervals.

Hence every reparameterization by finite unions of intervals can be uniformly converted into a finite-set reparameterization, yielding Theorem 4.2.

Functional refinement over ordinals

The reparameterizations obtained in Theorem 4.4 (and hence in Theorem 4.2) are not necessarily functional. Over ordinals, however, they can be made functional by choosing, for each input, a canonical (least) tuple of finite-set parameters.

Lemma 4.6 (Definable well-order on finite subsets of ordinals).

There exists an 𝑀𝑆𝑂(<)-formula W(X,Y) such that, for every ordinal α,<, the relation W is a well-order on the family of finite subsets of α.

 Remark (Canonical choice yields functionality).

Over ordinals, any reparameterization with finite-set image variables can be made functional by requiring that the image tuple be W-least among all witnesses, where W is an 𝑀𝑆𝑂(<)-definable well-order on finite subsets (Lemma 4.6).

5 Conclusion and Further Results

We establish reparameterization as a unifying and effective framework for systematically simplifying MSO interpretations. By leveraging Rabin’s theorem in this new context, we obtain a complete, decidable toolkit for interpretation simplification over infinite countable chains.

Our primary goal in this work is to establish existence results rather than optimality. In particular, Theorem 3.1 characterizes when a finite-set-to-point reparameterization exists, and Theorem 4.2 characterizes when a set-to-finite-set reparameterization exists. However, our constructions are not optimized with respect to the dimension of the resulting reparameterizations.

Bojańczyk [2] introduced polyregular functions, a class of string-to-string functions with polynomial output size, and showed that it is decidable whether an 𝑀𝑆𝑂 formula with m free first-order variables admits a d-dimensional point reparameterization over finite words. In [8], we extended this result to arbitrary countable labeled chains, showing that it is decidable whether an 𝑀𝑆𝑂 formula with m free first-order variables admits a d-dimensional point reparameterization in this setting. Together with Theorem 3.1, this yields a characterization of the optimal dimension of finite-set-to-point reparameterizations.

A natural open problem is to decide whether an 𝑀𝑆𝑂 formula with m free finite-set variables admits a d-dimensional reparameterization over countable chains using only image variables ranging over finite sets. This problem appears to require new techniques beyond those developed in the present work.

Another interesting problem is to decide when a formula admits a functional set-to-finite-set reparameterization over 𝖣𝖢.

References

  • [1] Vince Barany, Lukasz Kaiser, and Alexander Rabinovich. Expressing cardinality quantifiers in monadic second-order logic over chains. J. Symb. Log., 76(2):603–619, 2011. doi:10.2178/jsl/1305810766.
  • [2] Mikołaj Bojańczyk. On the growth rates of polyregular functions. In 2023 38th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), pages 1–13. IEEE, 2023. doi:10.1109/LICS56636.2023.10175808.
  • [3] Paul Gallot, Nathan Lhote, and Lê Thành Dũng Nguyên. The structure of polynomial growth for tree automata/transducers and MSO set queries. To appear in TheoretiCS, 2025. Available at https://doi.org/10.48550/arXiv.2501.10270.
  • [4] Ronald L. Graham, Bruce L. Rothschild, and Joel H. Spencer. Ramsey Theory. Wiley, 1990.
  • [5] Yuri Gurevich. Monadic second-order theories. Model-theoretic logics, pages 479–506, 1985.
  • [6] Jaakko Hintikka. Distributive Normal Forms in the Calculus of Predicates. Number 6 in Acta Philosophica Fennica. Societas Philosophica Fennica, Helsinki, 1953.
  • [7] Michael O Rabin. Decidability of second-order theories and automata on infinite trees. Transactions of the american Mathematical Society, 141:1–35, 1969.
  • [8] Alexander Rabinovich. Decidability of mso reparametrization over countable labelled chains. In Proceedings of the 33rd Workshop on Logic, Language, Information and Computation (WoLLIC 2026), 2026.
  • [9] Joseph G. Rosenstein. Linear Orderings. Academic Press, New York, 1982.
  • [10] Saharon Shelah. The monadic theory of order. Annals of Mathematics, 102(3):379–419, 1975.
  • [11] Alfred Tarski, Andrzej Mostowski, and Raphael M. Robinson. Undecidable Theories. North-Holland, Amsterdam, 1953.
  • [12] Wolfgang Thomas. Automata on infinite objects. In Formal Models and Semantics, pages 133–191. Elsevier, 1990. doi:10.1016/B978-0-444-88074-1.50009-3.

Appendix A Interpretations and Reparameterizations

In this section, we recall the standard definition of interpretation and explain how reparameterizations can be used to simplify interpretations. Although not strictly necessary for our main results, this material provides useful background and motivation for the reparameterization problem.

We follow [2] and adapt the definition of interpretation to our setting.

Definition (Interpretation)

An MSO interpretation is a function

f:CD

between two classes of structures. All formulas mentioned below are MSO formulas over the vocabulary of the input class C.

  1. 1.

    Components. There is a finite set Q of components. Each component has a dimension in {0,1,}.

  2. 2.

    Universe formulas. Each component qQ has a universe formula. The number of free variables equals the dimension of q.

    For an input structure AC, the universe of the output is

    qQ{X¯(2A)dim(q)|X¯ satisfies the universe formula for q}.
  3. 3.

    Relation interpretations. Let R be a relation in the output vocabulary D of arity . For every q1,,qQ, there is a formula φ such that for every AC,

    Aφ(X¯1,,X¯),where X¯i(2A)dim(qi),

    if and only if (X¯1,,X¯) belongs to R in the output structure.

An interpretation is a set (respectively, finite-set, point) interpretation if its free variables range over sets (respectively, finite sets, singleton sets). It is d-dimensional if the maximal dimension of its components is d.

Two interpretations f,h:CD are equivalent if, for every AC, the structures f(A) and h(A) are isomorphic.

The following proposition is well known (folklore).

Proposition A.1.

Let C be a class of structures equipped with an MSO-definable linear order. Assume that for each component q of a finite-set interpretation over C, the corresponding universe formula φq admits a functional point reparameterization of dimension d. Then the interpretation is equivalent to a d-dimensional point interpretation. In addition, there exists an 𝑀𝑆𝑂 formula that uniformly defines an isomorphism between the two interpretations.

Sketch.

Let Gq(X¯,Y¯) be a functional reparameterization of φq of dimension d, and let N be a bound on the number of preimages.

New components are pairs (q,i), where qQ and 1iN. The universe formula for (q,i) states that Y¯ has at least i preimages under Gq.

To interpret relations, let R be defined by a formula φ(X¯1,,X¯) corresponding to components q1,,q. For components (q1,j1),,(q,j), define a formula ψ(Y1¯,,Y)¯ such that φ(X¯1,,X¯) holds, where X¯i is the ji-th preimage of Yi¯ under Gqi, taken in lexicographic order.

Since the linear order is MSO-definable, so is the lexicographic order on finite sets, and hence the ji-th preimage is MSO-definable.

This yields a d-dimensional interpretation. The correspondence between original elements and their representatives is MSO-definable and induces an isomorphism. Every reparameterization has an equivalent reparameterization of bound 1. This reduction is achieved by introducing additional first-order image variables, at the cost of losing functionality.

Proposition A.2 (Reduction to preimage one).

Let G(X¯,Y¯) be a reparameterization of φ(X¯) with bound N. Then there exists a reparameterization

H(X¯,Y¯,z1,,zm)

of φ(X¯) whose bound is 1, where z1,,zm are first-order variables, such that

G(X¯,Y¯)z1zmH(X¯,Y¯,z1,,zm).

Furthermore, H is effectively computable from G. However, H need not be functional.

Sketch.

We present the construction in the one-dimensional case; the general case follows by a similar argument.

Assume X¯=X and Y¯=Y. Fix Y, and let X1,,Xk, where kN, be all distinct G-preimages of Y. For simplicity, assume that XiXj for all ij. Then, for every ij, there exists an element zi,jXiXj.

In this simplified case, we take m:=N1 new first-order image variables.

Define H(X,Y,z1,,zm) to hold if:

  1. (i)

    G(X,Y);

  2. (ii)

    z1,,zmX;

  3. (iii)

    for every XX, if G(X,Y), then

    {z1,,zm}X.

Then H has bound 1. Indeed, for fixed Y,z1,,zm, there is at most one X satisfying H, since the tuple z1,,zm is contained in such an X and, by condition (iii), is not contained in any other G-preimage of Y.

Moreover,

G(X,Y)z1zmH(X,Y,z1,,zm).

For the nontrivial direction, choose for each other G-preimage XX an element of XX; this is possible by the simplifying assumption. Since there are at most N1 such preimages, the variables z1,,zm suffice.

Note that H need not be functional. In an interpretation as defined above, each element of the output structure is represented by a unique tuple from the input structure. In contrast, in an interpretation with equivalence, an element may admit several representations.

An interpretation with equivalence is equipped with a definable equivalence relation that is a congruence with respect to all interpreted relations. The elements of the output structure are equivalence classes of tuples satisfying the universe formulas.

Proposition A.3.

Assume that for each component q, the corresponding universe formula φq admits a reparameterization of dimension d with bound 1. Then the interpretation is equivalent to a d-dimensional interpretation with equivalence. Moreover, there exists an 𝑀𝑆𝑂 formula that uniformly defines an isomorphism between the two interpretations.

Sketch.

Replace each component by its d-dimensional reparameterization. For each component q, define the new universe formula

ψq(Y¯):=X¯(φq(X¯)G(X¯,Y¯)).

Define the new equivalence relation by

Eqnew(Y¯,Y¯):=X¯X¯(Eq(X¯,X¯)G(X¯,Y¯)G(X¯,Y¯)).

To interpret relations, let R be defined by a formula φ(X¯1,,X¯) corresponding to components q1,,q. For components q1,,q, define a formula ψ(Y¯1,,Y¯) such that φ(X¯1,,X¯) holds, where X¯i is the preimage of Yi¯ under Gqi.

Since G has bound 1, this is well defined. It is straightforward to check that Eqnew is an equivalence relation and a congruence with respect to the interpreted relations. The resulting interpretation with equivalence is equivalent to the original one.

Appendix B Proof of Claim 3.5

Claim 3.5. [Restated, see original statement.]

For every r>q and every idempotent q-type τ(X¯), there exists an idempotent r-type τ(X¯) such that ττ. Moreover, if 2X¯τ(X¯) is satisfiable, then 2X¯τ(X¯) is also satisfiable.

Proof.

Let π be the natural projection from r-types to q-types. This projection is a semigroup morphism with respect to concatenation.

Since τ is satisfiable, choose an r-type ρ such that π(ρ)=τ. Since the semigroup of r-types is finite, some power ρm is idempotent. Put

τ:=ρm.

Then τ is an idempotent r-type, and

π(τ)=π(ρm)=π(ρ)m=τm=τ,

because τ is idempotent. Hence ττ.

Assume now that

2X¯τ(X¯)

is satisfiable. Then there is a structure with two distinct assignments A¯0A¯1 realizing τ. For each K, consider the concatenation of K copies of , and for every S{1,,K} define an assignment A¯S by using A¯1 on the copies in S and A¯0 on the remaining copies. Since τ is idempotent, every A¯S realizes the same q-type τ.

There are only finitely many r-types. Hence, for K large enough, two distinct sets ST yield assignments A¯S and A¯T with the same r-type, say ρ. Since both refine τ, we have π(ρ)=τ. Choose m such that ρm is idempotent and put τ:=ρm. Then τ is an idempotent r-type with ττ.

In addition, τ is realized at least twice: take the concatenation of m copies of a structure realizing ρ twice, and use the first realization in all copies for one assignment, and the second realization in one copy and the first realization elsewhere for another. These two assignments are distinct and both have r-type ρm=τ. Thus 2X¯τ(X¯) is satisfiable.

Appendix C Proof of Lemma 3.10

Lemma 3.10 (Uniform bound on restricted factorizations). [Restated, see original statement.]

For every finite semigroup (S,+), there exists NS such that every word over S admits a restricted factorization e0em with mNS.

Proof.

Let S be a finite semigroup. By Ramsey’s theorem for pairs, there exists NS such that for every coloring c of pairs {i,j} with 0i<jNS by elements of S, there exist

0i<j<kNS

such that

c(i,j)=c(j,k)=c(i,k).

We show that this NS satisfies the claim.

Suppose, for contradiction, that there exists a word u=u0u1S+ with uiS that admits no restricted factorization of length at most NS. Among all such words, fix one together with a restricted factorization

e0en1

of minimal length n, and let w0,,wn1 be the corresponding factors. Then n>NS.

Define a coloring of pairs 0i<jn by

c(i,j):=ei++ej1.

Since nNS+1, there exist indices i<j<k such that

c(i,j)=c(j,k)=c(i,k).

Let e:=c(i,j). Then e+e=e, so e is idempotent.

We merge the factors wi,,wk1 into a single factor. Define a new word e0en(ki)1 by

ep:={epif p<i,ei++ek1if p=i,ep+(ki1)if p>i.

Then e0en(ki)1 has length n(ki)+1<n.

Moreover, it is a restricted factorization of u, since the merged factor wiwk1 has value

ei++ek1=c(i,k)=e,

which is idempotent.

This contradicts the minimality of n. Hence every word admits a restricted factorization of length at most NS.

Appendix D Proof of Theorem 4.4

Using the results of [1], we now prove the following strengthening of Theorem 4.4.

Theorem D.1 (Reparameterization by finite unions of intervals).

Let 𝒞 be the class of countable chains, and let φ(X¯) be an 𝑀𝑆𝑂 formula. Then one can effectively compute an 𝑀𝑆𝑂 formula G(X¯,Y¯) such that for every 𝒞, if Sφ() is at most countable, then G(X¯,Y¯) defines a reparameterization of φ over , where each image variable in Y¯ ranges over finite unions of intervals.

Proof.

A finite family of non-empty intervals ={I1,,In} is a cover of a chain if it forms a partition of the domain of , that is,

i=1nIi=andIiIj= for all ij.

We first observe that every finite interval cover can be encoded by a single monadic predicate interpreted as a finite union of intervals. Assume that I1<I2<<In is such a cover, and let

P:=1jnjoddIj

be the union of the odd-indexed intervals. Let Γ(P,X) express that X is a maximal interval of such that either XP or XP. Then

LΓ(P,X)iffX{I1,,In}.

Thus, every finite interval cover of can be encoded bijectively by a single monadic predicate P, interpreted as a finite union of intervals.

Now fix a chain and an 𝑀𝑆𝑂 formula φ(X¯). The following notions and facts are defined and proved in [1]:

  • The notion of a balanced UU cover for A¯ with respect to and φ is defined in [1, Definition 14]. Every balanced UU cover is a finite interval cover.

  • There exists an 𝑀𝑆𝑂 formula expressing that a given cover is a balanced UU cover for A¯ with respect to and φ (see [1, Definition 14]).

  • If Sφ() is at most countable, then every tuple A¯ with φ(A¯) admits a balanced UU cover (see [1, Lemma 10 and Lemma 13]).

Furthermore, if ={I1,,In} is a balanced UU cover of a tuple A¯, then each interval Ij belongs to one of finitely many kinds (e.g. U-intervals, left-balanced unsplittable D intervals, and right-balanced unsplittable D intervals); see [1, Definition 14 and Lemma 15]. Furthermore, by [1, Lemma 16 and its proof] there exists a constant N, computable from φ, such that, for any fixed balanced UU cover and any fixed interval kind, the restriction A¯Ij can take at most N distinct values among all tuples A¯ admitting the cover .

Consequently, every tuple A¯ with φ(A¯) can be encoded by the following data:

  1. 1.

    a balanced UU cover ={I1,,In} of associated with A¯,

  2. 2.

    for each interval Ij:

    • the kind of Ij, and

    • an index in {1,,N} identifying the restriction A¯Ij among all possibilities consistent with that kind.

By the first part of the proof, the cover can be encoded by a monadic predicate interpreted as a finite union of intervals. The interval kinds and the corresponding indices can be encoded using finitely many additional monadic predicates, each definable as a finite union of intervals; moreover, for this information, finite predicates already suffice. Hence, the above information can be represented by a bounded tuple of monadic predicates, each ranging over finite unions of intervals.

Therefore, one obtains a reparameterization of φ in which all image variables range over finite unions of intervals.

Finally, the construction is effective: the 𝑀𝑆𝑂 definitions of balanced UU covers, the finite list of interval kinds, and the bound N are computable from φ. This yields the required formula G(X¯,Y¯) and completes the proof.

Appendix E Proof of Lemma 4.5

Lemma 4.5 (Uniform coding of finite unions of intervals). [Restated, see original statement.]

There exists a constant m and a first-order formula ψ(x,F0,,Fm) such that:

  1. 1.

    For every Dedekind-complete linear order L and every set UL that is a finite union of intervals, there exist finite sets F0,,FmL such that for all xL:

    xU(L,<,F0,,Fm)ψ(x,F0,,Fm).
  2. 2.

    Conversely, for every Dedekind-complete linear order L and every tuple of finite sets F¯L, the set defined by {xL(L,<,F¯)ψ(x,F¯)} is a finite union of intervals.

Proof.

Let L be a Dedekind-complete linear order. Any set UL that is a finite union of intervals can be uniquely decomposed into a union of k disjoint, non-adjacent intervals I1<I2<<Ik.

Construction of the finite sets

We define six finite sets F0,,F5 (i.e., m=5) to encode the boundary behavior of U:

  • Lcl and Lop: the sets of finite left endpoints of the intervals Ij that are closed and open, respectively.

  • Rcl and Rop: the sets of finite right endpoints of the intervals Ij that are closed and open, respectively.

  • B and T: flag sets. We set B if and only if U is unbounded below, and T if and only if U is unbounded above. (For example, B can be a singleton containing any arbitrary element of L if the condition holds, and empty otherwise.)

Since U is a finite union of intervals, the set of all finite endpoints E=LclLopRclRop is finite.

The first-order formula

The formula ψ(x,F¯) determines membership in U by identifying the relative position of x with respect to the finite set E. Using first-order logic over the signature {<}, we can define the greatest endpoint at or below x:

max_below(x,y):=(yxyE)z((y<zx)zE)

In a Dedekind-complete order, if the set {yEyx} is non-empty, then the maximum y exists because E is finite. The formula ψ(x,F¯) is defined by a case analysis:

  1. 1.

    If x has no endpoints at or below it (¬y(yxyE)), then xU if and only if B.

  2. 2.

    If there exists a such that max_below(x,a), then xU if and only if:

    • aLcl, or

    • aLop and a<x, or

    • aRcl and a=x.

This logic ensures that if x falls within an interval (a,b), [a,b), (a,b], or [a,b], its membership is correctly determined by the kind of the last boundary point a. If x is beyond all endpoints, its membership is determined by whether the final interval is unbounded above, which is consistent with the behavior of the last endpoint in E and the flag T.

Property of the constructed formula

The second part of the lemma follows from the structure of ψ. For any choice of finite sets F¯, the points in E=Fi partition L into finitely many points and open segments (ei,ei+1). Because ψ(x,F¯) evaluates x solely based on its identity as an endpoint or its relative order to the nearest element in E, the truth value of ψ remains constant on each such segment. Consequently, for any finite F¯, the set {xL(L,<,F¯)ψ(x,F¯)} is necessarily a finite union of intervals.