Composition for Orders with an Extra
Binary Relation
Wolfgang Thomas
Bruno’s Workshop, Bordeaux, June 2012
Two Traditions in Effective Logic
Orderings with unary predicates
MSO-logic
Automata, Composition method
Graphs
Courcelle theory (for MSO)
Hanf and Gaifman theorems (for FO)
Here: Study of FO-theory of orderings expanded by graphs
Structures: (N, <, R) with binary R
Restriction: R is finite valency
R ⊆ A × A is of finite valency if for each a ∈ A there are only
finitely many b ∈ A with R(a, b) or R(b, a).
Injective functions f : N → N provide examples.
Wolfgang Thomas
Plan
1. MSO-Th(N, <, P) for unary P
2. Homogeneity of colorings is first-order definable
3. Orderings (N, <, R) with binary R
4. Conclusion
Wolfgang Thomas
Structures (N, <, P ) with unary P
Identify P ⊆ N with 0-1-word α(P)
Consequence of Büchi’s analysis of MSO-Th(N, <):
MSO-Th(N, <, P) is decidable iff the following decision
problem is decidable:
Given a Büchi automaton A, decide whether A accepts α(P).
So one only needs to decide whether the word α(P) can be cut
into pieces u0 , u1 , . . . such that
u0
ui
A : q0 → q and A : q → q for i = 1, 2, . . ., with q final.
The composition method allows this reduction to periodicity
directly, without reference to automata.
Wolfgang Thomas
m-Types (for FO and MSO)
Given quantifier-depth m define for two words u, v
(finite or infinite!):
u ≡m v :⇐⇒
u and v satisfy the same sentences of quantifier-depth m
Facts:
≡m is an equivalence relation of finite index;
call the equivalence classes m-types.
An m-type τ is definable by a sentence ϕτ of
quantifier-depth m.
Each sentence ψ of quantifier-depth m is equivalent to a
disjunction of sentences ϕτ .
Wolfgang Thomas
Composition
1. From the m-types of u and v one can compute the m-type
of uv.
2. From the m-type of u one can compute the m-type of
uuu . . . .
Consequence:
Given α = uvvv . . ., the m-type ̺ of α is determined by the
m-types σ of u and τ of v;
we write ̺ = σ + ∑ω τ
Ramsey’s Theorem guarantees such a decomposition for
arbitrary α
Wolfgang Thomas
Finite Colorings
Given a finite set Col = {c1 , . . . , cr } of colors.
A coloring over N with Col is a map
C : {(m, n) | m < n} → Col
C is additive if from C (ℓ, m) = C (ℓ′ , m′ ) and
C (m, n) = C (m′ , n′ ) we can infer C (ℓ, n) = C (ℓ′ , n′ ).
For colors c, d we may write c + d.
Example: For quantifier-depth m and ω-word α define
Cαm (i, j) = m-type of α[i, j − 1]
(either for FO or MSO)
Wolfgang Thomas
Ramsey’s Theorem
For any finite additive coloring C there is a ”homogeneous
set” H = {h0 < h1 < h2 < . . . } such that all colors C (hi , h j )
(where i < j) coincide.
Consequence: Then there are two colors c, d such that
C (0, h0 ) = c and C (hi , hi +1 ) = d
Call a color pair (c, d) good for C if there is
H = {h0 < h1 < . . .} such that C (0, h0 ) = c and
C (hi , h j ) = d for i < j,
in particular, C (hi , hi +1 ) = d, and d = d + d.
Wolfgang Thomas
Back to MSOTh(N, <, P )
MSOTh(N, <, P) is decidable
iff for each m we can compute the m-type ̺ of α(P)
iff for each m and the associated coloring Cαm(P ) we can
compute those pairs (σ, τ ) of m-types which are good for
Cαm(P ) .
In other words, for any P:
A sentence ψ of quantifier-depth m is effectively equivalent
over (N, <, P) to a disjunction of statements
”(σ, τ ) is good for Cαm(P ) ”
[Compare with the automata theoretic periodicity condition.]
Wolfgang Thomas
Defining to be Good
Let C be the tuple of binary predicates ”C (i, j) = c”.
Consider the associated structure (N, <, C ).
Remark:
There is an MSO-sentence ϕc,d saying in (N, <, C ) that (c, d)
is good for C:
∃X (X is infinite
∧C (0, x) = c for the smallest element x of X
∧ C ( x, y) = d for any x, y ∈ X with x < y)
We show that an FO-sentence suffices.
This will also give a proof of Ramsey’s Theorem.
Wolfgang Thomas
McNaughton’s Merge-Relation
Given α and an additive coloring C.
m, n merge at k (short m ∼C n(k)) if C (m, k) = C (n, k)
If m, n merge at k then also at each k′ > k.
Wolfgang Thomas
Lemma 1
(c, d) is good for C iff
(∗) ∃n[C (0, n) = c ∧ ∀m∃k > m(C (n, k) = d ∧ n ∼C k)]
Show ⇐:
Take n0 as the smallest n according to (∗).
Assume n0 , . . . , ni are defined, with n0 ∼C n j for j = 1, . . . , i.
Let n0 , . . . , ni merge at m.
Define ni +1 as the smallest number k > m guaranteed by (∗),
namely with C (n0 , ni +1 ) = d and n0 ∼ n j for all
j = 1, . . . , i + 1.
Wolfgang Thomas
Consequence: Ramsey’s Theorem
Let M be an infinite ∼C -equivalence class
Let n0 be its smallest element and set c = C (0, n0 ).
For some d infinitely many n in M exist with C (n0 , n) = d
Then (∗) is satisfied.
Hence (c, d) is good for C.
Wolfgang Thomas
Reducing Quantifier Alternation
(∗) ∃n[C (0, n) = c ∧ ∀m∃k > m(C (n, k) = d ∧ n ∼C k)]
is a Σ3 -condition (w.r.t. unbounded quantifiers).
Show that it can be written as a Boolean combination of
Σ2 -conditions.
Define a set Mℓ,c ( x):
Consider the ℓ-tuples of distinct numbers n1 , . . . , nℓ ≤ x such
that C (0, ni ) = c and any two of the n j do not merge at x.
If such an ℓ tuple exists
let Mℓ,c ( x) contain the elements of the smallest such tuple
(in lexicographical ordering)
otherwise let Mℓ,c ( x) = { x}.
Wolfgang Thomas
Lemma 2
Define
gℓ,c ( x) = max Mℓ,c ( x)
fℓ,c,d ( x) = the greatest y < x such that for some z ∈ Mℓ,c
C (z, y) = d and C (y, x) = d and C (z, x) = d
(take value 0 if such y does not exist)
Then
(c, d) is good for C iff
Wr
ℓ=1 ( gℓ,c
is bounded and fℓ,c,d unbounded).
Wolfgang Thomas
The ∀∃ ∧ ∃∀-Lemma
Let C be an additive finite coloring and C be the tuple of
relations C (i, j) = c.
There are bounded formulas ϕc,ℓ (y) and ψℓ,c,d (y) such that
(c, d) is good for C iff
(N, <, C ) |=
W|C |
ℓ=1 (∃ x∀y
> x ϕc,ℓ (y) ∧ ∀ x∃y > x ψc,d,ℓ (y))
Application: McNaughton’s Theorem
Any Büchi automaton can be converted into a deterministic
Muller automaton.
Use ∼A -classes as colors: u ∼A v iff for any states p, q
u
v
A : p → q [passing F ] ⇔ A : p → q [passing F ]
Wolfgang Thomas
Other Applications
1. For any P ⊆ N: MSO-Th(N, <, P) is decidable iff
WMSO-Th(N, <, P) is.
2. Any FO-definable ω-language can be recognized by a
counter-free Muller automaton.
Wolfgang Thomas
Binary relations and composition
Consider structures (N, <, R) with binary R
The m-types of two segments ([ℓ, m), <, R|[ℓ,m) ) and
([m, n), <, R|[m,n) ) are not sufficient to determine the m-type
of ([ℓ, n), <, R|[ℓ,n) )
But we can do composition if enough interface information is
provided.
Wolfgang Thomas
Finite Valency
Let R ⊆ N × N be of finite valency: For any a there are at
most finitely many b with R(a, b) or R(b, a).
Call [ a, b] an R-segment if R(a, b) or R(b, a).
An R-segment is maximal if it is not properly contained in
another R-segment.
Remark: If R is of finite valency then each R-segment is
contained in a maximal one.
Wolfgang Thomas
m-Admissible Segments
Define for each b a sequence b(0) > b(1) > . . . as follows:
b (0 ) = b
b (i + 1 ) =
biggest c which is below all maximal R-segments [k, ℓ]
intersecting [b(i), ∞), if such c exists,
0 otherwise
The segment [ a, b] is m-admissible if b(2m ) > a
Write b∗ for b(2m ) if m is clear.
Denote by e
b the sequence (b(0), . . . , b(2m )).
For any k there is exist admissible segments [ a, b] above k.
Wolfgang Thomas
T - and D -Types
Let [ a, b] be m-admissible, a0 , . . . , ar −1 ∈ [ a, b].
let
TRm [a, b](a0 , . . . , ar −1 ) be the FO-m type of the restriction
of N to [ a, b]
D m [a, b](a0 , . . . , ar −1 ) := T m [a∗ , b](a
e, e
b, a0 , . . . , ar −1 )
R
R
m defines an almost total coloring:
DR
For each a there are only finitely many b ≥ a such that [ a, b] is
not m-admissible.
Wolfgang Thomas
Composition Lemma
1. Given m-admissible segments [ a, b] and [b, c],
m [ a, b] and D m [b, c] determine effectively the type
DR
R
m [ a, c]
DR
2. Given a sequence a0 , a1 , . . . such that [ ai , ai +1 ] is
m [a , a
m-admissible and DR
i i +1 ] = τ for some m-type τ ,
m
DR [a0 , ∞) is determined effectively by τ .
m [0, a ] = σ we may write
If DR
0
m [0, ∞) = σ + τ + τ + . . .
DR
Wolfgang Thomas
Nondefinability of + and ·
Theorem:
In a structure (N, <, R) with R of finite valency, neither
addition nor multiplication is FO-definable.
Lemma:
Let f : N2 → N be FO-definable in (N, <, R) where R is of
finite valency.
Then one of the following two sets is finite:
X f := { x ∈ N | λy f ( x, y) is injective}
Y f := {y ∈ N | λx f ( x, y) is injective}.
Note: X+ , Y+ , X· , Y· are all infinite.
Wolfgang Thomas
Proof of Lemma
Assume f is FO-definable by ϕ( x, y, z) of quantifier-depth m
m+1
Consider the coloring CR
and a homogeneous set H
Pick x0 ∈ X f , y0 ∈ Y f in distant H -segments:
x0 ∈ [hi , hi +1 ], y0 ∈ [h j , h j+1 ]
Let z0 = f ( x0 , y0 ), assume z0 is far from x0
Pick x′ ∈ [hi +1 , hi +2 ] of same m-type as x0 in [hi , hi +1 ]
Then f ( x0 , y0 ) = f ( x′ , y0 ) = z0
λy f ( x0 , y0 ) not injective, so y0 6∈ Y f
Wolfgang Thomas
A Normal Form
Over (N, < R) each sentence ϕ is equivalent to a sentence
Wn
i =1 (∀ x∃y∀z
ϕi ( x, y, z) ∧ ∃ x∀y∃z ψi ( x, y, z)
where the ϕi , ψi are bounded in z.
Use the ∀∃ ∧ ∃∀-Lemma for additive colorings.
m [ x, y] = τ
As color formulas C ( x, y) = c we take DR
m [ x, y] = τ relative to a bound z by a formula
We can define DR
m [ x, y](z) = τ bounded in z.
DR
Then:
m [ x, y] = τ
DR
m [ x, y](z) = τ
⇔ ∃ω z D R
m
ω
⇔ ∀ z DR [ x, y](z) = τ
Wolfgang Thomas
Degree of FO-Th(N, <, R )
For R ⊆ N2 of finite valency, FO-Th(N, <, R) ≤ T R′′′ ,
and R′′′ cannot in general be replaced by R′′
Proof of lower bound:
V3 := {m | ∀k∃ℓ > k(ℓ ∈ Wm ∧ Wℓ = 6O)} (is Π3 -complete)
So:
m ∈ V3
⇔ Wm contains infinitely many indices of the empty r.e. set
Find recursive R of finite valency s.t. a V3 ≤ T FO-Th(N, <, R)
Let (ℓi , mi ) the i-th pair in enumeration of all (ℓ, m) with
ℓ ∈ Wm
Wolfgang Thomas
Explaining the Reduction
Wolfgang Thomas
Reduction
Recall: (ℓi , mi ) is the i-th pair in enumeration of all (ℓ, m) with
ℓ ∈ Wm
At stage i include (i, i + mi + 1) in R,
Using ℓi include (i, i) if up to stage i an element in Wℓi
was found,
At later stage j include ( j, i) if then for the first time an
element in Wℓi is found.
R is recursive and of finite valency.
∃ω ℓ(ℓ ∈ Wm ∧ Wℓ = 6O)
iff (N, <, R) |= ∃ω x ( R( x, x + m + 1) ∧ ∀z¬ R(z, x))
Wolfgang Thomas
Special Case
R is effectively of finite valency
if the finite sets Na = {b | R(a, b)} and Nb = { a | R(a, b)}
are computable from a, b, respectively.
In this case the bound R′′′ can be replaced by R′′ .
Wolfgang Thomas
Strongly Monotone Functions
For a monotone function f : N → N define ∆ f by
∆ f ( n ) = f ( n + 1 ) − f ( n ).
Call f strongly monotone if f and ∆ f are monotone (in the
≤-sense).
Theorem
If f is strongly monotone and recursive, the first-order theory
of (N, <, f ) is decidable.
In contrast: Let fP (i) = i-th prime.
Is FO-Th(N, <, fP ) decidable?
Is FO-Th(N, <, P ) decidable?
Wolfgang Thomas
Conclusion
1. Variations:
Signatures <, R1 , . . . , Rn rather than <, R.
Finitely many exceptions of finite valency do not matter.
Adaptation to relations of higher arity is possible.
Injective function f allows definability of + and ·.
In FO-Th(ω2 , <, R) with R of finite valency + and · are
definable.
2. Questions:
Are there natural examples of recursive R with
FO-Th(N, <, R)?
What about FO-Th(N, <, fP ), FO-Th(, N, <, ⊥),
FO-Th(N, +, ⊥) ?
Are there applications in model-checking?
Wolfgang Thomas
Summary
Composition of FO-types is possible for segments of N if
the order < is expanded by a binary relation R of finite
valency.
In this case, the structure (N, <, R) is ultimately periodic
when analyzing it w.r.t. fixed quantifier-depth.
This excludes definability of + and ·.
Any FO-sentence is expressible as a Boolean combination
of Σ3 -sentences (with bounded kernel).
Wolfgang Thomas
© Copyright 2026 Paperzz